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
@@ -7,34 +7,35 @@ selector: "nextChunk",
7
7
  category: 'reading',
8
8
  fn: function (){
9
9
  var self=this;
10
- var $1,$2,$3;
10
+ var char,result,chunk;
11
+ return smalltalk.withContext(function($ctx1) {
11
12
  var $early={};
12
13
  try {
13
- var char_;
14
- var result;
15
- var chunk;
16
- result=smalltalk.send("","_writeStream",[]);
17
- smalltalk.send((function(){
18
- char_=smalltalk.send(self["@stream"],"_next",[]);
19
- char_;
20
- return smalltalk.send(char_,"_notNil",[]);
21
- }),"_whileTrue_",[(function(){
22
- $1=smalltalk.send(char_,"__eq",["!"]);
23
- if(smalltalk.assert($1)){
24
- $2=smalltalk.send(smalltalk.send(self["@stream"],"_peek",[]),"__eq",["!"]);
25
- if(smalltalk.assert($2)){
26
- smalltalk.send(self["@stream"],"_next",[]);
14
+ result=_st("")._writeStream();
15
+ $1=(function(){
16
+ return smalltalk.withContext(function($ctx2) {
17
+ char;
18
+ return _st(char)._notNil();
19
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
20
+ $2=(function(){
21
+ return smalltalk.withContext(function($ctx2) {
22
+ $4=(function(){
23
+ return smalltalk.withContext(function($ctx3) {
24
+ if(smalltalk.assert($5)){
25
+ return _st(self["@stream"])._next();
27
26
  } else {
28
- $3=smalltalk.send(smalltalk.send(result,"_contents",[]),"_trimBoth",[]);
29
- throw $early=[$3];
27
+ $6=_st(_st(result)._contents())._trimBoth();
28
+ throw $early=[$6];
30
29
  };
31
- };
32
- return smalltalk.send(result,"_nextPut_",[char_]);
33
- })]);
30
+ }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
31
+ _st($3)._ifTrue_($4);
32
+ return _st(result)._nextPut_(char);
33
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
34
+ _st($1)._whileTrue_($2);
34
35
  return nil;
35
36
  }
36
37
  catch(e) {if(e===$early)return e[0]; throw e}
37
- },
38
+ }, function($ctx1) {$ctx1.fill(self,"nextChunk",{char:char,result:result,chunk:chunk}, smalltalk.ChunkParser)})},
38
39
  args: [],
39
40
  source: "nextChunk\x0a\x09\x22The chunk format (Smalltalk Interchange Format or Fileout format)\x0a\x09is a trivial format but can be a bit tricky to understand:\x0a\x09\x09- Uses the exclamation mark as delimiter of chunks.\x0a\x09\x09- Inside a chunk a normal exclamation mark must be doubled.\x0a\x09\x09- A non empty chunk must be a valid Smalltalk expression.\x0a\x09\x09- A chunk on top level with a preceding empty chunk is an instruction chunk:\x0a\x09\x09\x09- The object created by the expression then takes over reading chunks.\x0a\x0a\x09This metod returns next chunk as a String (trimmed), empty String (all whitespace) or nil.\x22\x0a\x0a\x09| char result chunk |\x0a\x09result := '' writeStream.\x0a [char := stream next.\x0a char notNil] whileTrue: [\x0a char = '!' ifTrue: [\x0a stream peek = '!'\x0a ifTrue: [stream next \x22skipping the escape double\x22]\x0a ifFalse: [^result contents trimBoth \x22chunk end marker found\x22]].\x0a result nextPut: char].\x0a\x09^nil \x22a chunk needs to end with !\x22",
40
41
  messageSends: ["writeStream", "whileTrue:", "ifTrue:", "ifTrue:ifFalse:", "next", "trimBoth", "contents", "=", "peek", "nextPut:", "notNil"],
@@ -49,8 +50,8 @@ selector: "stream:",
49
50
  category: 'accessing',
50
51
  fn: function (aStream){
51
52
  var self=this;
52
- self["@stream"]=aStream;
53
- return self},
53
+ return smalltalk.withContext(function($ctx1) {
54
+ return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream}, smalltalk.ChunkParser)})},
54
55
  args: ["aStream"],
55
56
  source: "stream: aStream\x0a\x09stream := aStream",
56
57
  messageSends: [],
@@ -66,10 +67,10 @@ selector: "on:",
66
67
  category: 'not yet classified',
67
68
  fn: function (aStream){
68
69
  var self=this;
69
- var $1;
70
- $1=smalltalk.send(smalltalk.send(self,"_new",[]),"_stream_",[aStream]);
70
+ return smalltalk.withContext(function($ctx1) {
71
+ $1=_st(_st(self)._new())._stream_(aStream);
71
72
  return $1;
72
- },
73
+ }, function($ctx1) {$ctx1.fill(self,"on:",{aStream:aStream}, smalltalk.ChunkParser.klass)})},
73
74
  args: ["aStream"],
74
75
  source: "on: aStream\x0a\x09^self new stream: aStream",
75
76
  messageSends: ["stream:", "new"],
@@ -86,20 +87,22 @@ selector: "classNameFor:",
86
87
  category: 'private',
87
88
  fn: function (aClass){
88
89
  var self=this;
89
- var $2,$3,$1;
90
- $2=smalltalk.send(aClass,"_isMetaclass",[]);
91
- if(smalltalk.assert($2)){
92
- $1=smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_instanceClass",[]),"_name",[]),"__comma",[".klass"]);
93
- } else {
94
- $3=smalltalk.send(aClass,"_isNil",[]);
95
- if(smalltalk.assert($3)){
96
- $1="nil";
90
+ return smalltalk.withContext(function($ctx1) {
91
+ $2=_st(aClass)._isMetaclass();
92
+ $3=(function(){
93
+ return smalltalk.withContext(function($ctx2) {
94
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
95
+ $4=(function(){
96
+ return smalltalk.withContext(function($ctx2) {
97
+ if(smalltalk.assert($5)){
98
+ return "nil";
97
99
  } else {
98
- $1=smalltalk.send(aClass,"_name",[]);
99
- };
100
+ return _st(aClass)._name();
100
101
  };
102
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
103
+ $1=_st($2)._ifTrue_ifFalse_($3,$4);
101
104
  return $1;
102
- },
105
+ }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass}, smalltalk.Exporter)})},
103
106
  args: ["aClass"],
104
107
  source: "classNameFor: aClass\x0a\x09^aClass isMetaclass\x0a\x09 ifTrue: [aClass instanceClass name, '.klass']\x0a\x09 ifFalse: [\x0a\x09\x09aClass isNil\x0a\x09\x09 ifTrue: ['nil']\x0a\x09\x09 ifFalse: [aClass name]]",
105
108
  messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMetaclass"],
@@ -114,14 +117,14 @@ selector: "exportAll",
114
117
  category: 'fileOut',
115
118
  fn: function (){
116
119
  var self=this;
117
- var $1;
118
- $1=smalltalk.send((smalltalk.String || String),"_streamContents_",[(function(stream){
119
- return smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_packages",[]),"_do_",[(function(pkg){
120
- return smalltalk.send(stream,"_nextPutAll_",[smalltalk.send(self,"_exportPackage_",[smalltalk.send(pkg,"_name",[])])]);
121
- })]);
122
- })]);
120
+ return smalltalk.withContext(function($ctx1) {
121
+ $1=_st((smalltalk.String || String))._streamContents_((function(stream){
122
+ return smalltalk.withContext(function($ctx2) {
123
+ return smalltalk.withContext(function($ctx3) {
124
+ }, function($ctx3) {$ctx3.fillBlock({pkg:pkg},$ctx1)})}));
125
+ }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
123
126
  return $1;
124
- },
127
+ }, function($ctx1) {$ctx1.fill(self,"exportAll",{}, smalltalk.Exporter)})},
125
128
  args: [],
126
129
  source: "exportAll\x0a \x22Export all packages in the system.\x22\x0a\x0a ^String streamContents: [:stream |\x0a \x09Smalltalk current packages do: [:pkg |\x0a\x09\x09stream nextPutAll: (self exportPackage: pkg name)]]",
127
130
  messageSends: ["streamContents:", "do:", "nextPutAll:", "exportPackage:", "name", "packages", "current"],
@@ -136,15 +139,15 @@ selector: "exportClass:",
136
139
  category: 'fileOut',
137
140
  fn: function (aClass){
138
141
  var self=this;
139
- var $1;
140
- $1=smalltalk.send((smalltalk.String || String),"_streamContents_",[(function(stream){
141
- smalltalk.send(self,"_exportDefinitionOf_on_",[aClass,stream]);
142
- smalltalk.send(self,"_exportMethodsOf_on_",[aClass,stream]);
143
- smalltalk.send(self,"_exportMetaDefinitionOf_on_",[aClass,stream]);
144
- return smalltalk.send(self,"_exportMethodsOf_on_",[smalltalk.send(aClass,"_class",[]),stream]);
145
- })]);
142
+ return smalltalk.withContext(function($ctx1) {
143
+ $1=_st((smalltalk.String || String))._streamContents_((function(stream){
144
+ return smalltalk.withContext(function($ctx2) {
145
+ _st(self)._exportMethodsOf_on_(aClass,stream);
146
+ _st(self)._exportMetaDefinitionOf_on_(aClass,stream);
147
+ return _st(self)._exportMethodsOf_on_(_st(aClass)._class(),stream);
148
+ }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
146
149
  return $1;
147
- },
150
+ }, function($ctx1) {$ctx1.fill(self,"exportClass:",{aClass:aClass}, smalltalk.Exporter)})},
148
151
  args: ["aClass"],
149
152
  source: "exportClass: aClass\x0a\x09\x22Export a single class. Subclasses override these methods.\x22\x0a\x0a\x09^String streamContents: [:stream |\x0a\x09\x09self exportDefinitionOf: aClass on: stream.\x0a\x09\x09self exportMethodsOf: aClass on: stream.\x0a\x09\x09self exportMetaDefinitionOf: aClass on: stream.\x0a\x09\x09self exportMethodsOf: aClass class on: stream]",
150
153
  messageSends: ["streamContents:", "exportDefinitionOf:on:", "exportMethodsOf:on:", "exportMetaDefinitionOf:on:", "class"],
@@ -159,30 +162,33 @@ selector: "exportDefinitionOf:on:",
159
162
  category: 'private',
160
163
  fn: function (aClass,aStream){
161
164
  var self=this;
162
- var $1,$2,$3,$4;
163
- smalltalk.send(aStream,"_nextPutAll_",["smalltalk.addClass("]);
164
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("'","__comma",[smalltalk.send(self,"_classNameFor_",[aClass])]),"__comma",["', "])]);
165
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("smalltalk.","__comma",[smalltalk.send(self,"_classNameFor_",[smalltalk.send(aClass,"_superclass",[])])])]);
166
- $1=smalltalk.send(aStream,"_nextPutAll_",[", ["]);
167
- smalltalk.send(smalltalk.send(aClass,"_instanceVariableNames",[]),"_do_separatedBy_",[(function(each){
168
- return smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("'","__comma",[each]),"__comma",["'"])]);
169
- }),(function(){
170
- return smalltalk.send(aStream,"_nextPutAll_",[", "]);
171
- })]);
172
- smalltalk.send(aStream,"_nextPutAll_",["], '"]);
173
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send(aClass,"_category",[]),"__comma",["'"])]);
174
- $2=smalltalk.send(aStream,"_nextPutAll_",[");"]);
175
- $3=smalltalk.send(smalltalk.send(aClass,"_comment",[]),"_notEmpty",[]);
176
- if(smalltalk.assert($3)){
177
- smalltalk.send(aStream,"_lf",[]);
178
- smalltalk.send(aStream,"_nextPutAll_",["smalltalk."]);
179
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(self,"_classNameFor_",[aClass])]);
180
- smalltalk.send(aStream,"_nextPutAll_",[".comment="]);
181
- $4=smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send(aClass,"_comment",[]),"_asJavascript",[])]);
182
- $4;
165
+ return smalltalk.withContext(function($ctx1) {
166
+ $1=aStream;
167
+ _st($1)._nextPutAll_("smalltalk.addClass(");
168
+ _st($1)._nextPutAll_(_st(_st("'").__comma(_st(self)._classNameFor_(aClass))).__comma("', "));
169
+ _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._superclass())));
170
+ $2=_st($1)._nextPutAll_(", [");
171
+ _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
172
+ return smalltalk.withContext(function($ctx2) {
173
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
174
+ return smalltalk.withContext(function($ctx2) {
175
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
176
+ $3=aStream;
177
+ _st($3)._nextPutAll_("], '");
178
+ _st($3)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
179
+ $4=_st($3)._nextPutAll_(");");
180
+ $5=_st(_st(aClass)._comment())._notEmpty();
181
+ if(smalltalk.assert($5)){
182
+ $6=aStream;
183
+ _st($6)._lf();
184
+ _st($6)._nextPutAll_("smalltalk.");
185
+ _st($6)._nextPutAll_(_st(self)._classNameFor_(aClass));
186
+ _st($6)._nextPutAll_(".comment=");
187
+ $7=_st($6)._nextPutAll_(_st(_st(aClass)._comment())._asJavascript());
188
+ $7;
183
189
  };
184
- smalltalk.send(aStream,"_lf",[]);
185
- return self},
190
+ _st(aStream)._lf();
191
+ return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream}, smalltalk.Exporter)})},
186
192
  args: ["aClass", "aStream"],
187
193
  source: "exportDefinitionOf: aClass on: aStream\x0a\x09aStream \x0a\x09 nextPutAll: 'smalltalk.addClass(';\x0a\x09 nextPutAll: '''', (self classNameFor: aClass), ''', ';\x0a\x09 nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);\x0a\x09 nextPutAll: ', ['.\x0a\x09aClass instanceVariableNames \x0a\x09 do: [:each | aStream nextPutAll: '''', each, '''']\x0a\x09 separatedBy: [aStream nextPutAll: ', '].\x0a\x09aStream\x09\x0a\x09 nextPutAll: '], ''';\x0a\x09 nextPutAll: aClass category, '''';\x0a\x09 nextPutAll: ');'.\x0a\x09aClass comment notEmpty ifTrue: [\x0a\x09 aStream \x0a\x09 \x09lf;\x0a\x09\x09nextPutAll: 'smalltalk.';\x0a\x09\x09nextPutAll: (self classNameFor: aClass);\x0a\x09\x09nextPutAll: '.comment=';\x0a\x09\x09nextPutAll: aClass comment asJavascript].\x0a\x09aStream lf",
188
194
  messageSends: ["nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "lf", "asJavascript", "comment", "notEmpty"],
@@ -197,20 +203,21 @@ selector: "exportMetaDefinitionOf:on:",
197
203
  category: 'private',
198
204
  fn: function (aClass,aStream){
199
205
  var self=this;
200
- var $1,$2;
201
- $1=smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_class",[]),"_instanceVariableNames",[]),"_isEmpty",[]);
206
+ return smalltalk.withContext(function($ctx1) {
207
+ $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
202
208
  if(! smalltalk.assert($1)){
203
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("smalltalk.","__comma",[smalltalk.send(self,"_classNameFor_",[smalltalk.send(aClass,"_class",[])])])]);
204
- $2=smalltalk.send(aStream,"_nextPutAll_",[".iVarNames = ["]);
205
- $2;
206
- smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_class",[]),"_instanceVariableNames",[]),"_do_separatedBy_",[(function(each){
207
- return smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("'","__comma",[each]),"__comma",["'"])]);
208
- }),(function(){
209
- return smalltalk.send(aStream,"_nextPutAll_",[","]);
210
- })]);
211
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("];","__comma",[smalltalk.send((smalltalk.String || String),"_lf",[])])]);
209
+ $2=aStream;
210
+ _st($2)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._class())));
211
+ $3=_st($2)._nextPutAll_(".iVarNames = [");
212
+ $3;
213
+ _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
214
+ return smalltalk.withContext(function($ctx2) {
215
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
216
+ return smalltalk.withContext(function($ctx2) {
217
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
218
+ _st(aStream)._nextPutAll_(_st("];").__comma(_st((smalltalk.String || String))._lf()));
212
219
  };
213
- return self},
220
+ return self}, function($ctx1) {$ctx1.fill(self,"exportMetaDefinitionOf:on:",{aClass:aClass,aStream:aStream}, smalltalk.Exporter)})},
214
221
  args: ["aClass", "aStream"],
215
222
  source: "exportMetaDefinitionOf: aClass on: aStream\x0a\x09aClass class instanceVariableNames isEmpty ifFalse: [\x0a\x09 aStream \x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass class);\x0a\x09\x09nextPutAll: '.iVarNames = ['.\x0a\x09 aClass class instanceVariableNames\x0a\x09\x09do: [:each | aStream nextPutAll: '''', each, '''']\x0a\x09\x09separatedBy: [aStream nextPutAll: ','].\x0a\x09 aStream nextPutAll: '];', String lf]",
216
223
  messageSends: ["ifFalse:", "nextPutAll:", ",", "classNameFor:", "class", "do:separatedBy:", "instanceVariableNames", "lf", "isEmpty"],
@@ -225,34 +232,36 @@ selector: "exportMethod:of:on:",
225
232
  category: 'private',
226
233
  fn: function (aMethod,aClass,aStream){
227
234
  var self=this;
228
- var $1,$2;
229
- smalltalk.send(aStream,"_nextPutAll_",["smalltalk.addMethod("]);
230
- smalltalk.send(aStream,"_lf",[]);
231
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod,"_selector",[]),"_asSelector",[]),"_asJavascript",[]),"__comma",[","])]);
232
- smalltalk.send(aStream,"_lf",[]);
233
- smalltalk.send(aStream,"_nextPutAll_",["smalltalk.method({"]);
234
- smalltalk.send(aStream,"_lf",[]);
235
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("selector: ","__comma",[smalltalk.send(smalltalk.send(aMethod,"_selector",[]),"_asJavascript",[])]),"__comma",[","])]);
236
- smalltalk.send(aStream,"_lf",[]);
237
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("category: '","__comma",[smalltalk.send(aMethod,"_category",[])]),"__comma",["',"])]);
238
- smalltalk.send(aStream,"_lf",[]);
239
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("fn: ","__comma",[smalltalk.send(smalltalk.send(aMethod,"_fn",[]),"_compiledSource",[])]),"__comma",[","])]);
240
- smalltalk.send(aStream,"_lf",[]);
241
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("args: ","__comma",[smalltalk.send(smalltalk.send(aMethod,"_arguments",[]),"_asJavascript",[])]),"__comma",[","])]);
242
- smalltalk.send(aStream,"_lf",[]);
243
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("source: ","__comma",[smalltalk.send(smalltalk.send(aMethod,"_source",[]),"_asJavascript",[])]),"__comma",[","])]);
244
- smalltalk.send(aStream,"_lf",[]);
245
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("messageSends: ","__comma",[smalltalk.send(smalltalk.send(aMethod,"_messageSends",[]),"_asJavascript",[])]),"__comma",[","])]);
246
- smalltalk.send(aStream,"_lf",[]);
247
- $1=smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("referencedClasses: ","__comma",[smalltalk.send(smalltalk.send(aMethod,"_referencedClasses",[]),"_asJavascript",[])])]);
248
- smalltalk.send(aStream,"_lf",[]);
249
- smalltalk.send(aStream,"_nextPutAll_",["}),"]);
250
- smalltalk.send(aStream,"_lf",[]);
251
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("smalltalk.","__comma",[smalltalk.send(self,"_classNameFor_",[aClass])])]);
252
- smalltalk.send(aStream,"_nextPutAll_",[");"]);
253
- smalltalk.send(aStream,"_lf",[]);
254
- $2=smalltalk.send(aStream,"_lf",[]);
255
- return self},
235
+ return smalltalk.withContext(function($ctx1) {
236
+ $1=aStream;
237
+ _st($1)._nextPutAll_("smalltalk.addMethod(");
238
+ _st($1)._lf();
239
+ _st($1)._nextPutAll_(_st(_st(_st(_st(aMethod)._selector())._asSelector())._asJavascript()).__comma(","));
240
+ _st($1)._lf();
241
+ _st($1)._nextPutAll_("smalltalk.method({");
242
+ _st($1)._lf();
243
+ _st($1)._nextPutAll_(_st(_st("selector: ").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
244
+ _st($1)._lf();
245
+ _st($1)._nextPutAll_(_st(_st("category: '").__comma(_st(aMethod)._category())).__comma("',"));
246
+ _st($1)._lf();
247
+ _st($1)._nextPutAll_(_st(_st("fn: ").__comma(_st(_st(aMethod)._fn())._compiledSource())).__comma(","));
248
+ _st($1)._lf();
249
+ _st($1)._nextPutAll_(_st(_st("args: ").__comma(_st(_st(aMethod)._arguments())._asJavascript())).__comma(","));
250
+ _st($1)._lf();
251
+ _st($1)._nextPutAll_(_st(_st("source: ").__comma(_st(_st(aMethod)._source())._asJavascript())).__comma(","));
252
+ _st($1)._lf();
253
+ _st($1)._nextPutAll_(_st(_st("messageSends: ").__comma(_st(_st(aMethod)._messageSends())._asJavascript())).__comma(","));
254
+ _st($1)._lf();
255
+ $2=_st($1)._nextPutAll_(_st("referencedClasses: ").__comma(_st(_st(aMethod)._referencedClasses())._asJavascript()));
256
+ $3=aStream;
257
+ _st($3)._lf();
258
+ _st($3)._nextPutAll_("}),");
259
+ _st($3)._lf();
260
+ _st($3)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(aClass)));
261
+ _st($3)._nextPutAll_(");");
262
+ _st($3)._lf();
263
+ $4=_st($3)._lf();
264
+ return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:of:on:",{aMethod:aMethod,aClass:aClass,aStream:aStream}, smalltalk.Exporter)})},
256
265
  args: ["aMethod", "aClass", "aStream"],
257
266
  source: "exportMethod: aMethod of: aClass on: aStream\x0a\x09aStream \x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'category: ''', aMethod category, ''',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;\x0a\x09\x09nextPutAll: 'args: ', aMethod arguments asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'source: ', aMethod source asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'messageSends: ', aMethod messageSends asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ', aMethod referencedClasses asJavascript.\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
258
267
  messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "asSelector", "selector", "category", "compiledSource", "fn", "arguments", "source", "messageSends", "referencedClasses", "classNameFor:"],
@@ -267,17 +276,19 @@ selector: "exportMethodsOf:on:",
267
276
  category: 'private',
268
277
  fn: function (aClass,aStream){
269
278
  var self=this;
270
- var $1;
271
- smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_methodDictionary",[]),"_values",[]),"_sorted_",[(function(a,b){
272
- return smalltalk.send(smalltalk.send(a,"_selector",[]),"__lt_eq",[smalltalk.send(b,"_selector",[])]);
273
- })]),"_do_",[(function(each){
274
- $1=smalltalk.send(smalltalk.send(each,"_category",[]),"_match_",["^\x5c*"]);
275
- if(! smalltalk.assert($1)){
276
- return smalltalk.send(self,"_exportMethod_of_on_",[each,aClass,aStream]);
279
+ return smalltalk.withContext(function($ctx1) {
280
+ $1=_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
281
+ return smalltalk.withContext(function($ctx2) {
282
+ }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})}));
283
+ $2=(function(each){
284
+ return smalltalk.withContext(function($ctx2) {
285
+ if(! smalltalk.assert($3)){
286
+ return _st(self)._exportMethod_of_on_(each,aClass,aStream);
277
287
  };
278
- })]);
279
- smalltalk.send(aStream,"_lf",[]);
280
- return self},
288
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})});
289
+ _st($1)._do_($2);
290
+ _st(aStream)._lf();
291
+ return self}, function($ctx1) {$ctx1.fill(self,"exportMethodsOf:on:",{aClass:aClass,aStream:aStream}, smalltalk.Exporter)})},
281
292
  args: ["aClass", "aStream"],
282
293
  source: "exportMethodsOf: aClass on: aStream\x0a\x09\x22Issue #143: sort methods alphabetically\x22\x0a\x0a\x09((aClass methodDictionary values) sorted: [:a :b | a selector <= b selector]) do: [:each |\x0a\x09\x09(each category match: '^\x5c*') ifFalse: [\x0a\x09\x09\x09self exportMethod: each of: aClass on: aStream]].\x0a\x09aStream lf",
283
294
  messageSends: ["do:", "ifFalse:", "exportMethod:of:on:", "match:", "category", "sorted:", "<=", "selector", "values", "methodDictionary", "lf"],
@@ -292,19 +303,19 @@ selector: "exportPackage:",
292
303
  category: 'fileOut',
293
304
  fn: function (packageName){
294
305
  var self=this;
295
- var $1;
296
- var package;
297
- $1=smalltalk.send((smalltalk.String || String),"_streamContents_",[(function(stream){
298
- package=smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_packageAt_",[packageName]);
299
- package;
300
- smalltalk.send(self,"_exportPackageDefinitionOf_on_",[package,stream]);
301
- smalltalk.send(smalltalk.send(smalltalk.send(package,"_sortedClasses",[]),"_asSet",[]),"_do_",[(function(each){
302
- return smalltalk.send(stream,"_nextPutAll_",[smalltalk.send(self,"_exportClass_",[each])]);
303
- })]);
304
- return smalltalk.send(self,"_exportPackageExtensionsOf_on_",[package,stream]);
305
- })]);
306
+ var package_;
307
+ return smalltalk.withContext(function($ctx1) {
308
+ $1=_st((smalltalk.String || String))._streamContents_((function(stream){
309
+ return smalltalk.withContext(function($ctx2) {
310
+ package_;
311
+ _st(self)._exportPackageDefinitionOf_on_(package_,stream);
312
+ _st(_st(_st(package_)._sortedClasses())._asSet())._do_((function(each){
313
+ return smalltalk.withContext(function($ctx3) {
314
+ }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
315
+ return _st(self)._exportPackageExtensionsOf_on_(package_,stream);
316
+ }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
306
317
  return $1;
307
- },
318
+ }, function($ctx1) {$ctx1.fill(self,"exportPackage:",{packageName:packageName,package_:package_}, smalltalk.Exporter)})},
308
319
  args: ["packageName"],
309
320
  source: "exportPackage: packageName\x0a\x09\x22Export a given package by name.\x22\x0a\x0a\x09| package |\x0a\x09^String streamContents: [:stream |\x0a package := Smalltalk current packageAt: packageName.\x0a self exportPackageDefinitionOf: package on: stream.\x0a\x0a\x09\x09\x22Export classes in dependency order.\x0a\x09\x09Update (issue #171): Remove duplicates for export\x22\x0a\x09 \x09package sortedClasses asSet do: [:each |\x0a stream nextPutAll: (self exportClass: each)].\x0a\x09\x09self exportPackageExtensionsOf: package on: stream]",
310
321
  messageSends: ["streamContents:", "packageAt:", "current", "exportPackageDefinitionOf:on:", "do:", "nextPutAll:", "exportClass:", "asSet", "sortedClasses", "exportPackageExtensionsOf:on:"],
@@ -317,13 +328,14 @@ smalltalk.addMethod(
317
328
  smalltalk.method({
318
329
  selector: "exportPackageDefinitionOf:on:",
319
330
  category: 'private',
320
- fn: function (package,aStream){
331
+ fn: function (package_,aStream){
321
332
  var self=this;
322
- var $1;
323
- smalltalk.send(aStream,"_nextPutAll_",["smalltalk.addPackage("]);
324
- $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",[");"])]);
325
- smalltalk.send(aStream,"_lf",[]);
326
- return self},
333
+ return smalltalk.withContext(function($ctx1) {
334
+ $1=aStream;
335
+ _st($1)._nextPutAll_("smalltalk.addPackage(");
336
+ $2=_st($1)._nextPutAll_(_st(_st(_st(_st("'").__comma(_st(package_)._name())).__comma("', ")).__comma(_st(package_)._propertiesAsJSON())).__comma(");"));
337
+ _st(aStream)._lf();
338
+ return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{package_:package_,aStream:aStream}, smalltalk.Exporter)})},
327
339
  args: ["package", "aStream"],
328
340
  source: "exportPackageDefinitionOf: package on: aStream\x0a\x09aStream \x0a\x09 nextPutAll: 'smalltalk.addPackage(';\x0a\x09 nextPutAll: '''', package name, ''', ', package propertiesAsJSON , ');'.\x0a\x09aStream lf",
329
341
  messageSends: ["nextPutAll:", ",", "propertiesAsJSON", "name", "lf"],
@@ -336,24 +348,30 @@ smalltalk.addMethod(
336
348
  smalltalk.method({
337
349
  selector: "exportPackageExtensionsOf:on:",
338
350
  category: 'private',
339
- fn: function (package,aStream){
351
+ fn: function (package_,aStream){
340
352
  var self=this;
341
- var $1;
342
353
  var name;
343
- name=smalltalk.send(package,"_name",[]);
344
- smalltalk.send(smalltalk.send((smalltalk.Package || Package),"_sortedClasses_",[smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_classes",[])]),"_do_",[(function(each){
345
- return smalltalk.send([each,smalltalk.send(each,"_class",[])],"_do_",[(function(aClass){
346
- return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_methodDictionary",[]),"_values",[]),"_sorted_",[(function(a,b){
347
- return smalltalk.send(smalltalk.send(a,"_selector",[]),"__lt_eq",[smalltalk.send(b,"_selector",[])]);
348
- })]),"_do_",[(function(method){
349
- $1=smalltalk.send(smalltalk.send(method,"_category",[]),"_match_",[smalltalk.send("^\x5c*","__comma",[name])]);
350
- if(smalltalk.assert($1)){
351
- return smalltalk.send(self,"_exportMethod_of_on_",[method,aClass,aStream]);
354
+ return smalltalk.withContext(function($ctx1) {
355
+ name=_st(package_)._name();
356
+ $1=_st((smalltalk.Package || Package))._sortedClasses_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes());
357
+ $2=(function(each){
358
+ return smalltalk.withContext(function($ctx2) {
359
+ $4=(function(aClass){
360
+ return smalltalk.withContext(function($ctx3) {
361
+ return smalltalk.withContext(function($ctx4) {
362
+ }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})}));
363
+ $6=(function(method){
364
+ return smalltalk.withContext(function($ctx4) {
365
+ if(smalltalk.assert($7)){
366
+ return _st(self)._exportMethod_of_on_(method,aClass,aStream);
352
367
  };
353
- })]);
354
- })]);
355
- })]);
356
- return self},
368
+ }, function($ctx4) {$ctx4.fillBlock({method:method},$ctx1)})});
369
+ return _st($5)._do_($6);
370
+ }, function($ctx3) {$ctx3.fillBlock({aClass:aClass},$ctx1)})});
371
+ return _st($3)._do_($4);
372
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})});
373
+ _st($1)._do_($2);
374
+ return self}, function($ctx1) {$ctx1.fill(self,"exportPackageExtensionsOf:on:",{package_:package_,aStream:aStream,name:name}, smalltalk.Exporter)})},
357
375
  args: ["package", "aStream"],
358
376
  source: "exportPackageExtensionsOf: package on: aStream\x0a\x09\x22Issue #143: sort classes and methods alphabetically\x22\x0a\x0a\x09| name |\x0a\x09name := package name.\x0a\x09(Package sortedClasses: Smalltalk current classes) do: [:each |\x0a\x09\x09{each. each class} do: [:aClass | \x0a\x09\x09\x09((aClass methodDictionary values) sorted: [:a :b | a selector <= b selector]) do: [:method |\x0a\x09\x09\x09\x09(method category match: '^\x5c*', name) ifTrue: [\x0a\x09\x09\x09\x09\x09self exportMethod: method of: aClass on: aStream ]]]]",
359
377
  messageSends: ["name", "do:", "ifTrue:", "exportMethod:of:on:", "match:", ",", "category", "sorted:", "<=", "selector", "values", "methodDictionary", "class", "sortedClasses:", "classes", "current"],
@@ -371,10 +389,10 @@ selector: "chunkEscape:",
371
389
  category: 'not yet classified',
372
390
  fn: function (aString){
373
391
  var self=this;
374
- var $1;
375
- $1=smalltalk.send(smalltalk.send(aString,"_replace_with_",["!","!!"]),"_trimBoth",[]);
392
+ return smalltalk.withContext(function($ctx1) {
393
+ $1=_st(_st(aString)._replace_with_("!","!!"))._trimBoth();
376
394
  return $1;
377
- },
395
+ }, function($ctx1) {$ctx1.fill(self,"chunkEscape:",{aString:aString}, smalltalk.ChunkExporter)})},
378
396
  args: ["aString"],
379
397
  source: "chunkEscape: aString\x0a\x09\x22Replace all occurrences of ! with !! and trim at both ends.\x22\x0a\x0a\x09^(aString replace: '!' with: '!!') trimBoth",
380
398
  messageSends: ["trimBoth", "replace:with:"],
@@ -389,20 +407,22 @@ selector: "classNameFor:",
389
407
  category: 'not yet classified',
390
408
  fn: function (aClass){
391
409
  var self=this;
392
- var $2,$3,$1;
393
- $2=smalltalk.send(aClass,"_isMetaclass",[]);
394
- if(smalltalk.assert($2)){
395
- $1=smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_instanceClass",[]),"_name",[]),"__comma",[" class"]);
396
- } else {
397
- $3=smalltalk.send(aClass,"_isNil",[]);
398
- if(smalltalk.assert($3)){
399
- $1="nil";
410
+ return smalltalk.withContext(function($ctx1) {
411
+ $2=_st(aClass)._isMetaclass();
412
+ $3=(function(){
413
+ return smalltalk.withContext(function($ctx2) {
414
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
415
+ $4=(function(){
416
+ return smalltalk.withContext(function($ctx2) {
417
+ if(smalltalk.assert($5)){
418
+ return "nil";
400
419
  } else {
401
- $1=smalltalk.send(aClass,"_name",[]);
402
- };
420
+ return _st(aClass)._name();
403
421
  };
422
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
423
+ $1=_st($2)._ifTrue_ifFalse_($3,$4);
404
424
  return $1;
405
- },
425
+ }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass}, smalltalk.ChunkExporter)})},
406
426
  args: ["aClass"],
407
427
  source: "classNameFor: aClass\x0a\x09^aClass isMetaclass\x0a\x09 ifTrue: [aClass instanceClass name, ' class']\x0a\x09 ifFalse: [\x0a\x09\x09aClass isNil\x0a\x09\x09 ifTrue: ['nil']\x0a\x09\x09 ifFalse: [aClass name]]",
408
428
  messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMetaclass"],
@@ -417,30 +437,33 @@ selector: "exportDefinitionOf:on:",
417
437
  category: 'not yet classified',
418
438
  fn: function (aClass,aStream){
419
439
  var self=this;
420
- var $1,$2,$3,$4;
421
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(self,"_classNameFor_",[smalltalk.send(aClass,"_superclass",[])])]);
422
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(" subclass: #","__comma",[smalltalk.send(self,"_classNameFor_",[aClass])])]);
423
- smalltalk.send(aStream,"_lf",[]);
424
- $1=smalltalk.send(aStream,"_nextPutAll_",["\x09instanceVariableNames: '"]);
425
- smalltalk.send(smalltalk.send(aClass,"_instanceVariableNames",[]),"_do_separatedBy_",[(function(each){
426
- return smalltalk.send(aStream,"_nextPutAll_",[each]);
427
- }),(function(){
428
- return smalltalk.send(aStream,"_nextPutAll_",[" "]);
429
- })]);
430
- smalltalk.send(aStream,"_nextPutAll_",["'"]);
431
- smalltalk.send(aStream,"_lf",[]);
432
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("\x09package: '","__comma",[smalltalk.send(aClass,"_category",[])]),"__comma",["'!"])]);
433
- $2=smalltalk.send(aStream,"_lf",[]);
434
- $3=smalltalk.send(smalltalk.send(aClass,"_comment",[]),"_notEmpty",[]);
435
- if(smalltalk.assert($3)){
436
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("!","__comma",[smalltalk.send(self,"_classNameFor_",[aClass])]),"__comma",[" commentStamp!"])]);
437
- smalltalk.send(aStream,"_lf",[]);
438
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send(self,"_chunkEscape_",[smalltalk.send(aClass,"_comment",[])]),"__comma",["!"])]);
439
- $4=smalltalk.send(aStream,"_lf",[]);
440
- $4;
440
+ return smalltalk.withContext(function($ctx1) {
441
+ $1=aStream;
442
+ _st($1)._nextPutAll_(_st(self)._classNameFor_(_st(aClass)._superclass()));
443
+ _st($1)._nextPutAll_(_st(" subclass: #").__comma(_st(self)._classNameFor_(aClass)));
444
+ _st($1)._lf();
445
+ $2=_st($1)._nextPutAll_("\x09instanceVariableNames: '");
446
+ _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
447
+ return smalltalk.withContext(function($ctx2) {
448
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
449
+ return smalltalk.withContext(function($ctx2) {
450
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
451
+ $3=aStream;
452
+ _st($3)._nextPutAll_("'");
453
+ _st($3)._lf();
454
+ _st($3)._nextPutAll_(_st(_st("\x09package: '").__comma(_st(aClass)._category())).__comma("'!"));
455
+ $4=_st($3)._lf();
456
+ $5=_st(_st(aClass)._comment())._notEmpty();
457
+ if(smalltalk.assert($5)){
458
+ $6=aStream;
459
+ _st($6)._nextPutAll_(_st(_st("!").__comma(_st(self)._classNameFor_(aClass))).__comma(" commentStamp!"));
460
+ _st($6)._lf();
461
+ _st($6)._nextPutAll_(_st(_st(self)._chunkEscape_(_st(aClass)._comment())).__comma("!"));
462
+ $7=_st($6)._lf();
463
+ $7;
441
464
  };
442
- smalltalk.send(aStream,"_lf",[]);
443
- return self},
465
+ _st(aStream)._lf();
466
+ return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream}, smalltalk.ChunkExporter)})},
444
467
  args: ["aClass", "aStream"],
445
468
  source: "exportDefinitionOf: aClass on: aStream\x0a \x22Chunk format.\x22\x0a\x0a aStream \x0a nextPutAll: (self classNameFor: aClass superclass);\x0a nextPutAll: ' subclass: #', (self classNameFor: aClass); lf;\x0a nextPutAll: '\x09instanceVariableNames: '''.\x0a aClass instanceVariableNames \x0a do: [:each | aStream nextPutAll: each]\x0a separatedBy: [aStream nextPutAll: ' '].\x0a aStream \x0a nextPutAll: ''''; lf;\x0a nextPutAll: '\x09package: ''', aClass category, '''!'; lf.\x0a aClass comment notEmpty ifTrue: [\x0a aStream \x0a nextPutAll: '!', (self classNameFor: aClass), ' commentStamp!';lf;\x0a nextPutAll: (self chunkEscape: aClass comment), '!';lf].\x0a aStream lf",
446
469
  messageSends: ["nextPutAll:", "classNameFor:", "superclass", ",", "lf", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "chunkEscape:", "comment", "notEmpty"],
@@ -455,23 +478,25 @@ selector: "exportMetaDefinitionOf:on:",
455
478
  category: 'not yet classified',
456
479
  fn: function (aClass,aStream){
457
480
  var self=this;
458
- var $1,$2,$3;
459
- $1=smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_class",[]),"_instanceVariableNames",[]),"_isEmpty",[]);
481
+ return smalltalk.withContext(function($ctx1) {
482
+ $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
460
483
  if(! smalltalk.assert($1)){
461
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(self,"_classNameFor_",[smalltalk.send(aClass,"_class",[])])]);
462
- $2=smalltalk.send(aStream,"_nextPutAll_",[" instanceVariableNames: '"]);
463
- $2;
464
- smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_class",[]),"_instanceVariableNames",[]),"_do_separatedBy_",[(function(each){
465
- return smalltalk.send(aStream,"_nextPutAll_",[each]);
466
- }),(function(){
467
- return smalltalk.send(aStream,"_nextPutAll_",[" "]);
468
- })]);
469
- smalltalk.send(aStream,"_nextPutAll_",["'!"]);
470
- smalltalk.send(aStream,"_lf",[]);
471
- $3=smalltalk.send(aStream,"_lf",[]);
484
+ $2=aStream;
485
+ _st($2)._nextPutAll_(_st(self)._classNameFor_(_st(aClass)._class()));
486
+ $3=_st($2)._nextPutAll_(" instanceVariableNames: '");
472
487
  $3;
488
+ _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
489
+ return smalltalk.withContext(function($ctx2) {
490
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
491
+ return smalltalk.withContext(function($ctx2) {
492
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
493
+ $4=aStream;
494
+ _st($4)._nextPutAll_("'!");
495
+ _st($4)._lf();
496
+ $5=_st($4)._lf();
497
+ $5;
473
498
  };
474
- return self},
499
+ return self}, function($ctx1) {$ctx1.fill(self,"exportMetaDefinitionOf:on:",{aClass:aClass,aStream:aStream}, smalltalk.ChunkExporter)})},
475
500
  args: ["aClass", "aStream"],
476
501
  source: "exportMetaDefinitionOf: aClass on: aStream\x0a\x0a\x09aClass class instanceVariableNames isEmpty ifFalse: [\x0a\x09\x09aStream \x0a\x09\x09 nextPutAll: (self classNameFor: aClass class);\x0a\x09\x09 nextPutAll: ' instanceVariableNames: '''.\x0a\x09\x09aClass class instanceVariableNames \x0a\x09\x09 do: [:each | aStream nextPutAll: each]\x0a\x09\x09 separatedBy: [aStream nextPutAll: ' '].\x0a\x09\x09aStream\x09\x0a\x09\x09 nextPutAll: '''!'; lf; lf]",
477
502
  messageSends: ["ifFalse:", "nextPutAll:", "classNameFor:", "class", "do:separatedBy:", "instanceVariableNames", "lf", "isEmpty"],
@@ -486,13 +511,14 @@ selector: "exportMethod:of:on:",
486
511
  category: 'not yet classified',
487
512
  fn: function (aMethod,aClass,aStream){
488
513
  var self=this;
489
- var $1;
490
- smalltalk.send(aStream,"_lf",[]);
491
- smalltalk.send(aStream,"_lf",[]);
492
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(self,"_chunkEscape_",[smalltalk.send(aMethod,"_source",[])])]);
493
- smalltalk.send(aStream,"_lf",[]);
494
- $1=smalltalk.send(aStream,"_nextPutAll_",["!"]);
495
- return self},
514
+ return smalltalk.withContext(function($ctx1) {
515
+ $1=aStream;
516
+ _st($1)._lf();
517
+ _st($1)._lf();
518
+ _st($1)._nextPutAll_(_st(self)._chunkEscape_(_st(aMethod)._source()));
519
+ _st($1)._lf();
520
+ $2=_st($1)._nextPutAll_("!");
521
+ return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:of:on:",{aMethod:aMethod,aClass:aClass,aStream:aStream}, smalltalk.ChunkExporter)})},
496
522
  args: ["aMethod", "aClass", "aStream"],
497
523
  source: "exportMethod: aMethod of: aClass on: aStream\x0a\x09aStream \x0a\x09\x09lf; lf; nextPutAll: (self chunkEscape: aMethod source); lf;\x0a\x09\x09nextPutAll: '!'",
498
524
  messageSends: ["lf", "nextPutAll:", "chunkEscape:", "source"],
@@ -507,18 +533,20 @@ selector: "exportMethods:category:of:on:",
507
533
  category: 'not yet classified',
508
534
  fn: function (methods,category,aClass,aStream){
509
535
  var self=this;
510
- var $1,$2;
511
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("!","__comma",[smalltalk.send(self,"_classNameFor_",[aClass])])]);
512
- $1=smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send(" methodsFor: '","__comma",[category]),"__comma",["'!"])]);
513
- smalltalk.send(smalltalk.send(methods,"_sorted_",[(function(a,b){
514
- return smalltalk.send(smalltalk.send(a,"_selector",[]),"__lt_eq",[smalltalk.send(b,"_selector",[])]);
515
- })]),"_do_",[(function(each){
516
- return smalltalk.send(self,"_exportMethod_of_on_",[each,aClass,aStream]);
517
- })]);
518
- smalltalk.send(aStream,"_nextPutAll_",[" !"]);
519
- smalltalk.send(aStream,"_lf",[]);
520
- $2=smalltalk.send(aStream,"_lf",[]);
521
- return self},
536
+ return smalltalk.withContext(function($ctx1) {
537
+ $1=aStream;
538
+ _st($1)._nextPutAll_(_st("!").__comma(_st(self)._classNameFor_(aClass)));
539
+ $2=_st($1)._nextPutAll_(_st(_st(" methodsFor: '").__comma(category)).__comma("'!"));
540
+ _st(_st(methods)._sorted_((function(a,b){
541
+ return smalltalk.withContext(function($ctx2) {
542
+ }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
543
+ return smalltalk.withContext(function($ctx2) {
544
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
545
+ $3=aStream;
546
+ _st($3)._nextPutAll_(" !");
547
+ _st($3)._lf();
548
+ $4=_st($3)._lf();
549
+ return self}, function($ctx1) {$ctx1.fill(self,"exportMethods:category:of:on:",{methods:methods,category:category,aClass:aClass,aStream:aStream}, smalltalk.ChunkExporter)})},
522
550
  args: ["methods", "category", "aClass", "aStream"],
523
551
  source: "exportMethods: methods category: category of: aClass on: aStream\x0a\x09\x22Issue #143: sort methods alphabetically\x22\x0a\x0a\x09aStream\x0a\x09\x09nextPutAll: '!', (self classNameFor: aClass);\x0a\x09\x09nextPutAll: ' methodsFor: ''', category, '''!'.\x0a\x09\x09(methods sorted: [:a :b | a selector <= b selector]) do: [:each |\x0a\x09\x09\x09\x09self exportMethod: each of: aClass on: aStream].\x0a\x09aStream nextPutAll: ' !'; lf; lf",
524
552
  messageSends: ["nextPutAll:", ",", "classNameFor:", "do:", "exportMethod:of:on:", "sorted:", "<=", "selector", "lf"],
@@ -533,24 +561,26 @@ selector: "exportMethodsOf:on:",
533
561
  category: 'not yet classified',
534
562
  fn: function (aClass,aStream){
535
563
  var self=this;
536
- var $1;
537
564
  var map;
538
- map=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
539
- smalltalk.send(aClass,"_protocolsDo_",[(function(category,methods){
540
- $1=smalltalk.send(category,"_match_",["^\x5c*"]);
541
- if(! smalltalk.assert($1)){
542
- return smalltalk.send(map,"_at_put_",[category,methods]);
565
+ return smalltalk.withContext(function($ctx1) {
566
+ map=_st((smalltalk.Dictionary || Dictionary))._new();
567
+ $1=aClass;
568
+ $2=(function(category,methods){
569
+ return smalltalk.withContext(function($ctx2) {
570
+ if(! smalltalk.assert($3)){
571
+ return _st(map)._at_put_(category,methods);
543
572
  };
544
- })]);
545
- smalltalk.send(smalltalk.send(smalltalk.send(map,"_keys",[]),"_sorted_",[(function(a,b){
546
- return smalltalk.send(a,"__lt_eq",[b]);
547
- })]),"_do_",[(function(category){
573
+ }, function($ctx2) {$ctx2.fillBlock({category:category,methods:methods},$ctx1)})});
574
+ _st($1)._protocolsDo_($2);
575
+ _st(_st(_st(map)._keys())._sorted_((function(a,b){
576
+ return smalltalk.withContext(function($ctx2) {
577
+ }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(category){
548
578
  var methods;
549
- methods=smalltalk.send(map,"_at_",[category]);
579
+ return smalltalk.withContext(function($ctx2) {
550
580
  methods;
551
- return smalltalk.send(self,"_exportMethods_category_of_on_",[methods,category,aClass,aStream]);
552
- })]);
553
- return self},
581
+ return _st(self)._exportMethods_category_of_on_(methods,category,aClass,aStream);
582
+ }, function($ctx2) {$ctx2.fillBlock({category:category,methods:methods},$ctx1)})}));
583
+ return self}, function($ctx1) {$ctx1.fill(self,"exportMethodsOf:on:",{aClass:aClass,aStream:aStream,map:map}, smalltalk.ChunkExporter)})},
554
584
  args: ["aClass", "aStream"],
555
585
  source: "exportMethodsOf: aClass on: aStream\x0a\x09\x22Issue #143: sort protocol alphabetically\x22\x0a\x0a\x09| map |\x0a\x09map := Dictionary new.\x0a\x09aClass protocolsDo: [:category :methods | \x0a\x09\x09(category match: '^\x5c*') ifFalse: [ map at: category put: methods ]].\x0a\x09(map keys sorted: [:a :b | a <= b ]) do: [:category | | methods |\x0a\x09\x09methods := map at: category.\x0a\x09\x09self\x0a\x09\x09\x09exportMethods: methods\x0a\x09\x09\x09category: category\x0a\x09\x09\x09of: aClass\x0a\x09\x09\x09on: aStream ]",
556
586
  messageSends: ["new", "protocolsDo:", "ifFalse:", "at:put:", "match:", "do:", "at:", "exportMethods:category:of:on:", "sorted:", "<=", "keys"],
@@ -563,12 +593,13 @@ smalltalk.addMethod(
563
593
  smalltalk.method({
564
594
  selector: "exportPackageDefinitionOf:on:",
565
595
  category: 'not yet classified',
566
- fn: function (package,aStream){
596
+ fn: function (package_,aStream){
567
597
  var self=this;
568
- var $1;
569
- 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",["!"])]);
570
- $1=smalltalk.send(aStream,"_lf",[]);
571
- return self},
598
+ return smalltalk.withContext(function($ctx1) {
599
+ $1=aStream;
600
+ _st($1)._nextPutAll_(_st(_st(_st(_st("Smalltalk current createPackage: '").__comma(_st(package_)._name())).__comma("' properties: ")).__comma(_st(_st(package_)._properties())._storeString())).__comma("!"));
601
+ $2=_st($1)._lf();
602
+ return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{package_:package_,aStream:aStream}, smalltalk.ChunkExporter)})},
572
603
  args: ["package", "aStream"],
573
604
  source: "exportPackageDefinitionOf: package on: aStream\x0a\x09\x22Chunk format.\x22\x0a\x0a\x09aStream \x0a\x09 nextPutAll: 'Smalltalk current createPackage: ''', package name,\x0a\x09\x09''' properties: ', package properties storeString, '!'; lf.",
574
605
  messageSends: ["nextPutAll:", ",", "storeString", "properties", "name", "lf"],
@@ -581,33 +612,38 @@ smalltalk.addMethod(
581
612
  smalltalk.method({
582
613
  selector: "exportPackageExtensionsOf:on:",
583
614
  category: 'not yet classified',
584
- fn: function (package,aStream){
615
+ fn: function (package_,aStream){
585
616
  var self=this;
586
- var $1;
587
- var name;
588
- var map;
589
- name=smalltalk.send(package,"_name",[]);
590
- smalltalk.send(smalltalk.send((smalltalk.Package || Package),"_sortedClasses_",[smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk),"_current",[]),"_classes",[])]),"_do_",[(function(each){
591
- return smalltalk.send([each,smalltalk.send(each,"_class",[])],"_do_",[(function(aClass){
592
- map=smalltalk.send((smalltalk.Dictionary || Dictionary),"_new",[]);
617
+ var name,map;
618
+ return smalltalk.withContext(function($ctx1) {
619
+ name=_st(package_)._name();
620
+ $1=_st((smalltalk.Package || Package))._sortedClasses_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes());
621
+ $2=(function(each){
622
+ return smalltalk.withContext(function($ctx2) {
623
+ $4=(function(aClass){
624
+ return smalltalk.withContext(function($ctx3) {
593
625
  map;
594
- smalltalk.send(aClass,"_protocolsDo_",[(function(category,methods){
595
- $1=smalltalk.send(category,"_match_",[smalltalk.send("^\x5c*","__comma",[name])]);
596
- if(smalltalk.assert($1)){
597
- return smalltalk.send(map,"_at_put_",[category,methods]);
626
+ $5=aClass;
627
+ $6=(function(category,methods){
628
+ return smalltalk.withContext(function($ctx4) {
629
+ if(smalltalk.assert($7)){
630
+ return _st(map)._at_put_(category,methods);
598
631
  };
599
- })]);
600
- return smalltalk.send(smalltalk.send(smalltalk.send(map,"_keys",[]),"_sorted_",[(function(a,b){
601
- return smalltalk.send(a,"__lt_eq",[b]);
602
- })]),"_do_",[(function(category){
632
+ }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx1)})});
633
+ _st($5)._protocolsDo_($6);
634
+ return _st(_st(_st(map)._keys())._sorted_((function(a,b){
635
+ return smalltalk.withContext(function($ctx4) {
636
+ }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(category){
603
637
  var methods;
604
- methods=smalltalk.send(map,"_at_",[category]);
638
+ return smalltalk.withContext(function($ctx4) {
605
639
  methods;
606
- return smalltalk.send(self,"_exportMethods_category_of_on_",[methods,category,aClass,aStream]);
607
- })]);
608
- })]);
609
- })]);
610
- return self},
640
+ return _st(self)._exportMethods_category_of_on_(methods,category,aClass,aStream);
641
+ }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx1)})}));
642
+ }, function($ctx3) {$ctx3.fillBlock({aClass:aClass},$ctx1)})});
643
+ return _st($3)._do_($4);
644
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})});
645
+ _st($1)._do_($2);
646
+ return self}, function($ctx1) {$ctx1.fill(self,"exportPackageExtensionsOf:on:",{package_:package_,aStream:aStream,name:name,map:map}, smalltalk.ChunkExporter)})},
611
647
  args: ["package", "aStream"],
612
648
  source: "exportPackageExtensionsOf: package on: aStream\x0a\x09\x22We need to override this one too since we need to group\x0a\x09all methods in a given protocol under a leading methodsFor: chunk\x0a\x09for that class.\x22\x0a\x0a\x09\x22Issue #143: sort protocol alphabetically\x22\x0a\x0a\x09| name map |\x0a\x09name := package name.\x0a\x09(Package sortedClasses: Smalltalk current classes) do: [:each |\x0a\x09\x09{each. each class} do: [:aClass |\x0a\x09\x09\x09map := Dictionary new.\x0a\x09\x09\x09aClass protocolsDo: [:category :methods | \x0a\x09\x09\x09\x09(category match: '^\x5c*', name) ifTrue: [ map at: category put: methods ]].\x0a\x09\x09\x09(map keys sorted: [:a :b | a <= b ]) do: [:category | | methods |\x0a\x09\x09\x09\x09methods := map at: category.\x09\x0a\x09\x09\x09\x09self exportMethods: methods category: category of: aClass on: aStream ]]]",
613
649
  messageSends: ["name", "do:", "new", "protocolsDo:", "ifTrue:", "at:put:", "match:", ",", "at:", "exportMethods:category:of:on:", "sorted:", "<=", "keys", "class", "sortedClasses:", "classes", "current"],
@@ -625,21 +661,23 @@ selector: "exportDefinitionOf:on:",
625
661
  category: 'private',
626
662
  fn: function (aClass,aStream){
627
663
  var self=this;
628
- var $1,$2;
629
- smalltalk.send(aStream,"_nextPutAll_",["smalltalk.addClass("]);
630
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("'","__comma",[smalltalk.send(self,"_classNameFor_",[aClass])]),"__comma",["', "])]);
631
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("smalltalk.","__comma",[smalltalk.send(self,"_classNameFor_",[smalltalk.send(aClass,"_superclass",[])])])]);
632
- $1=smalltalk.send(aStream,"_nextPutAll_",[", ["]);
633
- smalltalk.send(smalltalk.send(aClass,"_instanceVariableNames",[]),"_do_separatedBy_",[(function(each){
634
- return smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("'","__comma",[each]),"__comma",["'"])]);
635
- }),(function(){
636
- return smalltalk.send(aStream,"_nextPutAll_",[", "]);
637
- })]);
638
- smalltalk.send(aStream,"_nextPutAll_",["], '"]);
639
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send(aClass,"_category",[]),"__comma",["'"])]);
640
- $2=smalltalk.send(aStream,"_nextPutAll_",[");"]);
641
- smalltalk.send(aStream,"_lf",[]);
642
- return self},
664
+ return smalltalk.withContext(function($ctx1) {
665
+ $1=aStream;
666
+ _st($1)._nextPutAll_("smalltalk.addClass(");
667
+ _st($1)._nextPutAll_(_st(_st("'").__comma(_st(self)._classNameFor_(aClass))).__comma("', "));
668
+ _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._superclass())));
669
+ $2=_st($1)._nextPutAll_(", [");
670
+ _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
671
+ return smalltalk.withContext(function($ctx2) {
672
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
673
+ return smalltalk.withContext(function($ctx2) {
674
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
675
+ $3=aStream;
676
+ _st($3)._nextPutAll_("], '");
677
+ _st($3)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
678
+ $4=_st($3)._nextPutAll_(");");
679
+ _st(aStream)._lf();
680
+ return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream}, smalltalk.StrippedExporter)})},
643
681
  args: ["aClass", "aStream"],
644
682
  source: "exportDefinitionOf: aClass on: aStream\x0a\x09aStream \x0a\x09 nextPutAll: 'smalltalk.addClass(';\x0a\x09 nextPutAll: '''', (self classNameFor: aClass), ''', ';\x0a\x09 nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);\x0a\x09 nextPutAll: ', ['.\x0a\x09aClass instanceVariableNames \x0a\x09 do: [:each | aStream nextPutAll: '''', each, '''']\x0a\x09 separatedBy: [aStream nextPutAll: ', '].\x0a\x09aStream\x09\x0a\x09 nextPutAll: '], ''';\x0a\x09 nextPutAll: aClass category, '''';\x0a\x09 nextPutAll: ');'.\x0a\x09aStream lf",
645
683
  messageSends: ["nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "lf"],
@@ -654,24 +692,25 @@ selector: "exportMethod:of:on:",
654
692
  category: 'private',
655
693
  fn: function (aMethod,aClass,aStream){
656
694
  var self=this;
657
- var $1;
658
- smalltalk.send(aStream,"_nextPutAll_",["smalltalk.addMethod("]);
659
- smalltalk.send(aStream,"_lf",[]);
660
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod,"_selector",[]),"_asSelector",[]),"_asJavascript",[]),"__comma",[","])]);
661
- smalltalk.send(aStream,"_lf",[]);
662
- smalltalk.send(aStream,"_nextPutAll_",["smalltalk.method({"]);
663
- smalltalk.send(aStream,"_lf",[]);
664
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send(smalltalk.send("selector: ","__comma",[smalltalk.send(smalltalk.send(aMethod,"_selector",[]),"_asJavascript",[])]),"__comma",[","])]);
665
- smalltalk.send(aStream,"_lf",[]);
666
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("fn: ","__comma",[smalltalk.send(smalltalk.send(aMethod,"_fn",[]),"_compiledSource",[])])]);
667
- smalltalk.send(aStream,"_lf",[]);
668
- smalltalk.send(aStream,"_nextPutAll_",["}),"]);
669
- smalltalk.send(aStream,"_lf",[]);
670
- smalltalk.send(aStream,"_nextPutAll_",[smalltalk.send("smalltalk.","__comma",[smalltalk.send(self,"_classNameFor_",[aClass])])]);
671
- smalltalk.send(aStream,"_nextPutAll_",[");"]);
672
- smalltalk.send(aStream,"_lf",[]);
673
- $1=smalltalk.send(aStream,"_lf",[]);
674
- return self},
695
+ return smalltalk.withContext(function($ctx1) {
696
+ $1=aStream;
697
+ _st($1)._nextPutAll_("smalltalk.addMethod(");
698
+ _st($1)._lf();
699
+ _st($1)._nextPutAll_(_st(_st(_st(_st(aMethod)._selector())._asSelector())._asJavascript()).__comma(","));
700
+ _st($1)._lf();
701
+ _st($1)._nextPutAll_("smalltalk.method({");
702
+ _st($1)._lf();
703
+ _st($1)._nextPutAll_(_st(_st("selector: ").__comma(_st(_st(aMethod)._selector())._asJavascript())).__comma(","));
704
+ _st($1)._lf();
705
+ _st($1)._nextPutAll_(_st("fn: ").__comma(_st(_st(aMethod)._fn())._compiledSource()));
706
+ _st($1)._lf();
707
+ _st($1)._nextPutAll_("}),");
708
+ _st($1)._lf();
709
+ _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(aClass)));
710
+ _st($1)._nextPutAll_(");");
711
+ _st($1)._lf();
712
+ $2=_st($1)._lf();
713
+ return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:of:on:",{aMethod:aMethod,aClass:aClass,aStream:aStream}, smalltalk.StrippedExporter)})},
675
714
  args: ["aMethod", "aClass", "aStream"],
676
715
  source: "exportMethod: aMethod of: aClass on: aStream\x0a\x09aStream \x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource;lf;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: 'smalltalk.', (self classNameFor: aClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
677
716
  messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "asSelector", "selector", "compiledSource", "fn", "classNameFor:"],
@@ -689,33 +728,35 @@ selector: "import:",
689
728
  category: 'fileIn',
690
729
  fn: function (aStream){
691
730
  var self=this;
692
- var $1;
693
- var chunk;
694
- var result;
695
- var parser;
696
- var lastEmpty;
697
- parser=smalltalk.send((smalltalk.ChunkParser || ChunkParser),"_on_",[aStream]);
731
+ var chunk,result,parser,lastEmpty;
732
+ return smalltalk.withContext(function($ctx1) {
733
+ parser=_st((smalltalk.ChunkParser || ChunkParser))._on_(aStream);
698
734
  lastEmpty=false;
699
- smalltalk.send((function(){
700
- chunk=smalltalk.send(parser,"_nextChunk",[]);
735
+ $1=(function(){
736
+ return smalltalk.withContext(function($ctx2) {
701
737
  chunk;
702
- return smalltalk.send(chunk,"_isNil",[]);
703
- }),"_whileFalse_",[(function(){
704
- $1=smalltalk.send(chunk,"_isEmpty",[]);
705
- if(smalltalk.assert($1)){
706
- lastEmpty=true;
738
+ return _st(chunk)._isNil();
739
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
740
+ $2=(function(){
741
+ return smalltalk.withContext(function($ctx2) {
742
+ $4=(function(){
743
+ return smalltalk.withContext(function($ctx3) {
707
744
  return lastEmpty;
708
- } else {
709
- result=smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler),"_new",[]),"_evaluateExpression_",[chunk]);
745
+ }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
746
+ $5=(function(){
747
+ return smalltalk.withContext(function($ctx3) {
710
748
  result;
711
- if(smalltalk.assert(lastEmpty)){
749
+ $6=lastEmpty;
750
+ if(smalltalk.assert($6)){
712
751
  lastEmpty=false;
713
752
  lastEmpty;
714
- return smalltalk.send(result,"_scanFrom_",[parser]);
715
- };
753
+ return _st(result)._scanFrom_(parser);
716
754
  };
717
- })]);
718
- return self},
755
+ }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
756
+ return _st($3)._ifTrue_ifFalse_($4,$5);
757
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
758
+ _st($1)._whileFalse_($2);
759
+ return self}, function($ctx1) {$ctx1.fill(self,"import:",{aStream:aStream,chunk:chunk,result:result,parser:parser,lastEmpty:lastEmpty}, smalltalk.Importer)})},
719
760
  args: ["aStream"],
720
761
  source: "import: aStream\x0a | chunk result parser lastEmpty |\x0a parser := ChunkParser on: aStream.\x0a lastEmpty := false.\x0a [chunk := parser nextChunk.\x0a chunk isNil] whileFalse: [\x0a chunk isEmpty\x0a \x09\x09ifTrue: [lastEmpty := true]\x0a \x09\x09ifFalse: [\x0a \x09\x09result := Compiler new evaluateExpression: chunk.\x0a \x09\x09lastEmpty \x0a \x09\x09\x09ifTrue: [\x0a \x09lastEmpty := false.\x0a \x09result scanFrom: parser]]]",
721
762
  messageSends: ["on:", "whileFalse:", "ifTrue:ifFalse:", "evaluateExpression:", "new", "ifTrue:", "scanFrom:", "isEmpty", "nextChunk", "isNil"],
@@ -730,22 +771,18 @@ smalltalk.addMethod(
730
771
  "_initializePackageNamed_prefix_",
731
772
  smalltalk.method({
732
773
  selector: "initializePackageNamed:prefix:",
733
- category: 'not yet classified',
774
+ category: 'laoding',
734
775
  fn: function (packageName,aString){
735
776
  var self=this;
736
- var $1,$2;
737
- smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Package || Package),"_named_",[packageName]),"_classes",[]),"_do_",[(function(each){
738
- smalltalk.init(each);
739
- ;
740
- return smalltalk.send(each,"_initialize",[]);
741
- })]);
742
- $1=smalltalk.send((smalltalk.Package || Package),"_named_",[packageName]);
743
- smalltalk.send($1,"_commitPathJs_",[smalltalk.send(smalltalk.send("/","__comma",[aString]),"__comma",["/js"])]);
744
- $2=smalltalk.send($1,"_commitPathSt_",[smalltalk.send(smalltalk.send("/","__comma",[aString]),"__comma",["/st"])]);
745
- return self},
777
+ return smalltalk.withContext(function($ctx1) {
778
+ $1=_st((smalltalk.Package || Package))._named_(packageName);
779
+ _st($1)._setupClasses();
780
+ _st($1)._commitPathJs_(_st(_st("/").__comma(aString)).__comma("/js"));
781
+ $2=_st($1)._commitPathSt_(_st(_st("/").__comma(aString)).__comma("/st"));
782
+ return self}, function($ctx1) {$ctx1.fill(self,"initializePackageNamed:prefix:",{packageName:packageName,aString:aString}, smalltalk.PackageLoader)})},
746
783
  args: ["packageName", "aString"],
747
- source: "initializePackageNamed: packageName prefix: aString\x0a\x0a\x09(Package named: packageName) classes do: [ :each |\x0a \x09<smalltalk.init(each)>.\x0a each initialize. ].\x0a \x0a (Package named: packageName) \x0a \x09commitPathJs: '/', aString, '/js';\x0a commitPathSt: '/', aString, '/st'",
748
- messageSends: ["do:", "initialize", "classes", "named:", "commitPathJs:", ",", "commitPathSt:"],
784
+ source: "initializePackageNamed: packageName prefix: aString\x0a\x0a\x09(Package named: packageName) \x0a \x09setupClasses;\x0a commitPathJs: '/', aString, '/js';\x0a commitPathSt: '/', aString, '/st'",
785
+ messageSends: ["setupClasses", "named:", "commitPathJs:", ",", "commitPathSt:"],
749
786
  referencedClasses: ["Package"]
750
787
  }),
751
788
  smalltalk.PackageLoader);
@@ -754,21 +791,28 @@ smalltalk.addMethod(
754
791
  "_loadPackage_prefix_",
755
792
  smalltalk.method({
756
793
  selector: "loadPackage:prefix:",
757
- category: 'not yet classified',
794
+ category: 'laoding',
758
795
  fn: function (packageName,aString){
759
796
  var self=this;
760
- var $1;
761
797
  var url;
762
- url=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send("/","__comma",[aString]),"__comma",["/js/"]),"__comma",[packageName]),"__comma",[".js"]);
763
- 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){
764
- $1=smalltalk.send(smalltalk.send(jqXHR,"_readyState",[]),"__eq",[(4)]);
765
- if(smalltalk.assert($1)){
766
- return smalltalk.send(self,"_initializePackageNamed_prefix_",[packageName,aString]);
798
+ return smalltalk.withContext(function($ctx1) {
799
+ url=_st(_st(_st(_st("/").__comma(aString)).__comma("/js/")).__comma(packageName)).__comma(".js");
800
+ $1=jQuery;
801
+ $2=url;
802
+ $4=_st("type").__minus_gt("GET");
803
+ $5=_st("dataType").__minus_gt("script");
804
+ $7=(function(jqXHR,textStatus){
805
+ return smalltalk.withContext(function($ctx2) {
806
+ if(smalltalk.assert($8)){
807
+ return _st(self)._initializePackageNamed_prefix_(packageName,aString);
767
808
  };
768
- })]),smalltalk.send("error","__minus_gt",[(function(){
769
- return smalltalk.send(window,"_alert_",[smalltalk.send("Could not load package at: ","__comma",[url])]);
770
- })])])]);
771
- return self},
809
+ }, function($ctx2) {$ctx2.fillBlock({jqXHR:jqXHR,textStatus:textStatus},$ctx1)})});
810
+ $6=_st("complete").__minus_gt($7);
811
+ $3=smalltalk.HashedCollection._fromPairs_([$4,$5,$6,_st("error").__minus_gt((function(){
812
+ return smalltalk.withContext(function($ctx2) {
813
+ }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]);
814
+ _st($1)._ajax_options_($2,$3);
815
+ return self}, function($ctx1) {$ctx1.fill(self,"loadPackage:prefix:",{packageName:packageName,aString:aString,url:url}, smalltalk.PackageLoader)})},
772
816
  args: ["packageName", "aString"],
773
817
  source: "loadPackage: packageName prefix: aString\x09\x0a\x09| url |\x0a url := '/', aString, '/js/', packageName, '.js'.\x0a\x09jQuery \x0a\x09\x09ajax: url\x0a options: #{\x0a\x09\x09\x09'type' -> 'GET'.\x0a\x09\x09\x09'dataType' -> 'script'.\x0a \x09\x09'complete' -> [ :jqXHR :textStatus | \x0a\x09\x09\x09\x09jqXHR readyState = 4 \x0a \x09ifTrue: [ self initializePackageNamed: packageName prefix: aString ] ].\x0a\x09\x09\x09'error' -> [ window alert: 'Could not load package at: ', url ]\x0a\x09\x09}",
774
818
  messageSends: [",", "ajax:options:", "->", "ifTrue:", "initializePackageNamed:prefix:", "=", "readyState", "alert:"],
@@ -780,13 +824,13 @@ smalltalk.addMethod(
780
824
  "_loadPackages_prefix_",
781
825
  smalltalk.method({
782
826
  selector: "loadPackages:prefix:",
783
- category: 'not yet classified',
827
+ category: 'laoding',
784
828
  fn: function (aCollection,aString){
785
829
  var self=this;
786
- smalltalk.send(aCollection,"_do_",[(function(each){
787
- return smalltalk.send(self,"_loadPackage_prefix_",[each,aString]);
788
- })]);
789
- return self},
830
+ return smalltalk.withContext(function($ctx1) {
831
+ return smalltalk.withContext(function($ctx2) {
832
+ }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
833
+ return self}, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString}, smalltalk.PackageLoader)})},
790
834
  args: ["aCollection", "aString"],
791
835
  source: "loadPackages: aCollection prefix: aString\x0a\x09aCollection do: [ :each |\x0a \x09self loadPackage: each prefix: aString ]",
792
836
  messageSends: ["do:", "loadPackage:prefix:"],
@@ -802,10 +846,10 @@ selector: "loadPackages:prefix:",
802
846
  category: 'not yet classified',
803
847
  fn: function (aCollection,aString){
804
848
  var self=this;
805
- var $1;
806
- $1=smalltalk.send(smalltalk.send(self,"_new",[]),"_loadPackages_prefix_",[aCollection,aString]);
849
+ return smalltalk.withContext(function($ctx1) {
850
+ $1=_st(_st(self)._new())._loadPackages_prefix_(aCollection,aString);
807
851
  return $1;
808
- },
852
+ }, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString}, smalltalk.PackageLoader.klass)})},
809
853
  args: ["aCollection", "aString"],
810
854
  source: "loadPackages: aCollection prefix: aString\x0a\x09^ self new loadPackages: aCollection prefix: aString",
811
855
  messageSends: ["loadPackages:prefix:", "new"],