resin 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,34 +6,35 @@ smalltalk.method({
6
6
  selector: "nextChunk",
7
7
  fn: function (){
8
8
  var self=this;
9
- var $1,$2,$3;
9
+ var char,result,chunk;
10
+ return smalltalk.withContext(function($ctx1) {
10
11
  var $early={};
11
12
  try {
12
- var char_;
13
- var result;
14
- var chunk;
15
- result=smalltalk.send("","_writeStream",[]);
16
- smalltalk.send((function(){
17
- char_=smalltalk.send(self["@stream"],"_next",[]);
18
- char_;
19
- return smalltalk.send(char_,"_notNil",[]);
20
- }),"_whileTrue_",[(function(){
21
- $1=smalltalk.send(char_,"__eq",["!"]);
22
- if(smalltalk.assert($1)){
23
- $2=smalltalk.send(smalltalk.send(self["@stream"],"_peek",[]),"__eq",["!"]);
24
- if(smalltalk.assert($2)){
25
- smalltalk.send(self["@stream"],"_next",[]);
13
+ result=_st("")._writeStream();
14
+ $1=(function(){
15
+ return smalltalk.withContext(function($ctx2) {
16
+ char;
17
+ return _st(char)._notNil();
18
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
19
+ $2=(function(){
20
+ return smalltalk.withContext(function($ctx2) {
21
+ $4=(function(){
22
+ return smalltalk.withContext(function($ctx3) {
23
+ if(smalltalk.assert($5)){
24
+ return _st(self["@stream"])._next();
26
25
  } else {
27
- $3=smalltalk.send(smalltalk.send(result,"_contents",[]),"_trimBoth",[]);
28
- throw $early=[$3];
26
+ $6=_st(_st(result)._contents())._trimBoth();
27
+ throw $early=[$6];
29
28
  };
30
- };
31
- return smalltalk.send(result,"_nextPut_",[char_]);
32
- })]);
29
+ }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
30
+ _st($3)._ifTrue_($4);
31
+ return _st(result)._nextPut_(char);
32
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
33
+ _st($1)._whileTrue_($2);
33
34
  return nil;
34
35
  }
35
36
  catch(e) {if(e===$early)return e[0]; throw e}
36
- }
37
+ }, function($ctx1) {$ctx1.fill(self,"nextChunk",{char:char,result:result,chunk:chunk}, smalltalk.ChunkParser)})}
37
38
  }),
38
39
  smalltalk.ChunkParser);
39
40
 
@@ -43,8 +44,8 @@ smalltalk.method({
43
44
  selector: "stream:",
44
45
  fn: function (aStream){
45
46
  var self=this;
46
- self["@stream"]=aStream;
47
- return self}
47
+ return smalltalk.withContext(function($ctx1) {
48
+ return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream}, smalltalk.ChunkParser)})}
48
49
  }),
49
50
  smalltalk.ChunkParser);
50
51
 
@@ -55,10 +56,10 @@ smalltalk.method({
55
56
  selector: "on:",
56
57
  fn: function (aStream){
57
58
  var self=this;
58
- var $1;
59
- $1=smalltalk.send(smalltalk.send(self,"_new",[]),"_stream_",[aStream]);
59
+ return smalltalk.withContext(function($ctx1) {
60
+ $1=_st(_st(self)._new())._stream_(aStream);
60
61
  return $1;
61
- }
62
+ }, function($ctx1) {$ctx1.fill(self,"on:",{aStream:aStream}, smalltalk.ChunkParser.klass)})}
62
63
  }),
63
64
  smalltalk.ChunkParser.klass);
64
65
 
@@ -70,20 +71,22 @@ smalltalk.method({
70
71
  selector: "classNameFor:",
71
72
  fn: function (aClass){
72
73
  var self=this;
73
- var $2,$3,$1;
74
- $2=smalltalk.send(aClass,"_isMetaclass",[]);
75
- if(smalltalk.assert($2)){
76
- $1=smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_instanceClass",[]),"_name",[]),"__comma",[".klass"]);
74
+ return smalltalk.withContext(function($ctx1) {
75
+ $2=_st(aClass)._isMetaclass();
76
+ $3=(function(){
77
+ return smalltalk.withContext(function($ctx2) {
78
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
79
+ $4=(function(){
80
+ return smalltalk.withContext(function($ctx2) {
81
+ if(smalltalk.assert($5)){
82
+ return "nil";
77
83
  } else {
78
- $3=smalltalk.send(aClass,"_isNil",[]);
79
- if(smalltalk.assert($3)){
80
- $1="nil";
81
- } else {
82
- $1=smalltalk.send(aClass,"_name",[]);
83
- };
84
+ return _st(aClass)._name();
84
85
  };
86
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
87
+ $1=_st($2)._ifTrue_ifFalse_($3,$4);
85
88
  return $1;
86
- }
89
+ }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass}, smalltalk.Exporter)})}
87
90
  }),
88
91
  smalltalk.Exporter);
89
92
 
@@ -93,14 +96,14 @@ smalltalk.method({
93
96
  selector: "exportAll",
94
97
  fn: function (){
95
98
  var self=this;
96
- var $1;
97
- $1=smalltalk.send((smalltalk.String || String),"_streamContents_",[(function(stream){
98
- return smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_packages",[]),"_do_",[(function(pkg){
99
- return smalltalk.send(stream,"_nextPutAll_",[smalltalk.send(self,"_exportPackage_",[smalltalk.send(pkg,"_name",[])])]);
100
- })]);
101
- })]);
99
+ return smalltalk.withContext(function($ctx1) {
100
+ $1=_st((smalltalk.String || String))._streamContents_((function(stream){
101
+ return smalltalk.withContext(function($ctx2) {
102
+ return smalltalk.withContext(function($ctx3) {
103
+ }, function($ctx3) {$ctx3.fillBlock({pkg:pkg},$ctx1)})}));
104
+ }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
102
105
  return $1;
103
- }
106
+ }, function($ctx1) {$ctx1.fill(self,"exportAll",{}, smalltalk.Exporter)})}
104
107
  }),
105
108
  smalltalk.Exporter);
106
109
 
@@ -110,15 +113,15 @@ smalltalk.method({
110
113
  selector: "exportClass:",
111
114
  fn: function (aClass){
112
115
  var self=this;
113
- var $1;
114
- $1=smalltalk.send((smalltalk.String || String),"_streamContents_",[(function(stream){
115
- smalltalk.send(self,"_exportDefinitionOf_on_",[aClass,stream]);
116
- smalltalk.send(self,"_exportMethodsOf_on_",[aClass,stream]);
117
- smalltalk.send(self,"_exportMetaDefinitionOf_on_",[aClass,stream]);
118
- return smalltalk.send(self,"_exportMethodsOf_on_",[smalltalk.send(aClass,"_class",[]),stream]);
119
- })]);
116
+ return smalltalk.withContext(function($ctx1) {
117
+ $1=_st((smalltalk.String || String))._streamContents_((function(stream){
118
+ return smalltalk.withContext(function($ctx2) {
119
+ _st(self)._exportMethodsOf_on_(aClass,stream);
120
+ _st(self)._exportMetaDefinitionOf_on_(aClass,stream);
121
+ return _st(self)._exportMethodsOf_on_(_st(aClass)._class(),stream);
122
+ }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
120
123
  return $1;
121
- }
124
+ }, function($ctx1) {$ctx1.fill(self,"exportClass:",{aClass:aClass}, smalltalk.Exporter)})}
122
125
  }),
123
126
  smalltalk.Exporter);
124
127
 
@@ -128,30 +131,33 @@ smalltalk.method({
128
131
  selector: "exportDefinitionOf:on:",
129
132
  fn: function (aClass,aStream){
130
133
  var self=this;
131
- var $1,$2,$3,$4;
132
- smalltalk.send(aStream,"_nextPutAll_",["smalltalk.addClass("]);
133
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("'","__comma",[smalltalk.send(self,"_classNameFor_",[aClass])]),"__comma",["', "])]);
134
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("smalltalk.","__comma",[smalltalk.send(self,"_classNameFor_",[smalltalk.send(aClass,"_superclass",[])])])]);
135
- $1=smalltalk.send(aStream,"_nextPutAll_",[", ["]);
136
- smalltalk.send(smalltalk.send(aClass,"_instanceVariableNames",[]),"_do_separatedBy_",[(function(each){
137
- return smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("'","__comma",[each]),"__comma",["'"])]);
138
- }),(function(){
139
- return smalltalk.send(aStream,"_nextPutAll_",[", "]);
140
- })]);
141
- smalltalk.send(aStream,"_nextPutAll_",["], '"]);
142
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send(aClass,"_category",[]),"__comma",["'"])]);
143
- $2=smalltalk.send(aStream,"_nextPutAll_",[");"]);
144
- $3=smalltalk.send(smalltalk.send(aClass,"_comment",[]),"_notEmpty",[]);
145
- if(smalltalk.assert($3)){
146
- smalltalk.send(aStream,"_lf",[]);
147
- smalltalk.send(aStream,"_nextPutAll_",["smalltalk."]);
148
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(self,"_classNameFor_",[aClass])]);
149
- smalltalk.send(aStream,"_nextPutAll_",[".comment="]);
150
- $4=smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send(aClass,"_comment",[]),"_asJavascript",[])]);
151
- $4;
134
+ return smalltalk.withContext(function($ctx1) {
135
+ $1=aStream;
136
+ _st($1)._nextPutAll_("smalltalk.addClass(");
137
+ _st($1)._nextPutAll_(_st(_st("'").__comma(_st(self)._classNameFor_(aClass))).__comma("', "));
138
+ _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._superclass())));
139
+ $2=_st($1)._nextPutAll_(", [");
140
+ _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
141
+ return smalltalk.withContext(function($ctx2) {
142
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
143
+ return smalltalk.withContext(function($ctx2) {
144
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
145
+ $3=aStream;
146
+ _st($3)._nextPutAll_("], '");
147
+ _st($3)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
148
+ $4=_st($3)._nextPutAll_(");");
149
+ $5=_st(_st(aClass)._comment())._notEmpty();
150
+ if(smalltalk.assert($5)){
151
+ $6=aStream;
152
+ _st($6)._lf();
153
+ _st($6)._nextPutAll_("smalltalk.");
154
+ _st($6)._nextPutAll_(_st(self)._classNameFor_(aClass));
155
+ _st($6)._nextPutAll_(".comment=");
156
+ $7=_st($6)._nextPutAll_(_st(_st(aClass)._comment())._asJavascript());
157
+ $7;
152
158
  };
153
- smalltalk.send(aStream,"_lf",[]);
154
- return self}
159
+ _st(aStream)._lf();
160
+ return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream}, smalltalk.Exporter)})}
155
161
  }),
156
162
  smalltalk.Exporter);
157
163
 
@@ -161,20 +167,21 @@ smalltalk.method({
161
167
  selector: "exportMetaDefinitionOf:on:",
162
168
  fn: function (aClass,aStream){
163
169
  var self=this;
164
- var $1,$2;
165
- $1=smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_class",[]),"_instanceVariableNames",[]),"_isEmpty",[]);
170
+ return smalltalk.withContext(function($ctx1) {
171
+ $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
166
172
  if(! smalltalk.assert($1)){
167
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("smalltalk.","__comma",[smalltalk.send(self,"_classNameFor_",[smalltalk.send(aClass,"_class",[])])])]);
168
- $2=smalltalk.send(aStream,"_nextPutAll_",[".iVarNames = ["]);
169
- $2;
170
- smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_class",[]),"_instanceVariableNames",[]),"_do_separatedBy_",[(function(each){
171
- return smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("'","__comma",[each]),"__comma",["'"])]);
172
- }),(function(){
173
- return smalltalk.send(aStream,"_nextPutAll_",[","]);
174
- })]);
175
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("];","__comma",[smalltalk.send((smalltalk.String || String),"_lf",[])])]);
173
+ $2=aStream;
174
+ _st($2)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._class())));
175
+ $3=_st($2)._nextPutAll_(".iVarNames = [");
176
+ $3;
177
+ _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
178
+ return smalltalk.withContext(function($ctx2) {
179
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
180
+ return smalltalk.withContext(function($ctx2) {
181
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
182
+ _st(aStream)._nextPutAll_(_st("];").__comma(_st((smalltalk.String || String))._lf()));
176
183
  };
177
- return self}
184
+ return self}, function($ctx1) {$ctx1.fill(self,"exportMetaDefinitionOf:on:",{aClass:aClass,aStream:aStream}, smalltalk.Exporter)})}
178
185
  }),
179
186
  smalltalk.Exporter);
180
187
 
@@ -184,34 +191,36 @@ smalltalk.method({
184
191
  selector: "exportMethod:of:on:",
185
192
  fn: function (aMethod,aClass,aStream){
186
193
  var self=this;
187
- var $1,$2;
188
- smalltalk.send(aStream,"_nextPutAll_",["smalltalk.addMethod("]);
189
- smalltalk.send(aStream,"_lf",[]);
190
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod,"_selector",[]),"_asSelector",[]),"_asJavascript",[]),"__comma",[","])]);
191
- smalltalk.send(aStream,"_lf",[]);
192
- smalltalk.send(aStream,"_nextPutAll_",["smalltalk.method({"]);
193
- smalltalk.send(aStream,"_lf",[]);
194
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("selector: ","__comma",[smalltalk.send(smalltalk.send(aMethod,"_selector",[]),"_asJavascript",[])]),"__comma",[","])]);
195
- smalltalk.send(aStream,"_lf",[]);
196
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("category: '","__comma",[smalltalk.send(aMethod,"_category",[])]),"__comma",["',"])]);
197
- smalltalk.send(aStream,"_lf",[]);
198
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("fn: ","__comma",[smalltalk.send(smalltalk.send(aMethod,"_fn",[]),"_compiledSource",[])]),"__comma",[","])]);
199
- smalltalk.send(aStream,"_lf",[]);
200
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("args: ","__comma",[smalltalk.send(smalltalk.send(aMethod,"_arguments",[]),"_asJavascript",[])]),"__comma",[","])]);
201
- smalltalk.send(aStream,"_lf",[]);
202
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("source: ","__comma",[smalltalk.send(smalltalk.send(aMethod,"_source",[]),"_asJavascript",[])]),"__comma",[","])]);
203
- smalltalk.send(aStream,"_lf",[]);
204
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("messageSends: ","__comma",[smalltalk.send(smalltalk.send(aMethod,"_messageSends",[]),"_asJavascript",[])]),"__comma",[","])]);
205
- smalltalk.send(aStream,"_lf",[]);
206
- $1=smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("referencedClasses: ","__comma",[smalltalk.send(smalltalk.send(aMethod,"_referencedClasses",[]),"_asJavascript",[])])]);
207
- smalltalk.send(aStream,"_lf",[]);
208
- smalltalk.send(aStream,"_nextPutAll_",["}),"]);
209
- smalltalk.send(aStream,"_lf",[]);
210
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("smalltalk.","__comma",[smalltalk.send(self,"_classNameFor_",[aClass])])]);
211
- smalltalk.send(aStream,"_nextPutAll_",[");"]);
212
- smalltalk.send(aStream,"_lf",[]);
213
- $2=smalltalk.send(aStream,"_lf",[]);
214
- return self}
194
+ return smalltalk.withContext(function($ctx1) {
195
+ $1=aStream;
196
+ _st($1)._nextPutAll_("smalltalk.addMethod(");
197
+ _st($1)._lf();
198
+ _st($1)._nextPutAll_(_st(_st(_st(_st(aMethod)._selector())._asSelector())._asJavascript()).__comma(","));
199
+ _st($1)._lf();
200
+ _st($1)._nextPutAll_("smalltalk.method({");
201
+ _st($1)._lf();
202
+ _st($1)._nextPutAll_(_st(_st("selector: ").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
203
+ _st($1)._lf();
204
+ _st($1)._nextPutAll_(_st(_st("category: '").__comma(_st(aMethod)._category())).__comma("',"));
205
+ _st($1)._lf();
206
+ _st($1)._nextPutAll_(_st(_st("fn: ").__comma(_st(_st(aMethod)._fn())._compiledSource())).__comma(","));
207
+ _st($1)._lf();
208
+ _st($1)._nextPutAll_(_st(_st("args: ").__comma(_st(_st(aMethod)._arguments())._asJavascript())).__comma(","));
209
+ _st($1)._lf();
210
+ _st($1)._nextPutAll_(_st(_st("source: ").__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
211
+ _st($1)._lf();
212
+ _st($1)._nextPutAll_(_st(_st("messageSends: ").__comma(_st(_st(aMethod)._messageSends())._asJavascript())).__comma(","));
213
+ _st($1)._lf();
214
+ $2=_st($1)._nextPutAll_(_st("referencedClasses: ").__comma(_st(_st(aMethod)._referencedClasses())._asJavascript()));
215
+ $3=aStream;
216
+ _st($3)._lf();
217
+ _st($3)._nextPutAll_("}),");
218
+ _st($3)._lf();
219
+ _st($3)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(aClass)));
220
+ _st($3)._nextPutAll_(");");
221
+ _st($3)._lf();
222
+ $4=_st($3)._lf();
223
+ return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:of:on:",{aMethod:aMethod,aClass:aClass,aStream:aStream}, smalltalk.Exporter)})}
215
224
  }),
216
225
  smalltalk.Exporter);
217
226
 
@@ -221,17 +230,19 @@ smalltalk.method({
221
230
  selector: "exportMethodsOf:on:",
222
231
  fn: function (aClass,aStream){
223
232
  var self=this;
224
- var $1;
225
- smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_methodDictionary",[]),"_values",[]),"_sorted_",[(function(a,b){
226
- return smalltalk.send(smalltalk.send(a,"_selector",[]),"__lt_eq",[smalltalk.send(b,"_selector",[])]);
227
- })]),"_do_",[(function(each){
228
- $1=smalltalk.send(smalltalk.send(each,"_category",[]),"_match_",["^\x5c*"]);
229
- if(! smalltalk.assert($1)){
230
- return smalltalk.send(self,"_exportMethod_of_on_",[each,aClass,aStream]);
233
+ return smalltalk.withContext(function($ctx1) {
234
+ $1=_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
235
+ return smalltalk.withContext(function($ctx2) {
236
+ }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}));
237
+ $2=(function(each){
238
+ return smalltalk.withContext(function($ctx2) {
239
+ if(! smalltalk.assert($3)){
240
+ return _st(self)._exportMethod_of_on_(each,aClass,aStream);
231
241
  };
232
- })]);
233
- smalltalk.send(aStream,"_lf",[]);
234
- return self}
242
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})});
243
+ _st($1)._do_($2);
244
+ _st(aStream)._lf();
245
+ return self}, function($ctx1) {$ctx1.fill(self,"exportMethodsOf:on:",{aClass:aClass,aStream:aStream}, smalltalk.Exporter)})}
235
246
  }),
236
247
  smalltalk.Exporter);
237
248
 
@@ -241,19 +252,19 @@ smalltalk.method({
241
252
  selector: "exportPackage:",
242
253
  fn: function (packageName){
243
254
  var self=this;
244
- var $1;
245
- var package;
246
- $1=smalltalk.send((smalltalk.String || String),"_streamContents_",[(function(stream){
247
- package=smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_packageAt_",[packageName]);
248
- package;
249
- smalltalk.send(self,"_exportPackageDefinitionOf_on_",[package,stream]);
250
- smalltalk.send(smalltalk.send(smalltalk.send(package,"_sortedClasses",[]),"_asSet",[]),"_do_",[(function(each){
251
- return smalltalk.send(stream,"_nextPutAll_",[smalltalk.send(self,"_exportClass_",[each])]);
252
- })]);
253
- return smalltalk.send(self,"_exportPackageExtensionsOf_on_",[package,stream]);
254
- })]);
255
+ var package_;
256
+ return smalltalk.withContext(function($ctx1) {
257
+ $1=_st((smalltalk.String || String))._streamContents_((function(stream){
258
+ return smalltalk.withContext(function($ctx2) {
259
+ package_;
260
+ _st(self)._exportPackageDefinitionOf_on_(package_,stream);
261
+ _st(_st(_st(package_)._sortedClasses())._asSet())._do_((function(each){
262
+ return smalltalk.withContext(function($ctx3) {
263
+ }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
264
+ return _st(self)._exportPackageExtensionsOf_on_(package_,stream);
265
+ }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
255
266
  return $1;
256
- }
267
+ }, function($ctx1) {$ctx1.fill(self,"exportPackage:",{packageName:packageName,package_:package_}, smalltalk.Exporter)})}
257
268
  }),
258
269
  smalltalk.Exporter);
259
270
 
@@ -261,13 +272,14 @@ smalltalk.addMethod(
261
272
  "_exportPackageDefinitionOf_on_",
262
273
  smalltalk.method({
263
274
  selector: "exportPackageDefinitionOf:on:",
264
- fn: function (package,aStream){
275
+ fn: function (package_,aStream){
265
276
  var self=this;
266
- var $1;
267
- smalltalk.send(aStream,"_nextPutAll_",["smalltalk.addPackage("]);
268
- $1=smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("'","__comma",[smalltalk.send(package,"_name",[])]),"__comma",["', "]),"__comma",[smalltalk.send(package,"_propertiesAsJSON",[])]),"__comma",[");"])]);
269
- smalltalk.send(aStream,"_lf",[]);
270
- return self}
277
+ return smalltalk.withContext(function($ctx1) {
278
+ $1=aStream;
279
+ _st($1)._nextPutAll_("smalltalk.addPackage(");
280
+ $2=_st($1)._nextPutAll_(_st(_st(_st(_st("'").__comma(_st(package_)._name())).__comma("', ")).__comma(_st(package_)._propertiesAsJSON())).__comma(");"));
281
+ _st(aStream)._lf();
282
+ return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{package_:package_,aStream:aStream}, smalltalk.Exporter)})}
271
283
  }),
272
284
  smalltalk.Exporter);
273
285
 
@@ -275,24 +287,30 @@ smalltalk.addMethod(
275
287
  "_exportPackageExtensionsOf_on_",
276
288
  smalltalk.method({
277
289
  selector: "exportPackageExtensionsOf:on:",
278
- fn: function (package,aStream){
290
+ fn: function (package_,aStream){
279
291
  var self=this;
280
- var $1;
281
292
  var name;
282
- name=smalltalk.send(package,"_name",[]);
283
- smalltalk.send(smalltalk.send((smalltalk.Package || Package),"_sortedClasses_",[smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_classes",[])]),"_do_",[(function(each){
284
- return smalltalk.send([each,smalltalk.send(each,"_class",[])],"_do_",[(function(aClass){
285
- return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_methodDictionary",[]),"_values",[]),"_sorted_",[(function(a,b){
286
- return smalltalk.send(smalltalk.send(a,"_selector",[]),"__lt_eq",[smalltalk.send(b,"_selector",[])]);
287
- })]),"_do_",[(function(method){
288
- $1=smalltalk.send(smalltalk.send(method,"_category",[]),"_match_",[smalltalk.send("^\x5c*","__comma",[name])]);
289
- if(smalltalk.assert($1)){
290
- return smalltalk.send(self,"_exportMethod_of_on_",[method,aClass,aStream]);
293
+ return smalltalk.withContext(function($ctx1) {
294
+ name=_st(package_)._name();
295
+ $1=_st((smalltalk.Package || Package))._sortedClasses_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes());
296
+ $2=(function(each){
297
+ return smalltalk.withContext(function($ctx2) {
298
+ $4=(function(aClass){
299
+ return smalltalk.withContext(function($ctx3) {
300
+ return smalltalk.withContext(function($ctx4) {
301
+ }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})}));
302
+ $6=(function(method){
303
+ return smalltalk.withContext(function($ctx4) {
304
+ if(smalltalk.assert($7)){
305
+ return _st(self)._exportMethod_of_on_(method,aClass,aStream);
291
306
  };
292
- })]);
293
- })]);
294
- })]);
295
- return self}
307
+ }, function($ctx4) {$ctx4.fillBlock({method:method},$ctx1)})});
308
+ return _st($5)._do_($6);
309
+ }, function($ctx3) {$ctx3.fillBlock({aClass:aClass},$ctx1)})});
310
+ return _st($3)._do_($4);
311
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})});
312
+ _st($1)._do_($2);
313
+ return self}, function($ctx1) {$ctx1.fill(self,"exportPackageExtensionsOf:on:",{package_:package_,aStream:aStream,name:name}, smalltalk.Exporter)})}
296
314
  }),
297
315
  smalltalk.Exporter);
298
316
 
@@ -305,10 +323,10 @@ smalltalk.method({
305
323
  selector: "chunkEscape:",
306
324
  fn: function (aString){
307
325
  var self=this;
308
- var $1;
309
- $1=smalltalk.send(smalltalk.send(aString,"_replace_with_",["!","!!"]),"_trimBoth",[]);
326
+ return smalltalk.withContext(function($ctx1) {
327
+ $1=_st(_st(aString)._replace_with_("!","!!"))._trimBoth();
310
328
  return $1;
311
- }
329
+ }, function($ctx1) {$ctx1.fill(self,"chunkEscape:",{aString:aString}, smalltalk.ChunkExporter)})}
312
330
  }),
313
331
  smalltalk.ChunkExporter);
314
332
 
@@ -318,20 +336,22 @@ smalltalk.method({
318
336
  selector: "classNameFor:",
319
337
  fn: function (aClass){
320
338
  var self=this;
321
- var $2,$3,$1;
322
- $2=smalltalk.send(aClass,"_isMetaclass",[]);
323
- if(smalltalk.assert($2)){
324
- $1=smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_instanceClass",[]),"_name",[]),"__comma",[" class"]);
325
- } else {
326
- $3=smalltalk.send(aClass,"_isNil",[]);
327
- if(smalltalk.assert($3)){
328
- $1="nil";
339
+ return smalltalk.withContext(function($ctx1) {
340
+ $2=_st(aClass)._isMetaclass();
341
+ $3=(function(){
342
+ return smalltalk.withContext(function($ctx2) {
343
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
344
+ $4=(function(){
345
+ return smalltalk.withContext(function($ctx2) {
346
+ if(smalltalk.assert($5)){
347
+ return "nil";
329
348
  } else {
330
- $1=smalltalk.send(aClass,"_name",[]);
331
- };
349
+ return _st(aClass)._name();
332
350
  };
351
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
352
+ $1=_st($2)._ifTrue_ifFalse_($3,$4);
333
353
  return $1;
334
- }
354
+ }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass}, smalltalk.ChunkExporter)})}
335
355
  }),
336
356
  smalltalk.ChunkExporter);
337
357
 
@@ -341,30 +361,33 @@ smalltalk.method({
341
361
  selector: "exportDefinitionOf:on:",
342
362
  fn: function (aClass,aStream){
343
363
  var self=this;
344
- var $1,$2,$3,$4;
345
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(self,"_classNameFor_",[smalltalk.send(aClass,"_superclass",[])])]);
346
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(" subclass: #","__comma",[smalltalk.send(self,"_classNameFor_",[aClass])])]);
347
- smalltalk.send(aStream,"_lf",[]);
348
- $1=smalltalk.send(aStream,"_nextPutAll_",["\x09instanceVariableNames: '"]);
349
- smalltalk.send(smalltalk.send(aClass,"_instanceVariableNames",[]),"_do_separatedBy_",[(function(each){
350
- return smalltalk.send(aStream,"_nextPutAll_",[each]);
351
- }),(function(){
352
- return smalltalk.send(aStream,"_nextPutAll_",[" "]);
353
- })]);
354
- smalltalk.send(aStream,"_nextPutAll_",["'"]);
355
- smalltalk.send(aStream,"_lf",[]);
356
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("\x09package: '","__comma",[smalltalk.send(aClass,"_category",[])]),"__comma",["'!"])]);
357
- $2=smalltalk.send(aStream,"_lf",[]);
358
- $3=smalltalk.send(smalltalk.send(aClass,"_comment",[]),"_notEmpty",[]);
359
- if(smalltalk.assert($3)){
360
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("!","__comma",[smalltalk.send(self,"_classNameFor_",[aClass])]),"__comma",[" commentStamp!"])]);
361
- smalltalk.send(aStream,"_lf",[]);
362
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send(self,"_chunkEscape_",[smalltalk.send(aClass,"_comment",[])]),"__comma",["!"])]);
363
- $4=smalltalk.send(aStream,"_lf",[]);
364
- $4;
364
+ return smalltalk.withContext(function($ctx1) {
365
+ $1=aStream;
366
+ _st($1)._nextPutAll_(_st(self)._classNameFor_(_st(aClass)._superclass()));
367
+ _st($1)._nextPutAll_(_st(" subclass: #").__comma(_st(self)._classNameFor_(aClass)));
368
+ _st($1)._lf();
369
+ $2=_st($1)._nextPutAll_("\x09instanceVariableNames: '");
370
+ _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
371
+ return smalltalk.withContext(function($ctx2) {
372
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
373
+ return smalltalk.withContext(function($ctx2) {
374
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
375
+ $3=aStream;
376
+ _st($3)._nextPutAll_("'");
377
+ _st($3)._lf();
378
+ _st($3)._nextPutAll_(_st(_st("\x09package: '").__comma(_st(aClass)._category())).__comma("'!"));
379
+ $4=_st($3)._lf();
380
+ $5=_st(_st(aClass)._comment())._notEmpty();
381
+ if(smalltalk.assert($5)){
382
+ $6=aStream;
383
+ _st($6)._nextPutAll_(_st(_st("!").__comma(_st(self)._classNameFor_(aClass))).__comma(" commentStamp!"));
384
+ _st($6)._lf();
385
+ _st($6)._nextPutAll_(_st(_st(self)._chunkEscape_(_st(aClass)._comment())).__comma("!"));
386
+ $7=_st($6)._lf();
387
+ $7;
365
388
  };
366
- smalltalk.send(aStream,"_lf",[]);
367
- return self}
389
+ _st(aStream)._lf();
390
+ return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream}, smalltalk.ChunkExporter)})}
368
391
  }),
369
392
  smalltalk.ChunkExporter);
370
393
 
@@ -374,23 +397,25 @@ smalltalk.method({
374
397
  selector: "exportMetaDefinitionOf:on:",
375
398
  fn: function (aClass,aStream){
376
399
  var self=this;
377
- var $1,$2,$3;
378
- $1=smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_class",[]),"_instanceVariableNames",[]),"_isEmpty",[]);
400
+ return smalltalk.withContext(function($ctx1) {
401
+ $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
379
402
  if(! smalltalk.assert($1)){
380
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(self,"_classNameFor_",[smalltalk.send(aClass,"_class",[])])]);
381
- $2=smalltalk.send(aStream,"_nextPutAll_",[" instanceVariableNames: '"]);
382
- $2;
383
- smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_class",[]),"_instanceVariableNames",[]),"_do_separatedBy_",[(function(each){
384
- return smalltalk.send(aStream,"_nextPutAll_",[each]);
385
- }),(function(){
386
- return smalltalk.send(aStream,"_nextPutAll_",[" "]);
387
- })]);
388
- smalltalk.send(aStream,"_nextPutAll_",["'!"]);
389
- smalltalk.send(aStream,"_lf",[]);
390
- $3=smalltalk.send(aStream,"_lf",[]);
403
+ $2=aStream;
404
+ _st($2)._nextPutAll_(_st(self)._classNameFor_(_st(aClass)._class()));
405
+ $3=_st($2)._nextPutAll_(" instanceVariableNames: '");
391
406
  $3;
407
+ _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
408
+ return smalltalk.withContext(function($ctx2) {
409
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
410
+ return smalltalk.withContext(function($ctx2) {
411
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
412
+ $4=aStream;
413
+ _st($4)._nextPutAll_("'!");
414
+ _st($4)._lf();
415
+ $5=_st($4)._lf();
416
+ $5;
392
417
  };
393
- return self}
418
+ return self}, function($ctx1) {$ctx1.fill(self,"exportMetaDefinitionOf:on:",{aClass:aClass,aStream:aStream}, smalltalk.ChunkExporter)})}
394
419
  }),
395
420
  smalltalk.ChunkExporter);
396
421
 
@@ -400,13 +425,14 @@ smalltalk.method({
400
425
  selector: "exportMethod:of:on:",
401
426
  fn: function (aMethod,aClass,aStream){
402
427
  var self=this;
403
- var $1;
404
- smalltalk.send(aStream,"_lf",[]);
405
- smalltalk.send(aStream,"_lf",[]);
406
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(self,"_chunkEscape_",[smalltalk.send(aMethod,"_source",[])])]);
407
- smalltalk.send(aStream,"_lf",[]);
408
- $1=smalltalk.send(aStream,"_nextPutAll_",["!"]);
409
- return self}
428
+ return smalltalk.withContext(function($ctx1) {
429
+ $1=aStream;
430
+ _st($1)._lf();
431
+ _st($1)._lf();
432
+ _st($1)._nextPutAll_(_st(self)._chunkEscape_(_st(aMethod)._source()));
433
+ _st($1)._lf();
434
+ $2=_st($1)._nextPutAll_("!");
435
+ return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:of:on:",{aMethod:aMethod,aClass:aClass,aStream:aStream}, smalltalk.ChunkExporter)})}
410
436
  }),
411
437
  smalltalk.ChunkExporter);
412
438
 
@@ -416,18 +442,20 @@ smalltalk.method({
416
442
  selector: "exportMethods:category:of:on:",
417
443
  fn: function (methods,category,aClass,aStream){
418
444
  var self=this;
419
- var $1,$2;
420
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("!","__comma",[smalltalk.send(self,"_classNameFor_",[aClass])])]);
421
- $1=smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send(" methodsFor: '","__comma",[category]),"__comma",["'!"])]);
422
- smalltalk.send(smalltalk.send(methods,"_sorted_",[(function(a,b){
423
- return smalltalk.send(smalltalk.send(a,"_selector",[]),"__lt_eq",[smalltalk.send(b,"_selector",[])]);
424
- })]),"_do_",[(function(each){
425
- return smalltalk.send(self,"_exportMethod_of_on_",[each,aClass,aStream]);
426
- })]);
427
- smalltalk.send(aStream,"_nextPutAll_",[" !"]);
428
- smalltalk.send(aStream,"_lf",[]);
429
- $2=smalltalk.send(aStream,"_lf",[]);
430
- return self}
445
+ return smalltalk.withContext(function($ctx1) {
446
+ $1=aStream;
447
+ _st($1)._nextPutAll_(_st("!").__comma(_st(self)._classNameFor_(aClass)));
448
+ $2=_st($1)._nextPutAll_(_st(_st(" methodsFor: '").__comma(category)).__comma("'!"));
449
+ _st(_st(methods)._sorted_((function(a,b){
450
+ return smalltalk.withContext(function($ctx2) {
451
+ }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
452
+ return smalltalk.withContext(function($ctx2) {
453
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
454
+ $3=aStream;
455
+ _st($3)._nextPutAll_(" !");
456
+ _st($3)._lf();
457
+ $4=_st($3)._lf();
458
+ return self}, function($ctx1) {$ctx1.fill(self,"exportMethods:category:of:on:",{methods:methods,category:category,aClass:aClass,aStream:aStream}, smalltalk.ChunkExporter)})}
431
459
  }),
432
460
  smalltalk.ChunkExporter);
433
461
 
@@ -437,24 +465,26 @@ smalltalk.method({
437
465
  selector: "exportMethodsOf:on:",
438
466
  fn: function (aClass,aStream){
439
467
  var self=this;
440
- var $1;
441
468
  var map;
442
- map=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
443
- smalltalk.send(aClass,"_protocolsDo_",[(function(category,methods){
444
- $1=smalltalk.send(category,"_match_",["^\x5c*"]);
445
- if(! smalltalk.assert($1)){
446
- return smalltalk.send(map,"_at_put_",[category,methods]);
469
+ return smalltalk.withContext(function($ctx1) {
470
+ map=_st((smalltalk.Dictionary || Dictionary))._new();
471
+ $1=aClass;
472
+ $2=(function(category,methods){
473
+ return smalltalk.withContext(function($ctx2) {
474
+ if(! smalltalk.assert($3)){
475
+ return _st(map)._at_put_(category,methods);
447
476
  };
448
- })]);
449
- smalltalk.send(smalltalk.send(smalltalk.send(map,"_keys",[]),"_sorted_",[(function(a,b){
450
- return smalltalk.send(a,"__lt_eq",[b]);
451
- })]),"_do_",[(function(category){
477
+ }, function($ctx2) {$ctx2.fillBlock({category:category,methods:methods},$ctx1)})});
478
+ _st($1)._protocolsDo_($2);
479
+ _st(_st(_st(map)._keys())._sorted_((function(a,b){
480
+ return smalltalk.withContext(function($ctx2) {
481
+ }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(category){
452
482
  var methods;
453
- methods=smalltalk.send(map,"_at_",[category]);
483
+ return smalltalk.withContext(function($ctx2) {
454
484
  methods;
455
- return smalltalk.send(self,"_exportMethods_category_of_on_",[methods,category,aClass,aStream]);
456
- })]);
457
- return self}
485
+ return _st(self)._exportMethods_category_of_on_(methods,category,aClass,aStream);
486
+ }, function($ctx2) {$ctx2.fillBlock({category:category,methods:methods},$ctx1)})}));
487
+ return self}, function($ctx1) {$ctx1.fill(self,"exportMethodsOf:on:",{aClass:aClass,aStream:aStream,map:map}, smalltalk.ChunkExporter)})}
458
488
  }),
459
489
  smalltalk.ChunkExporter);
460
490
 
@@ -462,12 +492,13 @@ smalltalk.addMethod(
462
492
  "_exportPackageDefinitionOf_on_",
463
493
  smalltalk.method({
464
494
  selector: "exportPackageDefinitionOf:on:",
465
- fn: function (package,aStream){
495
+ fn: function (package_,aStream){
466
496
  var self=this;
467
- var $1;
468
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("Smalltalk current createPackage: '","__comma",[smalltalk.send(package,"_name",[])]),"__comma",["' properties: "]),"__comma",[smalltalk.send(smalltalk.send(package,"_properties",[]),"_storeString",[])]),"__comma",["!"])]);
469
- $1=smalltalk.send(aStream,"_lf",[]);
470
- return self}
497
+ return smalltalk.withContext(function($ctx1) {
498
+ $1=aStream;
499
+ _st($1)._nextPutAll_(_st(_st(_st(_st("Smalltalk current createPackage: '").__comma(_st(package_)._name())).__comma("' properties: ")).__comma(_st(_st(package_)._properties())._storeString())).__comma("!"));
500
+ $2=_st($1)._lf();
501
+ return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{package_:package_,aStream:aStream}, smalltalk.ChunkExporter)})}
471
502
  }),
472
503
  smalltalk.ChunkExporter);
473
504
 
@@ -475,33 +506,38 @@ smalltalk.addMethod(
475
506
  "_exportPackageExtensionsOf_on_",
476
507
  smalltalk.method({
477
508
  selector: "exportPackageExtensionsOf:on:",
478
- fn: function (package,aStream){
509
+ fn: function (package_,aStream){
479
510
  var self=this;
480
- var $1;
481
- var name;
482
- var map;
483
- name=smalltalk.send(package,"_name",[]);
484
- smalltalk.send(smalltalk.send((smalltalk.Package || Package),"_sortedClasses_",[smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_classes",[])]),"_do_",[(function(each){
485
- return smalltalk.send([each,smalltalk.send(each,"_class",[])],"_do_",[(function(aClass){
486
- map=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
511
+ var name,map;
512
+ return smalltalk.withContext(function($ctx1) {
513
+ name=_st(package_)._name();
514
+ $1=_st((smalltalk.Package || Package))._sortedClasses_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes());
515
+ $2=(function(each){
516
+ return smalltalk.withContext(function($ctx2) {
517
+ $4=(function(aClass){
518
+ return smalltalk.withContext(function($ctx3) {
487
519
  map;
488
- smalltalk.send(aClass,"_protocolsDo_",[(function(category,methods){
489
- $1=smalltalk.send(category,"_match_",[smalltalk.send("^\x5c*","__comma",[name])]);
490
- if(smalltalk.assert($1)){
491
- return smalltalk.send(map,"_at_put_",[category,methods]);
520
+ $5=aClass;
521
+ $6=(function(category,methods){
522
+ return smalltalk.withContext(function($ctx4) {
523
+ if(smalltalk.assert($7)){
524
+ return _st(map)._at_put_(category,methods);
492
525
  };
493
- })]);
494
- return smalltalk.send(smalltalk.send(smalltalk.send(map,"_keys",[]),"_sorted_",[(function(a,b){
495
- return smalltalk.send(a,"__lt_eq",[b]);
496
- })]),"_do_",[(function(category){
526
+ }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx1)})});
527
+ _st($5)._protocolsDo_($6);
528
+ return _st(_st(_st(map)._keys())._sorted_((function(a,b){
529
+ return smalltalk.withContext(function($ctx4) {
530
+ }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(category){
497
531
  var methods;
498
- methods=smalltalk.send(map,"_at_",[category]);
532
+ return smalltalk.withContext(function($ctx4) {
499
533
  methods;
500
- return smalltalk.send(self,"_exportMethods_category_of_on_",[methods,category,aClass,aStream]);
501
- })]);
502
- })]);
503
- })]);
504
- return self}
534
+ return _st(self)._exportMethods_category_of_on_(methods,category,aClass,aStream);
535
+ }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx1)})}));
536
+ }, function($ctx3) {$ctx3.fillBlock({aClass:aClass},$ctx1)})});
537
+ return _st($3)._do_($4);
538
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})});
539
+ _st($1)._do_($2);
540
+ return self}, function($ctx1) {$ctx1.fill(self,"exportPackageExtensionsOf:on:",{package_:package_,aStream:aStream,name:name,map:map}, smalltalk.ChunkExporter)})}
505
541
  }),
506
542
  smalltalk.ChunkExporter);
507
543
 
@@ -514,21 +550,23 @@ smalltalk.method({
514
550
  selector: "exportDefinitionOf:on:",
515
551
  fn: function (aClass,aStream){
516
552
  var self=this;
517
- var $1,$2;
518
- smalltalk.send(aStream,"_nextPutAll_",["smalltalk.addClass("]);
519
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("'","__comma",[smalltalk.send(self,"_classNameFor_",[aClass])]),"__comma",["', "])]);
520
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("smalltalk.","__comma",[smalltalk.send(self,"_classNameFor_",[smalltalk.send(aClass,"_superclass",[])])])]);
521
- $1=smalltalk.send(aStream,"_nextPutAll_",[", ["]);
522
- smalltalk.send(smalltalk.send(aClass,"_instanceVariableNames",[]),"_do_separatedBy_",[(function(each){
523
- return smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("'","__comma",[each]),"__comma",["'"])]);
524
- }),(function(){
525
- return smalltalk.send(aStream,"_nextPutAll_",[", "]);
526
- })]);
527
- smalltalk.send(aStream,"_nextPutAll_",["], '"]);
528
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send(aClass,"_category",[]),"__comma",["'"])]);
529
- $2=smalltalk.send(aStream,"_nextPutAll_",[");"]);
530
- smalltalk.send(aStream,"_lf",[]);
531
- return self}
553
+ return smalltalk.withContext(function($ctx1) {
554
+ $1=aStream;
555
+ _st($1)._nextPutAll_("smalltalk.addClass(");
556
+ _st($1)._nextPutAll_(_st(_st("'").__comma(_st(self)._classNameFor_(aClass))).__comma("', "));
557
+ _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._superclass())));
558
+ $2=_st($1)._nextPutAll_(", [");
559
+ _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
560
+ return smalltalk.withContext(function($ctx2) {
561
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
562
+ return smalltalk.withContext(function($ctx2) {
563
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
564
+ $3=aStream;
565
+ _st($3)._nextPutAll_("], '");
566
+ _st($3)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
567
+ $4=_st($3)._nextPutAll_(");");
568
+ _st(aStream)._lf();
569
+ return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream}, smalltalk.StrippedExporter)})}
532
570
  }),
533
571
  smalltalk.StrippedExporter);
534
572
 
@@ -538,24 +576,25 @@ smalltalk.method({
538
576
  selector: "exportMethod:of:on:",
539
577
  fn: function (aMethod,aClass,aStream){
540
578
  var self=this;
541
- var $1;
542
- smalltalk.send(aStream,"_nextPutAll_",["smalltalk.addMethod("]);
543
- smalltalk.send(aStream,"_lf",[]);
544
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod,"_selector",[]),"_asSelector",[]),"_asJavascript",[]),"__comma",[","])]);
545
- smalltalk.send(aStream,"_lf",[]);
546
- smalltalk.send(aStream,"_nextPutAll_",["smalltalk.method({"]);
547
- smalltalk.send(aStream,"_lf",[]);
548
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("selector: ","__comma",[smalltalk.send(smalltalk.send(aMethod,"_selector",[]),"_asJavascript",[])]),"__comma",[","])]);
549
- smalltalk.send(aStream,"_lf",[]);
550
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("fn: ","__comma",[smalltalk.send(smalltalk.send(aMethod,"_fn",[]),"_compiledSource",[])])]);
551
- smalltalk.send(aStream,"_lf",[]);
552
- smalltalk.send(aStream,"_nextPutAll_",["}),"]);
553
- smalltalk.send(aStream,"_lf",[]);
554
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("smalltalk.","__comma",[smalltalk.send(self,"_classNameFor_",[aClass])])]);
555
- smalltalk.send(aStream,"_nextPutAll_",[");"]);
556
- smalltalk.send(aStream,"_lf",[]);
557
- $1=smalltalk.send(aStream,"_lf",[]);
558
- return self}
579
+ return smalltalk.withContext(function($ctx1) {
580
+ $1=aStream;
581
+ _st($1)._nextPutAll_("smalltalk.addMethod(");
582
+ _st($1)._lf();
583
+ _st($1)._nextPutAll_(_st(_st(_st(_st(aMethod)._selector())._asSelector())._asJavascript()).__comma(","));
584
+ _st($1)._lf();
585
+ _st($1)._nextPutAll_("smalltalk.method({");
586
+ _st($1)._lf();
587
+ _st($1)._nextPutAll_(_st(_st("selector: ").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
588
+ _st($1)._lf();
589
+ _st($1)._nextPutAll_(_st("fn: ").__comma(_st(_st(aMethod)._fn())._compiledSource()));
590
+ _st($1)._lf();
591
+ _st($1)._nextPutAll_("}),");
592
+ _st($1)._lf();
593
+ _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(aClass)));
594
+ _st($1)._nextPutAll_(");");
595
+ _st($1)._lf();
596
+ $2=_st($1)._lf();
597
+ return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:of:on:",{aMethod:aMethod,aClass:aClass,aStream:aStream}, smalltalk.StrippedExporter)})}
559
598
  }),
560
599
  smalltalk.StrippedExporter);
561
600
 
@@ -568,33 +607,35 @@ smalltalk.method({
568
607
  selector: "import:",
569
608
  fn: function (aStream){
570
609
  var self=this;
571
- var $1;
572
- var chunk;
573
- var result;
574
- var parser;
575
- var lastEmpty;
576
- parser=smalltalk.send((smalltalk.ChunkParser || ChunkParser),"_on_",[aStream]);
610
+ var chunk,result,parser,lastEmpty;
611
+ return smalltalk.withContext(function($ctx1) {
612
+ parser=_st((smalltalk.ChunkParser || ChunkParser))._on_(aStream);
577
613
  lastEmpty=false;
578
- smalltalk.send((function(){
579
- chunk=smalltalk.send(parser,"_nextChunk",[]);
614
+ $1=(function(){
615
+ return smalltalk.withContext(function($ctx2) {
580
616
  chunk;
581
- return smalltalk.send(chunk,"_isNil",[]);
582
- }),"_whileFalse_",[(function(){
583
- $1=smalltalk.send(chunk,"_isEmpty",[]);
584
- if(smalltalk.assert($1)){
585
- lastEmpty=true;
617
+ return _st(chunk)._isNil();
618
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
619
+ $2=(function(){
620
+ return smalltalk.withContext(function($ctx2) {
621
+ $4=(function(){
622
+ return smalltalk.withContext(function($ctx3) {
586
623
  return lastEmpty;
587
- } else {
588
- result=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler),"_new",[]),"_evaluateExpression_",[chunk]);
624
+ }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
625
+ $5=(function(){
626
+ return smalltalk.withContext(function($ctx3) {
589
627
  result;
590
- if(smalltalk.assert(lastEmpty)){
628
+ $6=lastEmpty;
629
+ if(smalltalk.assert($6)){
591
630
  lastEmpty=false;
592
631
  lastEmpty;
593
- return smalltalk.send(result,"_scanFrom_",[parser]);
632
+ return _st(result)._scanFrom_(parser);
594
633
  };
595
- };
596
- })]);
597
- return self}
634
+ }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
635
+ return _st($3)._ifTrue_ifFalse_($4,$5);
636
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
637
+ _st($1)._whileFalse_($2);
638
+ return self}, function($ctx1) {$ctx1.fill(self,"import:",{aStream:aStream,chunk:chunk,result:result,parser:parser,lastEmpty:lastEmpty}, smalltalk.Importer)})}
598
639
  }),
599
640
  smalltalk.Importer);
600
641
 
@@ -607,16 +648,12 @@ smalltalk.method({
607
648
  selector: "initializePackageNamed:prefix:",
608
649
  fn: function (packageName,aString){
609
650
  var self=this;
610
- var $1,$2;
611
- smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Package || Package),"_named_",[packageName]),"_classes",[]),"_do_",[(function(each){
612
- smalltalk.init(each);
613
- ;
614
- return smalltalk.send(each,"_initialize",[]);
615
- })]);
616
- $1=smalltalk.send((smalltalk.Package || Package),"_named_",[packageName]);
617
- smalltalk.send($1,"_commitPathJs_",[smalltalk.send(smalltalk.send("/","__comma",[aString]),"__comma",["/js"])]);
618
- $2=smalltalk.send($1,"_commitPathSt_",[smalltalk.send(smalltalk.send("/","__comma",[aString]),"__comma",["/st"])]);
619
- return self}
651
+ return smalltalk.withContext(function($ctx1) {
652
+ $1=_st((smalltalk.Package || Package))._named_(packageName);
653
+ _st($1)._setupClasses();
654
+ _st($1)._commitPathJs_(_st(_st("/").__comma(aString)).__comma("/js"));
655
+ $2=_st($1)._commitPathSt_(_st(_st("/").__comma(aString)).__comma("/st"));
656
+ return self}, function($ctx1) {$ctx1.fill(self,"initializePackageNamed:prefix:",{packageName:packageName,aString:aString}, smalltalk.PackageLoader)})}
620
657
  }),
621
658
  smalltalk.PackageLoader);
622
659
 
@@ -626,18 +663,25 @@ smalltalk.method({
626
663
  selector: "loadPackage:prefix:",
627
664
  fn: function (packageName,aString){
628
665
  var self=this;
629
- var $1;
630
666
  var url;
631
- url=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("/","__comma",[aString]),"__comma",["/js/"]),"__comma",[packageName]),"__comma",[".js"]);
632
- smalltalk.send(jQuery,"_ajax_options_",[url,smalltalk.HashedCollection._fromPairs_([smalltalk.send("type","__minus_gt",["GET"]),smalltalk.send("dataType","__minus_gt",["script"]),smalltalk.send("complete","__minus_gt",[(function(jqXHR,textStatus){
633
- $1=smalltalk.send(smalltalk.send(jqXHR,"_readyState",[]),"__eq",[(4)]);
634
- if(smalltalk.assert($1)){
635
- return smalltalk.send(self,"_initializePackageNamed_prefix_",[packageName,aString]);
667
+ return smalltalk.withContext(function($ctx1) {
668
+ url=_st(_st(_st(_st("/").__comma(aString)).__comma("/js/")).__comma(packageName)).__comma(".js");
669
+ $1=jQuery;
670
+ $2=url;
671
+ $4=_st("type").__minus_gt("GET");
672
+ $5=_st("dataType").__minus_gt("script");
673
+ $7=(function(jqXHR,textStatus){
674
+ return smalltalk.withContext(function($ctx2) {
675
+ if(smalltalk.assert($8)){
676
+ return _st(self)._initializePackageNamed_prefix_(packageName,aString);
636
677
  };
637
- })]),smalltalk.send("error","__minus_gt",[(function(){
638
- return smalltalk.send(window,"_alert_",[smalltalk.send("Could not load package at: ","__comma",[url])]);
639
- })])])]);
640
- return self}
678
+ }, function($ctx2) {$ctx2.fillBlock({jqXHR:jqXHR,textStatus:textStatus},$ctx1)})});
679
+ $6=_st("complete").__minus_gt($7);
680
+ $3=smalltalk.HashedCollection._fromPairs_([$4,$5,$6,_st("error").__minus_gt((function(){
681
+ return smalltalk.withContext(function($ctx2) {
682
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]);
683
+ _st($1)._ajax_options_($2,$3);
684
+ return self}, function($ctx1) {$ctx1.fill(self,"loadPackage:prefix:",{packageName:packageName,aString:aString,url:url}, smalltalk.PackageLoader)})}
641
685
  }),
642
686
  smalltalk.PackageLoader);
643
687
 
@@ -647,10 +691,10 @@ smalltalk.method({
647
691
  selector: "loadPackages:prefix:",
648
692
  fn: function (aCollection,aString){
649
693
  var self=this;
650
- smalltalk.send(aCollection,"_do_",[(function(each){
651
- return smalltalk.send(self,"_loadPackage_prefix_",[each,aString]);
652
- })]);
653
- return self}
694
+ return smalltalk.withContext(function($ctx1) {
695
+ return smalltalk.withContext(function($ctx2) {
696
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
697
+ return self}, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString}, smalltalk.PackageLoader)})}
654
698
  }),
655
699
  smalltalk.PackageLoader);
656
700
 
@@ -661,10 +705,10 @@ smalltalk.method({
661
705
  selector: "loadPackages:prefix:",
662
706
  fn: function (aCollection,aString){
663
707
  var self=this;
664
- var $1;
665
- $1=smalltalk.send(smalltalk.send(self,"_new",[]),"_loadPackages_prefix_",[aCollection,aString]);
708
+ return smalltalk.withContext(function($ctx1) {
709
+ $1=_st(_st(self)._new())._loadPackages_prefix_(aCollection,aString);
666
710
  return $1;
667
- }
711
+ }, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString}, smalltalk.PackageLoader.klass)})}
668
712
  }),
669
713
  smalltalk.PackageLoader.klass);
670
714