Author: jbeard
Date: Thu Mar 17 16:21:16 2011
New Revision: 1082574
URL: http://svn.apache.org/viewvc?rev=1082574&view=rev
Log:
Small bug fix in which conditionals were not being properly processed. All unit
tests now pass.
Modified:
commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractStatechartGenerator.xsl
commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/StatePatternStatechartGenerator.xsl
commons/sandbox/gsoc/2010/scxml-js/trunk/test/in_predicate/scripts/unitTest.js
Modified:
commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractStatechartGenerator.xsl
URL:
http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractStatechartGenerator.xsl?rev=1082574&r1=1082573&r2=1082574&view=diff
==============================================================================
---
commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractStatechartGenerator.xsl
(original)
+++
commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractStatechartGenerator.xsl
Thu Mar 17 16:21:16 2011
@@ -1086,6 +1086,9 @@
<!-- TODO: wrap this in a return function -->
<!-- TODO: deal with history -->
+ <if test="@cond">
+ if(<value-of select="@cond"/>)
+ </if>
return {
preemptedBasicStates : <call-template
name="genPreemptedBasicStatesSet"><with-param name="t"
select="$t"/></call-template>,
action : function(){
Modified:
commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/StatePatternStatechartGenerator.xsl
URL:
http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/StatePatternStatechartGenerator.xsl?rev=1082574&r1=1082573&r2=1082574&view=diff
==============================================================================
---
commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/StatePatternStatechartGenerator.xsl
(original)
+++
commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/StatePatternStatechartGenerator.xsl
Thu Mar 17 16:21:16 2011
@@ -95,10 +95,7 @@
<variable name="eventName" select="@event"/>
<variable name="regexpName"
select="$allEventsEnum[c:name/text() = $eventName]/c:regexp/c:name"/>
- if(e.match(<value-of select="$regexpName"/>)
- <if test="@cond">
- && (<value-of
select="@cond"/>)
- </if>){
+ if(e.match(<value-of select="$regexpName"/>)){
<call-template
name="genTriggerDispatcherContents">
<with-param name="s"
select="$state"/>
<with-param name="transitions"
select="."/>
Modified:
commons/sandbox/gsoc/2010/scxml-js/trunk/test/in_predicate/scripts/unitTest.js
URL:
http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/in_predicate/scripts/unitTest.js?rev=1082574&r1=1082573&r2=1082574&view=diff
==============================================================================
---
commons/sandbox/gsoc/2010/scxml-js/trunk/test/in_predicate/scripts/unitTest.js
(original)
+++
commons/sandbox/gsoc/2010/scxml-js/trunk/test/in_predicate/scripts/unitTest.js
Thu Mar 17 16:21:16 2011
@@ -26,7 +26,7 @@ require.def( "test/in_predicate/scripts/
//TODO: can load this using RequireJS, so we don't need to use
the dojo module system?
dojo.require("doh.runner");
var sc;
- doh.register("testConditionalTransitionSuite",[
+ doh.register("testInPredicate",[
{
name:"testAll",
//timeout:5000,