Browse Source

require a smalltalk context for inlined js code:
- else the previous stack frame doesn't have the selected selector
- else the current stack frame is not shown in the debugger

Nicolas Petton 10 years ago
parent
commit
f28eddb0dc
2 changed files with 19 additions and 0 deletions
  1. 15 0
      js/Compiler-AST.js
  2. 4 0
      st/Compiler-AST.st

+ 15 - 0
js/Compiler-AST.js

@@ -1208,6 +1208,21 @@ referencedClasses: []
 }),
 globals.JSStatementNode);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "requiresSmalltalkContext",
+protocol: 'testing',
+fn: function (){
+var self=this;
+return true;
+},
+args: [],
+source: "requiresSmalltalkContext\x0a\x09^ true",
+messageSends: [],
+referencedClasses: []
+}),
+globals.JSStatementNode);
+
 
 
 smalltalk.addClass('MethodNode', globals.Node, ['selector', 'arguments', 'source', 'scope', 'classReferences', 'sendIndexes', 'superSends'], 'Compiler-AST');

+ 4 - 0
st/Compiler-AST.st

@@ -369,6 +369,10 @@ I represent an JavaScript statement node.!
 
 isJSStatementNode
 	^ true
+!
+
+requiresSmalltalkContext
+	^ true
 ! !
 
 !JSStatementNode methodsFor: 'visiting'!