resin 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/amber/bin/amberc +10 -350
  2. data/amber/js/Benchfib.deploy.js +80 -89
  3. data/amber/js/Benchfib.js +80 -89
  4. data/amber/js/Canvas.deploy.js +558 -545
  5. data/amber/js/Canvas.js +563 -545
  6. data/amber/js/Compiler-AST.deploy.js +431 -243
  7. data/amber/js/Compiler-AST.js +487 -244
  8. data/amber/js/Compiler-Core.deploy.js +201 -1045
  9. data/amber/js/Compiler-Core.js +208 -1207
  10. data/amber/js/Compiler-Exceptions.deploy.js +37 -18
  11. data/amber/js/Compiler-Exceptions.js +42 -18
  12. data/amber/js/Compiler-IR.deploy.js +1071 -774
  13. data/amber/js/Compiler-IR.js +1194 -848
  14. data/amber/js/Compiler-Inlining.deploy.js +395 -373
  15. data/amber/js/Compiler-Inlining.js +395 -373
  16. data/amber/js/Compiler-Interpreter.deploy.js +1202 -0
  17. data/amber/js/Compiler-Interpreter.js +1631 -0
  18. data/amber/js/Compiler-Semantic.deploy.js +695 -600
  19. data/amber/js/Compiler-Semantic.js +721 -611
  20. data/amber/js/Compiler-Tests.deploy.js +699 -376
  21. data/amber/js/Compiler-Tests.js +834 -381
  22. data/amber/js/Compiler.deploy.js +8563 -1805
  23. data/amber/js/Compiler.js +11476 -2633
  24. data/amber/js/Examples.deploy.js +29 -29
  25. data/amber/js/Examples.js +29 -29
  26. data/amber/js/IDE.deploy.js +3292 -2649
  27. data/amber/js/IDE.js +3318 -2710
  28. data/amber/js/Importer-Exporter.deploy.js +393 -349
  29. data/amber/js/Importer-Exporter.js +398 -354
  30. data/amber/js/Kernel-Announcements.deploy.js +53 -44
  31. data/amber/js/Kernel-Announcements.js +55 -44
  32. data/amber/js/Kernel-Classes.deploy.js +566 -368
  33. data/amber/js/Kernel-Classes.js +660 -402
  34. data/amber/js/Kernel-Collections.deploy.js +1149 -1098
  35. data/amber/js/Kernel-Collections.js +1183 -1116
  36. data/amber/js/Kernel-Exceptions.deploy.js +173 -75
  37. data/amber/js/Kernel-Exceptions.js +215 -77
  38. data/amber/js/Kernel-Methods.deploy.js +530 -313
  39. data/amber/js/Kernel-Methods.js +632 -338
  40. data/amber/js/Kernel-Objects.deploy.js +1734 -1577
  41. data/amber/js/Kernel-Objects.js +1867 -1654
  42. data/amber/js/Kernel-Tests.deploy.js +1416 -973
  43. data/amber/js/Kernel-Tests.js +1495 -981
  44. data/amber/js/Kernel-Transcript.deploy.js +23 -24
  45. data/amber/js/Kernel-Transcript.js +25 -26
  46. data/amber/js/SUnit-Tests.deploy.js +402 -0
  47. data/amber/js/SUnit-Tests.js +518 -0
  48. data/amber/js/SUnit.deploy.js +535 -237
  49. data/amber/js/SUnit.js +634 -246
  50. data/amber/js/amber.js +90 -53
  51. data/amber/js/boot.js +441 -255
  52. data/amber/js/init.js +1 -3
  53. data/amber/js/lib/CodeMirror/codemirror.css +3 -0
  54. data/amber/js/lib/CodeMirror/codemirror.js +104 -55
  55. data/amber/js/lib/peg-0.7.0.min.js +9 -0
  56. data/amber/js/parser.js +1504 -802
  57. data/amber/js/parser.pegjs +170 -165
  58. data/amber/st/Canvas.st +6 -0
  59. data/amber/st/Compiler-AST.st +54 -3
  60. data/amber/st/Compiler-Core.st +6 -551
  61. data/amber/st/Compiler-Exceptions.st +4 -0
  62. data/amber/st/Compiler-IR.st +205 -87
  63. data/amber/st/Compiler-Interpreter.st +597 -0
  64. data/amber/st/Compiler-Semantic.st +46 -21
  65. data/amber/st/Compiler-Tests.st +254 -7
  66. data/amber/st/Compiler.st +3172 -1541
  67. data/amber/st/IDE.st +57 -93
  68. data/amber/st/Importer-Exporter.st +4 -7
  69. data/amber/st/Kernel-Announcements.st +8 -0
  70. data/amber/st/Kernel-Classes.st +149 -40
  71. data/amber/st/Kernel-Collections.st +43 -32
  72. data/amber/st/Kernel-Exceptions.st +70 -1
  73. data/amber/st/Kernel-Methods.st +165 -27
  74. data/amber/st/Kernel-Objects.st +215 -140
  75. data/amber/st/Kernel-Tests.st +195 -10
  76. data/amber/st/Kernel-Transcript.st +1 -3
  77. data/amber/st/SUnit-Tests.st +186 -0
  78. data/amber/st/SUnit.st +186 -14
  79. data/bin/resin +6 -0
  80. data/lib/resin/cli.rb +19 -0
  81. metadata +41 -25
  82. data/amber/js/lib/peg-0.6.2.min.js +0 -2
  83. data/bin/resin-compile +0 -6
  84. data/bin/runresin +0 -12
@@ -6,12 +6,11 @@ smalltalk.addMethod(
6
6
  smalltalk.method({
7
7
  selector: "addArg:",
8
8
  category: 'adding',
9
- fn: function (aString) {
10
- var self = this;
11
- smalltalk.send(smalltalk.send(self, "_args", []), "_at_put_", [aString, smalltalk.send(smalltalk.ArgVar || ArgVar, "_on_", [aString])]);
12
- smalltalk.send(smalltalk.send(smalltalk.send(self, "_args", []), "_at_", [aString]), "_scope_", [self]);
13
- return self;
14
- },
9
+ fn: function (aString){
10
+ var self=this;
11
+ return smalltalk.withContext(function($ctx1) {
12
+ _st(_st(_st(self)._args())._at_(aString))._scope_(self);
13
+ return self}, function($ctx1) {$ctx1.fill(self,"addArg:",{aString:aString}, smalltalk.LexicalScope)})},
15
14
  args: ["aString"],
16
15
  source: "addArg: aString\x0a\x09self args at: aString put: (ArgVar on: aString).\x0a\x09(self args at: aString) scope: self",
17
16
  messageSends: ["at:put:", "on:", "args", "scope:", "at:"],
@@ -24,12 +23,11 @@ smalltalk.addMethod(
24
23
  smalltalk.method({
25
24
  selector: "addTemp:",
26
25
  category: 'adding',
27
- fn: function (aString) {
28
- var self = this;
29
- smalltalk.send(smalltalk.send(self, "_temps", []), "_at_put_", [aString, smalltalk.send(smalltalk.TempVar || TempVar, "_on_", [aString])]);
30
- smalltalk.send(smalltalk.send(smalltalk.send(self, "_temps", []), "_at_", [aString]), "_scope_", [self]);
31
- return self;
32
- },
26
+ fn: function (aString){
27
+ var self=this;
28
+ return smalltalk.withContext(function($ctx1) {
29
+ _st(_st(_st(self)._temps())._at_(aString))._scope_(self);
30
+ return self}, function($ctx1) {$ctx1.fill(self,"addTemp:",{aString:aString}, smalltalk.LexicalScope)})},
33
31
  args: ["aString"],
34
32
  source: "addTemp: aString\x0a\x09self temps at: aString put: (TempVar on: aString).\x0a\x09(self temps at: aString) scope: self",
35
33
  messageSends: ["at:put:", "on:", "temps", "scope:", "at:"],
@@ -37,17 +35,35 @@ referencedClasses: ["TempVar"]
37
35
  }),
38
36
  smalltalk.LexicalScope);
39
37
 
38
+ smalltalk.addMethod(
39
+ "_alias",
40
+ smalltalk.method({
41
+ selector: "alias",
42
+ category: 'accessing',
43
+ fn: function (){
44
+ var self=this;
45
+ return smalltalk.withContext(function($ctx1) {
46
+ $1=_st("$ctx").__comma(_st(_st(self)._scopeLevel())._asString());
47
+ return $1;
48
+ }, function($ctx1) {$ctx1.fill(self,"alias",{}, smalltalk.LexicalScope)})},
49
+ args: [],
50
+ source: "alias\x0a\x09^ '$ctx', self scopeLevel asString",
51
+ messageSends: [",", "asString", "scopeLevel"],
52
+ referencedClasses: []
53
+ }),
54
+ smalltalk.LexicalScope);
55
+
40
56
  smalltalk.addMethod(
41
57
  "_allVariableNames",
42
58
  smalltalk.method({
43
59
  selector: "allVariableNames",
44
60
  category: 'accessing',
45
- fn: function () {
46
- var self = this;
47
- var $1;
48
- $1 = smalltalk.send(smalltalk.send(smalltalk.send(self, "_args", []), "_keys", []), "__comma", [smalltalk.send(smalltalk.send(self, "_temps", []), "_keys", [])]);
49
- return $1;
50
- },
61
+ fn: function (){
62
+ var self=this;
63
+ return smalltalk.withContext(function($ctx1) {
64
+ $1=_st(_st(_st(self)._args())._keys()).__comma(_st(_st(self)._temps())._keys());
65
+ return $1;
66
+ }, function($ctx1) {$ctx1.fill(self,"allVariableNames",{}, smalltalk.LexicalScope)})},
51
67
  args: [],
52
68
  source: "allVariableNames\x0a\x09^ self args keys, self temps keys",
53
69
  messageSends: [",", "keys", "temps", "args"],
@@ -60,17 +76,18 @@ smalltalk.addMethod(
60
76
  smalltalk.method({
61
77
  selector: "args",
62
78
  category: 'accessing',
63
- fn: function () {
64
- var self = this;
65
- var $1;
66
- if (($receiver = self['@args']) == nil || $receiver == undefined) {
67
- self['@args'] = smalltalk.send(smalltalk.Dictionary || Dictionary, "_new", []);
68
- $1 = self['@args'];
69
- } else {
70
- $1 = self['@args'];
71
- }
72
- return $1;
73
- },
79
+ fn: function (){
80
+ var self=this;
81
+ return smalltalk.withContext(function($ctx1) {
82
+ $2=self["@args"];
83
+ if(($receiver = $2) == nil || $receiver == undefined){
84
+ self["@args"]=_st((smalltalk.Dictionary || Dictionary))._new();
85
+ $1=self["@args"];
86
+ } else {
87
+ $1=$2;
88
+ };
89
+ return $1;
90
+ }, function($ctx1) {$ctx1.fill(self,"args",{}, smalltalk.LexicalScope)})},
74
91
  args: [],
75
92
  source: "args\x0a\x09^ args ifNil: [ args := Dictionary new ]",
76
93
  messageSends: ["ifNil:", "new"],
@@ -83,12 +100,18 @@ smalltalk.addMethod(
83
100
  smalltalk.method({
84
101
  selector: "bindingFor:",
85
102
  category: 'accessing',
86
- fn: function (aStringOrNode) {
87
- var self = this;
88
- var $1;
89
- $1 = smalltalk.send(smalltalk.send(self, "_pseudoVars", []), "_at_ifAbsent_", [smalltalk.send(aStringOrNode, "_value", []), function () {return smalltalk.send(smalltalk.send(self, "_args", []), "_at_ifAbsent_", [smalltalk.send(aStringOrNode, "_value", []), function () {return smalltalk.send(smalltalk.send(self, "_temps", []), "_at_ifAbsent_", [smalltalk.send(aStringOrNode, "_value", []), function () {return nil;}]);}]);}]);
90
- return $1;
91
- },
103
+ fn: function (aStringOrNode){
104
+ var self=this;
105
+ return smalltalk.withContext(function($ctx1) {
106
+ $1=_st(_st(self)._pseudoVars())._at_ifAbsent_(_st(aStringOrNode)._value(),(function(){
107
+ return smalltalk.withContext(function($ctx2) {
108
+ return smalltalk.withContext(function($ctx3) {
109
+ return smalltalk.withContext(function($ctx4) {
110
+ }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
111
+ }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
112
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
113
+ return $1;
114
+ }, function($ctx1) {$ctx1.fill(self,"bindingFor:",{aStringOrNode:aStringOrNode}, smalltalk.LexicalScope)})},
92
115
  args: ["aStringOrNode"],
93
116
  source: "bindingFor: aStringOrNode\x0a\x09^ self pseudoVars at: aStringOrNode value ifAbsent: [ \x0a\x09\x09self args at: aStringOrNode value ifAbsent: [\x0a\x09\x09\x09self temps at: aStringOrNode value ifAbsent: [ nil ]]]",
94
117
  messageSends: ["at:ifAbsent:", "value", "temps", "args", "pseudoVars"],
@@ -101,12 +124,14 @@ smalltalk.addMethod(
101
124
  smalltalk.method({
102
125
  selector: "canInlineNonLocalReturns",
103
126
  category: 'testing',
104
- fn: function () {
105
- var self = this;
106
- var $1;
107
- $1 = smalltalk.send(smalltalk.send(self, "_isInlined", []), "_and_", [function () {return smalltalk.send(smalltalk.send(self, "_outerScope", []), "_canInlineNonLocalReturns", []);}]);
108
- return $1;
109
- },
127
+ fn: function (){
128
+ var self=this;
129
+ return smalltalk.withContext(function($ctx1) {
130
+ $1=_st(_st(self)._isInlined())._and_((function(){
131
+ return smalltalk.withContext(function($ctx2) {
132
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
133
+ return $1;
134
+ }, function($ctx1) {$ctx1.fill(self,"canInlineNonLocalReturns",{}, smalltalk.LexicalScope)})},
110
135
  args: [],
111
136
  source: "canInlineNonLocalReturns\x0a\x09^ self isInlined and: [ self outerScope canInlineNonLocalReturns ]",
112
137
  messageSends: ["and:", "canInlineNonLocalReturns", "outerScope", "isInlined"],
@@ -119,10 +144,12 @@ smalltalk.addMethod(
119
144
  smalltalk.method({
120
145
  selector: "instruction",
121
146
  category: 'accessing',
122
- fn: function () {
123
- var self = this;
124
- return self['@instruction'];
125
- },
147
+ fn: function (){
148
+ var self=this;
149
+ return smalltalk.withContext(function($ctx1) {
150
+ $1=self["@instruction"];
151
+ return $1;
152
+ }, function($ctx1) {$ctx1.fill(self,"instruction",{}, smalltalk.LexicalScope)})},
126
153
  args: [],
127
154
  source: "instruction\x0a\x09^ instruction",
128
155
  messageSends: [],
@@ -135,11 +162,10 @@ smalltalk.addMethod(
135
162
  smalltalk.method({
136
163
  selector: "instruction:",
137
164
  category: 'accessing',
138
- fn: function (anIRInstruction) {
139
- var self = this;
140
- self['@instruction'] = anIRInstruction;
141
- return self;
142
- },
165
+ fn: function (anIRInstruction){
166
+ var self=this;
167
+ return smalltalk.withContext(function($ctx1) {
168
+ return self}, function($ctx1) {$ctx1.fill(self,"instruction:",{anIRInstruction:anIRInstruction}, smalltalk.LexicalScope)})},
143
169
  args: ["anIRInstruction"],
144
170
  source: "instruction: anIRInstruction\x0a\x09instruction := anIRInstruction",
145
171
  messageSends: [],
@@ -152,12 +178,12 @@ smalltalk.addMethod(
152
178
  smalltalk.method({
153
179
  selector: "isBlockScope",
154
180
  category: 'testing',
155
- fn: function () {
156
- var self = this;
157
- var $1;
158
- $1 = smalltalk.send(smalltalk.send(self, "_isMethodScope", []), "_not", []);
159
- return $1;
160
- },
181
+ fn: function (){
182
+ var self=this;
183
+ return smalltalk.withContext(function($ctx1) {
184
+ $1=_st(_st(self)._isMethodScope())._not();
185
+ return $1;
186
+ }, function($ctx1) {$ctx1.fill(self,"isBlockScope",{}, smalltalk.LexicalScope)})},
161
187
  args: [],
162
188
  source: "isBlockScope\x0a\x09^ self isMethodScope not",
163
189
  messageSends: ["not", "isMethodScope"],
@@ -170,15 +196,17 @@ smalltalk.addMethod(
170
196
  smalltalk.method({
171
197
  selector: "isInlined",
172
198
  category: 'testing',
173
- fn: function () {
174
- var self = this;
175
- var $1;
176
- $1 = smalltalk.send(smalltalk.send(self, "_instruction", []), "_isInlined", []);
177
- return $1;
178
- },
199
+ fn: function (){
200
+ var self=this;
201
+ return smalltalk.withContext(function($ctx1) {
202
+ $1=_st(_st(_st(self)._instruction())._notNil())._and_((function(){
203
+ return smalltalk.withContext(function($ctx2) {
204
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
205
+ return $1;
206
+ }, function($ctx1) {$ctx1.fill(self,"isInlined",{}, smalltalk.LexicalScope)})},
179
207
  args: [],
180
- source: "isInlined\x0a\x09^ self instruction isInlined",
181
- messageSends: ["isInlined", "instruction"],
208
+ source: "isInlined\x0a\x09^ self instruction notNil and: [\x0a \x09self instruction isInlined ]",
209
+ messageSends: ["and:", "isInlined", "instruction", "notNil"],
182
210
  referencedClasses: []
183
211
  }),
184
212
  smalltalk.LexicalScope);
@@ -188,10 +216,10 @@ smalltalk.addMethod(
188
216
  smalltalk.method({
189
217
  selector: "isMethodScope",
190
218
  category: 'testing',
191
- fn: function () {
192
- var self = this;
193
- return false;
194
- },
219
+ fn: function (){
220
+ var self=this;
221
+ return smalltalk.withContext(function($ctx1) {
222
+ }, function($ctx1) {$ctx1.fill(self,"isMethodScope",{}, smalltalk.LexicalScope)})},
195
223
  args: [],
196
224
  source: "isMethodScope\x0a\x09^ false",
197
225
  messageSends: [],
@@ -204,22 +232,25 @@ smalltalk.addMethod(
204
232
  smalltalk.method({
205
233
  selector: "lookupVariable:",
206
234
  category: 'accessing',
207
- fn: function (aNode) {
208
- var self = this;
209
- var $1;
210
- var lookup;
211
- lookup = smalltalk.send(self, "_bindingFor_", [aNode]);
212
- if (($receiver = lookup) == nil || $receiver == undefined) {
213
- $1 = smalltalk.send(self, "_outerScope", []);
214
- if (($receiver = $1) == nil || $receiver == undefined) {
215
- lookup = $1;
216
- } else {
217
- lookup = smalltalk.send(smalltalk.send(self, "_outerScope", []), "_lookupVariable_", [aNode]);
218
- }
219
- } else {
220
- }
221
- return lookup;
222
- },
235
+ fn: function (aNode){
236
+ var self=this;
237
+ var lookup;
238
+ return smalltalk.withContext(function($ctx1) {
239
+ lookup=_st(self)._bindingFor_(aNode);
240
+ $1=lookup;
241
+ $2=(function(){
242
+ return smalltalk.withContext(function($ctx2) {
243
+ if(($receiver = $3) == nil || $receiver == undefined){
244
+ lookup=$3;
245
+ } else {
246
+ lookup=_st(_st(self)._outerScope())._lookupVariable_(aNode);
247
+ };
248
+ return lookup;
249
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
250
+ _st($1)._ifNil_($2);
251
+ $4=lookup;
252
+ return $4;
253
+ }, function($ctx1) {$ctx1.fill(self,"lookupVariable:",{aNode:aNode,lookup:lookup}, smalltalk.LexicalScope)})},
223
254
  args: ["aNode"],
224
255
  source: "lookupVariable: aNode\x0a\x09| lookup |\x0a\x09lookup := (self bindingFor: aNode).\x0a\x09lookup ifNil: [\x0a\x09\x09lookup := self outerScope ifNotNil: [ \x0a\x09\x09\x09(self outerScope lookupVariable: aNode) ]].\x0a\x09^ lookup",
225
256
  messageSends: ["bindingFor:", "ifNil:", "ifNotNil:", "lookupVariable:", "outerScope"],
@@ -232,17 +263,17 @@ smalltalk.addMethod(
232
263
  smalltalk.method({
233
264
  selector: "methodScope",
234
265
  category: 'accessing',
235
- fn: function () {
236
- var self = this;
237
- var $2, $1;
238
- $2 = smalltalk.send(self, "_outerScope", []);
239
- if (($receiver = $2) == nil || $receiver == undefined) {
240
- $1 = $2;
241
- } else {
242
- $1 = smalltalk.send(smalltalk.send(self, "_outerScope", []), "_methodScope", []);
243
- }
244
- return $1;
245
- },
266
+ fn: function (){
267
+ var self=this;
268
+ return smalltalk.withContext(function($ctx1) {
269
+ $2=_st(self)._outerScope();
270
+ if(($receiver = $2) == nil || $receiver == undefined){
271
+ $1=$2;
272
+ } else {
273
+ $1=_st(_st(self)._outerScope())._methodScope();
274
+ };
275
+ return $1;
276
+ }, function($ctx1) {$ctx1.fill(self,"methodScope",{}, smalltalk.LexicalScope)})},
246
277
  args: [],
247
278
  source: "methodScope\x0a\x09^ self outerScope ifNotNil: [\x0a\x09\x09self outerScope methodScope ]",
248
279
  messageSends: ["ifNotNil:", "methodScope", "outerScope"],
@@ -255,10 +286,12 @@ smalltalk.addMethod(
255
286
  smalltalk.method({
256
287
  selector: "node",
257
288
  category: 'accessing',
258
- fn: function () {
259
- var self = this;
260
- return self['@node'];
261
- },
289
+ fn: function (){
290
+ var self=this;
291
+ return smalltalk.withContext(function($ctx1) {
292
+ $1=self["@node"];
293
+ return $1;
294
+ }, function($ctx1) {$ctx1.fill(self,"node",{}, smalltalk.LexicalScope)})},
262
295
  args: [],
263
296
  source: "node\x0a\x09\x22Answer the node in which I am defined\x22\x0a\x09\x0a\x09^ node",
264
297
  messageSends: [],
@@ -271,11 +304,10 @@ smalltalk.addMethod(
271
304
  smalltalk.method({
272
305
  selector: "node:",
273
306
  category: 'accessing',
274
- fn: function (aNode) {
275
- var self = this;
276
- self['@node'] = aNode;
277
- return self;
278
- },
307
+ fn: function (aNode){
308
+ var self=this;
309
+ return smalltalk.withContext(function($ctx1) {
310
+ return self}, function($ctx1) {$ctx1.fill(self,"node:",{aNode:aNode}, smalltalk.LexicalScope)})},
279
311
  args: ["aNode"],
280
312
  source: "node: aNode\x0a\x09node := aNode",
281
313
  messageSends: [],
@@ -288,10 +320,12 @@ smalltalk.addMethod(
288
320
  smalltalk.method({
289
321
  selector: "outerScope",
290
322
  category: 'accessing',
291
- fn: function () {
292
- var self = this;
293
- return self['@outerScope'];
294
- },
323
+ fn: function (){
324
+ var self=this;
325
+ return smalltalk.withContext(function($ctx1) {
326
+ $1=self["@outerScope"];
327
+ return $1;
328
+ }, function($ctx1) {$ctx1.fill(self,"outerScope",{}, smalltalk.LexicalScope)})},
295
329
  args: [],
296
330
  source: "outerScope\x0a\x09^ outerScope",
297
331
  messageSends: [],
@@ -304,11 +338,10 @@ smalltalk.addMethod(
304
338
  smalltalk.method({
305
339
  selector: "outerScope:",
306
340
  category: 'accessing',
307
- fn: function (aLexicalScope) {
308
- var self = this;
309
- self['@outerScope'] = aLexicalScope;
310
- return self;
311
- },
341
+ fn: function (aLexicalScope){
342
+ var self=this;
343
+ return smalltalk.withContext(function($ctx1) {
344
+ return self}, function($ctx1) {$ctx1.fill(self,"outerScope:",{aLexicalScope:aLexicalScope}, smalltalk.LexicalScope)})},
312
345
  args: ["aLexicalScope"],
313
346
  source: "outerScope: aLexicalScope\x0a\x09outerScope := aLexicalScope",
314
347
  messageSends: [],
@@ -321,12 +354,12 @@ smalltalk.addMethod(
321
354
  smalltalk.method({
322
355
  selector: "pseudoVars",
323
356
  category: 'accessing',
324
- fn: function () {
325
- var self = this;
326
- var $1;
327
- $1 = smalltalk.send(smalltalk.send(self, "_methodScope", []), "_pseudoVars", []);
328
- return $1;
329
- },
357
+ fn: function (){
358
+ var self=this;
359
+ return smalltalk.withContext(function($ctx1) {
360
+ $1=_st(_st(self)._methodScope())._pseudoVars();
361
+ return $1;
362
+ }, function($ctx1) {$ctx1.fill(self,"pseudoVars",{}, smalltalk.LexicalScope)})},
330
363
  args: [],
331
364
  source: "pseudoVars\x0a\x09^ self methodScope pseudoVars",
332
365
  messageSends: ["pseudoVars", "methodScope"],
@@ -339,21 +372,26 @@ smalltalk.addMethod(
339
372
  smalltalk.method({
340
373
  selector: "scopeLevel",
341
374
  category: 'accessing',
342
- fn: function () {
343
- var self = this;
344
- var $3, $2, $1;
345
- $3 = smalltalk.send(self, "_outerScope", []);
346
- if (($receiver = $3) == nil || $receiver == undefined) {
347
- $2 = 0;
348
- } else {
349
- $2 = smalltalk.send(smalltalk.send(self, "_outerScope", []), "_scopeLevel", []);
350
- }
351
- $1 = smalltalk.send($2, "__plus", [1]);
352
- return $1;
353
- },
375
+ fn: function (){
376
+ var self=this;
377
+ return smalltalk.withContext(function($ctx1) {
378
+ $1=_st(self)._outerScope();
379
+ if(($receiver = $1) == nil || $receiver == undefined){
380
+ return (1);
381
+ } else {
382
+ $1;
383
+ };
384
+ $2=_st(self)._isInlined();
385
+ if(smalltalk.assert($2)){
386
+ $3=_st(_st(self)._outerScope())._scopeLevel();
387
+ return $3;
388
+ };
389
+ $4=_st(_st(_st(self)._outerScope())._scopeLevel()).__plus((1));
390
+ return $4;
391
+ }, function($ctx1) {$ctx1.fill(self,"scopeLevel",{}, smalltalk.LexicalScope)})},
354
392
  args: [],
355
- source: "scopeLevel\x0a\x09^ (self outerScope \x0a\x09\x09ifNil: [ 0 ]\x0a\x09\x09ifNotNil: [ self outerScope scopeLevel ]) + 1",
356
- messageSends: ["+", "ifNil:ifNotNil:", "scopeLevel", "outerScope"],
393
+ source: "scopeLevel\x0a\x09self outerScope ifNil: [ ^ 1 ].\x0a\x09self isInlined ifTrue: [ ^ self outerScope scopeLevel ].\x0a \x0a\x09^ self outerScope scopeLevel + 1",
394
+ messageSends: ["ifNil:", "outerScope", "ifTrue:", "scopeLevel", "isInlined", "+"],
357
395
  referencedClasses: []
358
396
  }),
359
397
  smalltalk.LexicalScope);
@@ -363,17 +401,18 @@ smalltalk.addMethod(
363
401
  smalltalk.method({
364
402
  selector: "temps",
365
403
  category: 'accessing',
366
- fn: function () {
367
- var self = this;
368
- var $1;
369
- if (($receiver = self['@temps']) == nil || $receiver == undefined) {
370
- self['@temps'] = smalltalk.send(smalltalk.Dictionary || Dictionary, "_new", []);
371
- $1 = self['@temps'];
372
- } else {
373
- $1 = self['@temps'];
374
- }
375
- return $1;
376
- },
404
+ fn: function (){
405
+ var self=this;
406
+ return smalltalk.withContext(function($ctx1) {
407
+ $2=self["@temps"];
408
+ if(($receiver = $2) == nil || $receiver == undefined){
409
+ self["@temps"]=_st((smalltalk.Dictionary || Dictionary))._new();
410
+ $1=self["@temps"];
411
+ } else {
412
+ $1=$2;
413
+ };
414
+ return $1;
415
+ }, function($ctx1) {$ctx1.fill(self,"temps",{}, smalltalk.LexicalScope)})},
377
416
  args: [],
378
417
  source: "temps\x0a\x09^ temps ifNil: [ temps := Dictionary new ]",
379
418
  messageSends: ["ifNil:", "new"],
@@ -390,12 +429,11 @@ smalltalk.addMethod(
390
429
  smalltalk.method({
391
430
  selector: "addIVar:",
392
431
  category: 'adding',
393
- fn: function (aString) {
394
- var self = this;
395
- smalltalk.send(smalltalk.send(self, "_iVars", []), "_at_put_", [aString, smalltalk.send(smalltalk.InstanceVar || InstanceVar, "_on_", [aString])]);
396
- smalltalk.send(smalltalk.send(smalltalk.send(self, "_iVars", []), "_at_", [aString]), "_scope_", [self]);
397
- return self;
398
- },
432
+ fn: function (aString){
433
+ var self=this;
434
+ return smalltalk.withContext(function($ctx1) {
435
+ _st(_st(_st(self)._iVars())._at_(aString))._scope_(self);
436
+ return self}, function($ctx1) {$ctx1.fill(self,"addIVar:",{aString:aString}, smalltalk.MethodLexicalScope)})},
399
437
  args: ["aString"],
400
438
  source: "addIVar: aString\x0a\x09self iVars at: aString put: (InstanceVar on: aString).\x0a\x09(self iVars at: aString) scope: self",
401
439
  messageSends: ["at:put:", "on:", "iVars", "scope:", "at:"],
@@ -408,11 +446,10 @@ smalltalk.addMethod(
408
446
  smalltalk.method({
409
447
  selector: "addNonLocalReturn:",
410
448
  category: 'adding',
411
- fn: function (aScope) {
412
- var self = this;
413
- smalltalk.send(smalltalk.send(self, "_nonLocalReturns", []), "_add_", [aScope]);
414
- return self;
415
- },
449
+ fn: function (aScope){
450
+ var self=this;
451
+ return smalltalk.withContext(function($ctx1) {
452
+ return self}, function($ctx1) {$ctx1.fill(self,"addNonLocalReturn:",{aScope:aScope}, smalltalk.MethodLexicalScope)})},
416
453
  args: ["aScope"],
417
454
  source: "addNonLocalReturn: aScope\x0a\x09self nonLocalReturns add: aScope",
418
455
  messageSends: ["add:", "nonLocalReturns"],
@@ -425,12 +462,12 @@ smalltalk.addMethod(
425
462
  smalltalk.method({
426
463
  selector: "allVariableNames",
427
464
  category: 'accessing',
428
- fn: function () {
429
- var self = this;
430
- var $1;
431
- $1 = smalltalk.send(smalltalk.send(self, "_allVariableNames", [], smalltalk.LexicalScope), "__comma", [smalltalk.send(smalltalk.send(self, "_iVars", []), "_keys", [])]);
432
- return $1;
433
- },
465
+ fn: function (){
466
+ var self=this;
467
+ return smalltalk.withContext(function($ctx1) {
468
+ $1=_st(smalltalk.LexicalScope.fn.prototype._allVariableNames.apply(_st(self), [])).__comma(_st(_st(self)._iVars())._keys());
469
+ return $1;
470
+ }, function($ctx1) {$ctx1.fill(self,"allVariableNames",{}, smalltalk.MethodLexicalScope)})},
434
471
  args: [],
435
472
  source: "allVariableNames\x0a\x09^ super allVariableNames, self iVars keys",
436
473
  messageSends: [",", "keys", "iVars", "allVariableNames"],
@@ -443,17 +480,19 @@ smalltalk.addMethod(
443
480
  smalltalk.method({
444
481
  selector: "bindingFor:",
445
482
  category: 'accessing',
446
- fn: function (aNode) {
447
- var self = this;
448
- var $2, $1;
449
- $2 = smalltalk.send(self, "_bindingFor_", [aNode], smalltalk.LexicalScope);
450
- if (($receiver = $2) == nil || $receiver == undefined) {
451
- $1 = smalltalk.send(smalltalk.send(self, "_iVars", []), "_at_ifAbsent_", [smalltalk.send(aNode, "_value", []), function () {return nil;}]);
452
- } else {
453
- $1 = $2;
454
- }
455
- return $1;
456
- },
483
+ fn: function (aNode){
484
+ var self=this;
485
+ return smalltalk.withContext(function($ctx1) {
486
+ $2=smalltalk.LexicalScope.fn.prototype._bindingFor_.apply(_st(self), [aNode]);
487
+ if(($receiver = $2) == nil || $receiver == undefined){
488
+ $1=_st(_st(self)._iVars())._at_ifAbsent_(_st(aNode)._value(),(function(){
489
+ return smalltalk.withContext(function($ctx2) {
490
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
491
+ } else {
492
+ $1=$2;
493
+ };
494
+ return $1;
495
+ }, function($ctx1) {$ctx1.fill(self,"bindingFor:",{aNode:aNode}, smalltalk.MethodLexicalScope)})},
457
496
  args: ["aNode"],
458
497
  source: "bindingFor: aNode\x0a\x09^ (super bindingFor: aNode) ifNil: [\x0a\x09\x09self iVars at: aNode value ifAbsent: [ nil ]]",
459
498
  messageSends: ["ifNil:", "at:ifAbsent:", "value", "iVars", "bindingFor:"],
@@ -466,10 +505,10 @@ smalltalk.addMethod(
466
505
  smalltalk.method({
467
506
  selector: "canInlineNonLocalReturns",
468
507
  category: 'testing',
469
- fn: function () {
470
- var self = this;
471
- return true;
472
- },
508
+ fn: function (){
509
+ var self=this;
510
+ return smalltalk.withContext(function($ctx1) {
511
+ }, function($ctx1) {$ctx1.fill(self,"canInlineNonLocalReturns",{}, smalltalk.MethodLexicalScope)})},
473
512
  args: [],
474
513
  source: "canInlineNonLocalReturns\x0a\x09^ true",
475
514
  messageSends: [],
@@ -482,12 +521,12 @@ smalltalk.addMethod(
482
521
  smalltalk.method({
483
522
  selector: "hasLocalReturn",
484
523
  category: 'testing',
485
- fn: function () {
486
- var self = this;
487
- var $1;
488
- $1 = smalltalk.send(self, "_localReturn", []);
489
- return $1;
490
- },
524
+ fn: function (){
525
+ var self=this;
526
+ return smalltalk.withContext(function($ctx1) {
527
+ $1=_st(self)._localReturn();
528
+ return $1;
529
+ }, function($ctx1) {$ctx1.fill(self,"hasLocalReturn",{}, smalltalk.MethodLexicalScope)})},
491
530
  args: [],
492
531
  source: "hasLocalReturn\x0a\x09^ self localReturn",
493
532
  messageSends: ["localReturn"],
@@ -500,12 +539,12 @@ smalltalk.addMethod(
500
539
  smalltalk.method({
501
540
  selector: "hasNonLocalReturn",
502
541
  category: 'testing',
503
- fn: function () {
504
- var self = this;
505
- var $1;
506
- $1 = smalltalk.send(smalltalk.send(self, "_nonLocalReturns", []), "_notEmpty", []);
507
- return $1;
508
- },
542
+ fn: function (){
543
+ var self=this;
544
+ return smalltalk.withContext(function($ctx1) {
545
+ $1=_st(_st(self)._nonLocalReturns())._notEmpty();
546
+ return $1;
547
+ }, function($ctx1) {$ctx1.fill(self,"hasNonLocalReturn",{}, smalltalk.MethodLexicalScope)})},
509
548
  args: [],
510
549
  source: "hasNonLocalReturn\x0a\x09^ self nonLocalReturns notEmpty",
511
550
  messageSends: ["notEmpty", "nonLocalReturns"],
@@ -518,17 +557,18 @@ smalltalk.addMethod(
518
557
  smalltalk.method({
519
558
  selector: "iVars",
520
559
  category: 'accessing',
521
- fn: function () {
522
- var self = this;
523
- var $1;
524
- if (($receiver = self['@iVars']) == nil || $receiver == undefined) {
525
- self['@iVars'] = smalltalk.send(smalltalk.Dictionary || Dictionary, "_new", []);
526
- $1 = self['@iVars'];
527
- } else {
528
- $1 = self['@iVars'];
529
- }
530
- return $1;
531
- },
560
+ fn: function (){
561
+ var self=this;
562
+ return smalltalk.withContext(function($ctx1) {
563
+ $2=self["@iVars"];
564
+ if(($receiver = $2) == nil || $receiver == undefined){
565
+ self["@iVars"]=_st((smalltalk.Dictionary || Dictionary))._new();
566
+ $1=self["@iVars"];
567
+ } else {
568
+ $1=$2;
569
+ };
570
+ return $1;
571
+ }, function($ctx1) {$ctx1.fill(self,"iVars",{}, smalltalk.MethodLexicalScope)})},
532
572
  args: [],
533
573
  source: "iVars\x0a\x09^ iVars ifNil: [ iVars := Dictionary new ]",
534
574
  messageSends: ["ifNil:", "new"],
@@ -541,10 +581,10 @@ smalltalk.addMethod(
541
581
  smalltalk.method({
542
582
  selector: "isMethodScope",
543
583
  category: 'testing',
544
- fn: function () {
545
- var self = this;
546
- return true;
547
- },
584
+ fn: function (){
585
+ var self=this;
586
+ return smalltalk.withContext(function($ctx1) {
587
+ }, function($ctx1) {$ctx1.fill(self,"isMethodScope",{}, smalltalk.MethodLexicalScope)})},
548
588
  args: [],
549
589
  source: "isMethodScope\x0a\x09^ true",
550
590
  messageSends: [],
@@ -557,16 +597,17 @@ smalltalk.addMethod(
557
597
  smalltalk.method({
558
598
  selector: "localReturn",
559
599
  category: 'accessing',
560
- fn: function () {
561
- var self = this;
562
- var $1;
563
- if (($receiver = self['@localReturn']) == nil || $receiver == undefined) {
564
- $1 = false;
565
- } else {
566
- $1 = self['@localReturn'];
567
- }
568
- return $1;
569
- },
600
+ fn: function (){
601
+ var self=this;
602
+ return smalltalk.withContext(function($ctx1) {
603
+ $2=self["@localReturn"];
604
+ if(($receiver = $2) == nil || $receiver == undefined){
605
+ $1=false;
606
+ } else {
607
+ $1=$2;
608
+ };
609
+ return $1;
610
+ }, function($ctx1) {$ctx1.fill(self,"localReturn",{}, smalltalk.MethodLexicalScope)})},
570
611
  args: [],
571
612
  source: "localReturn\x0a\x09^ localReturn ifNil: [ false ]",
572
613
  messageSends: ["ifNil:"],
@@ -579,11 +620,10 @@ smalltalk.addMethod(
579
620
  smalltalk.method({
580
621
  selector: "localReturn:",
581
622
  category: 'accessing',
582
- fn: function (aBoolean) {
583
- var self = this;
584
- self['@localReturn'] = aBoolean;
585
- return self;
586
- },
623
+ fn: function (aBoolean){
624
+ var self=this;
625
+ return smalltalk.withContext(function($ctx1) {
626
+ return self}, function($ctx1) {$ctx1.fill(self,"localReturn:",{aBoolean:aBoolean}, smalltalk.MethodLexicalScope)})},
587
627
  args: ["aBoolean"],
588
628
  source: "localReturn: aBoolean\x0a\x09localReturn := aBoolean",
589
629
  messageSends: [],
@@ -596,10 +636,12 @@ smalltalk.addMethod(
596
636
  smalltalk.method({
597
637
  selector: "methodScope",
598
638
  category: 'accessing',
599
- fn: function () {
600
- var self = this;
601
- return self;
602
- },
639
+ fn: function (){
640
+ var self=this;
641
+ return smalltalk.withContext(function($ctx1) {
642
+ $1=self;
643
+ return $1;
644
+ }, function($ctx1) {$ctx1.fill(self,"methodScope",{}, smalltalk.MethodLexicalScope)})},
603
645
  args: [],
604
646
  source: "methodScope\x0a\x09^ self",
605
647
  messageSends: [],
@@ -612,18 +654,18 @@ smalltalk.addMethod(
612
654
  smalltalk.method({
613
655
  selector: "nonLocalReturns",
614
656
  category: 'accessing',
615
- fn: function () {
616
- var self = this;
617
- var $1;
618
- if (($receiver = self['@nonLocalReturns']) == nil ||
619
- $receiver == undefined) {
620
- self['@nonLocalReturns'] = smalltalk.send(smalltalk.OrderedCollection || OrderedCollection, "_new", []);
621
- $1 = self['@nonLocalReturns'];
622
- } else {
623
- $1 = self['@nonLocalReturns'];
624
- }
625
- return $1;
626
- },
657
+ fn: function (){
658
+ var self=this;
659
+ return smalltalk.withContext(function($ctx1) {
660
+ $2=self["@nonLocalReturns"];
661
+ if(($receiver = $2) == nil || $receiver == undefined){
662
+ self["@nonLocalReturns"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
663
+ $1=self["@nonLocalReturns"];
664
+ } else {
665
+ $1=$2;
666
+ };
667
+ return $1;
668
+ }, function($ctx1) {$ctx1.fill(self,"nonLocalReturns",{}, smalltalk.MethodLexicalScope)})},
627
669
  args: [],
628
670
  source: "nonLocalReturns\x0a\x09^ nonLocalReturns ifNil: [ nonLocalReturns := OrderedCollection new ]",
629
671
  messageSends: ["ifNil:", "new"],
@@ -636,18 +678,25 @@ smalltalk.addMethod(
636
678
  smalltalk.method({
637
679
  selector: "pseudoVars",
638
680
  category: 'accessing',
639
- fn: function () {
640
- var self = this;
641
- var $1, $2;
642
- if (($receiver = self['@pseudoVars']) == nil || $receiver == undefined) {
643
- self['@pseudoVars'] = smalltalk.send(smalltalk.Dictionary || Dictionary, "_new", []);
644
- self['@pseudoVars'];
645
- smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_pseudoVariableNames", []), "_do_", [function (each) {$1 = smalltalk.send(smalltalk.PseudoVar || PseudoVar, "_on_", [each]);smalltalk.send($1, "_scope_", [smalltalk.send(self, "_methodScope", [])]);$2 = smalltalk.send($1, "_yourself", []);return smalltalk.send(self['@pseudoVars'], "_at_put_", [each, $2]);}]);
646
- } else {
647
- self['@pseudoVars'];
648
- }
649
- return self['@pseudoVars'];
650
- },
681
+ fn: function (){
682
+ var self=this;
683
+ return smalltalk.withContext(function($ctx1) {
684
+ $1=self["@pseudoVars"];
685
+ if(($receiver = $1) == nil || $receiver == undefined){
686
+ self["@pseudoVars"]=_st((smalltalk.Dictionary || Dictionary))._new();
687
+ self["@pseudoVars"];
688
+ _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._pseudoVariableNames())._do_((function(each){
689
+ return smalltalk.withContext(function($ctx2) {
690
+ _st($2)._scope_(_st(self)._methodScope());
691
+ $3=_st($2)._yourself();
692
+ return _st(self["@pseudoVars"])._at_put_(each,$3);
693
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
694
+ } else {
695
+ $1;
696
+ };
697
+ $4=self["@pseudoVars"];
698
+ return $4;
699
+ }, function($ctx1) {$ctx1.fill(self,"pseudoVars",{}, smalltalk.MethodLexicalScope)})},
651
700
  args: [],
652
701
  source: "pseudoVars\x0a\x09pseudoVars ifNil: [\x0a\x09\x09pseudoVars := Dictionary new.\x0a\x09\x09Smalltalk current pseudoVariableNames do: [ :each |\x0a\x09\x09\x09pseudoVars at: each put: ((PseudoVar on: each)\x0a\x09\x09\x09\x09scope: self methodScope;\x0a\x09\x09\x09\x09yourself) ]].\x0a\x09^ pseudoVars",
653
702
  messageSends: ["ifNil:", "new", "do:", "at:put:", "scope:", "methodScope", "on:", "yourself", "pseudoVariableNames", "current"],
@@ -660,11 +709,11 @@ smalltalk.addMethod(
660
709
  smalltalk.method({
661
710
  selector: "removeNonLocalReturn:",
662
711
  category: 'adding',
663
- fn: function (aScope) {
664
- var self = this;
665
- smalltalk.send(smalltalk.send(self, "_nonLocalReturns", []), "_remove_ifAbsent_", [aScope, function () {}]);
666
- return self;
667
- },
712
+ fn: function (aScope){
713
+ var self=this;
714
+ return smalltalk.withContext(function($ctx1) {
715
+ return smalltalk.withContext(function($ctx2) {
716
+ return self}, function($ctx1) {$ctx1.fill(self,"removeNonLocalReturn:",{aScope:aScope}, smalltalk.MethodLexicalScope)})},
668
717
  args: ["aScope"],
669
718
  source: "removeNonLocalReturn: aScope\x0a\x09self nonLocalReturns remove: aScope ifAbsent: []",
670
719
  messageSends: ["remove:ifAbsent:", "nonLocalReturns"],
@@ -677,18 +726,18 @@ smalltalk.addMethod(
677
726
  smalltalk.method({
678
727
  selector: "unknownVariables",
679
728
  category: 'accessing',
680
- fn: function () {
681
- var self = this;
682
- var $1;
683
- if (($receiver = self['@unknownVariables']) == nil ||
684
- $receiver == undefined) {
685
- self['@unknownVariables'] = smalltalk.send(smalltalk.OrderedCollection || OrderedCollection, "_new", []);
686
- $1 = self['@unknownVariables'];
687
- } else {
688
- $1 = self['@unknownVariables'];
689
- }
690
- return $1;
691
- },
729
+ fn: function (){
730
+ var self=this;
731
+ return smalltalk.withContext(function($ctx1) {
732
+ $2=self["@unknownVariables"];
733
+ if(($receiver = $2) == nil || $receiver == undefined){
734
+ self["@unknownVariables"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
735
+ $1=self["@unknownVariables"];
736
+ } else {
737
+ $1=$2;
738
+ };
739
+ return $1;
740
+ }, function($ctx1) {$ctx1.fill(self,"unknownVariables",{}, smalltalk.MethodLexicalScope)})},
692
741
  args: [],
693
742
  source: "unknownVariables\x0a\x09^ unknownVariables ifNil: [ unknownVariables := OrderedCollection new ]",
694
743
  messageSends: ["ifNil:", "new"],
@@ -705,12 +754,12 @@ smalltalk.addMethod(
705
754
  smalltalk.method({
706
755
  selector: "alias",
707
756
  category: 'accessing',
708
- fn: function () {
709
- var self = this;
710
- var $1;
711
- $1 = smalltalk.send(smalltalk.send(self, "_name", []), "_asVariableName", []);
712
- return $1;
713
- },
757
+ fn: function (){
758
+ var self=this;
759
+ return smalltalk.withContext(function($ctx1) {
760
+ $1=_st(_st(self)._name())._asVariableName();
761
+ return $1;
762
+ }, function($ctx1) {$ctx1.fill(self,"alias",{}, smalltalk.ScopeVar)})},
714
763
  args: [],
715
764
  source: "alias\x0a\x09^ self name asVariableName",
716
765
  messageSends: ["asVariableName", "name"],
@@ -723,10 +772,10 @@ smalltalk.addMethod(
723
772
  smalltalk.method({
724
773
  selector: "isArgVar",
725
774
  category: 'testing',
726
- fn: function () {
727
- var self = this;
728
- return false;
729
- },
775
+ fn: function (){
776
+ var self=this;
777
+ return smalltalk.withContext(function($ctx1) {
778
+ }, function($ctx1) {$ctx1.fill(self,"isArgVar",{}, smalltalk.ScopeVar)})},
730
779
  args: [],
731
780
  source: "isArgVar\x0a\x09^ false",
732
781
  messageSends: [],
@@ -739,10 +788,10 @@ smalltalk.addMethod(
739
788
  smalltalk.method({
740
789
  selector: "isClassRefVar",
741
790
  category: 'testing',
742
- fn: function () {
743
- var self = this;
744
- return false;
745
- },
791
+ fn: function (){
792
+ var self=this;
793
+ return smalltalk.withContext(function($ctx1) {
794
+ }, function($ctx1) {$ctx1.fill(self,"isClassRefVar",{}, smalltalk.ScopeVar)})},
746
795
  args: [],
747
796
  source: "isClassRefVar\x0a\x09^ false",
748
797
  messageSends: [],
@@ -755,10 +804,10 @@ smalltalk.addMethod(
755
804
  smalltalk.method({
756
805
  selector: "isInstanceVar",
757
806
  category: 'testing',
758
- fn: function () {
759
- var self = this;
760
- return false;
761
- },
807
+ fn: function (){
808
+ var self=this;
809
+ return smalltalk.withContext(function($ctx1) {
810
+ }, function($ctx1) {$ctx1.fill(self,"isInstanceVar",{}, smalltalk.ScopeVar)})},
762
811
  args: [],
763
812
  source: "isInstanceVar\x0a\x09^ false",
764
813
  messageSends: [],
@@ -771,10 +820,10 @@ smalltalk.addMethod(
771
820
  smalltalk.method({
772
821
  selector: "isPseudoVar",
773
822
  category: 'testing',
774
- fn: function () {
775
- var self = this;
776
- return false;
777
- },
823
+ fn: function (){
824
+ var self=this;
825
+ return smalltalk.withContext(function($ctx1) {
826
+ }, function($ctx1) {$ctx1.fill(self,"isPseudoVar",{}, smalltalk.ScopeVar)})},
778
827
  args: [],
779
828
  source: "isPseudoVar\x0a\x09^ false",
780
829
  messageSends: [],
@@ -787,10 +836,10 @@ smalltalk.addMethod(
787
836
  smalltalk.method({
788
837
  selector: "isTempVar",
789
838
  category: 'testing',
790
- fn: function () {
791
- var self = this;
792
- return false;
793
- },
839
+ fn: function (){
840
+ var self=this;
841
+ return smalltalk.withContext(function($ctx1) {
842
+ }, function($ctx1) {$ctx1.fill(self,"isTempVar",{}, smalltalk.ScopeVar)})},
794
843
  args: [],
795
844
  source: "isTempVar\x0a\x09^ false",
796
845
  messageSends: [],
@@ -803,10 +852,10 @@ smalltalk.addMethod(
803
852
  smalltalk.method({
804
853
  selector: "isUnknownVar",
805
854
  category: 'testing',
806
- fn: function () {
807
- var self = this;
808
- return false;
809
- },
855
+ fn: function (){
856
+ var self=this;
857
+ return smalltalk.withContext(function($ctx1) {
858
+ }, function($ctx1) {$ctx1.fill(self,"isUnknownVar",{}, smalltalk.ScopeVar)})},
810
859
  args: [],
811
860
  source: "isUnknownVar\x0a\x09^ false",
812
861
  messageSends: [],
@@ -819,10 +868,12 @@ smalltalk.addMethod(
819
868
  smalltalk.method({
820
869
  selector: "name",
821
870
  category: 'accessing',
822
- fn: function () {
823
- var self = this;
824
- return self['@name'];
825
- },
871
+ fn: function (){
872
+ var self=this;
873
+ return smalltalk.withContext(function($ctx1) {
874
+ $1=self["@name"];
875
+ return $1;
876
+ }, function($ctx1) {$ctx1.fill(self,"name",{}, smalltalk.ScopeVar)})},
826
877
  args: [],
827
878
  source: "name\x0a\x09^ name",
828
879
  messageSends: [],
@@ -835,11 +886,10 @@ smalltalk.addMethod(
835
886
  smalltalk.method({
836
887
  selector: "name:",
837
888
  category: 'accessing',
838
- fn: function (aString) {
839
- var self = this;
840
- self['@name'] = aString;
841
- return self;
842
- },
889
+ fn: function (aString){
890
+ var self=this;
891
+ return smalltalk.withContext(function($ctx1) {
892
+ return self}, function($ctx1) {$ctx1.fill(self,"name:",{aString:aString}, smalltalk.ScopeVar)})},
843
893
  args: ["aString"],
844
894
  source: "name: aString\x0a\x09name := aString",
845
895
  messageSends: [],
@@ -852,10 +902,12 @@ smalltalk.addMethod(
852
902
  smalltalk.method({
853
903
  selector: "scope",
854
904
  category: 'accessing',
855
- fn: function () {
856
- var self = this;
857
- return self['@scope'];
858
- },
905
+ fn: function (){
906
+ var self=this;
907
+ return smalltalk.withContext(function($ctx1) {
908
+ $1=self["@scope"];
909
+ return $1;
910
+ }, function($ctx1) {$ctx1.fill(self,"scope",{}, smalltalk.ScopeVar)})},
859
911
  args: [],
860
912
  source: "scope\x0a\x09^ scope",
861
913
  messageSends: [],
@@ -868,11 +920,10 @@ smalltalk.addMethod(
868
920
  smalltalk.method({
869
921
  selector: "scope:",
870
922
  category: 'accessing',
871
- fn: function (aScope) {
872
- var self = this;
873
- self['@scope'] = aScope;
874
- return self;
875
- },
923
+ fn: function (aScope){
924
+ var self=this;
925
+ return smalltalk.withContext(function($ctx1) {
926
+ return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aScope:aScope}, smalltalk.ScopeVar)})},
876
927
  args: ["aScope"],
877
928
  source: "scope: aScope\x0a\x09scope := aScope",
878
929
  messageSends: [],
@@ -885,17 +936,19 @@ smalltalk.addMethod(
885
936
  smalltalk.method({
886
937
  selector: "validateAssignment",
887
938
  category: 'testing',
888
- fn: function () {
889
- var self = this;
890
- var $1, $2, $3;
891
- $1 = smalltalk.send(smalltalk.send(self, "_isArgVar", []), "_or_", [function () {return smalltalk.send(self, "_isPseudoVar", []);}]);
892
- if (smalltalk.assert($1)) {
893
- $2 = smalltalk.send(smalltalk.InvalidAssignmentError || InvalidAssignmentError, "_new", []);
894
- smalltalk.send($2, "_variableName_", [smalltalk.send(self, "_name", [])]);
895
- $3 = smalltalk.send($2, "_signal", []);
896
- }
897
- return self;
898
- },
939
+ fn: function (){
940
+ var self=this;
941
+ return smalltalk.withContext(function($ctx1) {
942
+ $1=_st(_st(self)._isArgVar())._or_((function(){
943
+ return smalltalk.withContext(function($ctx2) {
944
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
945
+ if(smalltalk.assert($1)){
946
+ $2=_st((smalltalk.InvalidAssignmentError || InvalidAssignmentError))._new();
947
+ _st($2)._variableName_(_st(self)._name());
948
+ $3=_st($2)._signal();
949
+ $3;
950
+ };
951
+ return self}, function($ctx1) {$ctx1.fill(self,"validateAssignment",{}, smalltalk.ScopeVar)})},
899
952
  args: [],
900
953
  source: "validateAssignment\x0a\x09(self isArgVar or: [ self isPseudoVar ]) ifTrue: [\x0a\x09\x09InvalidAssignmentError new\x0a\x09\x09\x09variableName: self name;\x0a\x09\x09\x09signal]",
901
954
  messageSends: ["ifTrue:", "variableName:", "name", "new", "signal", "or:", "isPseudoVar", "isArgVar"],
@@ -909,15 +962,15 @@ smalltalk.addMethod(
909
962
  smalltalk.method({
910
963
  selector: "on:",
911
964
  category: 'instance creation',
912
- fn: function (aString) {
913
- var self = this;
914
- var $2, $3, $1;
915
- $2 = smalltalk.send(self, "_new", []);
916
- smalltalk.send($2, "_name_", [aString]);
917
- $3 = smalltalk.send($2, "_yourself", []);
918
- $1 = $3;
919
- return $1;
920
- },
965
+ fn: function (aString){
966
+ var self=this;
967
+ return smalltalk.withContext(function($ctx1) {
968
+ $2=_st(self)._new();
969
+ _st($2)._name_(aString);
970
+ $3=_st($2)._yourself();
971
+ $1=$3;
972
+ return $1;
973
+ }, function($ctx1) {$ctx1.fill(self,"on:",{aString:aString}, smalltalk.ScopeVar.klass)})},
921
974
  args: ["aString"],
922
975
  source: "on: aString\x0a\x09^ self new \x0a\x09\x09name: aString;\x0a\x09\x09yourself",
923
976
  messageSends: ["name:", "new", "yourself"],
@@ -933,10 +986,12 @@ smalltalk.addMethod(
933
986
  smalltalk.method({
934
987
  selector: "node",
935
988
  category: 'accessing',
936
- fn: function () {
937
- var self = this;
938
- return self['@node'];
939
- },
989
+ fn: function (){
990
+ var self=this;
991
+ return smalltalk.withContext(function($ctx1) {
992
+ $1=self["@node"];
993
+ return $1;
994
+ }, function($ctx1) {$ctx1.fill(self,"node",{}, smalltalk.AliasVar)})},
940
995
  args: [],
941
996
  source: "node\x0a\x09^ node",
942
997
  messageSends: [],
@@ -949,11 +1004,10 @@ smalltalk.addMethod(
949
1004
  smalltalk.method({
950
1005
  selector: "node:",
951
1006
  category: 'accessing',
952
- fn: function (aNode) {
953
- var self = this;
954
- self['@node'] = aNode;
955
- return self;
956
- },
1007
+ fn: function (aNode){
1008
+ var self=this;
1009
+ return smalltalk.withContext(function($ctx1) {
1010
+ return self}, function($ctx1) {$ctx1.fill(self,"node:",{aNode:aNode}, smalltalk.AliasVar)})},
957
1011
  args: ["aNode"],
958
1012
  source: "node: aNode\x0a\x09node := aNode",
959
1013
  messageSends: [],
@@ -970,10 +1024,10 @@ smalltalk.addMethod(
970
1024
  smalltalk.method({
971
1025
  selector: "isArgVar",
972
1026
  category: 'testing',
973
- fn: function () {
974
- var self = this;
975
- return true;
976
- },
1027
+ fn: function (){
1028
+ var self=this;
1029
+ return smalltalk.withContext(function($ctx1) {
1030
+ }, function($ctx1) {$ctx1.fill(self,"isArgVar",{}, smalltalk.ArgVar)})},
977
1031
  args: [],
978
1032
  source: "isArgVar\x0a\x09^ true",
979
1033
  messageSends: [],
@@ -990,12 +1044,12 @@ smalltalk.addMethod(
990
1044
  smalltalk.method({
991
1045
  selector: "alias",
992
1046
  category: 'accessing',
993
- fn: function () {
994
- var self = this;
995
- var $1;
996
- $1 = smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("(smalltalk.", "__comma", [smalltalk.send(self, "_name", [])]), "__comma", [" || "]), "__comma", [smalltalk.send(self, "_name", [])]), "__comma", [")"]);
997
- return $1;
998
- },
1047
+ fn: function (){
1048
+ var self=this;
1049
+ return smalltalk.withContext(function($ctx1) {
1050
+ $1=_st(_st(_st(_st("(smalltalk.").__comma(_st(self)._name())).__comma(" || ")).__comma(_st(self)._name())).__comma(")");
1051
+ return $1;
1052
+ }, function($ctx1) {$ctx1.fill(self,"alias",{}, smalltalk.ClassRefVar)})},
999
1053
  args: [],
1000
1054
  source: "alias\x0a\x09^ '(smalltalk.', self name, ' || ', self name, ')'",
1001
1055
  messageSends: [",", "name"],
@@ -1008,10 +1062,10 @@ smalltalk.addMethod(
1008
1062
  smalltalk.method({
1009
1063
  selector: "isClassRefVar",
1010
1064
  category: 'testing',
1011
- fn: function () {
1012
- var self = this;
1013
- return true;
1014
- },
1065
+ fn: function (){
1066
+ var self=this;
1067
+ return smalltalk.withContext(function($ctx1) {
1068
+ }, function($ctx1) {$ctx1.fill(self,"isClassRefVar",{}, smalltalk.ClassRefVar)})},
1015
1069
  args: [],
1016
1070
  source: "isClassRefVar\x0a\x09^ true",
1017
1071
  messageSends: [],
@@ -1028,12 +1082,12 @@ smalltalk.addMethod(
1028
1082
  smalltalk.method({
1029
1083
  selector: "alias",
1030
1084
  category: 'testing',
1031
- fn: function () {
1032
- var self = this;
1033
- var $1;
1034
- $1 = smalltalk.send(smalltalk.send("self[\"@", "__comma", [smalltalk.send(self, "_name", [])]), "__comma", ["\"]"]);
1035
- return $1;
1036
- },
1085
+ fn: function (){
1086
+ var self=this;
1087
+ return smalltalk.withContext(function($ctx1) {
1088
+ $1=_st(_st("self[\x22@").__comma(_st(self)._name())).__comma("\x22]");
1089
+ return $1;
1090
+ }, function($ctx1) {$ctx1.fill(self,"alias",{}, smalltalk.InstanceVar)})},
1037
1091
  args: [],
1038
1092
  source: "alias\x0a\x09^ 'self[\x22@', self name, '\x22]'",
1039
1093
  messageSends: [",", "name"],
@@ -1046,10 +1100,10 @@ smalltalk.addMethod(
1046
1100
  smalltalk.method({
1047
1101
  selector: "isInstanceVar",
1048
1102
  category: 'testing',
1049
- fn: function () {
1050
- var self = this;
1051
- return true;
1052
- },
1103
+ fn: function (){
1104
+ var self=this;
1105
+ return smalltalk.withContext(function($ctx1) {
1106
+ }, function($ctx1) {$ctx1.fill(self,"isInstanceVar",{}, smalltalk.InstanceVar)})},
1053
1107
  args: [],
1054
1108
  source: "isInstanceVar\x0a\x09^ true",
1055
1109
  messageSends: [],
@@ -1066,12 +1120,12 @@ smalltalk.addMethod(
1066
1120
  smalltalk.method({
1067
1121
  selector: "alias",
1068
1122
  category: 'accessing',
1069
- fn: function () {
1070
- var self = this;
1071
- var $1;
1072
- $1 = smalltalk.send(self, "_name", []);
1073
- return $1;
1074
- },
1123
+ fn: function (){
1124
+ var self=this;
1125
+ return smalltalk.withContext(function($ctx1) {
1126
+ $1=_st(self)._name();
1127
+ return $1;
1128
+ }, function($ctx1) {$ctx1.fill(self,"alias",{}, smalltalk.PseudoVar)})},
1075
1129
  args: [],
1076
1130
  source: "alias\x0a\x09^ self name",
1077
1131
  messageSends: ["name"],
@@ -1084,10 +1138,10 @@ smalltalk.addMethod(
1084
1138
  smalltalk.method({
1085
1139
  selector: "isPseudoVar",
1086
1140
  category: 'testing',
1087
- fn: function () {
1088
- var self = this;
1089
- return true;
1090
- },
1141
+ fn: function (){
1142
+ var self=this;
1143
+ return smalltalk.withContext(function($ctx1) {
1144
+ }, function($ctx1) {$ctx1.fill(self,"isPseudoVar",{}, smalltalk.PseudoVar)})},
1091
1145
  args: [],
1092
1146
  source: "isPseudoVar\x0a\x09^ true",
1093
1147
  messageSends: [],
@@ -1104,10 +1158,10 @@ smalltalk.addMethod(
1104
1158
  smalltalk.method({
1105
1159
  selector: "isTempVar",
1106
1160
  category: 'testing',
1107
- fn: function () {
1108
- var self = this;
1109
- return true;
1110
- },
1161
+ fn: function (){
1162
+ var self=this;
1163
+ return smalltalk.withContext(function($ctx1) {
1164
+ }, function($ctx1) {$ctx1.fill(self,"isTempVar",{}, smalltalk.TempVar)})},
1111
1165
  args: [],
1112
1166
  source: "isTempVar\x0a\x09^ true",
1113
1167
  messageSends: [],
@@ -1124,10 +1178,10 @@ smalltalk.addMethod(
1124
1178
  smalltalk.method({
1125
1179
  selector: "isUnknownVar",
1126
1180
  category: 'testing',
1127
- fn: function () {
1128
- var self = this;
1129
- return true;
1130
- },
1181
+ fn: function (){
1182
+ var self=this;
1183
+ return smalltalk.withContext(function($ctx1) {
1184
+ }, function($ctx1) {$ctx1.fill(self,"isUnknownVar",{}, smalltalk.UnknownVar)})},
1131
1185
  args: [],
1132
1186
  source: "isUnknownVar\x0a\x09^ true",
1133
1187
  messageSends: [],
@@ -1137,25 +1191,25 @@ smalltalk.UnknownVar);
1137
1191
 
1138
1192
 
1139
1193
 
1140
- smalltalk.addClass('SemanticAnalyzer', smalltalk.NodeVisitor, ['currentScope', 'theClass', 'classReferences', 'messageSends'], 'Compiler-Semantic');
1194
+ smalltalk.addClass('SemanticAnalyzer', smalltalk.NodeVisitor, ['currentScope', 'theClass', 'classReferences', 'messageSends', 'superSends'], 'Compiler-Semantic');
1141
1195
  smalltalk.SemanticAnalyzer.comment="I semantically analyze the abstract syntax tree and annotate it with informations such as non local returns and variable scopes."
1142
1196
  smalltalk.addMethod(
1143
1197
  "_classReferences",
1144
1198
  smalltalk.method({
1145
1199
  selector: "classReferences",
1146
1200
  category: 'accessing',
1147
- fn: function () {
1148
- var self = this;
1149
- var $1;
1150
- if (($receiver = self['@classReferences']) == nil ||
1151
- $receiver == undefined) {
1152
- self['@classReferences'] = smalltalk.send(smalltalk.Set || Set, "_new", []);
1153
- $1 = self['@classReferences'];
1154
- } else {
1155
- $1 = self['@classReferences'];
1156
- }
1157
- return $1;
1158
- },
1201
+ fn: function (){
1202
+ var self=this;
1203
+ return smalltalk.withContext(function($ctx1) {
1204
+ $2=self["@classReferences"];
1205
+ if(($receiver = $2) == nil || $receiver == undefined){
1206
+ self["@classReferences"]=_st((smalltalk.Set || Set))._new();
1207
+ $1=self["@classReferences"];
1208
+ } else {
1209
+ $1=$2;
1210
+ };
1211
+ return $1;
1212
+ }, function($ctx1) {$ctx1.fill(self,"classReferences",{}, smalltalk.SemanticAnalyzer)})},
1159
1213
  args: [],
1160
1214
  source: "classReferences\x0a\x09^ classReferences ifNil: [ classReferences := Set new ]",
1161
1215
  messageSends: ["ifNil:", "new"],
@@ -1168,14 +1222,13 @@ smalltalk.addMethod(
1168
1222
  smalltalk.method({
1169
1223
  selector: "errorShadowingVariable:",
1170
1224
  category: 'error handling',
1171
- fn: function (aString) {
1172
- var self = this;
1173
- var $1, $2;
1174
- $1 = smalltalk.send(smalltalk.ShadowingVariableError || ShadowingVariableError, "_new", []);
1175
- smalltalk.send($1, "_variableName_", [aString]);
1176
- $2 = smalltalk.send($1, "_signal", []);
1177
- return self;
1178
- },
1225
+ fn: function (aString){
1226
+ var self=this;
1227
+ return smalltalk.withContext(function($ctx1) {
1228
+ $1=_st((smalltalk.ShadowingVariableError || ShadowingVariableError))._new();
1229
+ _st($1)._variableName_(aString);
1230
+ $2=_st($1)._signal();
1231
+ return self}, function($ctx1) {$ctx1.fill(self,"errorShadowingVariable:",{aString:aString}, smalltalk.SemanticAnalyzer)})},
1179
1232
  args: ["aString"],
1180
1233
  source: "errorShadowingVariable: aString\x0a\x09ShadowingVariableError new\x0a\x09\x09variableName: aString;\x0a\x09\x09signal",
1181
1234
  messageSends: ["variableName:", "new", "signal"],
@@ -1188,44 +1241,63 @@ smalltalk.addMethod(
1188
1241
  smalltalk.method({
1189
1242
  selector: "errorUnknownVariable:",
1190
1243
  category: 'error handling',
1191
- fn: function (aNode) {
1192
- var self = this;
1193
- var $1, $2;
1194
- var notDefined;
1195
- notDefined = eval("typeof " + aNode._value() + " == \"undefined\"");
1196
- if (smalltalk.assert(notDefined)) {
1197
- $1 = smalltalk.send(smalltalk.UnknownVariableError || UnknownVariableError, "_new", []);
1198
- smalltalk.send($1, "_variableName_", [smalltalk.send(aNode, "_value", [])]);
1199
- $2 = smalltalk.send($1, "_signal", []);
1200
- } else {
1201
- smalltalk.send(smalltalk.send(smalltalk.send(self['@currentScope'], "_methodScope", []), "_unknownVariables", []), "_add_", [smalltalk.send(aNode, "_value", [])]);
1202
- }
1203
- return self;
1204
- },
1244
+ fn: function (aNode){
1245
+ var self=this;
1246
+ var identifier;
1247
+ return smalltalk.withContext(function($ctx1) {
1248
+ identifier=_st(aNode)._value();
1249
+ $1=_st(_st(_st(["jQuery", "window", "process", "global"])._includes_(identifier))._not())._and_((function(){
1250
+ return smalltalk.withContext(function($ctx2) {
1251
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
1252
+ if(smalltalk.assert($1)){
1253
+ $2=_st((smalltalk.UnknownVariableError || UnknownVariableError))._new();
1254
+ _st($2)._variableName_(_st(aNode)._value());
1255
+ $3=_st($2)._signal();
1256
+ $3;
1257
+ } else {
1258
+ _st(_st(_st(self["@currentScope"])._methodScope())._unknownVariables())._add_(_st(aNode)._value());
1259
+ };
1260
+ return self}, function($ctx1) {$ctx1.fill(self,"errorUnknownVariable:",{aNode:aNode,identifier:identifier}, smalltalk.SemanticAnalyzer)})},
1205
1261
  args: ["aNode"],
1206
- source: "errorUnknownVariable: aNode\x0a\x09\x22Throw an error if the variable is undeclared in the global JS scope (i.e. window)\x22\x0a\x0a\x09| notDefined |\x0a\x0a\x09notDefined := <eval('typeof ' + aNode._value() + ' == \x22undefined\x22')>.\x0a\x0a\x09notDefined\x0a\x09\x09ifTrue: [ \x0a\x09\x09\x09UnknownVariableError new\x0a\x09\x09\x09\x09variableName: aNode value;\x0a\x09\x09\x09\x09signal ]\x0a\x09\x09ifFalse: [\x0a\x09\x09\x09currentScope methodScope unknownVariables add: aNode value. ]",
1207
- messageSends: ["ifTrue:ifFalse:", "variableName:", "value", "new", "signal", "add:", "unknownVariables", "methodScope"],
1262
+ source: "errorUnknownVariable: aNode\x0a\x09\x22Throw an error if the variable is undeclared in the global JS scope (i.e. window).\x0a We allow four variable names in addition: `jQuery`, `window`, `process` and `global` \x0a for nodejs and browser environments. \x0a \x0a This is only to make sure compilation works on both browser-based and nodejs environments.\x0a The ideal solution would be to use a pragma instead\x22\x0a\x0a\x09| identifier |\x0a identifier := aNode value.\x0a \x0a\x09((#('jQuery' 'window' 'process' 'global') includes: identifier) not \x0a and: [ self isVariableGloballyUndefined: identifier ]) \x0a \x09ifTrue: [\x0a\x09\x09\x09\x09UnknownVariableError new\x0a\x09\x09\x09\x09\x09variableName: aNode value;\x0a\x09\x09\x09\x09\x09signal ]\x0a\x09\x09\x09ifFalse: [\x0a\x09\x09\x09\x09currentScope methodScope unknownVariables add: aNode value ]",
1263
+ messageSends: ["value", "ifTrue:ifFalse:", "variableName:", "new", "signal", "add:", "unknownVariables", "methodScope", "and:", "isVariableGloballyUndefined:", "not", "includes:"],
1208
1264
  referencedClasses: ["UnknownVariableError"]
1209
1265
  }),
1210
1266
  smalltalk.SemanticAnalyzer);
1211
1267
 
1268
+ smalltalk.addMethod(
1269
+ "_isVariableGloballyUndefined_",
1270
+ smalltalk.method({
1271
+ selector: "isVariableGloballyUndefined:",
1272
+ category: 'testing',
1273
+ fn: function (aString){
1274
+ var self=this;
1275
+ return smalltalk.withContext(function($ctx1) {
1276
+ return self}, function($ctx1) {$ctx1.fill(self,"isVariableGloballyUndefined:",{aString:aString}, smalltalk.SemanticAnalyzer)})},
1277
+ args: ["aString"],
1278
+ source: "isVariableGloballyUndefined: aString\x0a\x09<return eval('typeof ' + aString + ' == \x22undefined\x22')>",
1279
+ messageSends: [],
1280
+ referencedClasses: []
1281
+ }),
1282
+ smalltalk.SemanticAnalyzer);
1283
+
1212
1284
  smalltalk.addMethod(
1213
1285
  "_messageSends",
1214
1286
  smalltalk.method({
1215
1287
  selector: "messageSends",
1216
1288
  category: 'accessing',
1217
- fn: function () {
1218
- var self = this;
1219
- var $1;
1220
- if (($receiver = self['@messageSends']) == nil ||
1221
- $receiver == undefined) {
1222
- self['@messageSends'] = smalltalk.send(smalltalk.Dictionary || Dictionary, "_new", []);
1223
- $1 = self['@messageSends'];
1224
- } else {
1225
- $1 = self['@messageSends'];
1226
- }
1227
- return $1;
1228
- },
1289
+ fn: function (){
1290
+ var self=this;
1291
+ return smalltalk.withContext(function($ctx1) {
1292
+ $2=self["@messageSends"];
1293
+ if(($receiver = $2) == nil || $receiver == undefined){
1294
+ self["@messageSends"]=_st((smalltalk.Dictionary || Dictionary))._new();
1295
+ $1=self["@messageSends"];
1296
+ } else {
1297
+ $1=$2;
1298
+ };
1299
+ return $1;
1300
+ }, function($ctx1) {$ctx1.fill(self,"messageSends",{}, smalltalk.SemanticAnalyzer)})},
1229
1301
  args: [],
1230
1302
  source: "messageSends\x0a\x09^ messageSends ifNil: [ messageSends := Dictionary new ]",
1231
1303
  messageSends: ["ifNil:", "new"],
@@ -1238,12 +1310,12 @@ smalltalk.addMethod(
1238
1310
  smalltalk.method({
1239
1311
  selector: "newBlockScope",
1240
1312
  category: 'factory',
1241
- fn: function () {
1242
- var self = this;
1243
- var $1;
1244
- $1 = smalltalk.send(self, "_newScopeOfClass_", [smalltalk.LexicalScope || LexicalScope]);
1245
- return $1;
1246
- },
1313
+ fn: function (){
1314
+ var self=this;
1315
+ return smalltalk.withContext(function($ctx1) {
1316
+ $1=_st(self)._newScopeOfClass_((smalltalk.LexicalScope || LexicalScope));
1317
+ return $1;
1318
+ }, function($ctx1) {$ctx1.fill(self,"newBlockScope",{}, smalltalk.SemanticAnalyzer)})},
1247
1319
  args: [],
1248
1320
  source: "newBlockScope\x0a\x09^ self newScopeOfClass: LexicalScope",
1249
1321
  messageSends: ["newScopeOfClass:"],
@@ -1256,12 +1328,12 @@ smalltalk.addMethod(
1256
1328
  smalltalk.method({
1257
1329
  selector: "newMethodScope",
1258
1330
  category: 'factory',
1259
- fn: function () {
1260
- var self = this;
1261
- var $1;
1262
- $1 = smalltalk.send(self, "_newScopeOfClass_", [smalltalk.MethodLexicalScope || MethodLexicalScope]);
1263
- return $1;
1264
- },
1331
+ fn: function (){
1332
+ var self=this;
1333
+ return smalltalk.withContext(function($ctx1) {
1334
+ $1=_st(self)._newScopeOfClass_((smalltalk.MethodLexicalScope || MethodLexicalScope));
1335
+ return $1;
1336
+ }, function($ctx1) {$ctx1.fill(self,"newMethodScope",{}, smalltalk.SemanticAnalyzer)})},
1265
1337
  args: [],
1266
1338
  source: "newMethodScope\x0a\x09^ self newScopeOfClass: MethodLexicalScope",
1267
1339
  messageSends: ["newScopeOfClass:"],
@@ -1274,15 +1346,15 @@ smalltalk.addMethod(
1274
1346
  smalltalk.method({
1275
1347
  selector: "newScopeOfClass:",
1276
1348
  category: 'factory',
1277
- fn: function (aLexicalScopeClass) {
1278
- var self = this;
1279
- var $2, $3, $1;
1280
- $2 = smalltalk.send(aLexicalScopeClass, "_new", []);
1281
- smalltalk.send($2, "_outerScope_", [self['@currentScope']]);
1282
- $3 = smalltalk.send($2, "_yourself", []);
1283
- $1 = $3;
1284
- return $1;
1285
- },
1349
+ fn: function (aLexicalScopeClass){
1350
+ var self=this;
1351
+ return smalltalk.withContext(function($ctx1) {
1352
+ $2=_st(aLexicalScopeClass)._new();
1353
+ _st($2)._outerScope_(self["@currentScope"]);
1354
+ $3=_st($2)._yourself();
1355
+ $1=$3;
1356
+ return $1;
1357
+ }, function($ctx1) {$ctx1.fill(self,"newScopeOfClass:",{aLexicalScopeClass:aLexicalScopeClass}, smalltalk.SemanticAnalyzer)})},
1286
1358
  args: ["aLexicalScopeClass"],
1287
1359
  source: "newScopeOfClass: aLexicalScopeClass\x0a\x09^ aLexicalScopeClass new \x0a\x09\x09outerScope: currentScope;\x0a\x09\x09yourself",
1288
1360
  messageSends: ["outerScope:", "new", "yourself"],
@@ -1295,17 +1367,17 @@ smalltalk.addMethod(
1295
1367
  smalltalk.method({
1296
1368
  selector: "popScope",
1297
1369
  category: 'scope',
1298
- fn: function () {
1299
- var self = this;
1300
- if (($receiver = self['@currentScope']) == nil ||
1301
- $receiver == undefined) {
1302
- self['@currentScope'];
1303
- } else {
1304
- self['@currentScope'] = smalltalk.send(self['@currentScope'], "_outerScope", []);
1305
- self['@currentScope'];
1306
- }
1307
- return self;
1308
- },
1370
+ fn: function (){
1371
+ var self=this;
1372
+ return smalltalk.withContext(function($ctx1) {
1373
+ $1=self["@currentScope"];
1374
+ if(($receiver = $1) == nil || $receiver == undefined){
1375
+ $1;
1376
+ } else {
1377
+ self["@currentScope"]=_st(self["@currentScope"])._outerScope();
1378
+ self["@currentScope"];
1379
+ };
1380
+ return self}, function($ctx1) {$ctx1.fill(self,"popScope",{}, smalltalk.SemanticAnalyzer)})},
1309
1381
  args: [],
1310
1382
  source: "popScope\x0a\x09currentScope ifNotNil: [\x0a\x09\x09currentScope := currentScope outerScope ]",
1311
1383
  messageSends: ["ifNotNil:", "outerScope"],
@@ -1318,12 +1390,11 @@ smalltalk.addMethod(
1318
1390
  smalltalk.method({
1319
1391
  selector: "pushScope:",
1320
1392
  category: 'scope',
1321
- fn: function (aScope) {
1322
- var self = this;
1323
- smalltalk.send(aScope, "_outerScope_", [self['@currentScope']]);
1324
- self['@currentScope'] = aScope;
1325
- return self;
1326
- },
1393
+ fn: function (aScope){
1394
+ var self=this;
1395
+ return smalltalk.withContext(function($ctx1) {
1396
+ self["@currentScope"]=aScope;
1397
+ return self}, function($ctx1) {$ctx1.fill(self,"pushScope:",{aScope:aScope}, smalltalk.SemanticAnalyzer)})},
1327
1398
  args: ["aScope"],
1328
1399
  source: "pushScope: aScope\x0a\x09aScope outerScope: currentScope.\x0a\x09currentScope := aScope",
1329
1400
  messageSends: ["outerScope:"],
@@ -1331,15 +1402,41 @@ referencedClasses: []
1331
1402
  }),
1332
1403
  smalltalk.SemanticAnalyzer);
1333
1404
 
1405
+ smalltalk.addMethod(
1406
+ "_superSends",
1407
+ smalltalk.method({
1408
+ selector: "superSends",
1409
+ category: 'accessing',
1410
+ fn: function (){
1411
+ var self=this;
1412
+ return smalltalk.withContext(function($ctx1) {
1413
+ $2=self["@superSends"];
1414
+ if(($receiver = $2) == nil || $receiver == undefined){
1415
+ self["@superSends"]=_st((smalltalk.Dictionary || Dictionary))._new();
1416
+ $1=self["@superSends"];
1417
+ } else {
1418
+ $1=$2;
1419
+ };
1420
+ return $1;
1421
+ }, function($ctx1) {$ctx1.fill(self,"superSends",{}, smalltalk.SemanticAnalyzer)})},
1422
+ args: [],
1423
+ source: "superSends\x0a\x09^ superSends ifNil: [ superSends := Dictionary new ]",
1424
+ messageSends: ["ifNil:", "new"],
1425
+ referencedClasses: ["Dictionary"]
1426
+ }),
1427
+ smalltalk.SemanticAnalyzer);
1428
+
1334
1429
  smalltalk.addMethod(
1335
1430
  "_theClass",
1336
1431
  smalltalk.method({
1337
1432
  selector: "theClass",
1338
1433
  category: 'accessing',
1339
- fn: function () {
1340
- var self = this;
1341
- return self['@theClass'];
1342
- },
1434
+ fn: function (){
1435
+ var self=this;
1436
+ return smalltalk.withContext(function($ctx1) {
1437
+ $1=self["@theClass"];
1438
+ return $1;
1439
+ }, function($ctx1) {$ctx1.fill(self,"theClass",{}, smalltalk.SemanticAnalyzer)})},
1343
1440
  args: [],
1344
1441
  source: "theClass\x0a\x09^ theClass",
1345
1442
  messageSends: [],
@@ -1352,11 +1449,10 @@ smalltalk.addMethod(
1352
1449
  smalltalk.method({
1353
1450
  selector: "theClass:",
1354
1451
  category: 'accessing',
1355
- fn: function (aClass) {
1356
- var self = this;
1357
- self['@theClass'] = aClass;
1358
- return self;
1359
- },
1452
+ fn: function (aClass){
1453
+ var self=this;
1454
+ return smalltalk.withContext(function($ctx1) {
1455
+ return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass}, smalltalk.SemanticAnalyzer)})},
1360
1456
  args: ["aClass"],
1361
1457
  source: "theClass: aClass\x0a\x09theClass := aClass",
1362
1458
  messageSends: [],
@@ -1369,16 +1465,16 @@ smalltalk.addMethod(
1369
1465
  smalltalk.method({
1370
1466
  selector: "validateVariableScope:",
1371
1467
  category: 'scope',
1372
- fn: function (aString) {
1373
- var self = this;
1374
- var $1;
1375
- $1 = smalltalk.send(self['@currentScope'], "_lookupVariable_", [aString]);
1376
- if (($receiver = $1) == nil || $receiver == undefined) {
1377
- } else {
1378
- smalltalk.send(self, "_errorShadowingVariable_", [aString]);
1379
- }
1380
- return self;
1381
- },
1468
+ fn: function (aString){
1469
+ var self=this;
1470
+ return smalltalk.withContext(function($ctx1) {
1471
+ $1=_st(self["@currentScope"])._lookupVariable_(aString);
1472
+ if(($receiver = $1) == nil || $receiver == undefined){
1473
+ $1;
1474
+ } else {
1475
+ _st(self)._errorShadowingVariable_(aString);
1476
+ };
1477
+ return self}, function($ctx1) {$ctx1.fill(self,"validateVariableScope:",{aString:aString}, smalltalk.SemanticAnalyzer)})},
1382
1478
  args: ["aString"],
1383
1479
  source: "validateVariableScope: aString\x0a\x09\x22Validate the variable scope in by doing a recursive lookup, up to the method scope\x22\x0a\x0a\x09(currentScope lookupVariable: aString) ifNotNil: [\x0a\x09\x09self errorShadowingVariable: aString ]",
1384
1480
  messageSends: ["ifNotNil:", "errorShadowingVariable:", "lookupVariable:"],
@@ -1391,12 +1487,11 @@ smalltalk.addMethod(
1391
1487
  smalltalk.method({
1392
1488
  selector: "visitAssignmentNode:",
1393
1489
  category: 'visiting',
1394
- fn: function (aNode) {
1395
- var self = this;
1396
- smalltalk.send(self, "_visitAssignmentNode_", [aNode], smalltalk.NodeVisitor);
1397
- smalltalk.send(smalltalk.send(aNode, "_left", []), "_beAssigned", []);
1398
- return self;
1399
- },
1490
+ fn: function (aNode){
1491
+ var self=this;
1492
+ return smalltalk.withContext(function($ctx1) {
1493
+ _st(_st(aNode)._left())._beAssigned();
1494
+ return self}, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
1400
1495
  args: ["aNode"],
1401
1496
  source: "visitAssignmentNode: aNode\x0a\x09super visitAssignmentNode: aNode.\x0a\x09aNode left beAssigned",
1402
1497
  messageSends: ["visitAssignmentNode:", "beAssigned", "left"],
@@ -1409,16 +1504,18 @@ smalltalk.addMethod(
1409
1504
  smalltalk.method({
1410
1505
  selector: "visitBlockNode:",
1411
1506
  category: 'visiting',
1412
- fn: function (aNode) {
1413
- var self = this;
1414
- smalltalk.send(self, "_pushScope_", [smalltalk.send(self, "_newBlockScope", [])]);
1415
- smalltalk.send(aNode, "_scope_", [self['@currentScope']]);
1416
- smalltalk.send(self['@currentScope'], "_node_", [aNode]);
1417
- smalltalk.send(smalltalk.send(aNode, "_parameters", []), "_do_", [function (each) {smalltalk.send(self, "_validateVariableScope_", [each]);return smalltalk.send(self['@currentScope'], "_addArg_", [each]);}]);
1418
- smalltalk.send(self, "_visitBlockNode_", [aNode], smalltalk.NodeVisitor);
1419
- smalltalk.send(self, "_popScope", []);
1420
- return self;
1421
- },
1507
+ fn: function (aNode){
1508
+ var self=this;
1509
+ return smalltalk.withContext(function($ctx1) {
1510
+ _st(aNode)._scope_(self["@currentScope"]);
1511
+ _st(self["@currentScope"])._node_(aNode);
1512
+ _st(_st(aNode)._parameters())._do_((function(each){
1513
+ return smalltalk.withContext(function($ctx2) {
1514
+ return _st(self["@currentScope"])._addArg_(each);
1515
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
1516
+ smalltalk.NodeVisitor.fn.prototype._visitBlockNode_.apply(_st(self), [aNode]);
1517
+ _st(self)._popScope();
1518
+ return self}, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
1422
1519
  args: ["aNode"],
1423
1520
  source: "visitBlockNode: aNode\x0a\x09self pushScope: self newBlockScope.\x0a\x09aNode scope: currentScope.\x0a\x09currentScope node: aNode.\x0a\x09\x0a\x09aNode parameters do: [ :each | \x0a\x09\x09self validateVariableScope: each.\x0a\x09\x09currentScope addArg: each ].\x0a\x0a\x09super visitBlockNode: aNode.\x0a\x09self popScope",
1424
1521
  messageSends: ["pushScope:", "newBlockScope", "scope:", "node:", "do:", "validateVariableScope:", "addArg:", "parameters", "visitBlockNode:", "popScope"],
@@ -1431,17 +1528,20 @@ smalltalk.addMethod(
1431
1528
  smalltalk.method({
1432
1529
  selector: "visitCascadeNode:",
1433
1530
  category: 'visiting',
1434
- fn: function (aNode) {
1435
- var self = this;
1436
- var $1;
1437
- smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [function (each) {return smalltalk.send(each, "_receiver_", [smalltalk.send(aNode, "_receiver", [])]);}]);
1438
- smalltalk.send(self, "_visitCascadeNode_", [aNode], smalltalk.NodeVisitor);
1439
- $1 = smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_first", []), "_superSend", []);
1440
- if (smalltalk.assert($1)) {
1441
- smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [function (each) {return smalltalk.send(each, "_superSend_", [true]);}]);
1442
- }
1443
- return self;
1444
- },
1531
+ fn: function (aNode){
1532
+ var self=this;
1533
+ return smalltalk.withContext(function($ctx1) {
1534
+ _st(_st(aNode)._nodes())._do_((function(each){
1535
+ return smalltalk.withContext(function($ctx2) {
1536
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
1537
+ smalltalk.NodeVisitor.fn.prototype._visitCascadeNode_.apply(_st(self), [aNode]);
1538
+ $1=_st(_st(_st(aNode)._nodes())._first())._superSend();
1539
+ if(smalltalk.assert($1)){
1540
+ _st(_st(aNode)._nodes())._do_((function(each){
1541
+ return smalltalk.withContext(function($ctx2) {
1542
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
1543
+ };
1544
+ return self}, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
1445
1545
  args: ["aNode"],
1446
1546
  source: "visitCascadeNode: aNode\x0a\x09\x22Populate the receiver into all children\x22\x0a\x09aNode nodes do: [ :each | \x0a\x09\x09each receiver: aNode receiver ].\x0a\x09super visitCascadeNode: aNode.\x0a\x09aNode nodes first superSend ifTrue: [\x0a\x09\x09aNode nodes do: [ :each | each superSend: true ]]",
1447
1547
  messageSends: ["do:", "receiver:", "receiver", "nodes", "visitCascadeNode:", "ifTrue:", "superSend:", "superSend", "first"],
@@ -1454,16 +1554,15 @@ smalltalk.addMethod(
1454
1554
  smalltalk.method({
1455
1555
  selector: "visitClassReferenceNode:",
1456
1556
  category: 'visiting',
1457
- fn: function (aNode) {
1458
- var self = this;
1459
- var $1, $2;
1460
- smalltalk.send(smalltalk.send(self, "_classReferences", []), "_add_", [smalltalk.send(aNode, "_value", [])]);
1461
- $1 = smalltalk.send(smalltalk.ClassRefVar || ClassRefVar, "_new", []);
1462
- smalltalk.send($1, "_name_", [smalltalk.send(aNode, "_value", [])]);
1463
- $2 = smalltalk.send($1, "_yourself", []);
1464
- smalltalk.send(aNode, "_binding_", [$2]);
1465
- return self;
1466
- },
1557
+ fn: function (aNode){
1558
+ var self=this;
1559
+ return smalltalk.withContext(function($ctx1) {
1560
+ _st(_st(self)._classReferences())._add_(_st(aNode)._value());
1561
+ $1=_st((smalltalk.ClassRefVar || ClassRefVar))._new();
1562
+ _st($1)._name_(_st(aNode)._value());
1563
+ $2=_st($1)._yourself();
1564
+ _st(aNode)._binding_($2);
1565
+ return self}, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
1467
1566
  args: ["aNode"],
1468
1567
  source: "visitClassReferenceNode: aNode\x0a\x09self classReferences add: aNode value.\x0a\x09aNode binding: (ClassRefVar new name: aNode value; yourself)",
1469
1568
  messageSends: ["add:", "value", "classReferences", "binding:", "name:", "new", "yourself"],
@@ -1476,23 +1575,29 @@ smalltalk.addMethod(
1476
1575
  smalltalk.method({
1477
1576
  selector: "visitMethodNode:",
1478
1577
  category: 'visiting',
1479
- fn: function (aNode) {
1480
- var self = this;
1481
- var $1;
1482
- smalltalk.send(self, "_pushScope_", [smalltalk.send(self, "_newMethodScope", [])]);
1483
- smalltalk.send(aNode, "_scope_", [self['@currentScope']]);
1484
- smalltalk.send(self['@currentScope'], "_node_", [aNode]);
1485
- smalltalk.send(smalltalk.send(smalltalk.send(self, "_theClass", []), "_allInstanceVariableNames", []), "_do_", [function (each) {return smalltalk.send(self['@currentScope'], "_addIVar_", [each]);}]);
1486
- smalltalk.send(smalltalk.send(aNode, "_arguments", []), "_do_", [function (each) {smalltalk.send(self, "_validateVariableScope_", [each]);return smalltalk.send(self['@currentScope'], "_addArg_", [each]);}]);
1487
- smalltalk.send(self, "_visitMethodNode_", [aNode], smalltalk.NodeVisitor);
1488
- smalltalk.send(aNode, "_classReferences_", [smalltalk.send(self, "_classReferences", [])]);
1489
- $1 = smalltalk.send(aNode, "_messageSends_", [smalltalk.send(smalltalk.send(self, "_messageSends", []), "_keys", [])]);
1490
- smalltalk.send(self, "_popScope", []);
1491
- return self;
1492
- },
1578
+ fn: function (aNode){
1579
+ var self=this;
1580
+ return smalltalk.withContext(function($ctx1) {
1581
+ _st(self)._pushScope_(_st(self)._newMethodScope());
1582
+ _st(aNode)._scope_(self["@currentScope"]);
1583
+ _st(self["@currentScope"])._node_(aNode);
1584
+ _st(_st(_st(self)._theClass())._allInstanceVariableNames())._do_((function(each){
1585
+ return smalltalk.withContext(function($ctx2) {
1586
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
1587
+ _st(_st(aNode)._arguments())._do_((function(each){
1588
+ return smalltalk.withContext(function($ctx2) {
1589
+ return _st(self["@currentScope"])._addArg_(each);
1590
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
1591
+ smalltalk.NodeVisitor.fn.prototype._visitMethodNode_.apply(_st(self), [aNode]);
1592
+ $1=aNode;
1593
+ _st($1)._classReferences_(_st(self)._classReferences());
1594
+ _st($1)._messageSends_(_st(_st(self)._messageSends())._keys());
1595
+ $2=_st($1)._superSends_(_st(_st(self)._superSends())._keys());
1596
+ _st(self)._popScope();
1597
+ return self}, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
1493
1598
  args: ["aNode"],
1494
- source: "visitMethodNode: aNode\x0a\x09self pushScope: self newMethodScope.\x0a\x09aNode scope: currentScope.\x0a\x09currentScope node: aNode.\x0a\x0a\x09self theClass allInstanceVariableNames do: [:each | \x0a\x09\x09currentScope addIVar: each ].\x0a\x09aNode arguments do: [ :each | \x0a\x09\x09self validateVariableScope: each.\x0a\x09\x09currentScope addArg: each ].\x0a\x0a\x09super visitMethodNode: aNode.\x0a\x0a\x09aNode \x0a\x09\x09classReferences: self classReferences;\x0a\x09\x09messageSends: self messageSends keys.\x0a\x09self popScope",
1495
- messageSends: ["pushScope:", "newMethodScope", "scope:", "node:", "do:", "addIVar:", "allInstanceVariableNames", "theClass", "validateVariableScope:", "addArg:", "arguments", "visitMethodNode:", "classReferences:", "classReferences", "messageSends:", "keys", "messageSends", "popScope"],
1599
+ source: "visitMethodNode: aNode\x0a\x09self pushScope: self newMethodScope.\x0a\x09aNode scope: currentScope.\x0a\x09currentScope node: aNode.\x0a\x0a\x09self theClass allInstanceVariableNames do: [:each | \x0a\x09\x09currentScope addIVar: each ].\x0a\x09aNode arguments do: [ :each | \x0a\x09\x09self validateVariableScope: each.\x0a\x09\x09currentScope addArg: each ].\x0a\x0a\x09super visitMethodNode: aNode.\x0a\x0a\x09aNode \x0a\x09\x09classReferences: self classReferences;\x0a\x09\x09messageSends: self messageSends keys;\x0a superSends: self superSends keys.\x0a\x09self popScope",
1600
+ messageSends: ["pushScope:", "newMethodScope", "scope:", "node:", "do:", "addIVar:", "allInstanceVariableNames", "theClass", "validateVariableScope:", "addArg:", "arguments", "visitMethodNode:", "classReferences:", "classReferences", "messageSends:", "keys", "messageSends", "superSends:", "superSends", "popScope"],
1496
1601
  referencedClasses: []
1497
1602
  }),
1498
1603
  smalltalk.SemanticAnalyzer);
@@ -1502,19 +1607,18 @@ smalltalk.addMethod(
1502
1607
  smalltalk.method({
1503
1608
  selector: "visitReturnNode:",
1504
1609
  category: 'visiting',
1505
- fn: function (aNode) {
1506
- var self = this;
1507
- var $1;
1508
- smalltalk.send(aNode, "_scope_", [self['@currentScope']]);
1509
- $1 = smalltalk.send(self['@currentScope'], "_isMethodScope", []);
1510
- if (smalltalk.assert($1)) {
1511
- smalltalk.send(self['@currentScope'], "_localReturn_", [true]);
1512
- } else {
1513
- smalltalk.send(smalltalk.send(self['@currentScope'], "_methodScope", []), "_addNonLocalReturn_", [self['@currentScope']]);
1514
- }
1515
- smalltalk.send(self, "_visitReturnNode_", [aNode], smalltalk.NodeVisitor);
1516
- return self;
1517
- },
1610
+ fn: function (aNode){
1611
+ var self=this;
1612
+ return smalltalk.withContext(function($ctx1) {
1613
+ _st(aNode)._scope_(self["@currentScope"]);
1614
+ $1=_st(self["@currentScope"])._isMethodScope();
1615
+ if(smalltalk.assert($1)){
1616
+ _st(self["@currentScope"])._localReturn_(true);
1617
+ } else {
1618
+ _st(_st(self["@currentScope"])._methodScope())._addNonLocalReturn_(self["@currentScope"]);
1619
+ };
1620
+ smalltalk.NodeVisitor.fn.prototype._visitReturnNode_.apply(_st(self), [aNode]);
1621
+ return self}, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
1518
1622
  args: ["aNode"],
1519
1623
  source: "visitReturnNode: aNode\x0a\x09aNode scope: currentScope.\x0a\x09currentScope isMethodScope\x0a\x09\x09ifTrue: [ currentScope localReturn: true ]\x0a\x09\x09ifFalse: [ currentScope methodScope addNonLocalReturn: currentScope ].\x0a\x09super visitReturnNode: aNode",
1520
1624
  messageSends: ["scope:", "ifTrue:ifFalse:", "localReturn:", "addNonLocalReturn:", "methodScope", "isMethodScope", "visitReturnNode:"],
@@ -1527,33 +1631,37 @@ smalltalk.addMethod(
1527
1631
  smalltalk.method({
1528
1632
  selector: "visitSendNode:",
1529
1633
  category: 'visiting',
1530
- fn: function (aNode) {
1531
- var self = this;
1532
- var $1, $2, $3;
1533
- $1 = smalltalk.send(smalltalk.send(smalltalk.send(aNode, "_receiver", []), "_value", []), "__eq", ["super"]);
1534
- if (smalltalk.assert($1)) {
1535
- smalltalk.send(aNode, "_superSend_", [true]);
1536
- smalltalk.send(smalltalk.send(aNode, "_receiver", []), "_value_", ["self"]);
1537
- } else {
1538
- $2 = smalltalk.send(smalltalk.send(smalltalk.IRSendInliner || IRSendInliner, "_inlinedSelectors", []), "_includes_", [smalltalk.send(aNode, "_selector", [])]);
1539
- if (smalltalk.assert($2)) {
1540
- smalltalk.send(aNode, "_shouldBeInlined_", [true]);
1541
- $3 = smalltalk.send(smalltalk.send(aNode, "_receiver", []), "_isValueNode", []);
1542
- if (!smalltalk.assert($3)) {
1543
- smalltalk.send(smalltalk.send(aNode, "_receiver", []), "_shouldBeAliased_", [true]);
1544
- }
1545
- }
1546
- }
1547
- smalltalk.send(smalltalk.send(self, "_messageSends", []), "_at_ifAbsentPut_", [smalltalk.send(aNode, "_selector", []), function () {return smalltalk.send(smalltalk.Set || Set, "_new", []);}]);
1548
- smalltalk.send(smalltalk.send(smalltalk.send(self, "_messageSends", []), "_at_", [smalltalk.send(aNode, "_selector", [])]), "_add_", [aNode]);
1549
- smalltalk.send(aNode, "_index_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_messageSends", []), "_at_", [smalltalk.send(aNode, "_selector", [])]), "_size", [])]);
1550
- smalltalk.send(self, "_visitSendNode_", [aNode], smalltalk.NodeVisitor);
1551
- return self;
1552
- },
1634
+ fn: function (aNode){
1635
+ var self=this;
1636
+ return smalltalk.withContext(function($ctx1) {
1637
+ $1=_st(_st(_st(aNode)._receiver())._value()).__eq("super");
1638
+ $2=(function(){
1639
+ return smalltalk.withContext(function($ctx2) {
1640
+ _st(_st(aNode)._receiver())._value_("self");
1641
+ _st(_st(self)._superSends())._at_ifAbsentPut_(_st(aNode)._selector(),(function(){
1642
+ return smalltalk.withContext(function($ctx3) {
1643
+ }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
1644
+ return _st(_st(_st(self)._superSends())._at_(_st(aNode)._selector()))._add_(aNode);
1645
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
1646
+ $3=(function(){
1647
+ return smalltalk.withContext(function($ctx2) {
1648
+ if(smalltalk.assert($4)){
1649
+ _st(aNode)._shouldBeInlined_(true);
1650
+ return _st(_st(aNode)._receiver())._shouldBeAliased_(true);
1651
+ };
1652
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
1653
+ _st($1)._ifTrue_ifFalse_($2,$3);
1654
+ _st(_st(self)._messageSends())._at_ifAbsentPut_(_st(aNode)._selector(),(function(){
1655
+ return smalltalk.withContext(function($ctx2) {
1656
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
1657
+ _st(_st(_st(self)._messageSends())._at_(_st(aNode)._selector()))._add_(aNode);
1658
+ _st(aNode)._index_(_st(_st(_st(self)._messageSends())._at_(_st(aNode)._selector()))._size());
1659
+ smalltalk.NodeVisitor.fn.prototype._visitSendNode_.apply(_st(self), [aNode]);
1660
+ return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
1553
1661
  args: ["aNode"],
1554
- source: "visitSendNode: aNode\x0a\x0a\x09aNode receiver value = 'super' \x0a\x09\x09ifTrue: [\x0a\x09\x09\x09aNode superSend: true.\x0a\x09\x09\x09aNode receiver value: 'self' ]\x0a\x09\x09ifFalse: [ (IRSendInliner inlinedSelectors includes: aNode selector) ifTrue: [\x0a\x09\x09\x09aNode shouldBeInlined: true.\x0a\x09\x09\x09aNode receiver isValueNode ifFalse: [ aNode receiver shouldBeAliased: true ] ] ].\x0a\x0a\x09self messageSends at: aNode selector ifAbsentPut: [ Set new ].\x0a\x09(self messageSends at: aNode selector) add: aNode.\x0a\x0a\x09aNode index: (self messageSends at: aNode selector) size.\x0a\x0a\x09super visitSendNode: aNode",
1555
- messageSends: ["ifTrue:ifFalse:", "superSend:", "value:", "receiver", "ifTrue:", "shouldBeInlined:", "ifFalse:", "shouldBeAliased:", "isValueNode", "includes:", "selector", "inlinedSelectors", "=", "value", "at:ifAbsentPut:", "new", "messageSends", "add:", "at:", "index:", "size", "visitSendNode:"],
1556
- referencedClasses: ["IRSendInliner", "Set"]
1662
+ source: "visitSendNode: aNode\x0a\x0a\x09aNode receiver value = 'super' \x0a\x09\x09ifTrue: [\x0a\x09\x09\x09aNode superSend: true.\x0a\x09\x09\x09aNode receiver value: 'self'.\x0a\x09\x09\x09self superSends at: aNode selector ifAbsentPut: [ Set new ].\x0a\x09\x09\x09(self superSends at: aNode selector) add: aNode ]\x0a \x0a\x09\x09ifFalse: [ (IRSendInliner inlinedSelectors includes: aNode selector) ifTrue: [\x0a\x09\x09\x09aNode shouldBeInlined: true.\x0a\x09\x09\x09aNode receiver shouldBeAliased: true ] ].\x0a\x0a\x09self messageSends at: aNode selector ifAbsentPut: [ Set new ].\x0a\x09(self messageSends at: aNode selector) add: aNode.\x0a\x0a\x09aNode index: (self messageSends at: aNode selector) size.\x0a\x0a\x09super visitSendNode: aNode",
1663
+ messageSends: ["ifTrue:ifFalse:", "superSend:", "value:", "receiver", "at:ifAbsentPut:", "selector", "new", "superSends", "add:", "at:", "ifTrue:", "shouldBeInlined:", "shouldBeAliased:", "includes:", "inlinedSelectors", "=", "value", "messageSends", "index:", "size", "visitSendNode:"],
1664
+ referencedClasses: ["Set", "IRSendInliner"]
1557
1665
  }),
1558
1666
  smalltalk.SemanticAnalyzer);
1559
1667
 
@@ -1562,12 +1670,14 @@ smalltalk.addMethod(
1562
1670
  smalltalk.method({
1563
1671
  selector: "visitSequenceNode:",
1564
1672
  category: 'visiting',
1565
- fn: function (aNode) {
1566
- var self = this;
1567
- smalltalk.send(smalltalk.send(aNode, "_temps", []), "_do_", [function (each) {smalltalk.send(self, "_validateVariableScope_", [each]);return smalltalk.send(self['@currentScope'], "_addTemp_", [each]);}]);
1568
- smalltalk.send(self, "_visitSequenceNode_", [aNode], smalltalk.NodeVisitor);
1569
- return self;
1570
- },
1673
+ fn: function (aNode){
1674
+ var self=this;
1675
+ return smalltalk.withContext(function($ctx1) {
1676
+ return smalltalk.withContext(function($ctx2) {
1677
+ return _st(self["@currentScope"])._addTemp_(each);
1678
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
1679
+ smalltalk.NodeVisitor.fn.prototype._visitSequenceNode_.apply(_st(self), [aNode]);
1680
+ return self}, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
1571
1681
  args: ["aNode"],
1572
1682
  source: "visitSequenceNode: aNode\x0a\x09aNode temps do: [ :each | \x0a\x09\x09self validateVariableScope: each.\x0a\x09\x09currentScope addTemp: each ].\x0a\x0a\x09super visitSequenceNode: aNode",
1573
1683
  messageSends: ["do:", "validateVariableScope:", "addTemp:", "temps", "visitSequenceNode:"],
@@ -1580,22 +1690,22 @@ smalltalk.addMethod(
1580
1690
  smalltalk.method({
1581
1691
  selector: "visitVariableNode:",
1582
1692
  category: 'visiting',
1583
- fn: function (aNode) {
1584
- var self = this;
1585
- var $2, $3, $4, $1;
1586
- $2 = smalltalk.send(self['@currentScope'], "_lookupVariable_", [aNode]);
1587
- if (($receiver = $2) == nil || $receiver == undefined) {
1588
- smalltalk.send(self, "_errorUnknownVariable_", [aNode]);
1589
- $3 = smalltalk.send(smalltalk.UnknownVar || UnknownVar, "_new", []);
1590
- smalltalk.send($3, "_name_", [smalltalk.send(aNode, "_value", [])]);
1591
- $4 = smalltalk.send($3, "_yourself", []);
1592
- $1 = $4;
1593
- } else {
1594
- $1 = $2;
1595
- }
1596
- smalltalk.send(aNode, "_binding_", [$1]);
1597
- return self;
1598
- },
1693
+ fn: function (aNode){
1694
+ var self=this;
1695
+ return smalltalk.withContext(function($ctx1) {
1696
+ $1=aNode;
1697
+ $3=_st(self["@currentScope"])._lookupVariable_(aNode);
1698
+ if(($receiver = $3) == nil || $receiver == undefined){
1699
+ _st(self)._errorUnknownVariable_(aNode);
1700
+ $4=_st((smalltalk.UnknownVar || UnknownVar))._new();
1701
+ _st($4)._name_(_st(aNode)._value());
1702
+ $5=_st($4)._yourself();
1703
+ $2=$5;
1704
+ } else {
1705
+ $2=$3;
1706
+ };
1707
+ _st($1)._binding_($2);
1708
+ return self}, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode}, smalltalk.SemanticAnalyzer)})},
1599
1709
  args: ["aNode"],
1600
1710
  source: "visitVariableNode: aNode\x0a\x09\x22Bind a ScopeVar to aNode by doing a lookup in the current scope.\x0a\x09If no ScopeVar is found, bind a UnknowVar and throw an error\x22\x0a\x0a\x09aNode binding: ((currentScope lookupVariable: aNode) ifNil: [ \x0a\x09\x09self errorUnknownVariable: aNode.\x0a\x09\x09UnknownVar new name: aNode value; yourself ])",
1601
1711
  messageSends: ["binding:", "ifNil:", "errorUnknownVariable:", "name:", "value", "new", "yourself", "lookupVariable:"],
@@ -1609,15 +1719,15 @@ smalltalk.addMethod(
1609
1719
  smalltalk.method({
1610
1720
  selector: "on:",
1611
1721
  category: 'instance creation',
1612
- fn: function (aClass) {
1613
- var self = this;
1614
- var $2, $3, $1;
1615
- $2 = smalltalk.send(self, "_new", []);
1616
- smalltalk.send($2, "_theClass_", [aClass]);
1617
- $3 = smalltalk.send($2, "_yourself", []);
1618
- $1 = $3;
1619
- return $1;
1620
- },
1722
+ fn: function (aClass){
1723
+ var self=this;
1724
+ return smalltalk.withContext(function($ctx1) {
1725
+ $2=_st(self)._new();
1726
+ _st($2)._theClass_(aClass);
1727
+ $3=_st($2)._yourself();
1728
+ $1=$3;
1729
+ return $1;
1730
+ }, function($ctx1) {$ctx1.fill(self,"on:",{aClass:aClass}, smalltalk.SemanticAnalyzer.klass)})},
1621
1731
  args: ["aClass"],
1622
1732
  source: "on: aClass\x0a\x09^ self new\x0a\x09\x09theClass: aClass;\x0a\x09\x09yourself",
1623
1733
  messageSends: ["theClass:", "new", "yourself"],