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
data/amber/js/Kernel-Classes.js
CHANGED
@@ -8,18 +8,17 @@ selector: "addCompiledMethod:",
|
|
8
8
|
category: 'compiling',
|
9
9
|
fn: function (aMethod){
|
10
10
|
var self=this;
|
11
|
-
|
12
|
-
|
13
|
-
;
|
14
|
-
$1
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
return self},
|
11
|
+
return smalltalk.withContext(function($ctx1) {
|
12
|
+
_st(self)._basicAddCompiledMethod_(aMethod);
|
13
|
+
$1=_st((smalltalk.MethodAdded || MethodAdded))._new();
|
14
|
+
_st($1)._theClass_(self);
|
15
|
+
_st($1)._method_(aMethod);
|
16
|
+
$2=_st($1)._yourself();
|
17
|
+
_st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
|
18
|
+
return self}, function($ctx1) {$ctx1.fill(self,"addCompiledMethod:",{aMethod:aMethod}, smalltalk.Behavior)})},
|
20
19
|
args: ["aMethod"],
|
21
|
-
source: "addCompiledMethod: aMethod\x0a\
|
22
|
-
messageSends: ["announce:", "theClass:", "new", "method:", "yourself", "current"],
|
20
|
+
source: "addCompiledMethod: aMethod\x0a\x09self basicAddCompiledMethod: aMethod.\x0a \x0a SystemAnnouncer current\x0a \x09\x09announce: (MethodAdded new\x0a \x09theClass: self;\x0a method: aMethod;\x0a yourself)",
|
21
|
+
messageSends: ["basicAddCompiledMethod:", "announce:", "theClass:", "new", "method:", "yourself", "current"],
|
23
22
|
referencedClasses: ["MethodAdded", "SystemAnnouncer"]
|
24
23
|
}),
|
25
24
|
smalltalk.Behavior);
|
@@ -31,17 +30,18 @@ selector: "allInstanceVariableNames",
|
|
31
30
|
category: 'accessing',
|
32
31
|
fn: function (){
|
33
32
|
var self=this;
|
34
|
-
var $1;
|
35
33
|
var result;
|
36
|
-
|
37
|
-
|
34
|
+
return smalltalk.withContext(function($ctx1) {
|
35
|
+
result=_st(_st(self)._instanceVariableNames())._copy();
|
36
|
+
$1=_st(self)._superclass();
|
38
37
|
if(($receiver = $1) == nil || $receiver == undefined){
|
39
38
|
$1;
|
40
39
|
} else {
|
41
|
-
|
40
|
+
_st(result)._addAll_(_st(_st(self)._superclass())._allInstanceVariableNames());
|
42
41
|
};
|
43
|
-
|
44
|
-
|
42
|
+
$2=result;
|
43
|
+
return $2;
|
44
|
+
}, function($ctx1) {$ctx1.fill(self,"allInstanceVariableNames",{result:result}, smalltalk.Behavior)})},
|
45
45
|
args: [],
|
46
46
|
source: "allInstanceVariableNames\x0a\x09| result |\x0a\x09result := self instanceVariableNames copy.\x0a\x09self superclass ifNotNil: [\x0a\x09 result addAll: self superclass allInstanceVariableNames].\x0a\x09^result",
|
47
47
|
messageSends: ["copy", "instanceVariableNames", "ifNotNil:", "addAll:", "allInstanceVariableNames", "superclass"],
|
@@ -57,12 +57,14 @@ category: 'accessing',
|
|
57
57
|
fn: function (){
|
58
58
|
var self=this;
|
59
59
|
var result;
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
60
|
+
return smalltalk.withContext(function($ctx1) {
|
61
|
+
result=_st(self)._subclasses();
|
62
|
+
_st(_st(self)._subclasses())._do_((function(each){
|
63
|
+
return smalltalk.withContext(function($ctx2) {
|
64
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
65
|
+
$1=result;
|
66
|
+
return $1;
|
67
|
+
}, function($ctx1) {$ctx1.fill(self,"allSubclasses",{result:result}, smalltalk.Behavior)})},
|
66
68
|
args: [],
|
67
69
|
source: "allSubclasses\x0a\x09| result |\x0a\x09result := self subclasses.\x0a\x09self subclasses do: [:each |\x0a\x09 result addAll: each allSubclasses].\x0a\x09^result",
|
68
70
|
messageSends: ["subclasses", "do:", "addAll:", "allSubclasses"],
|
@@ -77,19 +79,19 @@ selector: "allSuperclasses",
|
|
77
79
|
category: 'accessing',
|
78
80
|
fn: function (){
|
79
81
|
var self=this;
|
80
|
-
|
81
|
-
$1=
|
82
|
+
return smalltalk.withContext(function($ctx1) {
|
83
|
+
$1=_st(self)._superclass();
|
82
84
|
if(($receiver = $1) == nil || $receiver == undefined){
|
83
85
|
return [];
|
84
86
|
} else {
|
85
87
|
$1;
|
86
88
|
};
|
87
|
-
$3=
|
88
|
-
|
89
|
-
$4=
|
89
|
+
$3=_st((smalltalk.OrderedCollection || OrderedCollection))._with_(_st(self)._superclass());
|
90
|
+
_st($3)._addAll_(_st(_st(self)._superclass())._allSuperclasses());
|
91
|
+
$4=_st($3)._yourself();
|
90
92
|
$2=$4;
|
91
93
|
return $2;
|
92
|
-
},
|
94
|
+
}, function($ctx1) {$ctx1.fill(self,"allSuperclasses",{}, smalltalk.Behavior)})},
|
93
95
|
args: [],
|
94
96
|
source: "allSuperclasses\x0a\x09\x0a self superclass ifNil: [ ^ #() ].\x0a \x0a\x09^ (OrderedCollection with: self superclass) \x0a \x09addAll: self superclass allSuperclasses;\x0a yourself",
|
95
97
|
messageSends: ["ifNil:", "superclass", "addAll:", "allSuperclasses", "with:", "yourself"],
|
@@ -97,6 +99,22 @@ referencedClasses: ["OrderedCollection"]
|
|
97
99
|
}),
|
98
100
|
smalltalk.Behavior);
|
99
101
|
|
102
|
+
smalltalk.addMethod(
|
103
|
+
"_basicAddCompiledMethod_",
|
104
|
+
smalltalk.method({
|
105
|
+
selector: "basicAddCompiledMethod:",
|
106
|
+
category: 'private',
|
107
|
+
fn: function (aMethod){
|
108
|
+
var self=this;
|
109
|
+
return smalltalk.withContext(function($ctx1) {
|
110
|
+
return self}, function($ctx1) {$ctx1.fill(self,"basicAddCompiledMethod:",{aMethod:aMethod}, smalltalk.Behavior)})},
|
111
|
+
args: ["aMethod"],
|
112
|
+
source: "basicAddCompiledMethod: aMethod\x0a\x09<smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self)>",
|
113
|
+
messageSends: [],
|
114
|
+
referencedClasses: []
|
115
|
+
}),
|
116
|
+
smalltalk.Behavior);
|
117
|
+
|
100
118
|
smalltalk.addMethod(
|
101
119
|
"_basicNew",
|
102
120
|
smalltalk.method({
|
@@ -104,9 +122,8 @@ selector: "basicNew",
|
|
104
122
|
category: 'instance creation',
|
105
123
|
fn: function (){
|
106
124
|
var self=this;
|
107
|
-
return
|
108
|
-
|
109
|
-
return self},
|
125
|
+
return smalltalk.withContext(function($ctx1) {
|
126
|
+
return self}, function($ctx1) {$ctx1.fill(self,"basicNew",{}, smalltalk.Behavior)})},
|
110
127
|
args: [],
|
111
128
|
source: "basicNew\x0a\x09<return new self.fn()>",
|
112
129
|
messageSends: [],
|
@@ -114,6 +131,25 @@ referencedClasses: []
|
|
114
131
|
}),
|
115
132
|
smalltalk.Behavior);
|
116
133
|
|
134
|
+
smalltalk.addMethod(
|
135
|
+
"_basicRemoveCompiledMethod_",
|
136
|
+
smalltalk.method({
|
137
|
+
selector: "basicRemoveCompiledMethod:",
|
138
|
+
category: 'private',
|
139
|
+
fn: function (aMethod){
|
140
|
+
var self=this;
|
141
|
+
return smalltalk.withContext(function($ctx1) {
|
142
|
+
smalltalk.removeMethod(aMethod)
|
143
|
+
smalltalk.init(self);
|
144
|
+
;
|
145
|
+
return self}, function($ctx1) {$ctx1.fill(self,"basicRemoveCompiledMethod:",{aMethod:aMethod}, smalltalk.Behavior)})},
|
146
|
+
args: ["aMethod"],
|
147
|
+
source: "basicRemoveCompiledMethod: aMethod\x0a\x09<\x0a \x09smalltalk.removeMethod(aMethod)\x0a\x09\x09smalltalk.init(self);\x0a >",
|
148
|
+
messageSends: [],
|
149
|
+
referencedClasses: []
|
150
|
+
}),
|
151
|
+
smalltalk.Behavior);
|
152
|
+
|
117
153
|
smalltalk.addMethod(
|
118
154
|
"_canUnderstand_",
|
119
155
|
smalltalk.method({
|
@@ -121,14 +157,14 @@ selector: "canUnderstand:",
|
|
121
157
|
category: 'testing',
|
122
158
|
fn: function (aSelector){
|
123
159
|
var self=this;
|
124
|
-
|
125
|
-
$1=
|
126
|
-
return smalltalk.
|
127
|
-
return smalltalk.
|
128
|
-
})
|
129
|
-
})
|
160
|
+
return smalltalk.withContext(function($ctx1) {
|
161
|
+
$1=_st(_st(_st(_st(self)._methodDictionary())._keys())._includes_(_st(aSelector)._asString()))._or_((function(){
|
162
|
+
return smalltalk.withContext(function($ctx2) {
|
163
|
+
return smalltalk.withContext(function($ctx3) {
|
164
|
+
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
|
165
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
130
166
|
return $1;
|
131
|
-
},
|
167
|
+
}, function($ctx1) {$ctx1.fill(self,"canUnderstand:",{aSelector:aSelector}, smalltalk.Behavior)})},
|
132
168
|
args: ["aSelector"],
|
133
169
|
source: "canUnderstand: aSelector\x0a\x09^(self methodDictionary keys includes: aSelector asString) or: [\x0a\x09\x09self superclass notNil and: [self superclass canUnderstand: aSelector]]",
|
134
170
|
messageSends: ["or:", "and:", "canUnderstand:", "superclass", "notNil", "includes:", "asString", "keys", "methodDictionary"],
|
@@ -143,15 +179,15 @@ selector: "comment",
|
|
143
179
|
category: 'accessing',
|
144
180
|
fn: function (){
|
145
181
|
var self=this;
|
146
|
-
|
147
|
-
$2=
|
182
|
+
return smalltalk.withContext(function($ctx1) {
|
183
|
+
$2=_st(self)._basicAt_("comment");
|
148
184
|
if(($receiver = $2) == nil || $receiver == undefined){
|
149
185
|
$1="";
|
150
186
|
} else {
|
151
187
|
$1=$2;
|
152
188
|
};
|
153
189
|
return $1;
|
154
|
-
},
|
190
|
+
}, function($ctx1) {$ctx1.fill(self,"comment",{}, smalltalk.Behavior)})},
|
155
191
|
args: [],
|
156
192
|
source: "comment\x0a ^(self basicAt: 'comment') ifNil: ['']",
|
157
193
|
messageSends: ["ifNil:", "basicAt:"],
|
@@ -166,13 +202,13 @@ selector: "comment:",
|
|
166
202
|
category: 'accessing',
|
167
203
|
fn: function (aString){
|
168
204
|
var self=this;
|
169
|
-
|
170
|
-
|
171
|
-
$1=
|
172
|
-
|
173
|
-
$2=
|
174
|
-
|
175
|
-
return self},
|
205
|
+
return smalltalk.withContext(function($ctx1) {
|
206
|
+
_st(self)._basicAt_put_("comment",aString);
|
207
|
+
$1=_st((smalltalk.ClassCommentChanged || ClassCommentChanged))._new();
|
208
|
+
_st($1)._theClass_(self);
|
209
|
+
$2=_st($1)._yourself();
|
210
|
+
_st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
|
211
|
+
return self}, function($ctx1) {$ctx1.fill(self,"comment:",{aString:aString}, smalltalk.Behavior)})},
|
176
212
|
args: ["aString"],
|
177
213
|
source: "comment: aString\x0a self basicAt: 'comment' put: aString.\x0a SystemAnnouncer current\x0a \x09announce: (ClassCommentChanged new\x0a \x09theClass: self;\x0a yourself)",
|
178
214
|
messageSends: ["basicAt:put:", "announce:", "theClass:", "new", "yourself", "current"],
|
@@ -187,13 +223,13 @@ selector: "commentStamp",
|
|
187
223
|
category: 'accessing',
|
188
224
|
fn: function (){
|
189
225
|
var self=this;
|
190
|
-
|
191
|
-
$2=
|
192
|
-
|
193
|
-
$3=
|
226
|
+
return smalltalk.withContext(function($ctx1) {
|
227
|
+
$2=_st((smalltalk.ClassCommentReader || ClassCommentReader))._new();
|
228
|
+
_st($2)._class_(self);
|
229
|
+
$3=_st($2)._yourself();
|
194
230
|
$1=$3;
|
195
231
|
return $1;
|
196
|
-
},
|
232
|
+
}, function($ctx1) {$ctx1.fill(self,"commentStamp",{}, smalltalk.Behavior)})},
|
197
233
|
args: [],
|
198
234
|
source: "commentStamp\x0a ^ClassCommentReader new\x0a\x09class: self;\x0a\x09yourself",
|
199
235
|
messageSends: ["class:", "new", "yourself"],
|
@@ -208,10 +244,10 @@ selector: "commentStamp:prior:",
|
|
208
244
|
category: 'accessing',
|
209
245
|
fn: function (aStamp,prior){
|
210
246
|
var self=this;
|
211
|
-
|
212
|
-
$1=
|
247
|
+
return smalltalk.withContext(function($ctx1) {
|
248
|
+
$1=_st(self)._commentStamp();
|
213
249
|
return $1;
|
214
|
-
},
|
250
|
+
}, function($ctx1) {$ctx1.fill(self,"commentStamp:prior:",{aStamp:aStamp,prior:prior}, smalltalk.Behavior)})},
|
215
251
|
args: ["aStamp", "prior"],
|
216
252
|
source: "commentStamp: aStamp prior: prior\x0a ^self commentStamp",
|
217
253
|
messageSends: ["commentStamp"],
|
@@ -226,8 +262,8 @@ selector: "compile:",
|
|
226
262
|
category: 'compiling',
|
227
263
|
fn: function (aString){
|
228
264
|
var self=this;
|
229
|
-
smalltalk.
|
230
|
-
return self},
|
265
|
+
return smalltalk.withContext(function($ctx1) {
|
266
|
+
return self}, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString}, smalltalk.Behavior)})},
|
231
267
|
args: ["aString"],
|
232
268
|
source: "compile: aString\x0a\x09self compile: aString category: ''",
|
233
269
|
messageSends: ["compile:category:"],
|
@@ -242,8 +278,8 @@ selector: "compile:category:",
|
|
242
278
|
category: 'compiling',
|
243
279
|
fn: function (aString,anotherString){
|
244
280
|
var self=this;
|
245
|
-
smalltalk.
|
246
|
-
return self},
|
281
|
+
return smalltalk.withContext(function($ctx1) {
|
282
|
+
return self}, function($ctx1) {$ctx1.fill(self,"compile:category:",{aString:aString,anotherString:anotherString}, smalltalk.Behavior)})},
|
247
283
|
args: ["aString", "anotherString"],
|
248
284
|
source: "compile: aString category: anotherString\x0a\x09Compiler new\x0a\x09\x09install: aString \x0a forClass: self \x0a category: anotherString",
|
249
285
|
messageSends: ["install:forClass:category:", "new"],
|
@@ -258,8 +294,8 @@ selector: "definition",
|
|
258
294
|
category: 'accessing',
|
259
295
|
fn: function (){
|
260
296
|
var self=this;
|
261
|
-
return
|
262
|
-
},
|
297
|
+
return smalltalk.withContext(function($ctx1) {
|
298
|
+
}, function($ctx1) {$ctx1.fill(self,"definition",{}, smalltalk.Behavior)})},
|
263
299
|
args: [],
|
264
300
|
source: "definition\x0a\x09^ ''",
|
265
301
|
messageSends: [],
|
@@ -267,6 +303,24 @@ referencedClasses: []
|
|
267
303
|
}),
|
268
304
|
smalltalk.Behavior);
|
269
305
|
|
306
|
+
smalltalk.addMethod(
|
307
|
+
"_includesSelector_",
|
308
|
+
smalltalk.method({
|
309
|
+
selector: "includesSelector:",
|
310
|
+
category: 'testing',
|
311
|
+
fn: function (aSymbol){
|
312
|
+
var self=this;
|
313
|
+
return smalltalk.withContext(function($ctx1) {
|
314
|
+
$1=_st(_st(self)._methodDictionary())._includesKey_(_st(aSymbol)._asString());
|
315
|
+
return $1;
|
316
|
+
}, function($ctx1) {$ctx1.fill(self,"includesSelector:",{aSymbol:aSymbol}, smalltalk.Behavior)})},
|
317
|
+
args: ["aSymbol"],
|
318
|
+
source: "includesSelector: aSymbol\x0a\x09^ self methodDictionary includesKey: aSymbol asString",
|
319
|
+
messageSends: ["includesKey:", "asString", "methodDictionary"],
|
320
|
+
referencedClasses: []
|
321
|
+
}),
|
322
|
+
smalltalk.Behavior);
|
323
|
+
|
270
324
|
smalltalk.addMethod(
|
271
325
|
"_inheritsFrom_",
|
272
326
|
smalltalk.method({
|
@@ -274,10 +328,10 @@ selector: "inheritsFrom:",
|
|
274
328
|
category: 'testing',
|
275
329
|
fn: function (aClass){
|
276
330
|
var self=this;
|
277
|
-
|
278
|
-
$1=
|
331
|
+
return smalltalk.withContext(function($ctx1) {
|
332
|
+
$1=_st(_st(aClass)._allSubclasses())._includes_(self);
|
279
333
|
return $1;
|
280
|
-
},
|
334
|
+
}, function($ctx1) {$ctx1.fill(self,"inheritsFrom:",{aClass:aClass}, smalltalk.Behavior)})},
|
281
335
|
args: ["aClass"],
|
282
336
|
source: "inheritsFrom: aClass\x0a\x09^aClass allSubclasses includes: self",
|
283
337
|
messageSends: ["includes:", "allSubclasses"],
|
@@ -292,9 +346,8 @@ selector: "instanceVariableNames",
|
|
292
346
|
category: 'accessing',
|
293
347
|
fn: function (){
|
294
348
|
var self=this;
|
295
|
-
return
|
296
|
-
|
297
|
-
return self},
|
349
|
+
return smalltalk.withContext(function($ctx1) {
|
350
|
+
return self}, function($ctx1) {$ctx1.fill(self,"instanceVariableNames",{}, smalltalk.Behavior)})},
|
298
351
|
args: [],
|
299
352
|
source: "instanceVariableNames\x0a\x09<return self.iVarNames>",
|
300
353
|
messageSends: [],
|
@@ -302,6 +355,42 @@ referencedClasses: []
|
|
302
355
|
}),
|
303
356
|
smalltalk.Behavior);
|
304
357
|
|
358
|
+
smalltalk.addMethod(
|
359
|
+
"_lookupSelector_",
|
360
|
+
smalltalk.method({
|
361
|
+
selector: "lookupSelector:",
|
362
|
+
category: 'accessing',
|
363
|
+
fn: function (selector){
|
364
|
+
var self=this;
|
365
|
+
var lookupClass;
|
366
|
+
return smalltalk.withContext(function($ctx1) {
|
367
|
+
var $early={};
|
368
|
+
try {
|
369
|
+
lookupClass=self;
|
370
|
+
$1=(function(){
|
371
|
+
return smalltalk.withContext(function($ctx2) {
|
372
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
|
373
|
+
$2=(function(){
|
374
|
+
return smalltalk.withContext(function($ctx2) {
|
375
|
+
if(smalltalk.assert($3)){
|
376
|
+
$4=_st(lookupClass)._methodAt_(selector);
|
377
|
+
throw $early=[$4];
|
378
|
+
};
|
379
|
+
lookupClass=_st(lookupClass)._superclass();
|
380
|
+
return lookupClass;
|
381
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
|
382
|
+
_st($1)._whileFalse_($2);
|
383
|
+
return nil;
|
384
|
+
}
|
385
|
+
catch(e) {if(e===$early)return e[0]; throw e}
|
386
|
+
}, function($ctx1) {$ctx1.fill(self,"lookupSelector:",{selector:selector,lookupClass:lookupClass}, smalltalk.Behavior)})},
|
387
|
+
args: ["selector"],
|
388
|
+
source: "lookupSelector: selector\x0a\x09\x22Look up the given selector in my methodDictionary.\x0a\x09Return the corresponding method if found.\x0a\x09Otherwise chase the superclass chain and try again.\x0a\x09Return nil if no method is found.\x22\x0a \x0a\x09| lookupClass |\x0a \x0a\x09lookupClass := self.\x0a\x09[ lookupClass = nil ] whileFalse: [\x0a \x09(lookupClass includesSelector: selector)\x0a\x09\x09\x09\x09ifTrue: [ ^ lookupClass methodAt: selector ].\x0a\x09\x09\x09lookupClass := lookupClass superclass ].\x0a\x09^ nil",
|
389
|
+
messageSends: ["whileFalse:", "ifTrue:", "methodAt:", "includesSelector:", "superclass", "="],
|
390
|
+
referencedClasses: []
|
391
|
+
}),
|
392
|
+
smalltalk.Behavior);
|
393
|
+
|
305
394
|
smalltalk.addMethod(
|
306
395
|
"_methodAt_",
|
307
396
|
smalltalk.method({
|
@@ -309,12 +398,13 @@ selector: "methodAt:",
|
|
309
398
|
category: 'accessing',
|
310
399
|
fn: function (aSymbol){
|
311
400
|
var self=this;
|
312
|
-
return smalltalk.
|
313
|
-
;
|
314
|
-
return
|
401
|
+
return smalltalk.withContext(function($ctx1) {
|
402
|
+
$1=_st(_st(self)._methodDictionary())._at_(_st(aSymbol)._asString());
|
403
|
+
return $1;
|
404
|
+
}, function($ctx1) {$ctx1.fill(self,"methodAt:",{aSymbol:aSymbol}, smalltalk.Behavior)})},
|
315
405
|
args: ["aSymbol"],
|
316
|
-
source: "methodAt: aSymbol\x0a\x09
|
317
|
-
messageSends: [],
|
406
|
+
source: "methodAt: aSymbol\x0a\x09^ self methodDictionary at: aSymbol asString",
|
407
|
+
messageSends: ["at:", "asString", "methodDictionary"],
|
318
408
|
referencedClasses: []
|
319
409
|
}),
|
320
410
|
smalltalk.Behavior);
|
@@ -326,18 +416,17 @@ selector: "methodDictionary",
|
|
326
416
|
category: 'accessing',
|
327
417
|
fn: function (){
|
328
418
|
var self=this;
|
329
|
-
|
330
|
-
var methods = self.
|
419
|
+
return smalltalk.withContext(function($ctx1) {
|
420
|
+
var methods = self.methods;
|
331
421
|
for(var i in methods) {
|
332
422
|
if(methods[i].selector) {
|
333
423
|
dict._at_put_(methods[i].selector, methods[i]);
|
334
424
|
}
|
335
425
|
};
|
336
426
|
return dict;
|
337
|
-
|
338
|
-
return self},
|
427
|
+
return self}, function($ctx1) {$ctx1.fill(self,"methodDictionary",{}, smalltalk.Behavior)})},
|
339
428
|
args: [],
|
340
|
-
source: "methodDictionary\x0a\x09<var dict = smalltalk.HashedCollection._new();\x0a\x09var methods = self.
|
429
|
+
source: "methodDictionary\x0a\x09<var dict = smalltalk.HashedCollection._new();\x0a\x09var methods = self.methods;\x0a\x09for(var i in methods) {\x0a\x09\x09if(methods[i].selector) {\x0a\x09\x09\x09dict._at_put_(methods[i].selector, methods[i]);\x0a\x09\x09}\x0a\x09};\x0a\x09return dict>",
|
341
430
|
messageSends: [],
|
342
431
|
referencedClasses: []
|
343
432
|
}),
|
@@ -350,10 +439,10 @@ selector: "methods",
|
|
350
439
|
category: 'accessing',
|
351
440
|
fn: function (){
|
352
441
|
var self=this;
|
353
|
-
|
354
|
-
$1=
|
442
|
+
return smalltalk.withContext(function($ctx1) {
|
443
|
+
$1=_st(_st(self)._methodDictionary())._values();
|
355
444
|
return $1;
|
356
|
-
},
|
445
|
+
}, function($ctx1) {$ctx1.fill(self,"methods",{}, smalltalk.Behavior)})},
|
357
446
|
args: [],
|
358
447
|
source: "methods\x0a\x09^ self methodDictionary values",
|
359
448
|
messageSends: ["values", "methodDictionary"],
|
@@ -368,13 +457,13 @@ selector: "methodsFor:",
|
|
368
457
|
category: 'accessing',
|
369
458
|
fn: function (aString){
|
370
459
|
var self=this;
|
371
|
-
|
372
|
-
$2=
|
373
|
-
|
374
|
-
$3=
|
460
|
+
return smalltalk.withContext(function($ctx1) {
|
461
|
+
$2=_st((smalltalk.ClassCategoryReader || ClassCategoryReader))._new();
|
462
|
+
_st($2)._class_category_(self,aString);
|
463
|
+
$3=_st($2)._yourself();
|
375
464
|
$1=$3;
|
376
465
|
return $1;
|
377
|
-
},
|
466
|
+
}, function($ctx1) {$ctx1.fill(self,"methodsFor:",{aString:aString}, smalltalk.Behavior)})},
|
378
467
|
args: ["aString"],
|
379
468
|
source: "methodsFor: aString\x0a\x09^ClassCategoryReader new\x0a\x09 class: self category: aString;\x0a\x09 yourself",
|
380
469
|
messageSends: ["class:category:", "new", "yourself"],
|
@@ -389,10 +478,10 @@ selector: "methodsFor:stamp:",
|
|
389
478
|
category: 'accessing',
|
390
479
|
fn: function (aString,aStamp){
|
391
480
|
var self=this;
|
392
|
-
|
393
|
-
$1=
|
481
|
+
return smalltalk.withContext(function($ctx1) {
|
482
|
+
$1=_st(self)._methodsFor_(aString);
|
394
483
|
return $1;
|
395
|
-
},
|
484
|
+
}, function($ctx1) {$ctx1.fill(self,"methodsFor:stamp:",{aString:aString,aStamp:aStamp}, smalltalk.Behavior)})},
|
396
485
|
args: ["aString", "aStamp"],
|
397
486
|
source: "methodsFor: aString stamp: aStamp\x0a\x09\x22Added for compatibility, right now ignores stamp.\x22\x0a\x09^self methodsFor: aString",
|
398
487
|
messageSends: ["methodsFor:"],
|
@@ -407,12 +496,12 @@ selector: "methodsInProtocol:",
|
|
407
496
|
category: 'accessing',
|
408
497
|
fn: function (aString){
|
409
498
|
var self=this;
|
410
|
-
|
411
|
-
$1=
|
412
|
-
return smalltalk.
|
413
|
-
})
|
499
|
+
return smalltalk.withContext(function($ctx1) {
|
500
|
+
$1=_st(_st(_st(self)._methodDictionary())._values())._select_((function(each){
|
501
|
+
return smalltalk.withContext(function($ctx2) {
|
502
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
414
503
|
return $1;
|
415
|
-
},
|
504
|
+
}, function($ctx1) {$ctx1.fill(self,"methodsInProtocol:",{aString:aString}, smalltalk.Behavior)})},
|
416
505
|
args: ["aString"],
|
417
506
|
source: "methodsInProtocol: aString\x0a\x09^ self methodDictionary values select: [ :each | each protocol = aString ]",
|
418
507
|
messageSends: ["select:", "=", "protocol", "values", "methodDictionary"],
|
@@ -427,9 +516,8 @@ selector: "name",
|
|
427
516
|
category: 'accessing',
|
428
517
|
fn: function (){
|
429
518
|
var self=this;
|
430
|
-
return
|
431
|
-
|
432
|
-
return self},
|
519
|
+
return smalltalk.withContext(function($ctx1) {
|
520
|
+
return self}, function($ctx1) {$ctx1.fill(self,"name",{}, smalltalk.Behavior)})},
|
433
521
|
args: [],
|
434
522
|
source: "name\x0a\x09<return self.className || nil>",
|
435
523
|
messageSends: [],
|
@@ -444,10 +532,10 @@ selector: "new",
|
|
444
532
|
category: 'instance creation',
|
445
533
|
fn: function (){
|
446
534
|
var self=this;
|
447
|
-
|
448
|
-
$1=
|
535
|
+
return smalltalk.withContext(function($ctx1) {
|
536
|
+
$1=_st(_st(self)._basicNew())._initialize();
|
449
537
|
return $1;
|
450
|
-
},
|
538
|
+
}, function($ctx1) {$ctx1.fill(self,"new",{}, smalltalk.Behavior)})},
|
451
539
|
args: [],
|
452
540
|
source: "new\x0a\x09^self basicNew initialize",
|
453
541
|
messageSends: ["initialize", "basicNew"],
|
@@ -462,10 +550,10 @@ selector: "organization",
|
|
462
550
|
category: 'accessing',
|
463
551
|
fn: function (){
|
464
552
|
var self=this;
|
465
|
-
|
466
|
-
$1=
|
553
|
+
return smalltalk.withContext(function($ctx1) {
|
554
|
+
$1=_st(self)._basicAt_("organization");
|
467
555
|
return $1;
|
468
|
-
},
|
556
|
+
}, function($ctx1) {$ctx1.fill(self,"organization",{}, smalltalk.Behavior)})},
|
469
557
|
args: [],
|
470
558
|
source: "organization\x0a\x09^ self basicAt: 'organization'",
|
471
559
|
messageSends: ["basicAt:"],
|
@@ -480,10 +568,10 @@ selector: "protocols",
|
|
480
568
|
category: 'accessing',
|
481
569
|
fn: function (){
|
482
570
|
var self=this;
|
483
|
-
|
484
|
-
$1=
|
571
|
+
return smalltalk.withContext(function($ctx1) {
|
572
|
+
$1=_st(_st(_st(self)._organization())._elements())._sorted();
|
485
573
|
return $1;
|
486
|
-
},
|
574
|
+
}, function($ctx1) {$ctx1.fill(self,"protocols",{}, smalltalk.Behavior)})},
|
487
575
|
args: [],
|
488
576
|
source: "protocols\x0a ^ self organization elements sorted",
|
489
577
|
messageSends: ["sorted", "elements", "organization"],
|
@@ -499,16 +587,16 @@ category: 'accessing',
|
|
499
587
|
fn: function (aBlock){
|
500
588
|
var self=this;
|
501
589
|
var methodsByCategory;
|
502
|
-
|
503
|
-
|
504
|
-
return smalltalk.
|
505
|
-
return smalltalk.
|
506
|
-
})
|
507
|
-
})
|
508
|
-
|
509
|
-
return smalltalk.
|
510
|
-
})
|
511
|
-
return self},
|
590
|
+
return smalltalk.withContext(function($ctx1) {
|
591
|
+
_st(_st(_st(self)._methodDictionary())._values())._do_((function(m){
|
592
|
+
return smalltalk.withContext(function($ctx2) {
|
593
|
+
return smalltalk.withContext(function($ctx3) {
|
594
|
+
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})))._add_(m);
|
595
|
+
}, function($ctx2) {$ctx2.fillBlock({m:m},$ctx1)})}));
|
596
|
+
_st(_st(self)._protocols())._do_((function(category){
|
597
|
+
return smalltalk.withContext(function($ctx2) {
|
598
|
+
}, function($ctx2) {$ctx2.fillBlock({category:category},$ctx1)})}));
|
599
|
+
return self}, function($ctx1) {$ctx1.fill(self,"protocolsDo:",{aBlock:aBlock,methodsByCategory:methodsByCategory}, smalltalk.Behavior)})},
|
512
600
|
args: ["aBlock"],
|
513
601
|
source: "protocolsDo: aBlock\x0a\x09\x22Execute aBlock for each method category with\x0a\x09its collection of methods in the sort order of category name.\x22\x0a\x0a\x09| methodsByCategory |\x0a\x09methodsByCategory := HashedCollection new.\x0a\x09self methodDictionary values do: [:m |\x0a\x09\x09(methodsByCategory at: m category ifAbsentPut: [Array new])\x0a \x09\x09\x09add: m]. \x0a\x09self protocols do: [:category |\x0a\x09\x09aBlock value: category value: (methodsByCategory at: category)]",
|
514
602
|
messageSends: ["new", "do:", "add:", "at:ifAbsentPut:", "category", "values", "methodDictionary", "value:value:", "at:", "protocols"],
|
@@ -523,9 +611,8 @@ selector: "prototype",
|
|
523
611
|
category: 'accessing',
|
524
612
|
fn: function (){
|
525
613
|
var self=this;
|
526
|
-
return
|
527
|
-
|
528
|
-
return self},
|
614
|
+
return smalltalk.withContext(function($ctx1) {
|
615
|
+
return self}, function($ctx1) {$ctx1.fill(self,"prototype",{}, smalltalk.Behavior)})},
|
529
616
|
args: [],
|
530
617
|
source: "prototype\x0a\x09<return self.fn.prototype>",
|
531
618
|
messageSends: [],
|
@@ -540,21 +627,17 @@ selector: "removeCompiledMethod:",
|
|
540
627
|
category: 'compiling',
|
541
628
|
fn: function (aMethod){
|
542
629
|
var self=this;
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
;
|
549
|
-
|
550
|
-
|
551
|
-
smalltalk.send($1,"_method_",[aMethod]);
|
552
|
-
$2=smalltalk.send($1,"_yourself",[]);
|
553
|
-
smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$2]);
|
554
|
-
return self},
|
630
|
+
return smalltalk.withContext(function($ctx1) {
|
631
|
+
_st(self)._basicRemoveCompiledMethod_(aMethod);
|
632
|
+
$1=_st((smalltalk.MethodRemoved || MethodRemoved))._new();
|
633
|
+
_st($1)._theClass_(self);
|
634
|
+
_st($1)._method_(aMethod);
|
635
|
+
$2=_st($1)._yourself();
|
636
|
+
_st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
|
637
|
+
return self}, function($ctx1) {$ctx1.fill(self,"removeCompiledMethod:",{aMethod:aMethod}, smalltalk.Behavior)})},
|
555
638
|
args: ["aMethod"],
|
556
|
-
source: "removeCompiledMethod: aMethod\x0a\
|
557
|
-
messageSends: ["announce:", "theClass:", "new", "method:", "yourself", "current"],
|
639
|
+
source: "removeCompiledMethod: aMethod\x0a\x09self basicRemoveCompiledMethod: aMethod.\x0a \x0a SystemAnnouncer current\x0a \x09\x09announce: (MethodRemoved new\x0a \x09theClass: self;\x0a method: aMethod;\x0a yourself)",
|
640
|
+
messageSends: ["basicRemoveCompiledMethod:", "announce:", "theClass:", "new", "method:", "yourself", "current"],
|
558
641
|
referencedClasses: ["MethodRemoved", "SystemAnnouncer"]
|
559
642
|
}),
|
560
643
|
smalltalk.Behavior);
|
@@ -566,10 +649,10 @@ selector: "selectors",
|
|
566
649
|
category: 'accessing',
|
567
650
|
fn: function (){
|
568
651
|
var self=this;
|
569
|
-
|
570
|
-
$1=
|
652
|
+
return smalltalk.withContext(function($ctx1) {
|
653
|
+
$1=_st(_st(self)._methodDictionary())._keys();
|
571
654
|
return $1;
|
572
|
-
},
|
655
|
+
}, function($ctx1) {$ctx1.fill(self,"selectors",{}, smalltalk.Behavior)})},
|
573
656
|
args: [],
|
574
657
|
source: "selectors\x0a\x09^ self methodDictionary keys",
|
575
658
|
messageSends: ["keys", "methodDictionary"],
|
@@ -584,9 +667,8 @@ selector: "subclasses",
|
|
584
667
|
category: 'accessing',
|
585
668
|
fn: function (){
|
586
669
|
var self=this;
|
587
|
-
return smalltalk.
|
588
|
-
|
589
|
-
return self},
|
670
|
+
return smalltalk.withContext(function($ctx1) {
|
671
|
+
return self}, function($ctx1) {$ctx1.fill(self,"subclasses",{}, smalltalk.Behavior)})},
|
590
672
|
args: [],
|
591
673
|
source: "subclasses\x0a\x09<return smalltalk.subclasses(self)>",
|
592
674
|
messageSends: [],
|
@@ -601,9 +683,8 @@ selector: "superclass",
|
|
601
683
|
category: 'accessing',
|
602
684
|
fn: function (){
|
603
685
|
var self=this;
|
604
|
-
return
|
605
|
-
|
606
|
-
return self},
|
686
|
+
return smalltalk.withContext(function($ctx1) {
|
687
|
+
return self}, function($ctx1) {$ctx1.fill(self,"superclass",{}, smalltalk.Behavior)})},
|
607
688
|
args: [],
|
608
689
|
source: "superclass\x0a\x09<return self.superclass || nil>",
|
609
690
|
messageSends: [],
|
@@ -618,10 +699,10 @@ selector: "theMetaClass",
|
|
618
699
|
category: 'accessing',
|
619
700
|
fn: function (){
|
620
701
|
var self=this;
|
621
|
-
|
622
|
-
$1=
|
702
|
+
return smalltalk.withContext(function($ctx1) {
|
703
|
+
$1=_st(self)._class();
|
623
704
|
return $1;
|
624
|
-
},
|
705
|
+
}, function($ctx1) {$ctx1.fill(self,"theMetaClass",{}, smalltalk.Behavior)})},
|
625
706
|
args: [],
|
626
707
|
source: "theMetaClass\x0a\x09^ self class",
|
627
708
|
messageSends: ["class"],
|
@@ -636,8 +717,10 @@ selector: "theNonMetaClass",
|
|
636
717
|
category: 'accessing',
|
637
718
|
fn: function (){
|
638
719
|
var self=this;
|
639
|
-
return
|
640
|
-
|
720
|
+
return smalltalk.withContext(function($ctx1) {
|
721
|
+
$1=self;
|
722
|
+
return $1;
|
723
|
+
}, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{}, smalltalk.Behavior)})},
|
641
724
|
args: [],
|
642
725
|
source: "theNonMetaClass\x0a\x09^ self",
|
643
726
|
messageSends: [],
|
@@ -652,13 +735,13 @@ selector: "withAllSubclasses",
|
|
652
735
|
category: 'accessing',
|
653
736
|
fn: function (){
|
654
737
|
var self=this;
|
655
|
-
|
656
|
-
$2=
|
657
|
-
|
658
|
-
$3=
|
738
|
+
return smalltalk.withContext(function($ctx1) {
|
739
|
+
$2=_st((smalltalk.Array || Array))._with_(self);
|
740
|
+
_st($2)._addAll_(_st(self)._allSubclasses());
|
741
|
+
$3=_st($2)._yourself();
|
659
742
|
$1=$3;
|
660
743
|
return $1;
|
661
|
-
},
|
744
|
+
}, function($ctx1) {$ctx1.fill(self,"withAllSubclasses",{}, smalltalk.Behavior)})},
|
662
745
|
args: [],
|
663
746
|
source: "withAllSubclasses\x0a\x09^(Array with: self) addAll: self allSubclasses; yourself",
|
664
747
|
messageSends: ["addAll:", "allSubclasses", "with:", "yourself"],
|
@@ -677,10 +760,10 @@ selector: "asJavascript",
|
|
677
760
|
category: 'converting',
|
678
761
|
fn: function (){
|
679
762
|
var self=this;
|
680
|
-
|
681
|
-
$1=
|
763
|
+
return smalltalk.withContext(function($ctx1) {
|
764
|
+
$1=_st("smalltalk.").__comma(_st(self)._name());
|
682
765
|
return $1;
|
683
|
-
},
|
766
|
+
}, function($ctx1) {$ctx1.fill(self,"asJavascript",{}, smalltalk.Class)})},
|
684
767
|
args: [],
|
685
768
|
source: "asJavascript\x0a\x09^ 'smalltalk.', self name",
|
686
769
|
messageSends: [",", "name"],
|
@@ -695,15 +778,15 @@ selector: "category",
|
|
695
778
|
category: 'accessing',
|
696
779
|
fn: function (){
|
697
780
|
var self=this;
|
698
|
-
|
699
|
-
$2=
|
781
|
+
return smalltalk.withContext(function($ctx1) {
|
782
|
+
$2=_st(self)._package();
|
700
783
|
if(($receiver = $2) == nil || $receiver == undefined){
|
701
784
|
$1="Unclassified";
|
702
785
|
} else {
|
703
|
-
$1=
|
786
|
+
$1=_st(_st(self)._package())._name();
|
704
787
|
};
|
705
788
|
return $1;
|
706
|
-
},
|
789
|
+
}, function($ctx1) {$ctx1.fill(self,"category",{}, smalltalk.Class)})},
|
707
790
|
args: [],
|
708
791
|
source: "category\x0a\x09^self package ifNil: ['Unclassified'] ifNotNil: [self package name]",
|
709
792
|
messageSends: ["ifNil:ifNotNil:", "name", "package"],
|
@@ -718,27 +801,29 @@ selector: "definition",
|
|
718
801
|
category: 'accessing',
|
719
802
|
fn: function (){
|
720
803
|
var self=this;
|
721
|
-
|
722
|
-
$1=
|
723
|
-
smalltalk.
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
$2
|
728
|
-
$2;
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
$
|
738
|
-
|
739
|
-
|
804
|
+
return smalltalk.withContext(function($ctx1) {
|
805
|
+
$1=_st((smalltalk.String || String))._streamContents_((function(stream){
|
806
|
+
return smalltalk.withContext(function($ctx2) {
|
807
|
+
_st($2)._nextPutAll_(_st(_st(self)._superclass())._asString());
|
808
|
+
_st($2)._nextPutAll_(" subclass: #");
|
809
|
+
_st($2)._nextPutAll_(_st(self)._name());
|
810
|
+
_st($2)._nextPutAll_(_st(_st((smalltalk.String || String))._lf()).__comma(_st((smalltalk.String || String))._tab()));
|
811
|
+
$3=_st($2)._nextPutAll_("instanceVariableNames: '");
|
812
|
+
$3;
|
813
|
+
_st(_st(self)._instanceVariableNames())._do_separatedBy_((function(each){
|
814
|
+
return smalltalk.withContext(function($ctx3) {
|
815
|
+
}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
|
816
|
+
return smalltalk.withContext(function($ctx3) {
|
817
|
+
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
|
818
|
+
$4=stream;
|
819
|
+
_st($4)._nextPutAll_(_st(_st("'").__comma(_st((smalltalk.String || String))._lf())).__comma(_st((smalltalk.String || String))._tab()));
|
820
|
+
_st($4)._nextPutAll_("package: '");
|
821
|
+
_st($4)._nextPutAll_(_st(self)._category());
|
822
|
+
$5=_st($4)._nextPutAll_("'");
|
823
|
+
return $5;
|
824
|
+
}, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
|
740
825
|
return $1;
|
741
|
-
},
|
826
|
+
}, function($ctx1) {$ctx1.fill(self,"definition",{}, smalltalk.Class)})},
|
742
827
|
args: [],
|
743
828
|
source: "definition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09 \x09nextPutAll: self superclass asString;\x0a\x09 \x09nextPutAll: ' subclass: #';\x0a\x09 \x09nextPutAll: self name;\x0a\x09 \x09nextPutAll: String lf, String tab;\x0a\x09 \x09nextPutAll: 'instanceVariableNames: '''.\x0a\x09\x09self instanceVariableNames \x0a \x09do: [ :each | stream nextPutAll: each ] \x0a\x09 \x09separatedBy: [ stream nextPutAll: ' ' ].\x0a\x09\x09stream\x0a\x09 \x09nextPutAll: '''', String lf, String tab;\x0a\x09 \x09nextPutAll: 'package: ''';\x0a\x09 \x09nextPutAll: self category;\x0a\x09 \x09nextPutAll: '''' ]",
|
744
829
|
messageSends: ["streamContents:", "nextPutAll:", "asString", "superclass", "name", ",", "tab", "lf", "do:separatedBy:", "instanceVariableNames", "category"],
|
@@ -753,8 +838,8 @@ selector: "isClass",
|
|
753
838
|
category: 'testing',
|
754
839
|
fn: function (){
|
755
840
|
var self=this;
|
756
|
-
return
|
757
|
-
},
|
841
|
+
return smalltalk.withContext(function($ctx1) {
|
842
|
+
}, function($ctx1) {$ctx1.fill(self,"isClass",{}, smalltalk.Class)})},
|
758
843
|
args: [],
|
759
844
|
source: "isClass\x0a\x09^true",
|
760
845
|
messageSends: [],
|
@@ -769,9 +854,8 @@ selector: "package",
|
|
769
854
|
category: 'accessing',
|
770
855
|
fn: function (){
|
771
856
|
var self=this;
|
772
|
-
return
|
773
|
-
|
774
|
-
return self},
|
857
|
+
return smalltalk.withContext(function($ctx1) {
|
858
|
+
return self}, function($ctx1) {$ctx1.fill(self,"package",{}, smalltalk.Class)})},
|
775
859
|
args: [],
|
776
860
|
source: "package\x0a\x09<return self.pkg>",
|
777
861
|
messageSends: [],
|
@@ -786,9 +870,8 @@ selector: "package:",
|
|
786
870
|
category: 'accessing',
|
787
871
|
fn: function (aPackage){
|
788
872
|
var self=this;
|
789
|
-
|
790
|
-
|
791
|
-
return self},
|
873
|
+
return smalltalk.withContext(function($ctx1) {
|
874
|
+
return self}, function($ctx1) {$ctx1.fill(self,"package:",{aPackage:aPackage}, smalltalk.Class)})},
|
792
875
|
args: ["aPackage"],
|
793
876
|
source: "package: aPackage\x0a\x09<self.pkg = aPackage>",
|
794
877
|
messageSends: [],
|
@@ -803,10 +886,10 @@ selector: "printString",
|
|
803
886
|
category: 'printing',
|
804
887
|
fn: function (){
|
805
888
|
var self=this;
|
806
|
-
|
807
|
-
$1=
|
889
|
+
return smalltalk.withContext(function($ctx1) {
|
890
|
+
$1=_st(self)._name();
|
808
891
|
return $1;
|
809
|
-
},
|
892
|
+
}, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Class)})},
|
810
893
|
args: [],
|
811
894
|
source: "printString\x0a\x09^self name",
|
812
895
|
messageSends: ["name"],
|
@@ -821,8 +904,8 @@ selector: "rename:",
|
|
821
904
|
category: 'accessing',
|
822
905
|
fn: function (aString){
|
823
906
|
var self=this;
|
824
|
-
smalltalk.
|
825
|
-
return self},
|
907
|
+
return smalltalk.withContext(function($ctx1) {
|
908
|
+
return self}, function($ctx1) {$ctx1.fill(self,"rename:",{aString:aString}, smalltalk.Class)})},
|
826
909
|
args: ["aString"],
|
827
910
|
source: "rename: aString\x0a\x09ClassBuilder new renameClass: self to: aString",
|
828
911
|
messageSends: ["renameClass:to:", "new"],
|
@@ -837,10 +920,10 @@ selector: "subclass:instanceVariableNames:",
|
|
837
920
|
category: 'class creation',
|
838
921
|
fn: function (aString,anotherString){
|
839
922
|
var self=this;
|
840
|
-
|
841
|
-
$1=
|
923
|
+
return smalltalk.withContext(function($ctx1) {
|
924
|
+
$1=_st(self)._subclass_instanceVariableNames_package_(aString,anotherString,nil);
|
842
925
|
return $1;
|
843
|
-
},
|
926
|
+
}, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:",{aString:aString,anotherString:anotherString}, smalltalk.Class)})},
|
844
927
|
args: ["aString", "anotherString"],
|
845
928
|
source: "subclass: aString instanceVariableNames: anotherString\x0a\x09\x22Kept for compatibility.\x22\x0a\x09^self subclass: aString instanceVariableNames: anotherString package: nil",
|
846
929
|
messageSends: ["subclass:instanceVariableNames:package:"],
|
@@ -855,11 +938,11 @@ selector: "subclass:instanceVariableNames:category:",
|
|
855
938
|
category: 'class creation',
|
856
939
|
fn: function (aString,aString2,aString3){
|
857
940
|
var self=this;
|
858
|
-
|
859
|
-
|
860
|
-
$1=
|
941
|
+
return smalltalk.withContext(function($ctx1) {
|
942
|
+
_st(self)._deprecatedAPI();
|
943
|
+
$1=_st(self)._subclass_instanceVariableNames_package_(aString,aString2,aString3);
|
861
944
|
return $1;
|
862
|
-
},
|
945
|
+
}, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:category:",{aString:aString,aString2:aString2,aString3:aString3}, smalltalk.Class)})},
|
863
946
|
args: ["aString", "aString2", "aString3"],
|
864
947
|
source: "subclass: aString instanceVariableNames: aString2 category: aString3\x0a\x09\x22Kept for compatibility.\x22\x0a\x09self deprecatedAPI.\x0a\x09^self subclass: aString instanceVariableNames: aString2 package: aString3",
|
865
948
|
messageSends: ["deprecatedAPI", "subclass:instanceVariableNames:package:"],
|
@@ -874,10 +957,10 @@ selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:ca
|
|
874
957
|
category: 'class creation',
|
875
958
|
fn: function (aString,aString2,classVars,pools,aString3){
|
876
959
|
var self=this;
|
877
|
-
|
878
|
-
$1=
|
960
|
+
return smalltalk.withContext(function($ctx1) {
|
961
|
+
$1=_st(self)._subclass_instanceVariableNames_package_(aString,aString2,aString3);
|
879
962
|
return $1;
|
880
|
-
},
|
963
|
+
}, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",{aString:aString,aString2:aString2,classVars:classVars,pools:pools,aString3:aString3}, smalltalk.Class)})},
|
881
964
|
args: ["aString", "aString2", "classVars", "pools", "aString3"],
|
882
965
|
source: "subclass: aString instanceVariableNames: aString2 classVariableNames: classVars poolDictionaries: pools category: aString3\x0a\x09\x22Just ignore class variables and pools. Added for compatibility.\x22\x0a\x09^self subclass: aString instanceVariableNames: aString2 package: aString3",
|
883
966
|
messageSends: ["subclass:instanceVariableNames:package:"],
|
@@ -892,10 +975,10 @@ selector: "subclass:instanceVariableNames:package:",
|
|
892
975
|
category: 'class creation',
|
893
976
|
fn: function (aString,aString2,aString3){
|
894
977
|
var self=this;
|
895
|
-
|
896
|
-
$1=
|
978
|
+
return smalltalk.withContext(function($ctx1) {
|
979
|
+
$1=_st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._superclass_subclass_instanceVariableNames_package_(self,_st(aString)._asString(),aString2,aString3);
|
897
980
|
return $1;
|
898
|
-
},
|
981
|
+
}, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:package:",{aString:aString,aString2:aString2,aString3:aString3}, smalltalk.Class)})},
|
899
982
|
args: ["aString", "aString2", "aString3"],
|
900
983
|
source: "subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09^ClassBuilder new\x0a\x09 superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3",
|
901
984
|
messageSends: ["superclass:subclass:instanceVariableNames:package:", "asString", "new"],
|
@@ -914,10 +997,10 @@ selector: "asJavascript",
|
|
914
997
|
category: 'converting',
|
915
998
|
fn: function (){
|
916
999
|
var self=this;
|
917
|
-
|
918
|
-
$1=
|
1000
|
+
return smalltalk.withContext(function($ctx1) {
|
1001
|
+
$1=_st(_st("smalltalk.").__comma(_st(_st(self)._instanceClass())._name())).__comma(".klass");
|
919
1002
|
return $1;
|
920
|
-
},
|
1003
|
+
}, function($ctx1) {$ctx1.fill(self,"asJavascript",{}, smalltalk.Metaclass)})},
|
921
1004
|
args: [],
|
922
1005
|
source: "asJavascript\x0a\x09^ 'smalltalk.', self instanceClass name, '.klass'",
|
923
1006
|
messageSends: [",", "name", "instanceClass"],
|
@@ -932,21 +1015,22 @@ selector: "definition",
|
|
932
1015
|
category: 'accessing',
|
933
1016
|
fn: function (){
|
934
1017
|
var self=this;
|
935
|
-
|
936
|
-
$1=
|
937
|
-
smalltalk.
|
938
|
-
|
939
|
-
$2
|
940
|
-
$2;
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
1018
|
+
return smalltalk.withContext(function($ctx1) {
|
1019
|
+
$1=_st((smalltalk.String || String))._streamContents_((function(stream){
|
1020
|
+
return smalltalk.withContext(function($ctx2) {
|
1021
|
+
_st($2)._nextPutAll_(_st(self)._asString());
|
1022
|
+
_st($2)._nextPutAll_(" class ");
|
1023
|
+
$3=_st($2)._nextPutAll_("instanceVariableNames: '");
|
1024
|
+
$3;
|
1025
|
+
_st(_st(self)._instanceVariableNames())._do_separatedBy_((function(each){
|
1026
|
+
return smalltalk.withContext(function($ctx3) {
|
1027
|
+
}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
|
1028
|
+
return smalltalk.withContext(function($ctx3) {
|
1029
|
+
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
|
1030
|
+
return _st(stream)._nextPutAll_("'");
|
1031
|
+
}, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
|
948
1032
|
return $1;
|
949
|
-
},
|
1033
|
+
}, function($ctx1) {$ctx1.fill(self,"definition",{}, smalltalk.Metaclass)})},
|
950
1034
|
args: [],
|
951
1035
|
source: "definition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09 \x09 \x09nextPutAll: self asString;\x0a\x09 \x09nextPutAll: ' class ';\x0a\x09 \x09nextPutAll: 'instanceVariableNames: '''.\x0a\x09\x09self instanceVariableNames\x0a\x09 \x09do: [ :each | stream nextPutAll: each ]\x0a\x09 \x09separatedBy: [ stream nextPutAll: ' ' ].\x0a\x09\x09stream nextPutAll: '''' ]",
|
952
1036
|
messageSends: ["streamContents:", "nextPutAll:", "asString", "do:separatedBy:", "instanceVariableNames"],
|
@@ -961,9 +1045,8 @@ selector: "instanceClass",
|
|
961
1045
|
category: 'accessing',
|
962
1046
|
fn: function (){
|
963
1047
|
var self=this;
|
964
|
-
return
|
965
|
-
|
966
|
-
return self},
|
1048
|
+
return smalltalk.withContext(function($ctx1) {
|
1049
|
+
return self}, function($ctx1) {$ctx1.fill(self,"instanceClass",{}, smalltalk.Metaclass)})},
|
967
1050
|
args: [],
|
968
1051
|
source: "instanceClass\x0a\x09<return self.instanceClass>",
|
969
1052
|
messageSends: [],
|
@@ -978,8 +1061,8 @@ selector: "instanceVariableNames:",
|
|
978
1061
|
category: 'accessing',
|
979
1062
|
fn: function (aCollection){
|
980
1063
|
var self=this;
|
981
|
-
smalltalk.
|
982
|
-
return self},
|
1064
|
+
return smalltalk.withContext(function($ctx1) {
|
1065
|
+
return self}, function($ctx1) {$ctx1.fill(self,"instanceVariableNames:",{aCollection:aCollection}, smalltalk.Metaclass)})},
|
983
1066
|
args: ["aCollection"],
|
984
1067
|
source: "instanceVariableNames: aCollection\x0a\x09ClassBuilder new\x0a\x09 class: self instanceVariableNames: aCollection",
|
985
1068
|
messageSends: ["class:instanceVariableNames:", "new"],
|
@@ -994,8 +1077,8 @@ selector: "isMetaclass",
|
|
994
1077
|
category: 'testing',
|
995
1078
|
fn: function (){
|
996
1079
|
var self=this;
|
997
|
-
return
|
998
|
-
},
|
1080
|
+
return smalltalk.withContext(function($ctx1) {
|
1081
|
+
}, function($ctx1) {$ctx1.fill(self,"isMetaclass",{}, smalltalk.Metaclass)})},
|
999
1082
|
args: [],
|
1000
1083
|
source: "isMetaclass\x0a\x09^true",
|
1001
1084
|
messageSends: [],
|
@@ -1010,10 +1093,10 @@ selector: "printString",
|
|
1010
1093
|
category: 'printing',
|
1011
1094
|
fn: function (){
|
1012
1095
|
var self=this;
|
1013
|
-
|
1014
|
-
$1=
|
1096
|
+
return smalltalk.withContext(function($ctx1) {
|
1097
|
+
$1=_st(_st(_st(self)._instanceClass())._name()).__comma(" class");
|
1015
1098
|
return $1;
|
1016
|
-
},
|
1099
|
+
}, function($ctx1) {$ctx1.fill(self,"printString",{}, smalltalk.Metaclass)})},
|
1017
1100
|
args: [],
|
1018
1101
|
source: "printString\x0a\x09^self instanceClass name, ' class'",
|
1019
1102
|
messageSends: [",", "name", "instanceClass"],
|
@@ -1028,8 +1111,10 @@ selector: "theMetaClass",
|
|
1028
1111
|
category: 'accessing',
|
1029
1112
|
fn: function (){
|
1030
1113
|
var self=this;
|
1031
|
-
return
|
1032
|
-
|
1114
|
+
return smalltalk.withContext(function($ctx1) {
|
1115
|
+
$1=self;
|
1116
|
+
return $1;
|
1117
|
+
}, function($ctx1) {$ctx1.fill(self,"theMetaClass",{}, smalltalk.Metaclass)})},
|
1033
1118
|
args: [],
|
1034
1119
|
source: "theMetaClass\x0a\x09^ self",
|
1035
1120
|
messageSends: [],
|
@@ -1044,10 +1129,10 @@ selector: "theNonMetaClass",
|
|
1044
1129
|
category: 'accessing',
|
1045
1130
|
fn: function (){
|
1046
1131
|
var self=this;
|
1047
|
-
|
1048
|
-
$1=
|
1132
|
+
return smalltalk.withContext(function($ctx1) {
|
1133
|
+
$1=_st(self)._instanceClass();
|
1049
1134
|
return $1;
|
1050
|
-
},
|
1135
|
+
}, function($ctx1) {$ctx1.fill(self,"theNonMetaClass",{}, smalltalk.Metaclass)})},
|
1051
1136
|
args: [],
|
1052
1137
|
source: "theNonMetaClass\x0a\x09^ self instanceClass",
|
1053
1138
|
messageSends: ["instanceClass"],
|
@@ -1060,63 +1145,140 @@ smalltalk.Metaclass);
|
|
1060
1145
|
smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel-Classes');
|
1061
1146
|
smalltalk.ClassBuilder.comment="ClassBuilder is responsible for compiling new classes or modifying existing classes in the system.\x0a\x0aRather than using ClassBuilder directly to compile a class, use `Class >> subclass:instanceVariableNames:package:`."
|
1062
1147
|
smalltalk.addMethod(
|
1063
|
-
"
|
1148
|
+
"_addSubclassOf_named_instanceVariableNames_package_",
|
1064
1149
|
smalltalk.method({
|
1065
|
-
selector: "addSubclassOf:named:instanceVariableNames:",
|
1150
|
+
selector: "addSubclassOf:named:instanceVariableNames:package:",
|
1066
1151
|
category: 'private',
|
1067
|
-
fn: function (aClass,aString,aCollection){
|
1068
|
-
var self=this;
|
1069
|
-
smalltalk.
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1152
|
+
fn: function (aClass,aString,aCollection,packageName){
|
1153
|
+
var self=this;
|
1154
|
+
return smalltalk.withContext(function($ctx1) {
|
1155
|
+
$1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(aString);
|
1156
|
+
if(($receiver = $1) == nil || $receiver == undefined){
|
1157
|
+
$1;
|
1158
|
+
} else {
|
1159
|
+
$2=_st(self)._migrateClassNamed_superclass_instanceVariableNames_package_(aString,aClass,aCollection,packageName);
|
1160
|
+
return $2;
|
1161
|
+
};
|
1162
|
+
$3=_st(self)._basicAddSubclassOf_named_instanceVariableNames_package_(aClass,aString,aCollection,packageName);
|
1163
|
+
return $3;
|
1164
|
+
}, function($ctx1) {$ctx1.fill(self,"addSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,aString:aString,aCollection:aCollection,packageName:packageName}, smalltalk.ClassBuilder)})},
|
1165
|
+
args: ["aClass", "aString", "aCollection", "packageName"],
|
1166
|
+
source: "addSubclassOf: aClass named: aString instanceVariableNames: aCollection package: packageName\x0a\x09\x0a (Smalltalk current at: aString) ifNotNil: [ \x0a \x09^ self \x0a \x09migrateClassNamed: aString \x0a superclass: aClass \x0a instanceVariableNames: aCollection \x0a package: packageName ].\x0a\x0a\x09^ self \x0a \x09basicAddSubclassOf: aClass \x0a named: aString \x0a instanceVariableNames: aCollection \x0a package: packageName",
|
1167
|
+
messageSends: ["ifNotNil:", "migrateClassNamed:superclass:instanceVariableNames:package:", "at:", "current", "basicAddSubclassOf:named:instanceVariableNames:package:"],
|
1168
|
+
referencedClasses: ["Smalltalk"]
|
1077
1169
|
}),
|
1078
1170
|
smalltalk.ClassBuilder);
|
1079
1171
|
|
1080
1172
|
smalltalk.addMethod(
|
1081
|
-
"
|
1173
|
+
"_basicAddSubclassOf_named_instanceVariableNames_package_",
|
1082
1174
|
smalltalk.method({
|
1083
|
-
selector: "
|
1175
|
+
selector: "basicAddSubclassOf:named:instanceVariableNames:package:",
|
1084
1176
|
category: 'private',
|
1085
1177
|
fn: function (aClass,aString,aCollection,packageName){
|
1086
1178
|
var self=this;
|
1087
|
-
smalltalk.
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1179
|
+
return smalltalk.withContext(function($ctx1) {
|
1180
|
+
smalltalk.addClass(aString, aClass, aCollection, packageName);
|
1181
|
+
return smalltalk[aString]
|
1182
|
+
;
|
1183
|
+
return self}, function($ctx1) {$ctx1.fill(self,"basicAddSubclassOf:named:instanceVariableNames:package:",{aClass:aClass,aString:aString,aCollection:aCollection,packageName:packageName}, smalltalk.ClassBuilder)})},
|
1091
1184
|
args: ["aClass", "aString", "aCollection", "packageName"],
|
1092
|
-
source: "
|
1185
|
+
source: "basicAddSubclassOf: aClass named: aString instanceVariableNames: aCollection package: packageName\x0a\x09<\x0a\x09\x09smalltalk.addClass(aString, aClass, aCollection, packageName);\x0a\x09\x09return smalltalk[aString]\x0a\x09>",
|
1093
1186
|
messageSends: [],
|
1094
1187
|
referencedClasses: []
|
1095
1188
|
}),
|
1096
1189
|
smalltalk.ClassBuilder);
|
1097
1190
|
|
1098
1191
|
smalltalk.addMethod(
|
1099
|
-
"
|
1192
|
+
"_basicClass_instanceVariableNames_",
|
1100
1193
|
smalltalk.method({
|
1101
|
-
selector: "
|
1102
|
-
category: '
|
1194
|
+
selector: "basicClass:instanceVariableNames:",
|
1195
|
+
category: 'private',
|
1103
1196
|
fn: function (aClass,aString){
|
1104
1197
|
var self=this;
|
1105
|
-
|
1106
|
-
$
|
1198
|
+
return smalltalk.withContext(function($ctx1) {
|
1199
|
+
return self}, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariableNames:",{aClass:aClass,aString:aString}, smalltalk.ClassBuilder)})},
|
1200
|
+
args: ["aClass", "aString"],
|
1201
|
+
source: "basicClass: aClass instanceVariableNames: aString\x0a\x09self basicClass: aClass instanceVariables: (self instanceVariableNamesFor: aString)",
|
1202
|
+
messageSends: ["basicClass:instanceVariables:", "instanceVariableNamesFor:"],
|
1203
|
+
referencedClasses: []
|
1204
|
+
}),
|
1205
|
+
smalltalk.ClassBuilder);
|
1206
|
+
|
1207
|
+
smalltalk.addMethod(
|
1208
|
+
"_basicClass_instanceVariables_",
|
1209
|
+
smalltalk.method({
|
1210
|
+
selector: "basicClass:instanceVariables:",
|
1211
|
+
category: 'private',
|
1212
|
+
fn: function (aClass,aCollection){
|
1213
|
+
var self=this;
|
1214
|
+
return smalltalk.withContext(function($ctx1) {
|
1215
|
+
$1=_st(aClass)._isMetaclass();
|
1107
1216
|
if(! smalltalk.assert($1)){
|
1108
|
-
|
1217
|
+
_st(self)._error_(_st(_st(aClass)._name()).__comma(" is not a metaclass"));
|
1109
1218
|
};
|
1110
|
-
|
1111
|
-
$
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1219
|
+
_st(aClass)._basicAt_put_("iVarNames",aCollection);
|
1220
|
+
return self}, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariables:",{aClass:aClass,aCollection:aCollection}, smalltalk.ClassBuilder)})},
|
1221
|
+
args: ["aClass", "aCollection"],
|
1222
|
+
source: "basicClass: aClass instanceVariables: aCollection\x0a\x0a\x09aClass isMetaclass ifFalse: [self error: aClass name, ' is not a metaclass'].\x0a\x09aClass basicAt: 'iVarNames' put: aCollection",
|
1223
|
+
messageSends: ["ifFalse:", "error:", ",", "name", "isMetaclass", "basicAt:put:"],
|
1224
|
+
referencedClasses: []
|
1225
|
+
}),
|
1226
|
+
smalltalk.ClassBuilder);
|
1227
|
+
|
1228
|
+
smalltalk.addMethod(
|
1229
|
+
"_basicRemoveClass_",
|
1230
|
+
smalltalk.method({
|
1231
|
+
selector: "basicRemoveClass:",
|
1232
|
+
category: 'private',
|
1233
|
+
fn: function (aClass){
|
1234
|
+
var self=this;
|
1235
|
+
return smalltalk.withContext(function($ctx1) {
|
1236
|
+
return self}, function($ctx1) {$ctx1.fill(self,"basicRemoveClass:",{aClass:aClass}, smalltalk.ClassBuilder)})},
|
1237
|
+
args: ["aClass"],
|
1238
|
+
source: "basicRemoveClass: aClass\x0a\x09<smalltalk.removeClass(aClass)>",
|
1239
|
+
messageSends: [],
|
1240
|
+
referencedClasses: []
|
1241
|
+
}),
|
1242
|
+
smalltalk.ClassBuilder);
|
1243
|
+
|
1244
|
+
smalltalk.addMethod(
|
1245
|
+
"_basicRenameClass_to_",
|
1246
|
+
smalltalk.method({
|
1247
|
+
selector: "basicRenameClass:to:",
|
1248
|
+
category: 'private',
|
1249
|
+
fn: function (aClass,aString){
|
1250
|
+
var self=this;
|
1251
|
+
return smalltalk.withContext(function($ctx1) {
|
1252
|
+
smalltalk[aString] = aClass;
|
1253
|
+
delete smalltalk[aClass.className];
|
1254
|
+
aClass.className = aString;
|
1255
|
+
;
|
1256
|
+
return self}, function($ctx1) {$ctx1.fill(self,"basicRenameClass:to:",{aClass:aClass,aString:aString}, smalltalk.ClassBuilder)})},
|
1117
1257
|
args: ["aClass", "aString"],
|
1118
|
-
source: "
|
1119
|
-
messageSends: [
|
1258
|
+
source: "basicRenameClass: aClass to: aString\x0a\x09<\x0a\x09\x09smalltalk[aString] = aClass;\x0a\x09\x09delete smalltalk[aClass.className];\x0a\x09\x09aClass.className = aString;\x0a\x09>",
|
1259
|
+
messageSends: [],
|
1260
|
+
referencedClasses: []
|
1261
|
+
}),
|
1262
|
+
smalltalk.ClassBuilder);
|
1263
|
+
|
1264
|
+
smalltalk.addMethod(
|
1265
|
+
"_class_instanceVariableNames_",
|
1266
|
+
smalltalk.method({
|
1267
|
+
selector: "class:instanceVariableNames:",
|
1268
|
+
category: 'api',
|
1269
|
+
fn: function (aClass,aString){
|
1270
|
+
var self=this;
|
1271
|
+
return smalltalk.withContext(function($ctx1) {
|
1272
|
+
_st(self)._basicClass_instanceVariableNames_(aClass,aString);
|
1273
|
+
_st(self)._setupClass_(aClass);
|
1274
|
+
$1=_st((smalltalk.ClassDefinitionChanged || ClassDefinitionChanged))._new();
|
1275
|
+
_st($1)._theClass_(aClass);
|
1276
|
+
$2=_st($1)._yourself();
|
1277
|
+
_st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
|
1278
|
+
return self}, function($ctx1) {$ctx1.fill(self,"class:instanceVariableNames:",{aClass:aClass,aString:aString}, smalltalk.ClassBuilder)})},
|
1279
|
+
args: ["aClass", "aString"],
|
1280
|
+
source: "class: aClass instanceVariableNames: aString\x0a\x09self basicClass: aClass instanceVariableNames: aString.\x0a self setupClass: aClass.\x0a \x0a SystemAnnouncer current\x0a \x09announce: (ClassDefinitionChanged new\x0a \x09theClass: aClass;\x0a yourself)",
|
1281
|
+
messageSends: ["basicClass:instanceVariableNames:", "setupClass:", "announce:", "theClass:", "new", "yourself", "current"],
|
1120
1282
|
referencedClasses: ["ClassDefinitionChanged", "SystemAnnouncer"]
|
1121
1283
|
}),
|
1122
1284
|
smalltalk.ClassBuilder);
|
@@ -1129,24 +1291,64 @@ category: 'private',
|
|
1129
1291
|
fn: function (aClass,aString){
|
1130
1292
|
var self=this;
|
1131
1293
|
var newClass;
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
return smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler),"_new",[]),"_install_forClass_category_",[smalltalk.send(each,"_source",[]),smalltalk.send(newClass,"_class",[]),smalltalk.send(each,"_category",[])]);
|
1139
|
-
})]);
|
1140
|
-
smalltalk.send(self,"_setupClass_",[newClass]);
|
1141
|
-
return newClass;
|
1142
|
-
},
|
1294
|
+
return smalltalk.withContext(function($ctx1) {
|
1295
|
+
newClass=_st(self)._addSubclassOf_named_instanceVariableNames_package_(_st(aClass)._superclass(),aString,_st(aClass)._instanceVariableNames(),_st(_st(aClass)._package())._name());
|
1296
|
+
_st(self)._copyClass_to_(aClass,newClass);
|
1297
|
+
$1=newClass;
|
1298
|
+
return $1;
|
1299
|
+
}, function($ctx1) {$ctx1.fill(self,"copyClass:named:",{aClass:aClass,aString:aString,newClass:newClass}, smalltalk.ClassBuilder)})},
|
1143
1300
|
args: ["aClass", "aString"],
|
1144
|
-
source: "copyClass: aClass named: aString\x0a\x09| newClass |\x0a\x0a\x09newClass := self \x0a\x09\x09addSubclassOf: aClass superclass\x0a\x09\x09named: aString \x0a\x09\x09instanceVariableNames: aClass instanceVariableNames \x0a\x09\x09package: aClass package name.\x0a\x0a\x09self
|
1145
|
-
messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "instanceVariableNames", "name", "package", "
|
1301
|
+
source: "copyClass: aClass named: aString\x0a\x09| newClass |\x0a\x0a\x09newClass := self \x0a\x09\x09addSubclassOf: aClass superclass\x0a\x09\x09named: aString \x0a\x09\x09instanceVariableNames: aClass instanceVariableNames \x0a\x09\x09package: aClass package name.\x0a\x0a\x09self copyClass: aClass to: newClass.\x0a \x0a\x09^newClass",
|
1302
|
+
messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "instanceVariableNames", "name", "package", "copyClass:to:"],
|
1303
|
+
referencedClasses: []
|
1304
|
+
}),
|
1305
|
+
smalltalk.ClassBuilder);
|
1306
|
+
|
1307
|
+
smalltalk.addMethod(
|
1308
|
+
"_copyClass_to_",
|
1309
|
+
smalltalk.method({
|
1310
|
+
selector: "copyClass:to:",
|
1311
|
+
category: 'private',
|
1312
|
+
fn: function (aClass,anotherClass){
|
1313
|
+
var self=this;
|
1314
|
+
return smalltalk.withContext(function($ctx1) {
|
1315
|
+
_st(_st(_st(aClass)._methodDictionary())._values())._do_((function(each){
|
1316
|
+
return smalltalk.withContext(function($ctx2) {
|
1317
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
1318
|
+
_st(_st(_st(_st(aClass)._class())._methodDictionary())._values())._do_((function(each){
|
1319
|
+
return smalltalk.withContext(function($ctx2) {
|
1320
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
1321
|
+
_st(self)._basicClass_instanceVariables_(_st(anotherClass)._class(),_st(_st(aClass)._class())._instanceVariableNames());
|
1322
|
+
_st(self)._setupClass_(anotherClass);
|
1323
|
+
return self}, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,anotherClass:anotherClass}, smalltalk.ClassBuilder)})},
|
1324
|
+
args: ["aClass", "anotherClass"],
|
1325
|
+
source: "copyClass: aClass to: anotherClass\x0a\x0a\x09anotherClass comment: aClass comment.\x0a\x0a\x09aClass methodDictionary values do: [ :each |\x0a\x09\x09Compiler new install: each source forClass: anotherClass category: each category ].\x0a\x0a\x09aClass class methodDictionary values do: [ :each |\x0a\x09\x09Compiler new install: each source forClass: anotherClass class category: each category ].\x0a\x0a\x09self basicClass: anotherClass class instanceVariables: aClass class instanceVariableNames.\x0a\x0a\x09self setupClass: anotherClass",
|
1326
|
+
messageSends: ["comment:", "comment", "do:", "install:forClass:category:", "source", "category", "new", "values", "methodDictionary", "class", "basicClass:instanceVariables:", "instanceVariableNames", "setupClass:"],
|
1146
1327
|
referencedClasses: ["Compiler"]
|
1147
1328
|
}),
|
1148
1329
|
smalltalk.ClassBuilder);
|
1149
1330
|
|
1331
|
+
smalltalk.addMethod(
|
1332
|
+
"_installMethod_forClass_category_",
|
1333
|
+
smalltalk.method({
|
1334
|
+
selector: "installMethod:forClass:category:",
|
1335
|
+
category: 'api',
|
1336
|
+
fn: function (aCompiledMethod,aBehavior,aString){
|
1337
|
+
var self=this;
|
1338
|
+
return smalltalk.withContext(function($ctx1) {
|
1339
|
+
_st(aCompiledMethod)._category_(aString);
|
1340
|
+
_st(aBehavior)._addCompiledMethod_(aCompiledMethod);
|
1341
|
+
_st(self)._setupClass_(aBehavior);
|
1342
|
+
$1=aCompiledMethod;
|
1343
|
+
return $1;
|
1344
|
+
}, function($ctx1) {$ctx1.fill(self,"installMethod:forClass:category:",{aCompiledMethod:aCompiledMethod,aBehavior:aBehavior,aString:aString}, smalltalk.ClassBuilder)})},
|
1345
|
+
args: ["aCompiledMethod", "aBehavior", "aString"],
|
1346
|
+
source: "installMethod: aCompiledMethod forClass: aBehavior category: aString\x0a\x09aCompiledMethod category: aString.\x0a\x09aBehavior addCompiledMethod: aCompiledMethod.\x0a self setupClass: aBehavior.\x0a\x09^aCompiledMethod",
|
1347
|
+
messageSends: ["category:", "addCompiledMethod:", "setupClass:"],
|
1348
|
+
referencedClasses: []
|
1349
|
+
}),
|
1350
|
+
smalltalk.ClassBuilder);
|
1351
|
+
|
1150
1352
|
smalltalk.addMethod(
|
1151
1353
|
"_instanceVariableNamesFor_",
|
1152
1354
|
smalltalk.method({
|
@@ -1154,41 +1356,87 @@ selector: "instanceVariableNamesFor:",
|
|
1154
1356
|
category: 'private',
|
1155
1357
|
fn: function (aString){
|
1156
1358
|
var self=this;
|
1157
|
-
|
1158
|
-
$1=
|
1159
|
-
return smalltalk.
|
1160
|
-
})
|
1359
|
+
return smalltalk.withContext(function($ctx1) {
|
1360
|
+
$1=_st(_st(aString)._tokenize_(" "))._reject_((function(each){
|
1361
|
+
return smalltalk.withContext(function($ctx2) {
|
1362
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
1161
1363
|
return $1;
|
1162
|
-
},
|
1364
|
+
}, function($ctx1) {$ctx1.fill(self,"instanceVariableNamesFor:",{aString:aString}, smalltalk.ClassBuilder)})},
|
1163
1365
|
args: ["aString"],
|
1164
|
-
source: "instanceVariableNamesFor: aString\x0a\x09^(aString tokenize: ' ') reject: [:each | each isEmpty]",
|
1366
|
+
source: "instanceVariableNamesFor: aString\x0a\x09^(aString tokenize: ' ') reject: [ :each | each isEmpty ]",
|
1165
1367
|
messageSends: ["reject:", "isEmpty", "tokenize:"],
|
1166
1368
|
referencedClasses: []
|
1167
1369
|
}),
|
1168
1370
|
smalltalk.ClassBuilder);
|
1169
1371
|
|
1372
|
+
smalltalk.addMethod(
|
1373
|
+
"_migrateClass_superclass_",
|
1374
|
+
smalltalk.method({
|
1375
|
+
selector: "migrateClass:superclass:",
|
1376
|
+
category: 'private',
|
1377
|
+
fn: function (aClass,anotherClass){
|
1378
|
+
var self=this;
|
1379
|
+
return smalltalk.withContext(function($ctx1) {
|
1380
|
+
return self}, function($ctx1) {$ctx1.fill(self,"migrateClass:superclass:",{aClass:aClass,anotherClass:anotherClass}, smalltalk.ClassBuilder)})},
|
1381
|
+
args: ["aClass", "anotherClass"],
|
1382
|
+
source: "migrateClass: aClass superclass: anotherClass\x0a\x09self \x0a \x09migrateClassNamed: aClass name\x0a superclass: anotherClass\x0a instanceVariableNames: aClass instanceVariableNames\x0a package: aClass package name",
|
1383
|
+
messageSends: ["migrateClassNamed:superclass:instanceVariableNames:package:", "name", "instanceVariableNames", "package"],
|
1384
|
+
referencedClasses: []
|
1385
|
+
}),
|
1386
|
+
smalltalk.ClassBuilder);
|
1387
|
+
|
1388
|
+
smalltalk.addMethod(
|
1389
|
+
"_migrateClassNamed_superclass_instanceVariableNames_package_",
|
1390
|
+
smalltalk.method({
|
1391
|
+
selector: "migrateClassNamed:superclass:instanceVariableNames:package:",
|
1392
|
+
category: 'private',
|
1393
|
+
fn: function (aString,aClass,aCollection,packageName){
|
1394
|
+
var self=this;
|
1395
|
+
var oldClass,newClass;
|
1396
|
+
return smalltalk.withContext(function($ctx1) {
|
1397
|
+
oldClass=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(aString);
|
1398
|
+
_st(self)._basicRenameClass_to_(oldClass,_st("Old").__comma(aString));
|
1399
|
+
newClass=_st(self)._addSubclassOf_named_instanceVariableNames_package_(aClass,aString,aCollection,packageName);
|
1400
|
+
_st(_st(oldClass)._subclasses())._do_((function(each){
|
1401
|
+
return smalltalk.withContext(function($ctx2) {
|
1402
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
1403
|
+
_st((function(){
|
1404
|
+
return smalltalk.withContext(function($ctx2) {
|
1405
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.Error || Error),(function(exception){
|
1406
|
+
return smalltalk.withContext(function($ctx2) {
|
1407
|
+
_st($1)._basicRemoveClass_(newClass);
|
1408
|
+
$2=_st($1)._basicRenameClass_to_(oldClass,aString);
|
1409
|
+
$2;
|
1410
|
+
return _st(exception)._signal();
|
1411
|
+
}, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1)})}));
|
1412
|
+
_st(self)._basicRemoveClass_(oldClass);
|
1413
|
+
$3=newClass;
|
1414
|
+
return $3;
|
1415
|
+
}, function($ctx1) {$ctx1.fill(self,"migrateClassNamed:superclass:instanceVariableNames:package:",{aString:aString,aClass:aClass,aCollection:aCollection,packageName:packageName,oldClass:oldClass,newClass:newClass}, smalltalk.ClassBuilder)})},
|
1416
|
+
args: ["aString", "aClass", "aCollection", "packageName"],
|
1417
|
+
source: "migrateClassNamed: aString superclass: aClass instanceVariableNames: aCollection package: packageName\x0a\x09| oldClass newClass |\x0a \x0a oldClass := Smalltalk current at: aString.\x0a \x0a \x22Rename the old class for existing instances\x22\x0a\x09self basicRenameClass: oldClass to: 'Old', aString.\x0a \x0a newClass := self \x0a\x09\x09addSubclassOf: aClass\x0a\x09\x09named: aString \x0a\x09\x09instanceVariableNames: aCollection\x0a\x09\x09package: packageName.\x0a\x0a\x09oldClass subclasses do: [ :each |\x0a \x09self migrateClass: each superclass: newClass ].\x0a\x0a [ self copyClass: oldClass to: newClass ] \x0a \x09on: Error\x0a do: [ :exception |\x0a \x09self \x0a \x09basicRemoveClass: newClass;\x0a \x09basicRenameClass: oldClass to: aString.\x0a exception signal ].\x0a \x0a self basicRemoveClass: oldClass.\x0a\x09^newClass",
|
1418
|
+
messageSends: ["at:", "current", "basicRenameClass:to:", ",", "addSubclassOf:named:instanceVariableNames:package:", "do:", "migrateClass:superclass:", "subclasses", "on:do:", "basicRemoveClass:", "signal", "copyClass:to:"],
|
1419
|
+
referencedClasses: ["Smalltalk", "Error"]
|
1420
|
+
}),
|
1421
|
+
smalltalk.ClassBuilder);
|
1422
|
+
|
1170
1423
|
smalltalk.addMethod(
|
1171
1424
|
"_renameClass_to_",
|
1172
1425
|
smalltalk.method({
|
1173
1426
|
selector: "renameClass:to:",
|
1174
|
-
category: '
|
1427
|
+
category: 'api',
|
1175
1428
|
fn: function (aClass,aString){
|
1176
1429
|
var self=this;
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
$1=smalltalk.send((smalltalk.ClassRenamed || ClassRenamed),"_new",[]);
|
1185
|
-
smalltalk.send($1,"_theClass_",[aClass]);
|
1186
|
-
$2=smalltalk.send($1,"_yourself",[]);
|
1187
|
-
smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$2]);
|
1188
|
-
return self},
|
1430
|
+
return smalltalk.withContext(function($ctx1) {
|
1431
|
+
_st(self)._basicRenameClass_to_(aClass,aString);
|
1432
|
+
$1=_st((smalltalk.ClassRenamed || ClassRenamed))._new();
|
1433
|
+
_st($1)._theClass_(aClass);
|
1434
|
+
$2=_st($1)._yourself();
|
1435
|
+
_st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($2);
|
1436
|
+
return self}, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,aString:aString}, smalltalk.ClassBuilder)})},
|
1189
1437
|
args: ["aClass", "aString"],
|
1190
|
-
source: "renameClass: aClass to: aString\x0a\
|
1191
|
-
messageSends: ["announce:", "theClass:", "new", "yourself", "current"],
|
1438
|
+
source: "renameClass: aClass to: aString\x0a\x09self basicRenameClass: aClass to: aString.\x0a \x0a SystemAnnouncer current\x0a \x09announce: (ClassRenamed new\x0a \x09theClass: aClass;\x0a yourself)",
|
1439
|
+
messageSends: ["basicRenameClass:to:", "announce:", "theClass:", "new", "yourself", "current"],
|
1192
1440
|
referencedClasses: ["ClassRenamed", "SystemAnnouncer"]
|
1193
1441
|
}),
|
1194
1442
|
smalltalk.ClassBuilder);
|
@@ -1197,12 +1445,11 @@ smalltalk.addMethod(
|
|
1197
1445
|
"_setupClass_",
|
1198
1446
|
smalltalk.method({
|
1199
1447
|
selector: "setupClass:",
|
1200
|
-
category: '
|
1448
|
+
category: 'api',
|
1201
1449
|
fn: function (aClass){
|
1202
1450
|
var self=this;
|
1203
|
-
smalltalk.
|
1204
|
-
|
1205
|
-
return self},
|
1451
|
+
return smalltalk.withContext(function($ctx1) {
|
1452
|
+
return self}, function($ctx1) {$ctx1.fill(self,"setupClass:",{aClass:aClass}, smalltalk.ClassBuilder)})},
|
1206
1453
|
args: ["aClass"],
|
1207
1454
|
source: "setupClass: aClass\x0a\x09<smalltalk.init(aClass);>",
|
1208
1455
|
messageSends: [],
|
@@ -1214,13 +1461,13 @@ smalltalk.addMethod(
|
|
1214
1461
|
"_superclass_subclass_",
|
1215
1462
|
smalltalk.method({
|
1216
1463
|
selector: "superclass:subclass:",
|
1217
|
-
category: '
|
1464
|
+
category: 'api',
|
1218
1465
|
fn: function (aClass,aString){
|
1219
1466
|
var self=this;
|
1220
|
-
|
1221
|
-
$1=
|
1467
|
+
return smalltalk.withContext(function($ctx1) {
|
1468
|
+
$1=_st(self)._superclass_subclass_instanceVariableNames_package_(aClass,aString,"",nil);
|
1222
1469
|
return $1;
|
1223
|
-
},
|
1470
|
+
}, function($ctx1) {$ctx1.fill(self,"superclass:subclass:",{aClass:aClass,aString:aString}, smalltalk.ClassBuilder)})},
|
1224
1471
|
args: ["aClass", "aString"],
|
1225
1472
|
source: "superclass: aClass subclass: aString\x0a\x09^self superclass: aClass subclass: aString instanceVariableNames: '' package: nil",
|
1226
1473
|
messageSends: ["superclass:subclass:instanceVariableNames:package:"],
|
@@ -1232,24 +1479,30 @@ smalltalk.addMethod(
|
|
1232
1479
|
"_superclass_subclass_instanceVariableNames_package_",
|
1233
1480
|
smalltalk.method({
|
1234
1481
|
selector: "superclass:subclass:instanceVariableNames:package:",
|
1235
|
-
category: '
|
1482
|
+
category: 'api',
|
1236
1483
|
fn: function (aClass,aString,aString2,aString3){
|
1237
1484
|
var self=this;
|
1238
|
-
var $1,$2,$3;
|
1239
1485
|
var newClass;
|
1240
|
-
|
1241
|
-
$1=
|
1486
|
+
return smalltalk.withContext(function($ctx1) {
|
1487
|
+
$1=self;
|
1488
|
+
$2=aClass;
|
1489
|
+
$3=aString;
|
1490
|
+
$4=_st(self)._instanceVariableNamesFor_(aString2);
|
1491
|
+
$6=aString3;
|
1492
|
+
if(($receiver = $6) == nil || $receiver == undefined){
|
1493
|
+
$5="unclassified";
|
1242
1494
|
} else {
|
1243
|
-
$
|
1495
|
+
$5=$6;
|
1244
1496
|
};
|
1245
|
-
newClass=
|
1246
|
-
|
1247
|
-
$
|
1248
|
-
|
1249
|
-
$
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1497
|
+
newClass=_st($1)._addSubclassOf_named_instanceVariableNames_package_($2,$3,$4,$5);
|
1498
|
+
_st(self)._setupClass_(newClass);
|
1499
|
+
$7=_st((smalltalk.ClassAdded || ClassAdded))._new();
|
1500
|
+
_st($7)._theClass_(newClass);
|
1501
|
+
$8=_st($7)._yourself();
|
1502
|
+
_st(_st((smalltalk.SystemAnnouncer || SystemAnnouncer))._current())._announce_($8);
|
1503
|
+
$9=newClass;
|
1504
|
+
return $9;
|
1505
|
+
}, function($ctx1) {$ctx1.fill(self,"superclass:subclass:instanceVariableNames:package:",{aClass:aClass,aString:aString,aString2:aString2,aString3:aString3,newClass:newClass}, smalltalk.ClassBuilder)})},
|
1253
1506
|
args: ["aClass", "aString", "aString2", "aString3"],
|
1254
1507
|
source: "superclass: aClass subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09| newClass |\x0a\x09\x0a newClass := self addSubclassOf: aClass\x0a\x09\x09named: aString instanceVariableNames: (self instanceVariableNamesFor: aString2)\x0a\x09\x09package: (aString3 ifNil: ['unclassified']).\x0a\x09self setupClass: newClass.\x0a \x0a SystemAnnouncer current \x0a \x09announce: (ClassAdded new\x0a \x09theClass: newClass;\x0a yourself).\x0a \x0a\x09^newClass",
|
1255
1508
|
messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "instanceVariableNamesFor:", "ifNil:", "setupClass:", "announce:", "theClass:", "new", "yourself", "current"],
|
@@ -1259,7 +1512,7 @@ smalltalk.ClassBuilder);
|
|
1259
1512
|
|
1260
1513
|
|
1261
1514
|
|
1262
|
-
smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category'
|
1515
|
+
smalltalk.addClass('ClassCategoryReader', smalltalk.Object, ['class', 'category'], 'Kernel-Classes');
|
1263
1516
|
smalltalk.ClassCategoryReader.comment="ClassCategoryReader represents a mechanism for retrieving class descriptions stored on a file."
|
1264
1517
|
smalltalk.addMethod(
|
1265
1518
|
"_class_category_",
|
@@ -1268,9 +1521,9 @@ selector: "class:category:",
|
|
1268
1521
|
category: 'accessing',
|
1269
1522
|
fn: function (aClass,aString){
|
1270
1523
|
var self=this;
|
1271
|
-
|
1524
|
+
return smalltalk.withContext(function($ctx1) {
|
1272
1525
|
self["@category"]=aString;
|
1273
|
-
return self},
|
1526
|
+
return self}, function($ctx1) {$ctx1.fill(self,"class:category:",{aClass:aClass,aString:aString}, smalltalk.ClassCategoryReader)})},
|
1274
1527
|
args: ["aClass", "aString"],
|
1275
1528
|
source: "class: aClass category: aString\x0a\x09class := aClass.\x0a\x09category := aString",
|
1276
1529
|
messageSends: [],
|
@@ -1285,8 +1538,8 @@ selector: "compileMethod:",
|
|
1285
1538
|
category: 'private',
|
1286
1539
|
fn: function (aString){
|
1287
1540
|
var self=this;
|
1288
|
-
smalltalk.
|
1289
|
-
return self},
|
1541
|
+
return smalltalk.withContext(function($ctx1) {
|
1542
|
+
return self}, function($ctx1) {$ctx1.fill(self,"compileMethod:",{aString:aString}, smalltalk.ClassCategoryReader)})},
|
1290
1543
|
args: ["aString"],
|
1291
1544
|
source: "compileMethod: aString\x0a\x09Compiler new install: aString forClass: class category: category",
|
1292
1545
|
messageSends: ["install:forClass:category:", "new"],
|
@@ -1301,13 +1554,12 @@ selector: "initialize",
|
|
1301
1554
|
category: 'initialization',
|
1302
1555
|
fn: function (){
|
1303
1556
|
var self=this;
|
1304
|
-
smalltalk.
|
1305
|
-
self
|
1306
|
-
return self},
|
1557
|
+
return smalltalk.withContext(function($ctx1) {
|
1558
|
+
return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ClassCategoryReader)})},
|
1307
1559
|
args: [],
|
1308
|
-
source: "initialize\x0a\x09super initialize
|
1309
|
-
messageSends: ["initialize"
|
1310
|
-
referencedClasses: [
|
1560
|
+
source: "initialize\x0a\x09super initialize.",
|
1561
|
+
messageSends: ["initialize"],
|
1562
|
+
referencedClasses: []
|
1311
1563
|
}),
|
1312
1564
|
smalltalk.ClassCategoryReader);
|
1313
1565
|
|
@@ -1319,26 +1571,26 @@ category: 'fileIn',
|
|
1319
1571
|
fn: function (aChunkParser){
|
1320
1572
|
var self=this;
|
1321
1573
|
var chunk;
|
1322
|
-
smalltalk.
|
1323
|
-
|
1574
|
+
return smalltalk.withContext(function($ctx1) {
|
1575
|
+
return smalltalk.withContext(function($ctx2) {
|
1324
1576
|
chunk;
|
1325
|
-
return
|
1326
|
-
})
|
1327
|
-
return smalltalk.
|
1328
|
-
})
|
1329
|
-
|
1330
|
-
return self},
|
1577
|
+
return _st(chunk)._isEmpty();
|
1578
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
|
1579
|
+
return smalltalk.withContext(function($ctx2) {
|
1580
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
1581
|
+
_st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._setupClass_(self["@class"]);
|
1582
|
+
return self}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk}, smalltalk.ClassCategoryReader)})},
|
1331
1583
|
args: ["aChunkParser"],
|
1332
|
-
source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09[chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty] whileFalse: [\x0a\x09 self compileMethod: chunk].\x0a\
|
1584
|
+
source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09[chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty] whileFalse: [\x0a\x09 self compileMethod: chunk].\x0a\x09ClassBuilder new setupClass: class",
|
1333
1585
|
messageSends: ["whileFalse:", "compileMethod:", "nextChunk", "isEmpty", "setupClass:", "new"],
|
1334
|
-
referencedClasses: ["
|
1586
|
+
referencedClasses: ["ClassBuilder"]
|
1335
1587
|
}),
|
1336
1588
|
smalltalk.ClassCategoryReader);
|
1337
1589
|
|
1338
1590
|
|
1339
1591
|
|
1340
|
-
smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class'
|
1341
|
-
smalltalk.ClassCommentReader.comment="ClassCommentReader represents a mechanism for retrieving class
|
1592
|
+
smalltalk.addClass('ClassCommentReader', smalltalk.Object, ['class'], 'Kernel-Classes');
|
1593
|
+
smalltalk.ClassCommentReader.comment="ClassCommentReader represents a mechanism for retrieving class comments stored on a file.\x0aSee `ClassCategoryReader` too."
|
1342
1594
|
smalltalk.addMethod(
|
1343
1595
|
"_class_",
|
1344
1596
|
smalltalk.method({
|
@@ -1346,8 +1598,8 @@ selector: "class:",
|
|
1346
1598
|
category: 'accessing',
|
1347
1599
|
fn: function (aClass){
|
1348
1600
|
var self=this;
|
1349
|
-
|
1350
|
-
return self},
|
1601
|
+
return smalltalk.withContext(function($ctx1) {
|
1602
|
+
return self}, function($ctx1) {$ctx1.fill(self,"class:",{aClass:aClass}, smalltalk.ClassCommentReader)})},
|
1351
1603
|
args: ["aClass"],
|
1352
1604
|
source: "class: aClass\x0a\x09class := aClass",
|
1353
1605
|
messageSends: [],
|
@@ -1362,13 +1614,12 @@ selector: "initialize",
|
|
1362
1614
|
category: 'initialization',
|
1363
1615
|
fn: function (){
|
1364
1616
|
var self=this;
|
1365
|
-
smalltalk.
|
1366
|
-
self
|
1367
|
-
return self},
|
1617
|
+
return smalltalk.withContext(function($ctx1) {
|
1618
|
+
return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ClassCommentReader)})},
|
1368
1619
|
args: [],
|
1369
|
-
source: "initialize\x0a\x09super initialize
|
1370
|
-
messageSends: ["initialize"
|
1371
|
-
referencedClasses: [
|
1620
|
+
source: "initialize\x0a\x09super initialize.",
|
1621
|
+
messageSends: ["initialize"],
|
1622
|
+
referencedClasses: []
|
1372
1623
|
}),
|
1373
1624
|
smalltalk.ClassCommentReader);
|
1374
1625
|
|
@@ -1379,14 +1630,14 @@ selector: "scanFrom:",
|
|
1379
1630
|
category: 'fileIn',
|
1380
1631
|
fn: function (aChunkParser){
|
1381
1632
|
var self=this;
|
1382
|
-
var $1;
|
1383
1633
|
var chunk;
|
1384
|
-
|
1385
|
-
|
1634
|
+
return smalltalk.withContext(function($ctx1) {
|
1635
|
+
chunk=_st(aChunkParser)._nextChunk();
|
1636
|
+
$1=_st(chunk)._isEmpty();
|
1386
1637
|
if(! smalltalk.assert($1)){
|
1387
|
-
|
1638
|
+
_st(self)._setComment_(chunk);
|
1388
1639
|
};
|
1389
|
-
return self},
|
1640
|
+
return self}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk}, smalltalk.ClassCommentReader)})},
|
1390
1641
|
args: ["aChunkParser"],
|
1391
1642
|
source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty ifFalse: [\x0a\x09 self setComment: chunk].",
|
1392
1643
|
messageSends: ["nextChunk", "ifFalse:", "setComment:", "isEmpty"],
|
@@ -1401,8 +1652,8 @@ selector: "setComment:",
|
|
1401
1652
|
category: 'private',
|
1402
1653
|
fn: function (aString){
|
1403
1654
|
var self=this;
|
1404
|
-
smalltalk.
|
1405
|
-
return self},
|
1655
|
+
return smalltalk.withContext(function($ctx1) {
|
1656
|
+
return self}, function($ctx1) {$ctx1.fill(self,"setComment:",{aString:aString}, smalltalk.ClassCommentReader)})},
|
1406
1657
|
args: ["aString"],
|
1407
1658
|
source: "setComment: aString\x0a class comment: aString",
|
1408
1659
|
messageSends: ["comment:"],
|
@@ -1420,23 +1671,24 @@ selector: "getNodesFrom:",
|
|
1420
1671
|
category: 'accessing',
|
1421
1672
|
fn: function (aCollection){
|
1422
1673
|
var self=this;
|
1423
|
-
var
|
1424
|
-
|
1425
|
-
var others;
|
1674
|
+
var children,others;
|
1675
|
+
return smalltalk.withContext(function($ctx1) {
|
1426
1676
|
children=[];
|
1427
1677
|
others=[];
|
1428
|
-
|
1429
|
-
$
|
1430
|
-
|
1431
|
-
|
1678
|
+
$1=aCollection;
|
1679
|
+
$2=(function(each){
|
1680
|
+
return smalltalk.withContext(function($ctx2) {
|
1681
|
+
if(smalltalk.assert($3)){
|
1682
|
+
return _st(children)._add_(each);
|
1432
1683
|
} else {
|
1433
|
-
return
|
1684
|
+
return _st(others)._add_(each);
|
1434
1685
|
};
|
1435
|
-
})
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1686
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})});
|
1687
|
+
_st($1)._do_($2);
|
1688
|
+
self["@nodes"]=_st(children)._collect_((function(each){
|
1689
|
+
return smalltalk.withContext(function($ctx2) {
|
1690
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
1691
|
+
return self}, function($ctx1) {$ctx1.fill(self,"getNodesFrom:",{aCollection:aCollection,children:children,others:others}, smalltalk.ClassSorterNode)})},
|
1440
1692
|
args: ["aCollection"],
|
1441
1693
|
source: "getNodesFrom: aCollection\x0a\x09| children others |\x0a\x09children := #().\x0a\x09others := #().\x0a\x09aCollection do: [:each |\x0a\x09\x09(each superclass = self theClass)\x0a\x09\x09\x09ifTrue: [children add: each]\x0a\x09\x09\x09ifFalse: [others add: each]].\x0a\x09nodes:= children collect: [:each |\x0a\x09\x09ClassSorterNode on: each classes: others level: self level + 1]",
|
1442
1694
|
messageSends: ["do:", "ifTrue:ifFalse:", "add:", "=", "theClass", "superclass", "collect:", "on:classes:level:", "+", "level"],
|
@@ -1451,8 +1703,10 @@ selector: "level",
|
|
1451
1703
|
category: 'accessing',
|
1452
1704
|
fn: function (){
|
1453
1705
|
var self=this;
|
1454
|
-
return
|
1455
|
-
|
1706
|
+
return smalltalk.withContext(function($ctx1) {
|
1707
|
+
$1=self["@level"];
|
1708
|
+
return $1;
|
1709
|
+
}, function($ctx1) {$ctx1.fill(self,"level",{}, smalltalk.ClassSorterNode)})},
|
1456
1710
|
args: [],
|
1457
1711
|
source: "level\x0a\x09^level",
|
1458
1712
|
messageSends: [],
|
@@ -1467,8 +1721,8 @@ selector: "level:",
|
|
1467
1721
|
category: 'accessing',
|
1468
1722
|
fn: function (anInteger){
|
1469
1723
|
var self=this;
|
1470
|
-
|
1471
|
-
return self},
|
1724
|
+
return smalltalk.withContext(function($ctx1) {
|
1725
|
+
return self}, function($ctx1) {$ctx1.fill(self,"level:",{anInteger:anInteger}, smalltalk.ClassSorterNode)})},
|
1472
1726
|
args: ["anInteger"],
|
1473
1727
|
source: "level: anInteger\x0a\x09level := anInteger",
|
1474
1728
|
messageSends: [],
|
@@ -1483,8 +1737,10 @@ selector: "nodes",
|
|
1483
1737
|
category: 'accessing',
|
1484
1738
|
fn: function (){
|
1485
1739
|
var self=this;
|
1486
|
-
return
|
1487
|
-
|
1740
|
+
return smalltalk.withContext(function($ctx1) {
|
1741
|
+
$1=self["@nodes"];
|
1742
|
+
return $1;
|
1743
|
+
}, function($ctx1) {$ctx1.fill(self,"nodes",{}, smalltalk.ClassSorterNode)})},
|
1488
1744
|
args: [],
|
1489
1745
|
source: "nodes\x0a\x09^nodes",
|
1490
1746
|
messageSends: [],
|
@@ -1499,8 +1755,10 @@ selector: "theClass",
|
|
1499
1755
|
category: 'accessing',
|
1500
1756
|
fn: function (){
|
1501
1757
|
var self=this;
|
1502
|
-
return
|
1503
|
-
|
1758
|
+
return smalltalk.withContext(function($ctx1) {
|
1759
|
+
$1=self["@theClass"];
|
1760
|
+
return $1;
|
1761
|
+
}, function($ctx1) {$ctx1.fill(self,"theClass",{}, smalltalk.ClassSorterNode)})},
|
1504
1762
|
args: [],
|
1505
1763
|
source: "theClass\x0a\x09^theClass",
|
1506
1764
|
messageSends: [],
|
@@ -1515,8 +1773,8 @@ selector: "theClass:",
|
|
1515
1773
|
category: 'accessing',
|
1516
1774
|
fn: function (aClass){
|
1517
1775
|
var self=this;
|
1518
|
-
|
1519
|
-
return self},
|
1776
|
+
return smalltalk.withContext(function($ctx1) {
|
1777
|
+
return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass}, smalltalk.ClassSorterNode)})},
|
1520
1778
|
args: ["aClass"],
|
1521
1779
|
source: "theClass: aClass\x0a\x09theClass := aClass",
|
1522
1780
|
messageSends: [],
|
@@ -1531,13 +1789,13 @@ selector: "traverseClassesWith:",
|
|
1531
1789
|
category: 'visiting',
|
1532
1790
|
fn: function (aCollection){
|
1533
1791
|
var self=this;
|
1534
|
-
smalltalk.
|
1535
|
-
|
1536
|
-
return smalltalk.
|
1537
|
-
})
|
1538
|
-
return smalltalk.
|
1539
|
-
})
|
1540
|
-
return self},
|
1792
|
+
return smalltalk.withContext(function($ctx1) {
|
1793
|
+
_st(_st(_st(self)._nodes())._sorted_((function(a,b){
|
1794
|
+
return smalltalk.withContext(function($ctx2) {
|
1795
|
+
}, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(aNode){
|
1796
|
+
return smalltalk.withContext(function($ctx2) {
|
1797
|
+
}, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1)})}));
|
1798
|
+
return self}, function($ctx1) {$ctx1.fill(self,"traverseClassesWith:",{aCollection:aCollection}, smalltalk.ClassSorterNode)})},
|
1541
1799
|
args: ["aCollection"],
|
1542
1800
|
source: "traverseClassesWith: aCollection\x0a\x09\x22sort classes alphabetically Issue #143\x22\x0a\x0a\x09aCollection add: self theClass.\x0a\x09(self nodes sorted: [:a :b | a theClass name <= b theClass name ]) do: [:aNode |\x0a\x09\x09aNode traverseClassesWith: aCollection ].",
|
1543
1801
|
messageSends: ["add:", "theClass", "do:", "traverseClassesWith:", "sorted:", "<=", "name", "nodes"],
|
@@ -1553,15 +1811,15 @@ selector: "on:classes:level:",
|
|
1553
1811
|
category: 'instance creation',
|
1554
1812
|
fn: function (aClass,aCollection,anInteger){
|
1555
1813
|
var self=this;
|
1556
|
-
|
1557
|
-
$2=
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
$3=
|
1814
|
+
return smalltalk.withContext(function($ctx1) {
|
1815
|
+
$2=_st(self)._new();
|
1816
|
+
_st($2)._theClass_(aClass);
|
1817
|
+
_st($2)._level_(anInteger);
|
1818
|
+
_st($2)._getNodesFrom_(aCollection);
|
1819
|
+
$3=_st($2)._yourself();
|
1562
1820
|
$1=$3;
|
1563
1821
|
return $1;
|
1564
|
-
},
|
1822
|
+
}, function($ctx1) {$ctx1.fill(self,"on:classes:level:",{aClass:aClass,aCollection:aCollection,anInteger:anInteger}, smalltalk.ClassSorterNode.klass)})},
|
1565
1823
|
args: ["aClass", "aCollection", "anInteger"],
|
1566
1824
|
source: "on: aClass classes: aCollection level: anInteger\x0a\x09^self new\x0a\x09\x09theClass: aClass;\x0a\x09\x09level: anInteger;\x0a\x09\x09getNodesFrom: aCollection;\x0a\x09\x09yourself",
|
1567
1825
|
messageSends: ["theClass:", "new", "level:", "getNodesFrom:", "yourself"],
|