Browse Source

CascadeNode >> subtreeNeedsAliasing ^ true. Fix #1214.

Herbert Vojčík 8 years ago
parent
commit
84cf8a7938
2 changed files with 27 additions and 0 deletions
  1. 23 0
      src/Compiler-AST.js
  2. 4 0
      src/Compiler-AST.st

+ 23 - 0
src/Compiler-AST.js

@@ -1514,6 +1514,29 @@ messageSends: []
 }),
 $globals.CascadeNode);
 
+$core.addMethod(
+$core.method({
+selector: "subtreeNeedsAliasing",
+protocol: 'testing',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+return $recv($recv(self._parent())._isSequenceNode())._not();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"subtreeNeedsAliasing",{},$globals.CascadeNode)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "subtreeNeedsAliasing\x0a\x09^ self parent isSequenceNode not",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["not", "isSequenceNode", "parent"]
+}),
+$globals.CascadeNode);
+
 
 
 $core.addClass('DynamicArrayNode', $globals.Node, [], 'Compiler-AST');

+ 4 - 0
src/Compiler-AST.st

@@ -327,6 +327,10 @@ receiver: aNode
 
 isCascadeNode
 	^ true
+!
+
+subtreeNeedsAliasing
+	^ self parent isSequenceNode not
 ! !
 
 !CascadeNode methodsFor: 'visiting'!