resin 0.2.1 → 0.2.2
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/README.markdown +2 -0
- data/amber/bin/nodecompile.js +3 -3
- data/amber/css/amber.css +47 -23
- data/amber/images/off.amber.png +0 -0
- data/amber/images/offHover.amber.png +0 -0
- data/amber/images/sprite.amber.png +0 -0
- data/amber/images/tinylogo.amber.png +0 -0
- data/amber/js/Benchfib.deploy.js +34 -34
- data/amber/js/Benchfib.js +49 -49
- data/amber/js/Canvas.deploy.js +937 -937
- data/amber/js/Canvas.js +1622 -1622
- data/amber/js/Compiler-Tests.deploy.js +97 -0
- data/amber/js/Compiler-Tests.js +137 -0
- data/amber/js/Compiler.deploy.js +1030 -924
- data/amber/js/Compiler.js +1613 -1467
- data/amber/js/Documentation.deploy.js +417 -417
- data/amber/js/Documentation.js +728 -728
- data/amber/js/Examples.deploy.js +24 -13
- data/amber/js/Examples.js +36 -19
- data/amber/js/IDE.deploy.js +1583 -1527
- data/amber/js/IDE.js +2586 -2510
- data/amber/js/Kernel-Announcements.deploy.js +19 -19
- data/amber/js/Kernel-Announcements.js +28 -28
- data/amber/js/Kernel-Classes.deploy.js +332 -229
- data/amber/js/Kernel-Classes.js +532 -384
- data/amber/js/Kernel-Collections.deploy.js +1516 -1712
- data/amber/js/Kernel-Collections.js +2436 -2712
- data/amber/js/Kernel-Exceptions.deploy.js +85 -62
- data/amber/js/Kernel-Exceptions.js +131 -98
- data/amber/js/Kernel-Methods.deploy.js +326 -378
- data/amber/js/Kernel-Methods.js +473 -525
- data/amber/js/Kernel-Objects.deploy.js +1777 -2428
- data/amber/js/Kernel-Objects.js +2599 -3426
- data/amber/js/Kernel-Tests.deploy.js +871 -772
- data/amber/js/Kernel-Tests.js +1207 -1083
- data/amber/js/Kernel-Transcript.deploy.js +57 -57
- data/amber/js/Kernel-Transcript.js +94 -94
- data/amber/js/SUnit.deploy.js +116 -116
- data/amber/js/SUnit.js +211 -211
- data/amber/js/amber.js +10 -11
- data/amber/js/boot.js +132 -156
- data/amber/js/init.js +2 -2
- data/amber/js/parser.js +2095 -3014
- data/amber/js/parser.pegjs +1 -1
- data/amber/st/Benchfib.st +22 -22
- data/amber/st/Canvas.st +471 -471
- data/amber/st/Compiler-Tests.st +471 -0
- data/amber/st/Compiler.st +858 -794
- data/amber/st/Examples.st +22 -5
- data/amber/st/IDE.st +1326 -1291
- data/amber/st/Kernel-Announcements.st +2 -2
- data/amber/st/Kernel-Classes.st +148 -90
- data/amber/st/Kernel-Collections.st +950 -1061
- data/amber/st/Kernel-Exceptions.st +33 -25
- data/amber/st/Kernel-Methods.st +151 -151
- data/amber/st/Kernel-Objects.st +891 -1036
- data/amber/st/Kernel-Tests.st +622 -544
- data/amber/st/Kernel-Transcript.st +38 -38
- data/amber/st/SUnit.st +53 -53
- metadata +27 -20
data/amber/js/Kernel-Methods.js
CHANGED
@@ -1,807 +1,755 @@
|
|
1
1
|
smalltalk.addPackage('Kernel-Methods', {});
|
2
|
-
smalltalk.addClass('
|
3
|
-
smalltalk.
|
4
|
-
smalltalk.addMethod(
|
5
|
-
unescape('_selector'),
|
6
|
-
smalltalk.method({
|
7
|
-
selector: unescape('selector'),
|
8
|
-
category: 'accessing',
|
9
|
-
fn: function () {
|
10
|
-
var self = this;
|
11
|
-
return self['@selector'];
|
12
|
-
return self;
|
13
|
-
},
|
14
|
-
args: [],
|
15
|
-
source: unescape('selector%0A%09%5Eselector'),
|
16
|
-
messageSends: [],
|
17
|
-
referencedClasses: []
|
18
|
-
}),
|
19
|
-
smalltalk.Message);
|
20
|
-
|
21
|
-
smalltalk.addMethod(
|
22
|
-
unescape('_selector_'),
|
23
|
-
smalltalk.method({
|
24
|
-
selector: unescape('selector%3A'),
|
25
|
-
category: 'accessing',
|
26
|
-
fn: function (aString) {
|
27
|
-
var self = this;
|
28
|
-
self['@selector'] = aString;
|
29
|
-
return self;
|
30
|
-
},
|
31
|
-
args: ["aString"],
|
32
|
-
source: unescape('selector%3A%20aString%0A%09selector%20%3A%3D%20aString'),
|
33
|
-
messageSends: [],
|
34
|
-
referencedClasses: []
|
35
|
-
}),
|
36
|
-
smalltalk.Message);
|
37
|
-
|
2
|
+
smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel-Methods');
|
3
|
+
smalltalk.BlockClosure.comment="A BlockClosure is a lexical closure.\x0aThe JavaScript representation is a function.\x0a\x0aA BlockClosure is evaluated with the `#value*` methods in the 'evaluating' protocol."
|
38
4
|
smalltalk.addMethod(
|
39
|
-
|
5
|
+
"_applyTo_arguments_",
|
40
6
|
smalltalk.method({
|
41
|
-
selector:
|
42
|
-
category: '
|
43
|
-
fn: function (
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
source: unescape('arguments%3A%20anArray%0A%09arguments%20%3A%3D%20anArray'),
|
7
|
+
selector: "applyTo:arguments:",
|
8
|
+
category: 'evaluating',
|
9
|
+
fn: function (anObject, aCollection){
|
10
|
+
var self=this;
|
11
|
+
return self.apply(anObject, aCollection);
|
12
|
+
return self;},
|
13
|
+
args: ["anObject", "aCollection"],
|
14
|
+
source: "applyTo: anObject arguments: aCollection\x0a\x09<return self.apply(anObject, aCollection)>",
|
50
15
|
messageSends: [],
|
51
16
|
referencedClasses: []
|
52
17
|
}),
|
53
|
-
smalltalk.
|
18
|
+
smalltalk.BlockClosure);
|
54
19
|
|
55
20
|
smalltalk.addMethod(
|
56
|
-
|
21
|
+
"_compiledSource",
|
57
22
|
smalltalk.method({
|
58
|
-
selector:
|
23
|
+
selector: "compiledSource",
|
59
24
|
category: 'accessing',
|
60
|
-
fn: function ()
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
},
|
25
|
+
fn: function (){
|
26
|
+
var self=this;
|
27
|
+
return self.toString();
|
28
|
+
return self;},
|
65
29
|
args: [],
|
66
|
-
source:
|
30
|
+
source: "compiledSource\x0a\x09<return self.toString()>",
|
67
31
|
messageSends: [],
|
68
32
|
referencedClasses: []
|
69
33
|
}),
|
70
|
-
smalltalk.
|
71
|
-
|
72
|
-
smalltalk.addMethod(
|
73
|
-
unescape('_printString'),
|
74
|
-
smalltalk.method({
|
75
|
-
selector: unescape('printString'),
|
76
|
-
category: 'printing',
|
77
|
-
fn: function () {
|
78
|
-
var self = this;
|
79
|
-
return smalltalk.send(smalltalk.String || String, "_streamContents_", [function (aStream) {return function ($rec) {smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Object)]);smalltalk.send($rec, "_nextPutAll_", [unescape("%28")]);smalltalk.send($rec, "_nextPutAll_", [self['@selector']]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%29")]);}(aStream);}]);
|
80
|
-
return self;
|
81
|
-
},
|
82
|
-
args: [],
|
83
|
-
source: unescape('printString%0A%09%5E%20String%20streamContents%3A%20%5B%3AaStream%7C%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09aStream%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20super%20printString%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27%28%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20selector%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%09%09%09%09%09nextPutAll%3A%20%27%29%27%20%09%09%09%09%5D'),
|
84
|
-
messageSends: ["streamContents:", "nextPutAll:", "printString"],
|
85
|
-
referencedClasses: ["String"]
|
86
|
-
}),
|
87
|
-
smalltalk.Message);
|
88
|
-
|
89
|
-
smalltalk.addMethod(
|
90
|
-
unescape('_sendTo_'),
|
91
|
-
smalltalk.method({
|
92
|
-
selector: unescape('sendTo%3A'),
|
93
|
-
category: 'printing',
|
94
|
-
fn: function (anObject) {
|
95
|
-
var self = this;
|
96
|
-
smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_send_to_arguments_", [smalltalk.send(self, "_selector", []), anObject, smalltalk.send(self, "_arguments", [])]);
|
97
|
-
return self;
|
98
|
-
},
|
99
|
-
args: ["anObject"],
|
100
|
-
source: unescape('sendTo%3A%20anObject%0A%09Smalltalk%20current%20send%3A%20self%20selector%20to%3A%20anObject%20arguments%3A%20self%20arguments'),
|
101
|
-
messageSends: ["send:to:arguments:", "current", "selector", "arguments"],
|
102
|
-
referencedClasses: ["Smalltalk"]
|
103
|
-
}),
|
104
|
-
smalltalk.Message);
|
105
|
-
|
34
|
+
smalltalk.BlockClosure);
|
106
35
|
|
107
36
|
smalltalk.addMethod(
|
108
|
-
|
37
|
+
"_ensure_",
|
109
38
|
smalltalk.method({
|
110
|
-
selector:
|
111
|
-
category: '
|
112
|
-
fn: function (
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
},
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
39
|
+
selector: "ensure:",
|
40
|
+
category: 'evaluating',
|
41
|
+
fn: function (aBlock){
|
42
|
+
var self=this;
|
43
|
+
var success=nil;
|
44
|
+
(success=false);
|
45
|
+
return smalltalk.send((function(){smalltalk.send(self, "_value", []);(success=true);return smalltalk.send(aBlock, "_value", []);}), "_on_do_", [(smalltalk.Error || Error), (function(ex){((($receiver = success).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(aBlock, "_value", []);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(aBlock, "_value", []);})]));return smalltalk.send(ex, "_signal", []);})]);
|
46
|
+
return self;},
|
47
|
+
args: ["aBlock"],
|
48
|
+
source: "ensure: aBlock\x0a\x09| success |\x0a\x09success := false.\x0a\x09^[self value. success := true. aBlock value]\x0a\x09\x09on: Error\x0a\x09\x09do: [:ex |\x0a\x09\x09\x09success ifFalse: [aBlock value].\x0a\x09\x09\x09ex signal]",
|
49
|
+
messageSends: ["on:do:", "value", "ifFalse:", "signal"],
|
50
|
+
referencedClasses: ["Error"]
|
121
51
|
}),
|
122
|
-
smalltalk.
|
123
|
-
|
52
|
+
smalltalk.BlockClosure);
|
124
53
|
|
125
|
-
smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');
|
126
|
-
smalltalk.MethodContext.comment=unescape('MethodContext%20holds%20all%20the%20dynamic%20state%20associated%20with%20the%20execution%20of%20either%20a%20method%20activation%20resulting%20from%20a%20message%20send.%20That%20is%20used%20to%20build%20the%20call%20stack%20while%20debugging.%0A%20%20%0AMethodContext%20instances%20are%20JavaScript%20%60SmalltalkMethodContext%60%20objects%20defined%20in%20boot.js%20%0A%0ACurrent%20limitation%3A%20MethodContext%20instances%20are%20not%20created%20on%20Block%20evaluation.%20That%20means%20it%27s%20actually%20impossible%20to%20debug%20inside%20a%20Block.')
|
127
54
|
smalltalk.addMethod(
|
128
|
-
|
55
|
+
"_new",
|
129
56
|
smalltalk.method({
|
130
|
-
selector:
|
131
|
-
category: '
|
132
|
-
fn: function ()
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
},
|
57
|
+
selector: "new",
|
58
|
+
category: 'evaluating',
|
59
|
+
fn: function (){
|
60
|
+
var self=this;
|
61
|
+
return new self();
|
62
|
+
return self;},
|
137
63
|
args: [],
|
138
|
-
source:
|
64
|
+
source: "new\x0a\x09\x22Use the receiver as a JS constructor. \x0a\x09*Do not* use this method to instanciate Smalltalk objects!\x22\x0a\x09<return new self()>",
|
139
65
|
messageSends: [],
|
140
66
|
referencedClasses: []
|
141
67
|
}),
|
142
|
-
smalltalk.
|
68
|
+
smalltalk.BlockClosure);
|
143
69
|
|
144
70
|
smalltalk.addMethod(
|
145
|
-
|
71
|
+
"_newValue_",
|
146
72
|
smalltalk.method({
|
147
|
-
selector:
|
148
|
-
category: '
|
149
|
-
fn: function ()
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
source: unescape('selector%0A%09%3Creturn%20smalltalk.convertSelector%28self.selector%29%3E'),
|
73
|
+
selector: "newValue:",
|
74
|
+
category: 'evaluating',
|
75
|
+
fn: function (anObject){
|
76
|
+
var self=this;
|
77
|
+
return new self(anObject);
|
78
|
+
return self;},
|
79
|
+
args: ["anObject"],
|
80
|
+
source: "newValue: anObject\x0a\x09\x22Use the receiver as a JS constructor. \x0a\x09*Do not* use this method to instanciate Smalltalk objects!\x22\x0a\x09<return new self(anObject)>",
|
156
81
|
messageSends: [],
|
157
82
|
referencedClasses: []
|
158
83
|
}),
|
159
|
-
smalltalk.
|
84
|
+
smalltalk.BlockClosure);
|
160
85
|
|
161
86
|
smalltalk.addMethod(
|
162
|
-
|
87
|
+
"_newValue_value_",
|
163
88
|
smalltalk.method({
|
164
|
-
selector:
|
165
|
-
category: '
|
166
|
-
fn: function ()
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
source: unescape('home%0A%09%3Creturn%20self.homeContext%3E'),
|
89
|
+
selector: "newValue:value:",
|
90
|
+
category: 'evaluating',
|
91
|
+
fn: function (anObject, anObject2){
|
92
|
+
var self=this;
|
93
|
+
return new self(anObject, anObject2);
|
94
|
+
return self;},
|
95
|
+
args: ["anObject", "anObject2"],
|
96
|
+
source: "newValue: anObject value: anObject2\x0a\x09\x22Use the receiver as a JS constructor. \x0a\x09*Do not* use this method to instanciate Smalltalk objects!\x22\x0a\x09<return new self(anObject, anObject2)>",
|
173
97
|
messageSends: [],
|
174
98
|
referencedClasses: []
|
175
99
|
}),
|
176
|
-
smalltalk.
|
100
|
+
smalltalk.BlockClosure);
|
177
101
|
|
178
102
|
smalltalk.addMethod(
|
179
|
-
|
103
|
+
"_newValue_value_value_",
|
180
104
|
smalltalk.method({
|
181
|
-
selector:
|
182
|
-
category: '
|
183
|
-
fn: function ()
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
source: unescape('temps%0A%09%3Creturn%20self.temps%3E'),
|
105
|
+
selector: "newValue:value:value:",
|
106
|
+
category: 'evaluating',
|
107
|
+
fn: function (anObject, anObject2, anObject3){
|
108
|
+
var self=this;
|
109
|
+
return new self(anObject, anObject2);
|
110
|
+
return self;},
|
111
|
+
args: ["anObject", "anObject2", "anObject3"],
|
112
|
+
source: "newValue: anObject value: anObject2 value: anObject3\x0a\x09\x22Use the receiver as a JS constructor. \x0a\x09*Do not* use this method to instanciate Smalltalk objects!\x22\x0a\x09<return new self(anObject, anObject2)>",
|
190
113
|
messageSends: [],
|
191
114
|
referencedClasses: []
|
192
115
|
}),
|
193
|
-
smalltalk.
|
194
|
-
|
195
|
-
smalltalk.addMethod(
|
196
|
-
unescape('_printString'),
|
197
|
-
smalltalk.method({
|
198
|
-
selector: unescape('printString'),
|
199
|
-
category: 'accessing',
|
200
|
-
fn: function () {
|
201
|
-
var self = this;
|
202
|
-
return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Object), "__comma", [unescape("%28")]), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [unescape("%29")]);
|
203
|
-
return self;
|
204
|
-
},
|
205
|
-
args: [],
|
206
|
-
source: unescape('printString%0A%09%5Esuper%20printString%2C%20%27%28%27%2C%20self%20asString%2C%20%27%29%27'),
|
207
|
-
messageSends: [unescape("%2C"), "printString", "asString"],
|
208
|
-
referencedClasses: []
|
209
|
-
}),
|
210
|
-
smalltalk.MethodContext);
|
211
|
-
|
212
|
-
smalltalk.addMethod(
|
213
|
-
unescape('_asString'),
|
214
|
-
smalltalk.method({
|
215
|
-
selector: unescape('asString'),
|
216
|
-
category: 'accessing',
|
217
|
-
fn: function () {
|
218
|
-
var self = this;
|
219
|
-
return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_receiver", []), "_class", []), "_printString", []), "__comma", [unescape("%20%3E%3E%20")]), "__comma", [smalltalk.send(self, "_selector", [])]);
|
220
|
-
return self;
|
221
|
-
},
|
222
|
-
args: [],
|
223
|
-
source: unescape('asString%0A%09%5Eself%20receiver%20class%20printString%2C%20%27%20%3E%3E%20%27%2C%20self%20selector'),
|
224
|
-
messageSends: [unescape("%2C"), "printString", "class", "receiver", "selector"],
|
225
|
-
referencedClasses: []
|
226
|
-
}),
|
227
|
-
smalltalk.MethodContext);
|
228
|
-
|
229
|
-
|
116
|
+
smalltalk.BlockClosure);
|
230
117
|
|
231
|
-
smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel-Methods');
|
232
|
-
smalltalk.BlockClosure.comment=unescape('A%20BlockClosure%20is%20a%20lexical%20closure.%0AThe%20JavaScript%20representation%20is%20a%20function.%0A%0AA%20BlockClosure%20is%20evaluated%20with%20the%20%60%23value*%60%20methods%20in%20the%20%27evaluating%27%20protocol.')
|
233
118
|
smalltalk.addMethod(
|
234
|
-
|
119
|
+
"_numArgs",
|
235
120
|
smalltalk.method({
|
236
|
-
selector:
|
121
|
+
selector: "numArgs",
|
237
122
|
category: 'accessing',
|
238
|
-
fn: function ()
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
},
|
123
|
+
fn: function (){
|
124
|
+
var self=this;
|
125
|
+
return self.length;
|
126
|
+
return self;},
|
243
127
|
args: [],
|
244
|
-
source:
|
128
|
+
source: "numArgs\x0a\x09<return self.length>",
|
245
129
|
messageSends: [],
|
246
130
|
referencedClasses: []
|
247
131
|
}),
|
248
132
|
smalltalk.BlockClosure);
|
249
133
|
|
250
134
|
smalltalk.addMethod(
|
251
|
-
|
135
|
+
"_on_do_",
|
252
136
|
smalltalk.method({
|
253
|
-
selector:
|
254
|
-
category: '
|
255
|
-
fn: function (aBlock)
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
args: ["aBlock"],
|
263
|
-
source: unescape('whileTrue%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Cwhile%28self%28%29%29%20%7BaBlock%28%29%7D%3E'),
|
264
|
-
messageSends: [],
|
137
|
+
selector: "on:do:",
|
138
|
+
category: 'error handling',
|
139
|
+
fn: function (anErrorClass, aBlock){
|
140
|
+
var self=this;
|
141
|
+
return smalltalk.send(self, "_try_catch_", [self, (function(error){return ((($receiver = smalltalk.send(error, "_isKindOf_", [anErrorClass])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aBlock, "_value_", [error]);})() : (function(){return smalltalk.send(error, "_signal", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aBlock, "_value_", [error]);}), (function(){return smalltalk.send(error, "_signal", []);})]));})]);
|
142
|
+
return self;},
|
143
|
+
args: ["anErrorClass", "aBlock"],
|
144
|
+
source: "on: anErrorClass do: aBlock\x0a\x09^self try: self catch: [:error |\x0a\x09 (error isKindOf: anErrorClass) \x0a\x09 ifTrue: [aBlock value: error]\x0a\x09 ifFalse: [error signal]]",
|
145
|
+
messageSends: ["try:catch:", "ifTrue:ifFalse:", "isKindOf:", "value:", "signal"],
|
265
146
|
referencedClasses: []
|
266
147
|
}),
|
267
148
|
smalltalk.BlockClosure);
|
268
149
|
|
269
150
|
smalltalk.addMethod(
|
270
|
-
|
151
|
+
"_timeToRun",
|
271
152
|
smalltalk.method({
|
272
|
-
selector:
|
273
|
-
category: '
|
274
|
-
fn: function (
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
source: unescape('whileFalse%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Cwhile%28%21self%28%29%29%20%7BaBlock%28%29%7D%3E'),
|
283
|
-
messageSends: [],
|
284
|
-
referencedClasses: []
|
153
|
+
selector: "timeToRun",
|
154
|
+
category: 'evaluating',
|
155
|
+
fn: function (){
|
156
|
+
var self=this;
|
157
|
+
return smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [self]);
|
158
|
+
return self;},
|
159
|
+
args: [],
|
160
|
+
source: "timeToRun\x0a\x09\x22Answer the number of milliseconds taken to execute this block.\x22\x0a\x0a\x09^ Date millisecondsToRun: self",
|
161
|
+
messageSends: ["millisecondsToRun:"],
|
162
|
+
referencedClasses: ["Date"]
|
285
163
|
}),
|
286
164
|
smalltalk.BlockClosure);
|
287
165
|
|
288
166
|
smalltalk.addMethod(
|
289
|
-
|
167
|
+
"_value",
|
290
168
|
smalltalk.method({
|
291
|
-
selector:
|
169
|
+
selector: "value",
|
292
170
|
category: 'evaluating',
|
293
|
-
fn: function ()
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
},
|
171
|
+
fn: function (){
|
172
|
+
var self=this;
|
173
|
+
return self();;
|
174
|
+
return self;},
|
298
175
|
args: [],
|
299
|
-
source:
|
176
|
+
source: "value\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<return self();>",
|
300
177
|
messageSends: [],
|
301
178
|
referencedClasses: []
|
302
179
|
}),
|
303
180
|
smalltalk.BlockClosure);
|
304
181
|
|
305
182
|
smalltalk.addMethod(
|
306
|
-
|
183
|
+
"_value_",
|
307
184
|
smalltalk.method({
|
308
|
-
selector:
|
185
|
+
selector: "value:",
|
309
186
|
category: 'evaluating',
|
310
|
-
fn: function (anArg)
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
},
|
187
|
+
fn: function (anArg){
|
188
|
+
var self=this;
|
189
|
+
return self(anArg);;
|
190
|
+
return self;},
|
315
191
|
args: ["anArg"],
|
316
|
-
source:
|
192
|
+
source: "value: anArg\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<return self(anArg);>",
|
317
193
|
messageSends: [],
|
318
194
|
referencedClasses: []
|
319
195
|
}),
|
320
196
|
smalltalk.BlockClosure);
|
321
197
|
|
322
198
|
smalltalk.addMethod(
|
323
|
-
|
199
|
+
"_value_value_",
|
324
200
|
smalltalk.method({
|
325
|
-
selector:
|
201
|
+
selector: "value:value:",
|
326
202
|
category: 'evaluating',
|
327
|
-
fn: function (firstArg, secondArg)
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
},
|
203
|
+
fn: function (firstArg, secondArg){
|
204
|
+
var self=this;
|
205
|
+
return self(firstArg, secondArg);;
|
206
|
+
return self;},
|
332
207
|
args: ["firstArg", "secondArg"],
|
333
|
-
source:
|
208
|
+
source: "value: firstArg value: secondArg\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<return self(firstArg, secondArg);>",
|
334
209
|
messageSends: [],
|
335
210
|
referencedClasses: []
|
336
211
|
}),
|
337
212
|
smalltalk.BlockClosure);
|
338
213
|
|
339
214
|
smalltalk.addMethod(
|
340
|
-
|
215
|
+
"_value_value_value_",
|
341
216
|
smalltalk.method({
|
342
|
-
selector:
|
217
|
+
selector: "value:value:value:",
|
343
218
|
category: 'evaluating',
|
344
|
-
fn: function (firstArg, secondArg, thirdArg)
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
},
|
219
|
+
fn: function (firstArg, secondArg, thirdArg){
|
220
|
+
var self=this;
|
221
|
+
return self(firstArg, secondArg, thirdArg);;
|
222
|
+
return self;},
|
349
223
|
args: ["firstArg", "secondArg", "thirdArg"],
|
350
|
-
source:
|
224
|
+
source: "value: firstArg value: secondArg value: thirdArg\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<return self(firstArg, secondArg, thirdArg);>",
|
351
225
|
messageSends: [],
|
352
226
|
referencedClasses: []
|
353
227
|
}),
|
354
228
|
smalltalk.BlockClosure);
|
355
229
|
|
356
230
|
smalltalk.addMethod(
|
357
|
-
|
231
|
+
"_valueWithInterval_",
|
358
232
|
smalltalk.method({
|
359
|
-
selector:
|
360
|
-
category: '
|
361
|
-
fn: function (
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
source: unescape('valueWithPossibleArguments%3A%20aCollection%0A%09%3Creturn%20self.apply%28null%2C%20aCollection%29%3B%3E'),
|
233
|
+
selector: "valueWithInterval:",
|
234
|
+
category: 'timeout/interval',
|
235
|
+
fn: function (aNumber){
|
236
|
+
var self=this;
|
237
|
+
return setInterval(self, aNumber);
|
238
|
+
return self;},
|
239
|
+
args: ["aNumber"],
|
240
|
+
source: "valueWithInterval: aNumber\x0a\x09<return setInterval(self, aNumber)>",
|
368
241
|
messageSends: [],
|
369
242
|
referencedClasses: []
|
370
243
|
}),
|
371
244
|
smalltalk.BlockClosure);
|
372
245
|
|
373
246
|
smalltalk.addMethod(
|
374
|
-
|
247
|
+
"_valueWithPossibleArguments_",
|
375
248
|
smalltalk.method({
|
376
|
-
selector:
|
377
|
-
category: '
|
378
|
-
fn: function (
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
messageSends: ["try:catch:", "ifTrue:ifFalse:", "isKindOf:", "value:", "signal"],
|
249
|
+
selector: "valueWithPossibleArguments:",
|
250
|
+
category: 'evaluating',
|
251
|
+
fn: function (aCollection){
|
252
|
+
var self=this;
|
253
|
+
return self.apply(null, aCollection);;
|
254
|
+
return self;},
|
255
|
+
args: ["aCollection"],
|
256
|
+
source: "valueWithPossibleArguments: aCollection\x0a\x09<return self.apply(null, aCollection);>",
|
257
|
+
messageSends: [],
|
386
258
|
referencedClasses: []
|
387
259
|
}),
|
388
260
|
smalltalk.BlockClosure);
|
389
261
|
|
390
262
|
smalltalk.addMethod(
|
391
|
-
|
263
|
+
"_valueWithTimeout_",
|
392
264
|
smalltalk.method({
|
393
|
-
selector:
|
265
|
+
selector: "valueWithTimeout:",
|
394
266
|
category: 'timeout/interval',
|
395
|
-
fn: function (aNumber)
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
},
|
267
|
+
fn: function (aNumber){
|
268
|
+
var self=this;
|
269
|
+
return setTimeout(self, aNumber);
|
270
|
+
return self;},
|
400
271
|
args: ["aNumber"],
|
401
|
-
source:
|
272
|
+
source: "valueWithTimeout: aNumber\x0a\x09<return setTimeout(self, aNumber)>",
|
402
273
|
messageSends: [],
|
403
274
|
referencedClasses: []
|
404
275
|
}),
|
405
276
|
smalltalk.BlockClosure);
|
406
277
|
|
407
278
|
smalltalk.addMethod(
|
408
|
-
|
279
|
+
"_whileFalse",
|
409
280
|
smalltalk.method({
|
410
|
-
selector:
|
411
|
-
category: '
|
412
|
-
fn: function (
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
messageSends: [],
|
281
|
+
selector: "whileFalse",
|
282
|
+
category: 'controlling',
|
283
|
+
fn: function (){
|
284
|
+
var self=this;
|
285
|
+
smalltalk.send(self, "_whileFalse_", [(function(){return nil;})]);
|
286
|
+
return self;},
|
287
|
+
args: [],
|
288
|
+
source: "whileFalse\x0a\x09\x22inlined in the Compiler\x22\x0a\x09self whileFalse: []",
|
289
|
+
messageSends: ["whileFalse:"],
|
420
290
|
referencedClasses: []
|
421
291
|
}),
|
422
292
|
smalltalk.BlockClosure);
|
423
293
|
|
424
294
|
smalltalk.addMethod(
|
425
|
-
|
295
|
+
"_whileFalse_",
|
426
296
|
smalltalk.method({
|
427
|
-
selector:
|
297
|
+
selector: "whileFalse:",
|
428
298
|
category: 'controlling',
|
429
|
-
fn: function ()
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
messageSends: ["whileFalse:"],
|
299
|
+
fn: function (aBlock){
|
300
|
+
var self=this;
|
301
|
+
while(!self()) {aBlock()};
|
302
|
+
return self;},
|
303
|
+
args: ["aBlock"],
|
304
|
+
source: "whileFalse: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<while(!self()) {aBlock()}>",
|
305
|
+
messageSends: [],
|
437
306
|
referencedClasses: []
|
438
307
|
}),
|
439
308
|
smalltalk.BlockClosure);
|
440
309
|
|
441
310
|
smalltalk.addMethod(
|
442
|
-
|
311
|
+
"_whileTrue",
|
443
312
|
smalltalk.method({
|
444
|
-
selector:
|
313
|
+
selector: "whileTrue",
|
445
314
|
category: 'controlling',
|
446
|
-
fn: function ()
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
},
|
315
|
+
fn: function (){
|
316
|
+
var self=this;
|
317
|
+
smalltalk.send(self, "_whileTrue_", [(function(){return nil;})]);
|
318
|
+
return self;},
|
451
319
|
args: [],
|
452
|
-
source:
|
320
|
+
source: "whileTrue\x0a\x09\x22inlined in the Compiler\x22\x0a\x09self whileTrue: []",
|
453
321
|
messageSends: ["whileTrue:"],
|
454
322
|
referencedClasses: []
|
455
323
|
}),
|
456
324
|
smalltalk.BlockClosure);
|
457
325
|
|
458
326
|
smalltalk.addMethod(
|
459
|
-
|
327
|
+
"_whileTrue_",
|
460
328
|
smalltalk.method({
|
461
|
-
selector:
|
462
|
-
category: '
|
463
|
-
fn: function ()
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
source: unescape('new%0A%09%22Use%20the%20receiver%20as%20a%20JS%20constructor.%20%0A%09*Do%20not*%20use%20this%20method%20to%20instanciate%20Smalltalk%20objects%21%22%0A%09%3Creturn%20new%20self%28%29%3E'),
|
329
|
+
selector: "whileTrue:",
|
330
|
+
category: 'controlling',
|
331
|
+
fn: function (aBlock){
|
332
|
+
var self=this;
|
333
|
+
while(self()) {aBlock()};
|
334
|
+
return self;},
|
335
|
+
args: ["aBlock"],
|
336
|
+
source: "whileTrue: aBlock\x0a\x09\x22inlined in the Compiler\x22\x0a\x09<while(self()) {aBlock()}>",
|
470
337
|
messageSends: [],
|
471
338
|
referencedClasses: []
|
472
339
|
}),
|
473
340
|
smalltalk.BlockClosure);
|
474
341
|
|
342
|
+
|
343
|
+
|
344
|
+
smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel-Methods');
|
345
|
+
smalltalk.CompiledMethod.comment="CompiledMethod hold the source and compiled code of a class method.\x0a\x0aYou can get a CompiledMethod using `Behavior>>methodAt:`\x0a\x0a\x09String methodAt: 'lines'\x0a\x0aand read the source code\x0a\x0a\x09(String methodAt: 'lines') source\x0a\x0aSee referenced classes:\x0a\x0a\x09(String methodAt: 'lines') referencedClasses\x0a\x0aor messages sent from this method:\x0a\x09\x0a\x09(String methodAt: 'lines') messageSends"
|
475
346
|
smalltalk.addMethod(
|
476
|
-
|
347
|
+
"_arguments",
|
477
348
|
smalltalk.method({
|
478
|
-
selector:
|
479
|
-
category: '
|
480
|
-
fn: function (
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
source: unescape('applyTo%3A%20anObject%20arguments%3A%20aCollection%0A%09%3Creturn%20self.apply%28anObject%2C%20aCollection%29%3E'),
|
349
|
+
selector: "arguments",
|
350
|
+
category: 'accessing',
|
351
|
+
fn: function (){
|
352
|
+
var self=this;
|
353
|
+
return self.args || [];
|
354
|
+
return self;},
|
355
|
+
args: [],
|
356
|
+
source: "arguments\x0a\x09<return self.args || []>",
|
487
357
|
messageSends: [],
|
488
358
|
referencedClasses: []
|
489
359
|
}),
|
490
|
-
smalltalk.
|
360
|
+
smalltalk.CompiledMethod);
|
491
361
|
|
492
362
|
smalltalk.addMethod(
|
493
|
-
|
363
|
+
"_category",
|
494
364
|
smalltalk.method({
|
495
|
-
selector:
|
496
|
-
category: '
|
497
|
-
fn: function ()
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
},
|
365
|
+
selector: "category",
|
366
|
+
category: 'accessing',
|
367
|
+
fn: function (){
|
368
|
+
var self=this;
|
369
|
+
return (($receiver = smalltalk.send(self, "_basicAt_", ["category"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
|
370
|
+
return self;},
|
502
371
|
args: [],
|
503
|
-
source:
|
504
|
-
messageSends: ["
|
505
|
-
referencedClasses: [
|
372
|
+
source: "category\x0a\x09^(self basicAt: 'category') ifNil: ['']",
|
373
|
+
messageSends: ["ifNil:", "basicAt:"],
|
374
|
+
referencedClasses: []
|
506
375
|
}),
|
507
|
-
smalltalk.
|
376
|
+
smalltalk.CompiledMethod);
|
377
|
+
|
378
|
+
smalltalk.addMethod(
|
379
|
+
"_category_",
|
380
|
+
smalltalk.method({
|
381
|
+
selector: "category:",
|
382
|
+
category: 'accessing',
|
383
|
+
fn: function (aString){
|
384
|
+
var self=this;
|
385
|
+
smalltalk.send(self, "_basicAt_put_", ["category", aString]);
|
386
|
+
return self;},
|
387
|
+
args: ["aString"],
|
388
|
+
source: "category: aString\x0a\x09self basicAt: 'category' put: aString",
|
389
|
+
messageSends: ["basicAt:put:"],
|
390
|
+
referencedClasses: []
|
391
|
+
}),
|
392
|
+
smalltalk.CompiledMethod);
|
508
393
|
|
509
394
|
smalltalk.addMethod(
|
510
|
-
|
395
|
+
"_fn",
|
511
396
|
smalltalk.method({
|
512
|
-
selector:
|
397
|
+
selector: "fn",
|
513
398
|
category: 'accessing',
|
514
|
-
fn: function ()
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
},
|
399
|
+
fn: function (){
|
400
|
+
var self=this;
|
401
|
+
return smalltalk.send(self, "_basicAt_", ["fn"]);
|
402
|
+
return self;},
|
519
403
|
args: [],
|
520
|
-
source:
|
521
|
-
messageSends: [],
|
404
|
+
source: "fn\x0a\x09^self basicAt: 'fn'",
|
405
|
+
messageSends: ["basicAt:"],
|
522
406
|
referencedClasses: []
|
523
407
|
}),
|
524
|
-
smalltalk.
|
408
|
+
smalltalk.CompiledMethod);
|
525
409
|
|
526
410
|
smalltalk.addMethod(
|
527
|
-
|
411
|
+
"_fn_",
|
528
412
|
smalltalk.method({
|
529
|
-
selector:
|
530
|
-
category: '
|
531
|
-
fn: function (aBlock)
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
return smalltalk.send(function () {smalltalk.send(self, "_value", []);success = true;return smalltalk.send(aBlock, "_value", []);}, "_on_do_", [smalltalk.Error || Error, function (ex) {($receiver = success).klass === smalltalk.Boolean ? !$receiver ? function () {return smalltalk.send(aBlock, "_value", []);}() : nil : smalltalk.send($receiver, "_ifFalse_", [function () {return smalltalk.send(aBlock, "_value", []);}]);return smalltalk.send(ex, "_signal", []);}]);
|
536
|
-
return self;
|
537
|
-
},
|
413
|
+
selector: "fn:",
|
414
|
+
category: 'accessing',
|
415
|
+
fn: function (aBlock){
|
416
|
+
var self=this;
|
417
|
+
smalltalk.send(self, "_basicAt_put_", ["fn", aBlock]);
|
418
|
+
return self;},
|
538
419
|
args: ["aBlock"],
|
539
|
-
source:
|
540
|
-
messageSends: ["
|
541
|
-
referencedClasses: [
|
420
|
+
source: "fn: aBlock\x0a\x09self basicAt: 'fn' put: aBlock",
|
421
|
+
messageSends: ["basicAt:put:"],
|
422
|
+
referencedClasses: []
|
542
423
|
}),
|
543
|
-
smalltalk.
|
424
|
+
smalltalk.CompiledMethod);
|
544
425
|
|
545
426
|
smalltalk.addMethod(
|
546
|
-
|
427
|
+
"_messageSends",
|
547
428
|
smalltalk.method({
|
548
|
-
selector:
|
549
|
-
category: '
|
550
|
-
fn: function (
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
messageSends: [],
|
429
|
+
selector: "messageSends",
|
430
|
+
category: 'accessing',
|
431
|
+
fn: function (){
|
432
|
+
var self=this;
|
433
|
+
return smalltalk.send(self, "_basicAt_", ["messageSends"]);
|
434
|
+
return self;},
|
435
|
+
args: [],
|
436
|
+
source: "messageSends\x0a\x09^self basicAt: 'messageSends'",
|
437
|
+
messageSends: ["basicAt:"],
|
558
438
|
referencedClasses: []
|
559
439
|
}),
|
560
|
-
smalltalk.
|
440
|
+
smalltalk.CompiledMethod);
|
561
441
|
|
562
442
|
smalltalk.addMethod(
|
563
|
-
|
443
|
+
"_methodClass",
|
564
444
|
smalltalk.method({
|
565
|
-
selector:
|
566
|
-
category: '
|
567
|
-
fn: function (
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
messageSends: [],
|
445
|
+
selector: "methodClass",
|
446
|
+
category: 'accessing',
|
447
|
+
fn: function (){
|
448
|
+
var self=this;
|
449
|
+
return smalltalk.send(self, "_basicAt_", ["methodClass"]);
|
450
|
+
return self;},
|
451
|
+
args: [],
|
452
|
+
source: "methodClass\x0a\x09^self basicAt: 'methodClass'",
|
453
|
+
messageSends: ["basicAt:"],
|
575
454
|
referencedClasses: []
|
576
455
|
}),
|
577
|
-
smalltalk.
|
456
|
+
smalltalk.CompiledMethod);
|
578
457
|
|
579
458
|
smalltalk.addMethod(
|
580
|
-
|
459
|
+
"_referencedClasses",
|
581
460
|
smalltalk.method({
|
582
|
-
selector:
|
583
|
-
category: '
|
584
|
-
fn: function (
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
messageSends: [],
|
461
|
+
selector: "referencedClasses",
|
462
|
+
category: 'accessing',
|
463
|
+
fn: function (){
|
464
|
+
var self=this;
|
465
|
+
return smalltalk.send(self, "_basicAt_", ["referencedClasses"]);
|
466
|
+
return self;},
|
467
|
+
args: [],
|
468
|
+
source: "referencedClasses\x0a\x09^self basicAt: 'referencedClasses'",
|
469
|
+
messageSends: ["basicAt:"],
|
592
470
|
referencedClasses: []
|
593
471
|
}),
|
594
|
-
smalltalk.
|
595
|
-
|
596
|
-
|
472
|
+
smalltalk.CompiledMethod);
|
597
473
|
|
598
|
-
smalltalk.addClass('CompiledMethod', smalltalk.Object, [], 'Kernel-Methods');
|
599
|
-
smalltalk.CompiledMethod.comment=unescape('CompiledMethod%20hold%20the%20source%20and%20compiled%20code%20of%20a%20class%20method.%0A%0AYou%20can%20get%20a%20CompiledMethod%20using%20%60Behavior%3E%3EmethodAt%3A%60%0A%0A%09String%20methodAt%3A%20%27lines%27%0A%0Aand%20read%20the%20source%20code%0A%0A%09%28String%20methodAt%3A%20%27lines%27%29%20source%0A%0ASee%20referenced%20classes%3A%0A%0A%09%28String%20methodAt%3A%20%27lines%27%29%20referencedClasses%0A%0Aor%20messages%20sent%20from%20this%20method%3A%0A%09%0A%09%28String%20methodAt%3A%20%27lines%27%29%20%20messageSends')
|
600
474
|
smalltalk.addMethod(
|
601
|
-
|
475
|
+
"_selector",
|
602
476
|
smalltalk.method({
|
603
|
-
selector:
|
477
|
+
selector: "selector",
|
604
478
|
category: 'accessing',
|
605
|
-
fn: function ()
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
return self;
|
610
|
-
},
|
479
|
+
fn: function (){
|
480
|
+
var self=this;
|
481
|
+
return smalltalk.send(self, "_basicAt_", ["selector"]);
|
482
|
+
return self;},
|
611
483
|
args: [],
|
612
|
-
source:
|
613
|
-
messageSends: ["
|
484
|
+
source: "selector\x0a\x09^self basicAt: 'selector'",
|
485
|
+
messageSends: ["basicAt:"],
|
614
486
|
referencedClasses: []
|
615
487
|
}),
|
616
488
|
smalltalk.CompiledMethod);
|
617
489
|
|
618
490
|
smalltalk.addMethod(
|
619
|
-
|
491
|
+
"_selector_",
|
620
492
|
smalltalk.method({
|
621
|
-
selector:
|
493
|
+
selector: "selector:",
|
622
494
|
category: 'accessing',
|
623
|
-
fn: function (aString)
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
},
|
495
|
+
fn: function (aString){
|
496
|
+
var self=this;
|
497
|
+
smalltalk.send(self, "_basicAt_put_", ["selector", aString]);
|
498
|
+
return self;},
|
628
499
|
args: ["aString"],
|
629
|
-
source:
|
500
|
+
source: "selector: aString\x0a\x09self basicAt: 'selector' put: aString",
|
630
501
|
messageSends: ["basicAt:put:"],
|
631
502
|
referencedClasses: []
|
632
503
|
}),
|
633
504
|
smalltalk.CompiledMethod);
|
634
505
|
|
635
506
|
smalltalk.addMethod(
|
636
|
-
|
507
|
+
"_source",
|
637
508
|
smalltalk.method({
|
638
|
-
selector:
|
509
|
+
selector: "source",
|
639
510
|
category: 'accessing',
|
640
|
-
fn: function ()
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
return self;
|
645
|
-
},
|
511
|
+
fn: function (){
|
512
|
+
var self=this;
|
513
|
+
return (($receiver = smalltalk.send(self, "_basicAt_", ["source"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
|
514
|
+
return self;},
|
646
515
|
args: [],
|
647
|
-
source:
|
516
|
+
source: "source\x0a\x09^(self basicAt: 'source') ifNil: ['']",
|
648
517
|
messageSends: ["ifNil:", "basicAt:"],
|
649
518
|
referencedClasses: []
|
650
519
|
}),
|
651
520
|
smalltalk.CompiledMethod);
|
652
521
|
|
653
522
|
smalltalk.addMethod(
|
654
|
-
|
523
|
+
"_source_",
|
655
524
|
smalltalk.method({
|
656
|
-
selector:
|
525
|
+
selector: "source:",
|
657
526
|
category: 'accessing',
|
658
|
-
fn: function (aString)
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
},
|
527
|
+
fn: function (aString){
|
528
|
+
var self=this;
|
529
|
+
smalltalk.send(self, "_basicAt_put_", ["source", aString]);
|
530
|
+
return self;},
|
663
531
|
args: ["aString"],
|
664
|
-
source:
|
532
|
+
source: "source: aString\x0a\x09self basicAt: 'source' put: aString",
|
665
533
|
messageSends: ["basicAt:put:"],
|
666
534
|
referencedClasses: []
|
667
535
|
}),
|
668
536
|
smalltalk.CompiledMethod);
|
669
537
|
|
538
|
+
|
539
|
+
|
540
|
+
smalltalk.addClass('Message', smalltalk.Object, ['selector', 'arguments'], 'Kernel-Methods');
|
541
|
+
smalltalk.Message.comment="Generally, the system does not use instances of Message for efficiency reasons.\x0aHowever, when a message is not understood by its receiver, the interpreter will make up an instance of it in order to capture the information involved in an actual message transmission. \x0aThis instance is sent it as an argument with the message `doesNotUnderstand:` to the receiver.\x0a\x0aSee boot.js, `messageNotUnderstood` and its counterpart `Object>>doesNotUnderstand:`"
|
670
542
|
smalltalk.addMethod(
|
671
|
-
|
543
|
+
"_arguments",
|
672
544
|
smalltalk.method({
|
673
|
-
selector:
|
545
|
+
selector: "arguments",
|
674
546
|
category: 'accessing',
|
675
|
-
fn: function ()
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
},
|
547
|
+
fn: function (){
|
548
|
+
var self=this;
|
549
|
+
return self['@arguments'];
|
550
|
+
return self;},
|
680
551
|
args: [],
|
681
|
-
source:
|
682
|
-
messageSends: [
|
552
|
+
source: "arguments\x0a\x09^arguments",
|
553
|
+
messageSends: [],
|
683
554
|
referencedClasses: []
|
684
555
|
}),
|
685
|
-
smalltalk.
|
556
|
+
smalltalk.Message);
|
686
557
|
|
687
558
|
smalltalk.addMethod(
|
688
|
-
|
559
|
+
"_arguments_",
|
689
560
|
smalltalk.method({
|
690
|
-
selector:
|
561
|
+
selector: "arguments:",
|
691
562
|
category: 'accessing',
|
692
|
-
fn: function (
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
563
|
+
fn: function (anArray){
|
564
|
+
var self=this;
|
565
|
+
(self['@arguments']=anArray);
|
566
|
+
return self;},
|
567
|
+
args: ["anArray"],
|
568
|
+
source: "arguments: anArray\x0a\x09arguments := anArray",
|
569
|
+
messageSends: [],
|
570
|
+
referencedClasses: []
|
571
|
+
}),
|
572
|
+
smalltalk.Message);
|
573
|
+
|
574
|
+
smalltalk.addMethod(
|
575
|
+
"_printString",
|
576
|
+
smalltalk.method({
|
577
|
+
selector: "printString",
|
578
|
+
category: 'printing',
|
579
|
+
fn: function (){
|
580
|
+
var self=this;
|
581
|
+
return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Message.superclass || nil)]);smalltalk.send($rec, "_nextPutAll_", ["("]);smalltalk.send($rec, "_nextPutAll_", [self['@selector']]);return smalltalk.send($rec, "_nextPutAll_", [")"]);})(aStream);})]);
|
582
|
+
return self;},
|
583
|
+
args: [],
|
584
|
+
source: "printString\x0a\x09^ String streamContents: [:aStream| \x0a \x09\x09\x09\x09aStream \x0a \x09\x09\x09\x09\x09nextPutAll: super printString;\x0a \x09\x09\x09\x09\x09nextPutAll: '(';\x0a \x09\x09\x09\x09\x09nextPutAll: selector;\x0a \x09\x09\x09\x09\x09nextPutAll: ')' \x09\x09\x09\x09]",
|
585
|
+
messageSends: ["streamContents:", "nextPutAll:", "printString"],
|
586
|
+
referencedClasses: ["String"]
|
587
|
+
}),
|
588
|
+
smalltalk.Message);
|
589
|
+
|
590
|
+
smalltalk.addMethod(
|
591
|
+
"_selector",
|
592
|
+
smalltalk.method({
|
593
|
+
selector: "selector",
|
594
|
+
category: 'accessing',
|
595
|
+
fn: function (){
|
596
|
+
var self=this;
|
597
|
+
return self['@selector'];
|
598
|
+
return self;},
|
599
|
+
args: [],
|
600
|
+
source: "selector\x0a\x09^selector",
|
601
|
+
messageSends: [],
|
602
|
+
referencedClasses: []
|
603
|
+
}),
|
604
|
+
smalltalk.Message);
|
605
|
+
|
606
|
+
smalltalk.addMethod(
|
607
|
+
"_selector_",
|
608
|
+
smalltalk.method({
|
609
|
+
selector: "selector:",
|
610
|
+
category: 'accessing',
|
611
|
+
fn: function (aString){
|
612
|
+
var self=this;
|
613
|
+
(self['@selector']=aString);
|
614
|
+
return self;},
|
697
615
|
args: ["aString"],
|
698
|
-
source:
|
699
|
-
messageSends: [
|
616
|
+
source: "selector: aString\x0a\x09selector := aString",
|
617
|
+
messageSends: [],
|
700
618
|
referencedClasses: []
|
701
619
|
}),
|
702
|
-
smalltalk.
|
620
|
+
smalltalk.Message);
|
703
621
|
|
704
622
|
smalltalk.addMethod(
|
705
|
-
|
623
|
+
"_sendTo_",
|
706
624
|
smalltalk.method({
|
707
|
-
selector:
|
625
|
+
selector: "sendTo:",
|
626
|
+
category: 'printing',
|
627
|
+
fn: function (anObject){
|
628
|
+
var self=this;
|
629
|
+
smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_send_to_arguments_", [smalltalk.send(self, "_selector", []), anObject, smalltalk.send(self, "_arguments", [])]);
|
630
|
+
return self;},
|
631
|
+
args: ["anObject"],
|
632
|
+
source: "sendTo: anObject\x0a\x09Smalltalk current send: self selector to: anObject arguments: self arguments",
|
633
|
+
messageSends: ["send:to:arguments:", "current", "selector", "arguments"],
|
634
|
+
referencedClasses: ["Smalltalk"]
|
635
|
+
}),
|
636
|
+
smalltalk.Message);
|
637
|
+
|
638
|
+
|
639
|
+
smalltalk.addMethod(
|
640
|
+
"_selector_arguments_",
|
641
|
+
smalltalk.method({
|
642
|
+
selector: "selector:arguments:",
|
643
|
+
category: 'instance creation',
|
644
|
+
fn: function (aString, anArray){
|
645
|
+
var self=this;
|
646
|
+
return (function($rec){smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
|
647
|
+
return self;},
|
648
|
+
args: ["aString", "anArray"],
|
649
|
+
source: "selector: aString arguments: anArray\x0a\x09^self new\x0a\x09\x09selector: aString;\x0a\x09\x09arguments: anArray;\x0a\x09\x09yourself",
|
650
|
+
messageSends: ["selector:", "arguments:", "yourself", "new"],
|
651
|
+
referencedClasses: []
|
652
|
+
}),
|
653
|
+
smalltalk.Message.klass);
|
654
|
+
|
655
|
+
|
656
|
+
smalltalk.addClass('MethodContext', smalltalk.Object, [], 'Kernel-Methods');
|
657
|
+
smalltalk.MethodContext.comment="MethodContext holds all the dynamic state associated with the execution of either a method activation resulting from a message send. That is used to build the call stack while debugging.\x0a \x0aMethodContext instances are JavaScript `SmalltalkMethodContext` objects defined in boot.js \x0a\x0aCurrent limitation: MethodContext instances are not created on Block evaluation. That means it's actually impossible to debug inside a Block."
|
658
|
+
smalltalk.addMethod(
|
659
|
+
"_asString",
|
660
|
+
smalltalk.method({
|
661
|
+
selector: "asString",
|
708
662
|
category: 'accessing',
|
709
|
-
fn: function ()
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
},
|
663
|
+
fn: function (){
|
664
|
+
var self=this;
|
665
|
+
return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_receiver", []), "_class", []), "_printString", []), "__comma", [" >> "]), "__comma", [smalltalk.send(self, "_selector", [])]);
|
666
|
+
return self;},
|
714
667
|
args: [],
|
715
|
-
source:
|
716
|
-
messageSends: ["
|
668
|
+
source: "asString\x0a\x09^self receiver class printString, ' >> ', self selector",
|
669
|
+
messageSends: [",", "printString", "class", "receiver", "selector"],
|
717
670
|
referencedClasses: []
|
718
671
|
}),
|
719
|
-
smalltalk.
|
672
|
+
smalltalk.MethodContext);
|
720
673
|
|
721
674
|
smalltalk.addMethod(
|
722
|
-
|
675
|
+
"_home",
|
723
676
|
smalltalk.method({
|
724
|
-
selector:
|
677
|
+
selector: "home",
|
725
678
|
category: 'accessing',
|
726
|
-
fn: function (
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
messageSends: ["basicAt:put:"],
|
679
|
+
fn: function (){
|
680
|
+
var self=this;
|
681
|
+
return self.homeContext;
|
682
|
+
return self;},
|
683
|
+
args: [],
|
684
|
+
source: "home\x0a\x09<return self.homeContext>",
|
685
|
+
messageSends: [],
|
734
686
|
referencedClasses: []
|
735
687
|
}),
|
736
|
-
smalltalk.
|
688
|
+
smalltalk.MethodContext);
|
737
689
|
|
738
690
|
smalltalk.addMethod(
|
739
|
-
|
691
|
+
"_printString",
|
740
692
|
smalltalk.method({
|
741
|
-
selector:
|
693
|
+
selector: "printString",
|
742
694
|
category: 'accessing',
|
743
|
-
fn: function ()
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
},
|
695
|
+
fn: function (){
|
696
|
+
var self=this;
|
697
|
+
return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.MethodContext.superclass || nil), "__comma", ["("]), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [")"]);
|
698
|
+
return self;},
|
748
699
|
args: [],
|
749
|
-
source:
|
750
|
-
messageSends: ["
|
700
|
+
source: "printString\x0a\x09^super printString, '(', self asString, ')'",
|
701
|
+
messageSends: [",", "printString", "asString"],
|
751
702
|
referencedClasses: []
|
752
703
|
}),
|
753
|
-
smalltalk.
|
704
|
+
smalltalk.MethodContext);
|
754
705
|
|
755
706
|
smalltalk.addMethod(
|
756
|
-
|
707
|
+
"_receiver",
|
757
708
|
smalltalk.method({
|
758
|
-
selector:
|
709
|
+
selector: "receiver",
|
759
710
|
category: 'accessing',
|
760
|
-
fn: function ()
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
},
|
711
|
+
fn: function (){
|
712
|
+
var self=this;
|
713
|
+
return self.receiver;
|
714
|
+
return self;},
|
765
715
|
args: [],
|
766
|
-
source:
|
767
|
-
messageSends: [
|
716
|
+
source: "receiver\x0a\x09<return self.receiver>",
|
717
|
+
messageSends: [],
|
768
718
|
referencedClasses: []
|
769
719
|
}),
|
770
|
-
smalltalk.
|
720
|
+
smalltalk.MethodContext);
|
771
721
|
|
772
722
|
smalltalk.addMethod(
|
773
|
-
|
723
|
+
"_selector",
|
774
724
|
smalltalk.method({
|
775
|
-
selector:
|
725
|
+
selector: "selector",
|
776
726
|
category: 'accessing',
|
777
|
-
fn: function ()
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
},
|
727
|
+
fn: function (){
|
728
|
+
var self=this;
|
729
|
+
return smalltalk.convertSelector(self.selector);
|
730
|
+
return self;},
|
782
731
|
args: [],
|
783
|
-
source:
|
784
|
-
messageSends: [
|
732
|
+
source: "selector\x0a\x09<return smalltalk.convertSelector(self.selector)>",
|
733
|
+
messageSends: [],
|
785
734
|
referencedClasses: []
|
786
735
|
}),
|
787
|
-
smalltalk.
|
736
|
+
smalltalk.MethodContext);
|
788
737
|
|
789
738
|
smalltalk.addMethod(
|
790
|
-
|
739
|
+
"_temps",
|
791
740
|
smalltalk.method({
|
792
|
-
selector:
|
741
|
+
selector: "temps",
|
793
742
|
category: 'accessing',
|
794
|
-
fn: function ()
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
},
|
743
|
+
fn: function (){
|
744
|
+
var self=this;
|
745
|
+
return self.temps;
|
746
|
+
return self;},
|
799
747
|
args: [],
|
800
|
-
source:
|
748
|
+
source: "temps\x0a\x09<return self.temps>",
|
801
749
|
messageSends: [],
|
802
750
|
referencedClasses: []
|
803
751
|
}),
|
804
|
-
smalltalk.
|
752
|
+
smalltalk.MethodContext);
|
805
753
|
|
806
754
|
|
807
755
|
|