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
@@ -7,34 +7,35 @@ selector: "nextChunk",
|
|
7
7
|
category: 'reading',
|
8
8
|
fn: function (){
|
9
9
|
var self=this;
|
10
|
-
var
|
10
|
+
var char,result,chunk;
|
11
|
+
return smalltalk.withContext(function($ctx1) {
|
11
12
|
var $early={};
|
12
13
|
try {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
return smalltalk.
|
21
|
-
|
22
|
-
|
23
|
-
if(smalltalk.assert($
|
24
|
-
|
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
|
-
$
|
29
|
-
throw $early=[$
|
27
|
+
$6=_st(_st(result)._contents())._trimBoth();
|
28
|
+
throw $early=[$6];
|
30
29
|
};
|
31
|
-
};
|
32
|
-
|
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
|
-
|
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
|
-
|
70
|
-
$1=
|
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
|
-
|
90
|
-
$2=
|
91
|
-
|
92
|
-
|
93
|
-
}
|
94
|
-
$
|
95
|
-
|
96
|
-
$
|
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
|
-
|
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
|
-
|
118
|
-
$1=
|
119
|
-
return smalltalk.
|
120
|
-
return smalltalk.
|
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
|
-
|
140
|
-
$1=
|
141
|
-
smalltalk.
|
142
|
-
|
143
|
-
|
144
|
-
return
|
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
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
$1
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
$
|
175
|
-
$3
|
176
|
-
|
177
|
-
|
178
|
-
smalltalk.
|
179
|
-
|
180
|
-
|
181
|
-
$
|
182
|
-
$
|
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
|
-
|
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
|
-
|
201
|
-
$1=
|
206
|
+
return smalltalk.withContext(function($ctx1) {
|
207
|
+
$1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
|
202
208
|
if(! smalltalk.assert($1)){
|
203
|
-
|
204
|
-
$2
|
205
|
-
$2;
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
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
|
-
|
229
|
-
|
230
|
-
smalltalk.
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
smalltalk.
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
$1
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
$
|
255
|
-
|
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
|
-
|
271
|
-
|
272
|
-
return smalltalk.
|
273
|
-
}
|
274
|
-
$
|
275
|
-
|
276
|
-
|
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
|
-
|
280
|
-
|
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
|
296
|
-
|
297
|
-
$1=
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
return smalltalk.
|
303
|
-
})
|
304
|
-
return
|
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 (
|
331
|
+
fn: function (package_,aStream){
|
321
332
|
var self=this;
|
322
|
-
|
323
|
-
|
324
|
-
$1
|
325
|
-
|
326
|
-
|
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 (
|
351
|
+
fn: function (package_,aStream){
|
340
352
|
var self=this;
|
341
|
-
var $1;
|
342
353
|
var name;
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
return smalltalk.
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
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
|
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
|
-
|
375
|
-
$1=
|
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
|
-
|
393
|
-
$2=
|
394
|
-
|
395
|
-
|
396
|
-
}
|
397
|
-
$
|
398
|
-
|
399
|
-
$
|
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
|
-
|
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
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
$1
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
$
|
434
|
-
$3
|
435
|
-
|
436
|
-
|
437
|
-
smalltalk.
|
438
|
-
|
439
|
-
$
|
440
|
-
$
|
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
|
-
|
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
|
-
|
459
|
-
$1=
|
481
|
+
return smalltalk.withContext(function($ctx1) {
|
482
|
+
$1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
|
460
483
|
if(! smalltalk.assert($1)){
|
461
|
-
|
462
|
-
$2
|
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
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
$1
|
495
|
-
|
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
|
-
|
511
|
-
|
512
|
-
$1
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
$
|
521
|
-
|
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
|
-
|
539
|
-
smalltalk.
|
540
|
-
$1=
|
541
|
-
|
542
|
-
return smalltalk.
|
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
|
-
|
546
|
-
|
547
|
-
|
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
|
-
|
579
|
+
return smalltalk.withContext(function($ctx2) {
|
550
580
|
methods;
|
551
|
-
return
|
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 (
|
596
|
+
fn: function (package_,aStream){
|
567
597
|
var self=this;
|
568
|
-
|
569
|
-
|
570
|
-
$1
|
571
|
-
|
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 (
|
615
|
+
fn: function (package_,aStream){
|
585
616
|
var self=this;
|
586
|
-
var
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
return smalltalk.
|
592
|
-
|
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
|
-
|
595
|
-
$
|
596
|
-
|
597
|
-
|
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
|
-
|
601
|
-
return
|
602
|
-
|
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
|
-
|
638
|
+
return smalltalk.withContext(function($ctx4) {
|
605
639
|
methods;
|
606
|
-
return
|
607
|
-
})
|
608
|
-
})
|
609
|
-
|
610
|
-
|
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
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
$1
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
$
|
641
|
-
|
642
|
-
|
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
|
-
|
658
|
-
|
659
|
-
smalltalk.
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
smalltalk.
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
$1
|
674
|
-
|
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
|
693
|
-
|
694
|
-
|
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
|
-
|
700
|
-
|
735
|
+
$1=(function(){
|
736
|
+
return smalltalk.withContext(function($ctx2) {
|
701
737
|
chunk;
|
702
|
-
return
|
703
|
-
}
|
704
|
-
$
|
705
|
-
|
706
|
-
|
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
|
-
}
|
709
|
-
|
745
|
+
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
|
746
|
+
$5=(function(){
|
747
|
+
return smalltalk.withContext(function($ctx3) {
|
710
748
|
result;
|
711
|
-
|
749
|
+
$6=lastEmpty;
|
750
|
+
if(smalltalk.assert($6)){
|
712
751
|
lastEmpty=false;
|
713
752
|
lastEmpty;
|
714
|
-
return
|
715
|
-
};
|
753
|
+
return _st(result)._scanFrom_(parser);
|
716
754
|
};
|
717
|
-
})
|
718
|
-
return
|
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: '
|
774
|
+
category: 'laoding',
|
734
775
|
fn: function (packageName,aString){
|
735
776
|
var self=this;
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
;
|
740
|
-
|
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)
|
748
|
-
messageSends: ["
|
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: '
|
794
|
+
category: 'laoding',
|
758
795
|
fn: function (packageName,aString){
|
759
796
|
var self=this;
|
760
|
-
var $1;
|
761
797
|
var url;
|
762
|
-
|
763
|
-
|
764
|
-
$1=
|
765
|
-
|
766
|
-
|
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
|
-
})
|
769
|
-
|
770
|
-
|
771
|
-
return
|
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: '
|
827
|
+
category: 'laoding',
|
784
828
|
fn: function (aCollection,aString){
|
785
829
|
var self=this;
|
786
|
-
smalltalk.
|
787
|
-
return smalltalk.
|
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
|
-
|
806
|
-
$1=
|
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"],
|