commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbe...@apache.org
Subject svn commit: r984035 - in /commons/sandbox/gsoc/2010/scxml-js/trunk: demo/drawing-tool/behaviour/canvas.xml src/javascript/scxml/cgf/main.js src/xslt/backends/js/AbstractStatechartGenerator.xsl
Date Tue, 10 Aug 2010 14:20:11 GMT
Author: jbeard
Date: Tue Aug 10 14:20:11 2010
New Revision: 984035

URL: http://svn.apache.org/viewvc?rev=984035&view=rev
Log:
Fixed bug in main.js that was importing incorrect xml module.
Fixed bug in AbstractSTatechartGenerator that was not accounting for case where some state
in current configuration may not be an ancestor of the LCA of a transition (as occurs in the
some parallel states, e.g. in the canvas demo).

Modified:
    commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/javascript/scxml/cgf/main.js
    commons/sandbox/gsoc/2010/scxml-js/trunk/src/xslt/backends/js/AbstractStatechartGenerator.xsl

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml?rev=984035&r1=984034&r2=984035&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml Tue Aug
10 14:20:11 2010
@@ -578,7 +578,7 @@ In both:
 				
 				<transition target="ready" event="mouseup">
 					<script>
-						nodesOnCanvas.push(nodeBeingDrawn);
+						allNodes.push(nodeBeingDrawn);
 						selectedNodes.push(nodeBeingDrawn);
 						$(nodeBeingDrawn).addClass("selected");
 					</script>

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/src/javascript/scxml/cgf/main.js
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/src/javascript/scxml/cgf/main.js?rev=984035&r1=984034&r2=984035&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/src/javascript/scxml/cgf/main.js (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/src/javascript/scxml/cgf/main.js Tue Aug 10 14:20:11
2010
@@ -36,7 +36,7 @@ It accepts command-line arguments, and c
 require.def("src/javascript/scxml/cgf/main",
 	[ "src/javascript/scxml/cgf/SCXMLCompiler",
 		"src/javascript/scxml/cgf/util/commandLine",
-		"src/javascript/scxml/cgf/util/xml",
+		"src/javascript/scxml/cgf/util/xml/rhino",
 		"src/javascript/scxml/cgf/util/xsl/rhino"],
 	function(SCXMLCompiler,cmdLineUtil,xmlUtil,transform){
 

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=984035&r1=984034&r2=984035&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:20:11 2010
@@ -608,16 +608,6 @@
 		//end static boilerplate code
 	</template>
 
-	<variable name="genNonBasicTriggerDispatcherExitBlockInnerForEach">
-		<text>
-			do{
-				statesExited.push(state);
-			}while((state = state.parent) &amp;&amp;
-				state != lca &amp;&amp; 
-				statesExited.indexOf(state) == -1)
-		</text>
-	</variable>
-
 	<template name="genHistoryTriggerDispatcher">
 		<param name="s"/>
 		<param name="t"/>
@@ -747,8 +737,14 @@
 		var statesExited = [];
 		var lca = <value-of select="$t/c:lca"/>;
 
-		<value-of select="$genNonBasicTriggerDispatcherExitBlockIteratorExpression"/>.forEach(function(state){
-			<value-of select="$genNonBasicTriggerDispatcherExitBlockInnerForEach"/>
+		<value-of select="$genNonBasicTriggerDispatcherExitBlockIteratorExpression"/>
+			.filter(function(state){return state.ancestors.indexOf(lca) !== -1})
+			.forEach(function(state){
+			do{
+				statesExited.push(state);
+			}while((state = state.parent) &amp;&amp;
+				state != lca &amp;&amp; 
+				statesExited.indexOf(state) == -1)
 		});
 
 		//sort by depth



Mime
View raw message