Author: jbeard
Date: Tue Aug 10 14:19:51 2010
New Revision: 984033

URL: http://svn.apache.org/viewvc?rev=984033&view=rev
Log:
Fixed small bug involving executable content in history state inside of 
parallel states. All unit tests now pass.

Modified:
    commons/sandbox/gsoc/2010/scxml-js/trunk/build.js
    
commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractStatechartGenerator.xsl

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/build.js
URL: 
http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/build.js?rev=984033&r1=984032&r2=984033&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/build.js (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/build.js Tue Aug 10 14:19:51 2010
@@ -75,14 +75,12 @@ require.def("build",
                        var scxmlTests = {
                                KitchenSink 
:"test/kitchen_sink/KitchenSink.xml",
                                KitchenSink_dataModule 
:"test/kitchen_sink/KitchenSink_dataModule.xml",
-                               /*
                                KitchenSink_performance 
:"test/kitchen_sink/KitchenSink_performance.xml",
                                KitchenSink_executableContent 
:"test/kitchen_sink/KitchenSink_executableContent.xml",
                                ConditionalTransition 
:"test/conditional_transition/TestConditionalTransition.xml",
                                InPredicate 
:"test/in_predicate/TestInPredicate.xml",
                                EventSystemProperties 
:"test/event_system_properties/TestEventSystemProperties.xml",
                                
PrefixEvents:"test/prefix_events/TestPrefixEvents.xml",
-                               */
                                Parallel:"test/parallel/TestParallel.xml"
                        }
 
@@ -112,13 +110,11 @@ require.def("build",
                        var unitTestScripts = [
                                "test/kitchen_sink/scripts/unitTest",
                                "test/kitchen_sink/scripts/unitTest_dataModel",
-                               /*
                                
"test/kitchen_sink/scripts/unitTest_executableContent",
                                "test/conditional_transition/scripts/unitTest",
                                "test/in_predicate/scripts/unitTest",
                                "test/event_system_properties/scripts/unitTest",
-                               "test/prefix_events/scripts/unitTest"
-                               */
+                               "test/prefix_events/scripts/unitTest",
                                "test/parallel/scripts/unitTest"
                        ]
 

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=984033&r1=984032&r2=984033&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
 Tue Aug 10 14:19:51 2010
@@ -608,26 +608,6 @@
                //end static boilerplate code
        </template>
 
-
-       <variable name="deepHistoryEnterAction">
-               <text>
-                       var topState;
-                       while(topState = statesEntered.pop()){
-                               topState.enterAction();
-                       }
-               </text>
-       </variable>
-
-       <variable name="shallowHistoryEnterAction">
-               <text>
-                       var topState = statesEntered.pop();
-
-                       topState.enterAction();
-
-                       newConfiguration.push(topState.initial ? 
topState.initial : topState ); 
-               </text>
-       </variable>
-
        <variable name="genNonBasicTriggerDispatcherExitBlockInnerForEach">
                <text>
                        do{
@@ -740,12 +720,23 @@
                }
 
                
+               var topState = statesEntered.pop();
+
+               <if test="$isChildOfParallel">
+                       <!-- this is because he will be entering the parallel 
region, whose enter action will also need to be executed -->
+                       topState.parent.enterAction();
+               </if>
+               topState.enterAction();
+
                <choose>
                        <when test="$isDeep">
-                               <value-of select="$deepHistoryEnterAction"/>
+                               <!-- execute the other states -->
+                               while(topState = statesEntered.pop()){
+                                       topState.enterAction();
+                               }
                        </when>
                        <otherwise>
-                               <value-of select="$shallowHistoryEnterAction"/>
+                               newConfiguration.push(topState.initial ? 
topState.initial : topState ); 
                        </otherwise>
                </choose>
        </template>


Reply via email to