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.
- data/amber/bin/amberc +10 -350
- data/amber/js/Benchfib.deploy.js +80 -89
- data/amber/js/Benchfib.js +80 -89
- data/amber/js/Canvas.deploy.js +558 -545
- data/amber/js/Canvas.js +563 -545
- data/amber/js/Compiler-AST.deploy.js +431 -243
- data/amber/js/Compiler-AST.js +487 -244
- data/amber/js/Compiler-Core.deploy.js +201 -1045
- data/amber/js/Compiler-Core.js +208 -1207
- data/amber/js/Compiler-Exceptions.deploy.js +37 -18
- data/amber/js/Compiler-Exceptions.js +42 -18
- data/amber/js/Compiler-IR.deploy.js +1071 -774
- data/amber/js/Compiler-IR.js +1194 -848
- data/amber/js/Compiler-Inlining.deploy.js +395 -373
- data/amber/js/Compiler-Inlining.js +395 -373
- data/amber/js/Compiler-Interpreter.deploy.js +1202 -0
- data/amber/js/Compiler-Interpreter.js +1631 -0
- data/amber/js/Compiler-Semantic.deploy.js +695 -600
- data/amber/js/Compiler-Semantic.js +721 -611
- data/amber/js/Compiler-Tests.deploy.js +699 -376
- data/amber/js/Compiler-Tests.js +834 -381
- data/amber/js/Compiler.deploy.js +8563 -1805
- data/amber/js/Compiler.js +11476 -2633
- data/amber/js/Examples.deploy.js +29 -29
- data/amber/js/Examples.js +29 -29
- data/amber/js/IDE.deploy.js +3292 -2649
- data/amber/js/IDE.js +3318 -2710
- data/amber/js/Importer-Exporter.deploy.js +393 -349
- data/amber/js/Importer-Exporter.js +398 -354
- data/amber/js/Kernel-Announcements.deploy.js +53 -44
- data/amber/js/Kernel-Announcements.js +55 -44
- data/amber/js/Kernel-Classes.deploy.js +566 -368
- data/amber/js/Kernel-Classes.js +660 -402
- data/amber/js/Kernel-Collections.deploy.js +1149 -1098
- data/amber/js/Kernel-Collections.js +1183 -1116
- data/amber/js/Kernel-Exceptions.deploy.js +173 -75
- data/amber/js/Kernel-Exceptions.js +215 -77
- data/amber/js/Kernel-Methods.deploy.js +530 -313
- data/amber/js/Kernel-Methods.js +632 -338
- data/amber/js/Kernel-Objects.deploy.js +1734 -1577
- data/amber/js/Kernel-Objects.js +1867 -1654
- data/amber/js/Kernel-Tests.deploy.js +1416 -973
- data/amber/js/Kernel-Tests.js +1495 -981
- data/amber/js/Kernel-Transcript.deploy.js +23 -24
- data/amber/js/Kernel-Transcript.js +25 -26
- data/amber/js/SUnit-Tests.deploy.js +402 -0
- data/amber/js/SUnit-Tests.js +518 -0
- data/amber/js/SUnit.deploy.js +535 -237
- data/amber/js/SUnit.js +634 -246
- data/amber/js/amber.js +90 -53
- data/amber/js/boot.js +441 -255
- data/amber/js/init.js +1 -3
- data/amber/js/lib/CodeMirror/codemirror.css +3 -0
- data/amber/js/lib/CodeMirror/codemirror.js +104 -55
- data/amber/js/lib/peg-0.7.0.min.js +9 -0
- data/amber/js/parser.js +1504 -802
- data/amber/js/parser.pegjs +170 -165
- data/amber/st/Canvas.st +6 -0
- data/amber/st/Compiler-AST.st +54 -3
- data/amber/st/Compiler-Core.st +6 -551
- data/amber/st/Compiler-Exceptions.st +4 -0
- data/amber/st/Compiler-IR.st +205 -87
- data/amber/st/Compiler-Interpreter.st +597 -0
- data/amber/st/Compiler-Semantic.st +46 -21
- data/amber/st/Compiler-Tests.st +254 -7
- data/amber/st/Compiler.st +3172 -1541
- data/amber/st/IDE.st +57 -93
- data/amber/st/Importer-Exporter.st +4 -7
- data/amber/st/Kernel-Announcements.st +8 -0
- data/amber/st/Kernel-Classes.st +149 -40
- data/amber/st/Kernel-Collections.st +43 -32
- data/amber/st/Kernel-Exceptions.st +70 -1
- data/amber/st/Kernel-Methods.st +165 -27
- data/amber/st/Kernel-Objects.st +215 -140
- data/amber/st/Kernel-Tests.st +195 -10
- data/amber/st/Kernel-Transcript.st +1 -3
- data/amber/st/SUnit-Tests.st +186 -0
- data/amber/st/SUnit.st +186 -14
- data/bin/resin +6 -0
- data/lib/resin/cli.rb +19 -0
- metadata +41 -25
- data/amber/js/lib/peg-0.6.2.min.js +0 -2
- data/bin/resin-compile +0 -6
- 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
|
9
|
+
var char,result,chunk;
|
10
|
+
return smalltalk.withContext(function($ctx1) {
|
10
11
|
var $early={};
|
11
12
|
try {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
return smalltalk.
|
20
|
-
|
21
|
-
|
22
|
-
if(smalltalk.assert($
|
23
|
-
|
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
|
-
$
|
28
|
-
throw $early=[$
|
26
|
+
$6=_st(_st(result)._contents())._trimBoth();
|
27
|
+
throw $early=[$6];
|
29
28
|
};
|
30
|
-
};
|
31
|
-
|
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
|
-
|
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
|
-
|
59
|
-
$1=
|
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
|
-
|
74
|
-
$2=
|
75
|
-
|
76
|
-
|
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
|
-
|
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
|
-
|
97
|
-
$1=
|
98
|
-
return smalltalk.
|
99
|
-
return smalltalk.
|
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
|
-
|
114
|
-
$1=
|
115
|
-
smalltalk.
|
116
|
-
|
117
|
-
|
118
|
-
return
|
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
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
$1
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
$
|
144
|
-
$3
|
145
|
-
|
146
|
-
|
147
|
-
smalltalk.
|
148
|
-
|
149
|
-
|
150
|
-
$
|
151
|
-
$
|
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
|
-
|
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
|
-
|
165
|
-
$1=
|
170
|
+
return smalltalk.withContext(function($ctx1) {
|
171
|
+
$1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
|
166
172
|
if(! smalltalk.assert($1)){
|
167
|
-
|
168
|
-
$2
|
169
|
-
$2;
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
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
|
-
|
188
|
-
|
189
|
-
smalltalk.
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
smalltalk.
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
$1
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
$
|
214
|
-
|
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
|
-
|
225
|
-
|
226
|
-
return smalltalk.
|
227
|
-
}
|
228
|
-
$
|
229
|
-
|
230
|
-
|
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
|
-
|
234
|
-
|
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
|
245
|
-
|
246
|
-
$1=
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
return smalltalk.
|
252
|
-
})
|
253
|
-
return
|
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 (
|
275
|
+
fn: function (package_,aStream){
|
265
276
|
var self=this;
|
266
|
-
|
267
|
-
|
268
|
-
$1
|
269
|
-
|
270
|
-
|
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 (
|
290
|
+
fn: function (package_,aStream){
|
279
291
|
var self=this;
|
280
|
-
var $1;
|
281
292
|
var name;
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
return smalltalk.
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
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
|
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
|
-
|
309
|
-
$1=
|
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
|
-
|
322
|
-
$2=
|
323
|
-
|
324
|
-
|
325
|
-
}
|
326
|
-
$
|
327
|
-
|
328
|
-
$
|
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
|
-
|
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
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
$1
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
$
|
358
|
-
$3
|
359
|
-
|
360
|
-
|
361
|
-
smalltalk.
|
362
|
-
|
363
|
-
$
|
364
|
-
$
|
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
|
-
|
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
|
-
|
378
|
-
$1=
|
400
|
+
return smalltalk.withContext(function($ctx1) {
|
401
|
+
$1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
|
379
402
|
if(! smalltalk.assert($1)){
|
380
|
-
|
381
|
-
$2
|
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
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
$1
|
409
|
-
|
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
|
-
|
420
|
-
|
421
|
-
$1
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
$
|
430
|
-
|
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
|
-
|
443
|
-
smalltalk.
|
444
|
-
$1=
|
445
|
-
|
446
|
-
return smalltalk.
|
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
|
-
|
450
|
-
|
451
|
-
|
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
|
-
|
483
|
+
return smalltalk.withContext(function($ctx2) {
|
454
484
|
methods;
|
455
|
-
return
|
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 (
|
495
|
+
fn: function (package_,aStream){
|
466
496
|
var self=this;
|
467
|
-
|
468
|
-
|
469
|
-
$1
|
470
|
-
|
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 (
|
509
|
+
fn: function (package_,aStream){
|
479
510
|
var self=this;
|
480
|
-
var
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
return smalltalk.
|
486
|
-
|
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
|
-
|
489
|
-
$
|
490
|
-
|
491
|
-
|
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
|
-
|
495
|
-
return
|
496
|
-
|
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
|
-
|
532
|
+
return smalltalk.withContext(function($ctx4) {
|
499
533
|
methods;
|
500
|
-
return
|
501
|
-
})
|
502
|
-
})
|
503
|
-
|
504
|
-
|
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
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
$1
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
$
|
530
|
-
|
531
|
-
|
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
|
-
|
542
|
-
|
543
|
-
smalltalk.
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
smalltalk.
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
$1
|
558
|
-
|
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
|
572
|
-
|
573
|
-
|
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
|
-
|
579
|
-
|
614
|
+
$1=(function(){
|
615
|
+
return smalltalk.withContext(function($ctx2) {
|
580
616
|
chunk;
|
581
|
-
return
|
582
|
-
}
|
583
|
-
$
|
584
|
-
|
585
|
-
|
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
|
-
}
|
588
|
-
|
624
|
+
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
|
625
|
+
$5=(function(){
|
626
|
+
return smalltalk.withContext(function($ctx3) {
|
589
627
|
result;
|
590
|
-
|
628
|
+
$6=lastEmpty;
|
629
|
+
if(smalltalk.assert($6)){
|
591
630
|
lastEmpty=false;
|
592
631
|
lastEmpty;
|
593
|
-
return
|
632
|
+
return _st(result)._scanFrom_(parser);
|
594
633
|
};
|
595
|
-
};
|
596
|
-
|
597
|
-
|
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
|
-
|
611
|
-
|
612
|
-
|
613
|
-
;
|
614
|
-
|
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
|
-
|
632
|
-
|
633
|
-
$1=
|
634
|
-
|
635
|
-
|
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
|
-
})
|
638
|
-
|
639
|
-
|
640
|
-
return
|
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.
|
651
|
-
return smalltalk.
|
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
|
-
|
665
|
-
$1=
|
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
|
|