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
@@ -1,10 +1,10 @@
|
|
1
1
|
smalltalk.addPackage('Kernel-Collections', {});
|
2
2
|
smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel-Collections');
|
3
3
|
smalltalk.addMethod(
|
4
|
-
|
4
|
+
"__eq",
|
5
5
|
smalltalk.method({
|
6
|
-
selector:
|
7
|
-
fn: function (anAssociation)
|
6
|
+
selector: "=",
|
7
|
+
fn: function (anAssociation){
|
8
8
|
var self=this;
|
9
9
|
return smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(anAssociation, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_key", []), "__eq", [smalltalk.send(anAssociation, "_key", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_value", []), "__eq", [smalltalk.send(anAssociation, "_value", [])]);})]);})]);
|
10
10
|
return self;}
|
@@ -12,43 +12,45 @@ return self;}
|
|
12
12
|
smalltalk.Association);
|
13
13
|
|
14
14
|
smalltalk.addMethod(
|
15
|
-
|
15
|
+
"_key",
|
16
16
|
smalltalk.method({
|
17
|
-
selector:
|
18
|
-
fn: function (
|
17
|
+
selector: "key",
|
18
|
+
fn: function (){
|
19
19
|
var self=this;
|
20
|
-
|
20
|
+
return self['@key'];
|
21
21
|
return self;}
|
22
22
|
}),
|
23
23
|
smalltalk.Association);
|
24
24
|
|
25
25
|
smalltalk.addMethod(
|
26
|
-
|
26
|
+
"_key_",
|
27
27
|
smalltalk.method({
|
28
|
-
selector:
|
29
|
-
fn: function ()
|
28
|
+
selector: "key:",
|
29
|
+
fn: function (aKey){
|
30
30
|
var self=this;
|
31
|
-
|
31
|
+
(self['@key']=aKey);
|
32
32
|
return self;}
|
33
33
|
}),
|
34
34
|
smalltalk.Association);
|
35
35
|
|
36
36
|
smalltalk.addMethod(
|
37
|
-
|
37
|
+
"_storeOn_",
|
38
38
|
smalltalk.method({
|
39
|
-
selector:
|
40
|
-
fn: function (
|
39
|
+
selector: "storeOn:",
|
40
|
+
fn: function (aStream){
|
41
41
|
var self=this;
|
42
|
-
(self['@
|
42
|
+
smalltalk.send(self['@key'], "_storeOn_", [aStream]);
|
43
|
+
smalltalk.send(aStream, "_nextPutAll_", ["->"]);
|
44
|
+
smalltalk.send(self['@value'], "_storeOn_", [aStream]);
|
43
45
|
return self;}
|
44
46
|
}),
|
45
47
|
smalltalk.Association);
|
46
48
|
|
47
49
|
smalltalk.addMethod(
|
48
|
-
|
50
|
+
"_value",
|
49
51
|
smalltalk.method({
|
50
|
-
selector:
|
51
|
-
fn: function ()
|
52
|
+
selector: "value",
|
53
|
+
fn: function (){
|
52
54
|
var self=this;
|
53
55
|
return self['@value'];
|
54
56
|
return self;}
|
@@ -56,24 +58,22 @@ return self;}
|
|
56
58
|
smalltalk.Association);
|
57
59
|
|
58
60
|
smalltalk.addMethod(
|
59
|
-
|
61
|
+
"_value_",
|
60
62
|
smalltalk.method({
|
61
|
-
selector:
|
62
|
-
fn: function (
|
63
|
+
selector: "value:",
|
64
|
+
fn: function (aValue){
|
63
65
|
var self=this;
|
64
|
-
|
65
|
-
smalltalk.send(aStream, "_nextPutAll_", [unescape("-%3E")]);
|
66
|
-
smalltalk.send(self['@value'], "_storeOn_", [aStream]);
|
66
|
+
(self['@value']=aValue);
|
67
67
|
return self;}
|
68
68
|
}),
|
69
69
|
smalltalk.Association);
|
70
70
|
|
71
71
|
|
72
72
|
smalltalk.addMethod(
|
73
|
-
|
73
|
+
"_key_value_",
|
74
74
|
smalltalk.method({
|
75
|
-
selector:
|
76
|
-
fn: function (aKey, aValue)
|
75
|
+
selector: "key:value:",
|
76
|
+
fn: function (aKey, aValue){
|
77
77
|
var self=this;
|
78
78
|
return (function($rec){smalltalk.send($rec, "_key_", [aKey]);smalltalk.send($rec, "_value_", [aValue]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
|
79
79
|
return self;}
|
@@ -81,913 +81,1008 @@ return self;}
|
|
81
81
|
smalltalk.Association.klass);
|
82
82
|
|
83
83
|
|
84
|
-
smalltalk.addClass('
|
84
|
+
smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel-Collections');
|
85
85
|
smalltalk.addMethod(
|
86
|
-
|
86
|
+
"__comma",
|
87
87
|
smalltalk.method({
|
88
|
-
selector:
|
89
|
-
fn: function ()
|
88
|
+
selector: ",",
|
89
|
+
fn: function (aCollection){
|
90
90
|
var self=this;
|
91
|
-
return self[
|
91
|
+
return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
|
92
92
|
return self;}
|
93
93
|
}),
|
94
|
-
smalltalk.
|
94
|
+
smalltalk.Collection);
|
95
95
|
|
96
96
|
smalltalk.addMethod(
|
97
|
-
|
97
|
+
"_add_",
|
98
98
|
smalltalk.method({
|
99
|
-
selector:
|
100
|
-
fn: function (
|
99
|
+
selector: "add:",
|
100
|
+
fn: function (anObject){
|
101
101
|
var self=this;
|
102
|
-
(self[
|
102
|
+
smalltalk.send(self, "_subclassResponsibility", []);
|
103
103
|
return self;}
|
104
104
|
}),
|
105
|
-
smalltalk.
|
105
|
+
smalltalk.Collection);
|
106
106
|
|
107
107
|
smalltalk.addMethod(
|
108
|
-
|
108
|
+
"_addAll_",
|
109
109
|
smalltalk.method({
|
110
|
-
selector:
|
111
|
-
fn: function ()
|
110
|
+
selector: "addAll:",
|
111
|
+
fn: function (aCollection){
|
112
112
|
var self=this;
|
113
|
-
|
113
|
+
smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_add_", [each]);})]);
|
114
|
+
return aCollection;
|
114
115
|
return self;}
|
115
116
|
}),
|
116
|
-
smalltalk.
|
117
|
+
smalltalk.Collection);
|
117
118
|
|
118
119
|
smalltalk.addMethod(
|
119
|
-
|
120
|
+
"_asArray",
|
120
121
|
smalltalk.method({
|
121
|
-
selector:
|
122
|
-
fn: function (
|
122
|
+
selector: "asArray",
|
123
|
+
fn: function (){
|
123
124
|
var self=this;
|
124
|
-
(self
|
125
|
+
return smalltalk.send((smalltalk.Array || Array), "_withAll_", [self]);
|
125
126
|
return self;}
|
126
127
|
}),
|
127
|
-
smalltalk.
|
128
|
+
smalltalk.Collection);
|
128
129
|
|
129
130
|
smalltalk.addMethod(
|
130
|
-
|
131
|
+
"_asJSON",
|
131
132
|
smalltalk.method({
|
132
|
-
selector:
|
133
|
-
fn: function ()
|
133
|
+
selector: "asJSON",
|
134
|
+
fn: function (){
|
134
135
|
var self=this;
|
135
|
-
return self[
|
136
|
+
return smalltalk.send(smalltalk.send(self, "_asArray", []), "_collect_", [(function(each){return smalltalk.send(each, "_asJSON", []);})]);
|
136
137
|
return self;}
|
137
138
|
}),
|
138
|
-
smalltalk.
|
139
|
+
smalltalk.Collection);
|
139
140
|
|
140
141
|
smalltalk.addMethod(
|
141
|
-
|
142
|
+
"_asOrderedCollection",
|
142
143
|
smalltalk.method({
|
143
|
-
selector:
|
144
|
-
fn: function (
|
144
|
+
selector: "asOrderedCollection",
|
145
|
+
fn: function (){
|
145
146
|
var self=this;
|
146
|
-
(self[
|
147
|
+
return smalltalk.send(self, "_asArray", []);
|
147
148
|
return self;}
|
148
149
|
}),
|
149
|
-
smalltalk.
|
150
|
+
smalltalk.Collection);
|
150
151
|
|
151
152
|
smalltalk.addMethod(
|
152
|
-
|
153
|
+
"_asSet",
|
153
154
|
smalltalk.method({
|
154
|
-
selector:
|
155
|
-
fn: function ()
|
155
|
+
selector: "asSet",
|
156
|
+
fn: function (){
|
156
157
|
var self=this;
|
157
|
-
return smalltalk.send(smalltalk.
|
158
|
+
return smalltalk.send((smalltalk.Set || Set), "_withAll_", [self]);
|
158
159
|
return self;}
|
159
160
|
}),
|
160
|
-
smalltalk.
|
161
|
+
smalltalk.Collection);
|
161
162
|
|
162
163
|
smalltalk.addMethod(
|
163
|
-
|
164
|
+
"_collect_",
|
164
165
|
smalltalk.method({
|
165
|
-
selector:
|
166
|
-
fn: function ()
|
166
|
+
selector: "collect:",
|
167
|
+
fn: function (aBlock){
|
167
168
|
var self=this;
|
168
|
-
|
169
|
+
var newCollection=nil;
|
170
|
+
(newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
|
171
|
+
smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(aBlock, "_value_", [each])]);})]);
|
172
|
+
return newCollection;
|
169
173
|
return self;}
|
170
174
|
}),
|
171
|
-
smalltalk.
|
175
|
+
smalltalk.Collection);
|
172
176
|
|
173
177
|
smalltalk.addMethod(
|
174
|
-
|
178
|
+
"_copyWith_",
|
175
179
|
smalltalk.method({
|
176
|
-
selector:
|
177
|
-
fn: function ()
|
180
|
+
selector: "copyWith:",
|
181
|
+
fn: function (anObject){
|
178
182
|
var self=this;
|
179
|
-
smalltalk.send(
|
183
|
+
return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
|
180
184
|
return self;}
|
181
185
|
}),
|
182
|
-
smalltalk.
|
186
|
+
smalltalk.Collection);
|
183
187
|
|
184
188
|
smalltalk.addMethod(
|
185
|
-
|
189
|
+
"_copyWithAll_",
|
186
190
|
smalltalk.method({
|
187
|
-
selector:
|
188
|
-
fn: function ()
|
191
|
+
selector: "copyWithAll:",
|
192
|
+
fn: function (aCollection){
|
189
193
|
var self=this;
|
190
|
-
|
194
|
+
return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_copy", []));
|
191
195
|
return self;}
|
192
196
|
}),
|
193
|
-
smalltalk.
|
197
|
+
smalltalk.Collection);
|
194
198
|
|
195
199
|
smalltalk.addMethod(
|
196
|
-
|
200
|
+
"_copyWithoutAll_",
|
197
201
|
smalltalk.method({
|
198
|
-
selector:
|
199
|
-
fn: function ()
|
202
|
+
selector: "copyWithoutAll:",
|
203
|
+
fn: function (aCollection){
|
200
204
|
var self=this;
|
201
|
-
|
205
|
+
return smalltalk.send(self, "_reject_", [(function(each){return smalltalk.send(aCollection, "_includes_", [each]);})]);
|
202
206
|
return self;}
|
203
207
|
}),
|
204
|
-
smalltalk.
|
208
|
+
smalltalk.Collection);
|
205
209
|
|
206
210
|
smalltalk.addMethod(
|
207
|
-
|
211
|
+
"_detect_",
|
208
212
|
smalltalk.method({
|
209
|
-
selector:
|
210
|
-
fn: function ()
|
213
|
+
selector: "detect:",
|
214
|
+
fn: function (aBlock){
|
211
215
|
var self=this;
|
212
|
-
smalltalk.send(self, "
|
213
|
-
smalltalk.send(self, "_setStreamSize_", [(0)]);
|
216
|
+
return smalltalk.send(self, "_detect_ifNone_", [aBlock, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
|
214
217
|
return self;}
|
215
218
|
}),
|
216
|
-
smalltalk.
|
219
|
+
smalltalk.Collection);
|
217
220
|
|
218
221
|
smalltalk.addMethod(
|
219
|
-
|
222
|
+
"_detect_ifNone_",
|
220
223
|
smalltalk.method({
|
221
|
-
selector:
|
222
|
-
fn: function (aBlock)
|
224
|
+
selector: "detect:ifNone:",
|
225
|
+
fn: function (aBlock, anotherBlock){
|
223
226
|
var self=this;
|
224
|
-
|
227
|
+
|
228
|
+
for(var i = 0; i < self.length; i++)
|
229
|
+
if(aBlock(self[i]))
|
230
|
+
return self[i];
|
231
|
+
return anotherBlock();
|
232
|
+
;
|
225
233
|
return self;}
|
226
234
|
}),
|
227
|
-
smalltalk.
|
235
|
+
smalltalk.Collection);
|
228
236
|
|
229
237
|
smalltalk.addMethod(
|
230
|
-
|
238
|
+
"_do_",
|
231
239
|
smalltalk.method({
|
232
|
-
selector:
|
233
|
-
fn: function ()
|
240
|
+
selector: "do:",
|
241
|
+
fn: function (aBlock){
|
234
242
|
var self=this;
|
235
|
-
|
243
|
+
for(var i=0;i<self.length;i++){aBlock(self[i]);};
|
236
244
|
return self;}
|
237
245
|
}),
|
238
|
-
smalltalk.
|
246
|
+
smalltalk.Collection);
|
239
247
|
|
240
248
|
smalltalk.addMethod(
|
241
|
-
|
249
|
+
"_do_separatedBy_",
|
242
250
|
smalltalk.method({
|
243
|
-
selector:
|
244
|
-
fn: function (
|
251
|
+
selector: "do:separatedBy:",
|
252
|
+
fn: function (aBlock, anotherBlock){
|
245
253
|
var self=this;
|
246
|
-
|
254
|
+
var first=nil;
|
255
|
+
(first=true);
|
256
|
+
smalltalk.send(self, "_do_", [(function(each){((($receiver = first).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (first=false);})() : (function(){return smalltalk.send(anotherBlock, "_value", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (first=false);}), (function(){return smalltalk.send(anotherBlock, "_value", []);})]));return smalltalk.send(aBlock, "_value_", [each]);})]);
|
247
257
|
return self;}
|
248
258
|
}),
|
249
|
-
smalltalk.
|
259
|
+
smalltalk.Collection);
|
250
260
|
|
251
261
|
smalltalk.addMethod(
|
252
|
-
|
262
|
+
"_errorNotFound",
|
253
263
|
smalltalk.method({
|
254
|
-
selector:
|
255
|
-
fn: function ()
|
264
|
+
selector: "errorNotFound",
|
265
|
+
fn: function (){
|
256
266
|
var self=this;
|
257
|
-
|
267
|
+
smalltalk.send(self, "_error_", ["Object is not in the collection"]);
|
258
268
|
return self;}
|
259
269
|
}),
|
260
|
-
smalltalk.
|
270
|
+
smalltalk.Collection);
|
261
271
|
|
262
272
|
smalltalk.addMethod(
|
263
|
-
|
273
|
+
"_ifEmpty_",
|
264
274
|
smalltalk.method({
|
265
|
-
selector:
|
266
|
-
fn: function (
|
275
|
+
selector: "ifEmpty:",
|
276
|
+
fn: function (aBlock){
|
267
277
|
var self=this;
|
268
|
-
|
269
|
-
(tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []));
|
270
|
-
smalltalk.send(anInteger, "_timesRepeat_", [(function(){return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);})]));})]);
|
271
|
-
return tempCollection;
|
278
|
+
return ((($receiver = smalltalk.send(self, "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aBlock, "_value", []);})() : (function(){return self;})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aBlock, "_value", []);}), (function(){return self;})]));
|
272
279
|
return self;}
|
273
280
|
}),
|
274
|
-
smalltalk.
|
281
|
+
smalltalk.Collection);
|
275
282
|
|
276
283
|
smalltalk.addMethod(
|
277
|
-
|
284
|
+
"_ifNotEmpty_",
|
278
285
|
smalltalk.method({
|
279
|
-
selector:
|
280
|
-
fn: function (
|
286
|
+
selector: "ifNotEmpty:",
|
287
|
+
fn: function (aBlock){
|
281
288
|
var self=this;
|
282
|
-
smalltalk.send(
|
283
|
-
smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
|
284
|
-
smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
|
289
|
+
smalltalk.send(smalltalk.send(self, "_notEmpty", []), "_ifTrue_", [aBlock]);
|
285
290
|
return self;}
|
286
291
|
}),
|
287
|
-
smalltalk.
|
292
|
+
smalltalk.Collection);
|
288
293
|
|
289
294
|
smalltalk.addMethod(
|
290
|
-
|
295
|
+
"_includes_",
|
291
296
|
smalltalk.method({
|
292
|
-
selector:
|
293
|
-
fn: function (
|
297
|
+
selector: "includes:",
|
298
|
+
fn: function (anObject){
|
294
299
|
var self=this;
|
295
|
-
|
300
|
+
|
301
|
+
var i = self.length;
|
302
|
+
while (i--) {
|
303
|
+
if (smalltalk.send(self[i], "__eq", [anObject])) {return true;}
|
304
|
+
}
|
305
|
+
return false
|
306
|
+
;
|
296
307
|
return self;}
|
297
308
|
}),
|
298
|
-
smalltalk.
|
309
|
+
smalltalk.Collection);
|
299
310
|
|
300
311
|
smalltalk.addMethod(
|
301
|
-
|
312
|
+
"_inject_into_",
|
302
313
|
smalltalk.method({
|
303
|
-
selector:
|
304
|
-
fn: function ()
|
314
|
+
selector: "inject:into:",
|
315
|
+
fn: function (anObject, aBlock){
|
305
316
|
var self=this;
|
306
|
-
|
317
|
+
var result=nil;
|
318
|
+
(result=anObject);
|
319
|
+
smalltalk.send(self, "_do_", [(function(each){return (result=smalltalk.send(aBlock, "_value_value_", [result, each]));})]);
|
320
|
+
return result;
|
307
321
|
return self;}
|
308
322
|
}),
|
309
|
-
smalltalk.
|
323
|
+
smalltalk.Collection);
|
310
324
|
|
311
325
|
smalltalk.addMethod(
|
312
|
-
|
326
|
+
"_isEmpty",
|
313
327
|
smalltalk.method({
|
314
|
-
selector:
|
315
|
-
fn: function ()
|
328
|
+
selector: "isEmpty",
|
329
|
+
fn: function (){
|
316
330
|
var self=this;
|
317
|
-
return smalltalk.send(smalltalk.send(self, "
|
331
|
+
return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
|
318
332
|
return self;}
|
319
333
|
}),
|
320
|
-
smalltalk.
|
334
|
+
smalltalk.Collection);
|
321
335
|
|
322
336
|
smalltalk.addMethod(
|
323
|
-
|
337
|
+
"_notEmpty",
|
324
338
|
smalltalk.method({
|
325
|
-
selector:
|
326
|
-
fn: function ()
|
339
|
+
selector: "notEmpty",
|
340
|
+
fn: function (){
|
327
341
|
var self=this;
|
328
|
-
return smalltalk.send(smalltalk.send(self, "
|
342
|
+
return smalltalk.send(smalltalk.send(self, "_isEmpty", []), "_not", []);
|
329
343
|
return self;}
|
330
344
|
}),
|
331
|
-
smalltalk.
|
345
|
+
smalltalk.Collection);
|
332
346
|
|
333
347
|
smalltalk.addMethod(
|
334
|
-
|
348
|
+
"_readStream",
|
335
349
|
smalltalk.method({
|
336
|
-
selector:
|
337
|
-
fn: function ()
|
350
|
+
selector: "readStream",
|
351
|
+
fn: function (){
|
338
352
|
var self=this;
|
339
|
-
return smalltalk.send(
|
353
|
+
return smalltalk.send(self, "_stream", []);
|
340
354
|
return self;}
|
341
355
|
}),
|
342
|
-
smalltalk.
|
343
|
-
|
356
|
+
smalltalk.Collection);
|
344
357
|
|
345
358
|
smalltalk.addMethod(
|
346
|
-
|
359
|
+
"_reject_",
|
347
360
|
smalltalk.method({
|
348
|
-
selector:
|
349
|
-
fn: function (
|
361
|
+
selector: "reject:",
|
362
|
+
fn: function (aBlock){
|
350
363
|
var self=this;
|
351
|
-
return
|
364
|
+
return smalltalk.send(self, "_select_", [(function(each){return smalltalk.send(smalltalk.send(aBlock, "_value_", [each]), "__eq", [false]);})]);
|
352
365
|
return self;}
|
353
366
|
}),
|
354
|
-
smalltalk.
|
355
|
-
|
367
|
+
smalltalk.Collection);
|
356
368
|
|
357
|
-
smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
|
358
369
|
smalltalk.addMethod(
|
359
|
-
|
370
|
+
"_remove_",
|
360
371
|
smalltalk.method({
|
361
|
-
selector:
|
362
|
-
fn: function (
|
372
|
+
selector: "remove:",
|
373
|
+
fn: function (anObject){
|
363
374
|
var self=this;
|
364
|
-
return self.
|
375
|
+
return smalltalk.send(self, "_remove_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
|
365
376
|
return self;}
|
366
377
|
}),
|
367
|
-
smalltalk.
|
378
|
+
smalltalk.Collection);
|
368
379
|
|
369
380
|
smalltalk.addMethod(
|
370
|
-
|
381
|
+
"_remove_ifAbsent_",
|
371
382
|
smalltalk.method({
|
372
|
-
selector:
|
373
|
-
fn: function (
|
383
|
+
selector: "remove:ifAbsent:",
|
384
|
+
fn: function (anObject, aBlock){
|
374
385
|
var self=this;
|
375
|
-
|
386
|
+
smalltalk.send(self, "_subclassResponsibility", []);
|
376
387
|
return self;}
|
377
388
|
}),
|
378
|
-
smalltalk.
|
389
|
+
smalltalk.Collection);
|
379
390
|
|
380
391
|
smalltalk.addMethod(
|
381
|
-
|
392
|
+
"_select_",
|
382
393
|
smalltalk.method({
|
383
|
-
selector:
|
384
|
-
fn: function (
|
394
|
+
selector: "select:",
|
395
|
+
fn: function (aBlock){
|
385
396
|
var self=this;
|
386
|
-
|
397
|
+
var stream=nil;
|
398
|
+
(stream=smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []));
|
399
|
+
smalltalk.send(self, "_do_", [(function(each){return ((($receiver = smalltalk.send(aBlock, "_value_", [each])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(stream, "_nextPut_", [each]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(stream, "_nextPut_", [each]);})]));})]);
|
400
|
+
return smalltalk.send(stream, "_contents", []);
|
387
401
|
return self;}
|
388
402
|
}),
|
389
|
-
smalltalk.
|
390
|
-
|
403
|
+
smalltalk.Collection);
|
391
404
|
|
392
405
|
smalltalk.addMethod(
|
393
|
-
|
406
|
+
"_size",
|
394
407
|
smalltalk.method({
|
395
|
-
selector:
|
396
|
-
fn: function (
|
408
|
+
selector: "size",
|
409
|
+
fn: function (){
|
397
410
|
var self=this;
|
398
|
-
|
411
|
+
smalltalk.send(self, "_subclassResponsibility", []);
|
399
412
|
return self;}
|
400
413
|
}),
|
401
|
-
smalltalk.
|
414
|
+
smalltalk.Collection);
|
402
415
|
|
403
416
|
smalltalk.addMethod(
|
404
|
-
|
417
|
+
"_stream",
|
405
418
|
smalltalk.method({
|
406
|
-
selector:
|
407
|
-
fn: function (
|
419
|
+
selector: "stream",
|
420
|
+
fn: function (){
|
408
421
|
var self=this;
|
409
|
-
return smalltalk.send(self, "
|
422
|
+
return smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [self]);
|
410
423
|
return self;}
|
411
424
|
}),
|
412
|
-
smalltalk.
|
413
|
-
|
425
|
+
smalltalk.Collection);
|
414
426
|
|
415
|
-
smalltalk.addClass('Collection', smalltalk.Object, [], 'Kernel-Collections');
|
416
427
|
smalltalk.addMethod(
|
417
|
-
|
428
|
+
"_streamClass",
|
418
429
|
smalltalk.method({
|
419
|
-
selector:
|
420
|
-
fn: function ()
|
430
|
+
selector: "streamClass",
|
431
|
+
fn: function (){
|
421
432
|
var self=this;
|
422
|
-
smalltalk.send(self, "
|
433
|
+
return smalltalk.send(smalltalk.send(self, "_class", []), "_streamClass", []);
|
423
434
|
return self;}
|
424
435
|
}),
|
425
436
|
smalltalk.Collection);
|
426
437
|
|
427
438
|
smalltalk.addMethod(
|
428
|
-
|
439
|
+
"_writeStream",
|
429
440
|
smalltalk.method({
|
430
|
-
selector:
|
431
|
-
fn: function ()
|
441
|
+
selector: "writeStream",
|
442
|
+
fn: function (){
|
432
443
|
var self=this;
|
433
444
|
return smalltalk.send(self, "_stream", []);
|
434
445
|
return self;}
|
435
446
|
}),
|
436
447
|
smalltalk.Collection);
|
437
448
|
|
449
|
+
|
438
450
|
smalltalk.addMethod(
|
439
|
-
|
451
|
+
"_new_",
|
440
452
|
smalltalk.method({
|
441
|
-
selector:
|
442
|
-
fn: function ()
|
453
|
+
selector: "new:",
|
454
|
+
fn: function (anInteger){
|
443
455
|
var self=this;
|
444
|
-
return smalltalk.send(self, "
|
456
|
+
return smalltalk.send(self, "_new", []);
|
445
457
|
return self;}
|
446
458
|
}),
|
447
|
-
smalltalk.Collection);
|
459
|
+
smalltalk.Collection.klass);
|
448
460
|
|
449
461
|
smalltalk.addMethod(
|
450
|
-
|
462
|
+
"_streamClass",
|
451
463
|
smalltalk.method({
|
452
|
-
selector:
|
453
|
-
fn: function ()
|
464
|
+
selector: "streamClass",
|
465
|
+
fn: function (){
|
454
466
|
var self=this;
|
455
|
-
return
|
467
|
+
return (smalltalk.Stream || Stream);
|
456
468
|
return self;}
|
457
469
|
}),
|
458
|
-
smalltalk.Collection);
|
470
|
+
smalltalk.Collection.klass);
|
459
471
|
|
460
472
|
smalltalk.addMethod(
|
461
|
-
|
473
|
+
"_with_",
|
462
474
|
smalltalk.method({
|
463
|
-
selector:
|
464
|
-
fn: function ()
|
475
|
+
selector: "with:",
|
476
|
+
fn: function (anObject){
|
465
477
|
var self=this;
|
466
|
-
return smalltalk.send(smalltalk.send(
|
478
|
+
return (function($rec){smalltalk.send($rec, "_add_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
|
467
479
|
return self;}
|
468
480
|
}),
|
469
|
-
smalltalk.Collection);
|
481
|
+
smalltalk.Collection.klass);
|
470
482
|
|
471
483
|
smalltalk.addMethod(
|
472
|
-
|
484
|
+
"_with_with_",
|
473
485
|
smalltalk.method({
|
474
|
-
selector:
|
475
|
-
fn: function (anObject)
|
486
|
+
selector: "with:with:",
|
487
|
+
fn: function (anObject, anotherObject){
|
476
488
|
var self=this;
|
477
|
-
smalltalk.send(self, "
|
489
|
+
return (function($rec){smalltalk.send($rec, "_add_", [anObject]);smalltalk.send($rec, "_add_", [anotherObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
|
478
490
|
return self;}
|
479
491
|
}),
|
480
|
-
smalltalk.Collection);
|
492
|
+
smalltalk.Collection.klass);
|
481
493
|
|
482
494
|
smalltalk.addMethod(
|
483
|
-
|
495
|
+
"_with_with_with_",
|
484
496
|
smalltalk.method({
|
485
|
-
selector:
|
486
|
-
fn: function (
|
497
|
+
selector: "with:with:with:",
|
498
|
+
fn: function (firstObject, secondObject, thirdObject){
|
487
499
|
var self=this;
|
488
|
-
smalltalk.send(
|
489
|
-
return aCollection;
|
500
|
+
return (function($rec){smalltalk.send($rec, "_add_", [firstObject]);smalltalk.send($rec, "_add_", [secondObject]);smalltalk.send($rec, "_add_", [thirdObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
|
490
501
|
return self;}
|
491
502
|
}),
|
492
|
-
smalltalk.Collection);
|
503
|
+
smalltalk.Collection.klass);
|
493
504
|
|
494
505
|
smalltalk.addMethod(
|
495
|
-
|
506
|
+
"_withAll_",
|
496
507
|
smalltalk.method({
|
497
|
-
selector:
|
498
|
-
fn: function (aCollection)
|
508
|
+
selector: "withAll:",
|
509
|
+
fn: function (aCollection){
|
499
510
|
var self=this;
|
500
|
-
return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "
|
511
|
+
return (function($rec){smalltalk.send($rec, "_addAll_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
|
501
512
|
return self;}
|
502
513
|
}),
|
503
|
-
smalltalk.Collection);
|
514
|
+
smalltalk.Collection.klass);
|
515
|
+
|
504
516
|
|
517
|
+
smalltalk.addClass('HashedCollection', smalltalk.Collection, [], 'Kernel-Collections');
|
505
518
|
smalltalk.addMethod(
|
506
|
-
|
519
|
+
"__comma",
|
507
520
|
smalltalk.method({
|
508
|
-
selector:
|
509
|
-
fn: function (
|
521
|
+
selector: ",",
|
522
|
+
fn: function (aCollection){
|
510
523
|
var self=this;
|
511
|
-
|
524
|
+
smalltalk.send(self, "_shouldNotImplement", []);
|
512
525
|
return self;}
|
513
526
|
}),
|
514
|
-
smalltalk.
|
527
|
+
smalltalk.HashedCollection);
|
515
528
|
|
516
529
|
smalltalk.addMethod(
|
517
|
-
|
530
|
+
"__eq",
|
518
531
|
smalltalk.method({
|
519
|
-
selector:
|
520
|
-
fn: function (
|
532
|
+
selector: "=",
|
533
|
+
fn: function (aHashedCollection){
|
521
534
|
var self=this;
|
522
|
-
|
523
|
-
return
|
535
|
+
var $early={};
|
536
|
+
try{((($receiver = smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aHashedCollection, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw $early=[false]})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw $early=[false]})();})]));
|
537
|
+
((($receiver = smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aHashedCollection, "_size", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw $early=[false]})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw $early=[false]})();})]));
|
538
|
+
return smalltalk.send(smalltalk.send(self, "_associations", []), "__eq", [smalltalk.send(aHashedCollection, "_associations", [])]);
|
539
|
+
return self;
|
540
|
+
} catch(e) {if(e===$early)return e[0]; throw e}}
|
524
541
|
}),
|
525
|
-
smalltalk.
|
542
|
+
smalltalk.HashedCollection);
|
526
543
|
|
527
544
|
smalltalk.addMethod(
|
528
|
-
|
545
|
+
"_add_",
|
529
546
|
smalltalk.method({
|
530
|
-
selector:
|
531
|
-
fn: function ()
|
547
|
+
selector: "add:",
|
548
|
+
fn: function (anAssociation){
|
532
549
|
var self=this;
|
533
|
-
|
550
|
+
smalltalk.send(self, "_at_put_", [smalltalk.send(anAssociation, "_key", []), smalltalk.send(anAssociation, "_value", [])]);
|
534
551
|
return self;}
|
535
552
|
}),
|
536
|
-
smalltalk.
|
553
|
+
smalltalk.HashedCollection);
|
537
554
|
|
538
555
|
smalltalk.addMethod(
|
539
|
-
|
556
|
+
"_addAll_",
|
540
557
|
smalltalk.method({
|
541
|
-
selector:
|
542
|
-
fn: function (
|
558
|
+
selector: "addAll:",
|
559
|
+
fn: function (aHashedCollection){
|
543
560
|
var self=this;
|
544
|
-
|
561
|
+
smalltalk.send(self, "_addAll_", [smalltalk.send(aHashedCollection, "_associations", [])], smalltalk.HashedCollection.superclass || nil);
|
562
|
+
return aHashedCollection;
|
545
563
|
return self;}
|
546
564
|
}),
|
547
|
-
smalltalk.
|
565
|
+
smalltalk.HashedCollection);
|
548
566
|
|
549
567
|
smalltalk.addMethod(
|
550
|
-
|
568
|
+
"_asDictionary",
|
551
569
|
smalltalk.method({
|
552
|
-
selector:
|
553
|
-
fn: function (
|
570
|
+
selector: "asDictionary",
|
571
|
+
fn: function (){
|
554
572
|
var self=this;
|
555
|
-
|
556
|
-
(newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
|
557
|
-
smalltalk.send(self, "_do_", [(function(each){return smalltalk.send(newCollection, "_add_", [smalltalk.send(aBlock, "_value_", [each])]);})]);
|
558
|
-
return newCollection;
|
573
|
+
return smalltalk.send((smalltalk.Dictionary || Dictionary), "_fromPairs_", [smalltalk.send(self, "_associations", [])]);
|
559
574
|
return self;}
|
560
575
|
}),
|
561
|
-
smalltalk.
|
576
|
+
smalltalk.HashedCollection);
|
562
577
|
|
563
578
|
smalltalk.addMethod(
|
564
|
-
|
579
|
+
"_asJSON",
|
565
580
|
smalltalk.method({
|
566
|
-
selector:
|
567
|
-
fn: function (
|
581
|
+
selector: "asJSON",
|
582
|
+
fn: function (){
|
568
583
|
var self=this;
|
569
|
-
|
584
|
+
var c=nil;
|
585
|
+
(c=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
|
586
|
+
smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(c, "_at_put_", [key, smalltalk.send(value, "_asJSON", [])]);})]);
|
587
|
+
return c;
|
570
588
|
return self;}
|
571
589
|
}),
|
572
|
-
smalltalk.
|
590
|
+
smalltalk.HashedCollection);
|
573
591
|
|
574
592
|
smalltalk.addMethod(
|
575
|
-
|
593
|
+
"_associations",
|
576
594
|
smalltalk.method({
|
577
|
-
selector:
|
578
|
-
fn: function (
|
595
|
+
selector: "associations",
|
596
|
+
fn: function (){
|
579
597
|
var self=this;
|
598
|
+
var associations=nil;
|
599
|
+
(associations=[]);
|
600
|
+
smalltalk.send(smalltalk.send(self, "_keys", []), "_do_", [(function(each){return smalltalk.send(associations, "_add_", [smalltalk.send((smalltalk.Association || Association), "_key_value_", [each, smalltalk.send(self, "_at_", [each])])]);})]);
|
601
|
+
return associations;
|
602
|
+
return self;}
|
603
|
+
}),
|
604
|
+
smalltalk.HashedCollection);
|
580
605
|
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
606
|
+
smalltalk.addMethod(
|
607
|
+
"_associationsDo_",
|
608
|
+
smalltalk.method({
|
609
|
+
selector: "associationsDo:",
|
610
|
+
fn: function (aBlock){
|
611
|
+
var self=this;
|
612
|
+
smalltalk.send(smalltalk.send(self, "_associations", []), "_do_", [aBlock]);
|
586
613
|
return self;}
|
587
614
|
}),
|
588
|
-
smalltalk.
|
615
|
+
smalltalk.HashedCollection);
|
589
616
|
|
590
617
|
smalltalk.addMethod(
|
591
|
-
|
618
|
+
"_at_",
|
592
619
|
smalltalk.method({
|
593
|
-
selector:
|
594
|
-
fn: function (
|
620
|
+
selector: "at:",
|
621
|
+
fn: function (aKey){
|
595
622
|
var self=this;
|
596
|
-
|
597
|
-
(first=true);
|
598
|
-
smalltalk.send(self, "_do_", [(function(each){((($receiver = first).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (first=false);})() : (function(){return smalltalk.send(anotherBlock, "_value", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (first=false);}), (function(){return smalltalk.send(anotherBlock, "_value", []);})]));return smalltalk.send(aBlock, "_value_", [each]);})]);
|
623
|
+
return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
|
599
624
|
return self;}
|
600
625
|
}),
|
601
|
-
smalltalk.
|
626
|
+
smalltalk.HashedCollection);
|
602
627
|
|
603
628
|
smalltalk.addMethod(
|
604
|
-
|
629
|
+
"_at_ifAbsent_",
|
605
630
|
smalltalk.method({
|
606
|
-
selector:
|
607
|
-
fn: function (
|
631
|
+
selector: "at:ifAbsent:",
|
632
|
+
fn: function (aKey, aBlock){
|
608
633
|
var self=this;
|
609
|
-
|
610
|
-
(result=anObject);
|
611
|
-
smalltalk.send(self, "_do_", [(function(each){return (result=smalltalk.send(aBlock, "_value_value_", [result, each]));})]);
|
612
|
-
return result;
|
634
|
+
return smalltalk.send(smalltalk.send(self, "_includesKey_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
|
613
635
|
return self;}
|
614
636
|
}),
|
615
|
-
smalltalk.
|
637
|
+
smalltalk.HashedCollection);
|
616
638
|
|
617
639
|
smalltalk.addMethod(
|
618
|
-
|
640
|
+
"_at_ifAbsentPut_",
|
619
641
|
smalltalk.method({
|
620
|
-
selector:
|
621
|
-
fn: function (aBlock)
|
642
|
+
selector: "at:ifAbsentPut:",
|
643
|
+
fn: function (aKey, aBlock){
|
622
644
|
var self=this;
|
623
|
-
return smalltalk.send(self, "
|
645
|
+
return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_at_put_", [aKey, smalltalk.send(aBlock, "_value", [])]);})]);
|
624
646
|
return self;}
|
625
647
|
}),
|
626
|
-
smalltalk.
|
648
|
+
smalltalk.HashedCollection);
|
627
649
|
|
628
650
|
smalltalk.addMethod(
|
629
|
-
|
651
|
+
"_at_ifPresent_",
|
630
652
|
smalltalk.method({
|
631
|
-
selector:
|
632
|
-
fn: function (aBlock)
|
653
|
+
selector: "at:ifPresent:",
|
654
|
+
fn: function (aKey, aBlock){
|
633
655
|
var self=this;
|
634
|
-
|
635
|
-
(stream=smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_new", []), "_writeStream", []));
|
636
|
-
smalltalk.send(self, "_do_", [(function(each){return ((($receiver = smalltalk.send(aBlock, "_value_", [each])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(stream, "_nextPut_", [each]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(stream, "_nextPut_", [each]);})]));})]);
|
637
|
-
return smalltalk.send(stream, "_contents", []);
|
656
|
+
return (($receiver = smalltalk.send(self, "_basicAt_", [aKey])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})() : nil;
|
638
657
|
return self;}
|
639
658
|
}),
|
640
|
-
smalltalk.
|
659
|
+
smalltalk.HashedCollection);
|
641
660
|
|
642
661
|
smalltalk.addMethod(
|
643
|
-
|
662
|
+
"_at_ifPresent_ifAbsent_",
|
644
663
|
smalltalk.method({
|
645
|
-
selector:
|
646
|
-
fn: function ()
|
664
|
+
selector: "at:ifPresent:ifAbsent:",
|
665
|
+
fn: function (aKey, aBlock, anotherBlock){
|
647
666
|
var self=this;
|
648
|
-
smalltalk.send(self, "
|
667
|
+
return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
|
649
668
|
return self;}
|
650
669
|
}),
|
651
|
-
smalltalk.
|
670
|
+
smalltalk.HashedCollection);
|
652
671
|
|
653
672
|
smalltalk.addMethod(
|
654
|
-
|
673
|
+
"_at_put_",
|
655
674
|
smalltalk.method({
|
656
|
-
selector:
|
657
|
-
fn: function (
|
675
|
+
selector: "at:put:",
|
676
|
+
fn: function (aKey, aValue){
|
658
677
|
var self=this;
|
659
|
-
|
660
|
-
var i = self.length;
|
661
|
-
while (i--) {
|
662
|
-
if (smalltalk.send(self[i], "__eq", [anObject])) {return true;}
|
663
|
-
}
|
664
|
-
return false
|
665
|
-
;
|
678
|
+
return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
|
666
679
|
return self;}
|
667
680
|
}),
|
668
|
-
smalltalk.
|
681
|
+
smalltalk.HashedCollection);
|
669
682
|
|
670
683
|
smalltalk.addMethod(
|
671
|
-
|
684
|
+
"_collect_",
|
672
685
|
smalltalk.method({
|
673
|
-
selector:
|
674
|
-
fn: function ()
|
686
|
+
selector: "collect:",
|
687
|
+
fn: function (aBlock){
|
675
688
|
var self=this;
|
676
|
-
|
689
|
+
var newDict=nil;
|
690
|
+
(newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
|
691
|
+
smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
|
692
|
+
return newDict;
|
677
693
|
return self;}
|
678
694
|
}),
|
679
|
-
smalltalk.
|
695
|
+
smalltalk.HashedCollection);
|
680
696
|
|
681
697
|
smalltalk.addMethod(
|
682
|
-
|
698
|
+
"_copyFrom_to_",
|
683
699
|
smalltalk.method({
|
684
|
-
selector:
|
685
|
-
fn: function ()
|
700
|
+
selector: "copyFrom:to:",
|
701
|
+
fn: function (anIndex, anotherIndex){
|
686
702
|
var self=this;
|
687
|
-
|
703
|
+
smalltalk.send(self, "_shouldNotImplement", []);
|
688
704
|
return self;}
|
689
705
|
}),
|
690
|
-
smalltalk.
|
706
|
+
smalltalk.HashedCollection);
|
691
707
|
|
692
708
|
smalltalk.addMethod(
|
693
|
-
|
709
|
+
"_deepCopy",
|
694
710
|
smalltalk.method({
|
695
|
-
selector:
|
696
|
-
fn: function (
|
711
|
+
selector: "deepCopy",
|
712
|
+
fn: function (){
|
697
713
|
var self=this;
|
698
|
-
|
714
|
+
var copy=nil;
|
715
|
+
(copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
|
716
|
+
smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(smalltalk.send(each, "_value", []), "_deepCopy", [])]);})]);
|
717
|
+
return copy;
|
699
718
|
return self;}
|
700
719
|
}),
|
701
|
-
smalltalk.
|
720
|
+
smalltalk.HashedCollection);
|
702
721
|
|
703
722
|
smalltalk.addMethod(
|
704
|
-
|
723
|
+
"_detect_ifNone_",
|
705
724
|
smalltalk.method({
|
706
|
-
selector:
|
707
|
-
fn: function ()
|
725
|
+
selector: "detect:ifNone:",
|
726
|
+
fn: function (aBlock, anotherBlock){
|
708
727
|
var self=this;
|
709
|
-
return smalltalk.send(
|
728
|
+
return smalltalk.send(smalltalk.send(self, "_values", []), "_detect_ifNone_", [aBlock, anotherBlock]);
|
710
729
|
return self;}
|
711
730
|
}),
|
712
|
-
smalltalk.
|
731
|
+
smalltalk.HashedCollection);
|
713
732
|
|
714
733
|
smalltalk.addMethod(
|
715
|
-
|
734
|
+
"_do_",
|
716
735
|
smalltalk.method({
|
717
|
-
selector:
|
718
|
-
fn: function (aBlock)
|
736
|
+
selector: "do:",
|
737
|
+
fn: function (aBlock){
|
719
738
|
var self=this;
|
720
|
-
smalltalk.send(smalltalk.send(self, "
|
739
|
+
smalltalk.send(smalltalk.send(self, "_values", []), "_do_", [aBlock]);
|
721
740
|
return self;}
|
722
741
|
}),
|
723
|
-
smalltalk.
|
742
|
+
smalltalk.HashedCollection);
|
724
743
|
|
725
744
|
smalltalk.addMethod(
|
726
|
-
|
745
|
+
"_includes_",
|
727
746
|
smalltalk.method({
|
728
|
-
selector:
|
729
|
-
fn: function (
|
747
|
+
selector: "includes:",
|
748
|
+
fn: function (anObject){
|
730
749
|
var self=this;
|
731
|
-
return
|
750
|
+
return smalltalk.send(smalltalk.send(self, "_values", []), "_includes_", [anObject]);
|
732
751
|
return self;}
|
733
752
|
}),
|
734
|
-
smalltalk.
|
753
|
+
smalltalk.HashedCollection);
|
735
754
|
|
736
755
|
smalltalk.addMethod(
|
737
|
-
|
756
|
+
"_includesKey_",
|
738
757
|
smalltalk.method({
|
739
|
-
selector:
|
740
|
-
fn: function (
|
758
|
+
selector: "includesKey:",
|
759
|
+
fn: function (aKey){
|
741
760
|
var self=this;
|
742
|
-
return
|
761
|
+
return self.hasOwnProperty(aKey);
|
743
762
|
return self;}
|
744
763
|
}),
|
745
|
-
smalltalk.
|
764
|
+
smalltalk.HashedCollection);
|
746
765
|
|
747
766
|
smalltalk.addMethod(
|
748
|
-
|
767
|
+
"_keys",
|
749
768
|
smalltalk.method({
|
750
|
-
selector:
|
751
|
-
fn: function (
|
769
|
+
selector: "keys",
|
770
|
+
fn: function (){
|
752
771
|
var self=this;
|
753
|
-
|
772
|
+
|
773
|
+
if ('function'===typeof Object.keys) return Object.keys(self);
|
774
|
+
var keys = [];
|
775
|
+
for(var i in self) {
|
776
|
+
if(self.hasOwnProperty(i)) {
|
777
|
+
keys.push(i);
|
778
|
+
}
|
779
|
+
};
|
780
|
+
return keys;
|
781
|
+
;
|
754
782
|
return self;}
|
755
783
|
}),
|
756
|
-
smalltalk.
|
784
|
+
smalltalk.HashedCollection);
|
757
785
|
|
758
786
|
smalltalk.addMethod(
|
759
|
-
|
787
|
+
"_keysAndValuesDo_",
|
760
788
|
smalltalk.method({
|
761
|
-
selector:
|
762
|
-
fn: function ()
|
789
|
+
selector: "keysAndValuesDo:",
|
790
|
+
fn: function (aBlock){
|
763
791
|
var self=this;
|
764
|
-
return smalltalk.send(
|
792
|
+
smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(aBlock, "_value_value_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
|
765
793
|
return self;}
|
766
794
|
}),
|
767
|
-
smalltalk.
|
795
|
+
smalltalk.HashedCollection);
|
768
796
|
|
769
797
|
smalltalk.addMethod(
|
770
|
-
|
798
|
+
"_printString",
|
771
799
|
smalltalk.method({
|
772
|
-
selector:
|
800
|
+
selector: "printString",
|
773
801
|
fn: function (){
|
774
802
|
var self=this;
|
775
|
-
return smalltalk.send(smalltalk.send(self, "
|
803
|
+
return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.HashedCollection.superclass || nil)]);return smalltalk.send($rec, "_nextPutAll_", ["("]);})(aStream);smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(anAssociation){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(anAssociation, "_key", []), "_printString", [])]);smalltalk.send($rec, "_nextPutAll_", [" -> "]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(anAssociation, "_value", []), "_printString", [])]);})(aStream);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [" , "]);})]);return smalltalk.send(aStream, "_nextPutAll_", [")"]);})]);
|
776
804
|
return self;}
|
777
805
|
}),
|
778
|
-
smalltalk.
|
779
|
-
|
806
|
+
smalltalk.HashedCollection);
|
780
807
|
|
781
808
|
smalltalk.addMethod(
|
782
|
-
|
809
|
+
"_remove_ifAbsent_",
|
783
810
|
smalltalk.method({
|
784
|
-
selector:
|
785
|
-
fn: function ()
|
811
|
+
selector: "remove:ifAbsent:",
|
812
|
+
fn: function (aKey, aBlock){
|
786
813
|
var self=this;
|
787
|
-
return
|
814
|
+
return smalltalk.send(self, "_removeKey_ifAbsent_", [aKey, aBlock]);
|
788
815
|
return self;}
|
789
816
|
}),
|
790
|
-
smalltalk.
|
817
|
+
smalltalk.HashedCollection);
|
791
818
|
|
792
819
|
smalltalk.addMethod(
|
793
|
-
|
820
|
+
"_removeKey_",
|
794
821
|
smalltalk.method({
|
795
|
-
selector:
|
796
|
-
fn: function (
|
822
|
+
selector: "removeKey:",
|
823
|
+
fn: function (aKey){
|
797
824
|
var self=this;
|
798
|
-
return
|
825
|
+
return smalltalk.send(self, "_remove_", [aKey]);
|
799
826
|
return self;}
|
800
827
|
}),
|
801
|
-
smalltalk.
|
828
|
+
smalltalk.HashedCollection);
|
802
829
|
|
803
830
|
smalltalk.addMethod(
|
804
|
-
|
831
|
+
"_removeKey_ifAbsent_",
|
805
832
|
smalltalk.method({
|
806
|
-
selector:
|
807
|
-
fn: function (
|
833
|
+
selector: "removeKey:ifAbsent:",
|
834
|
+
fn: function (aKey, aBlock){
|
808
835
|
var self=this;
|
809
|
-
return (
|
836
|
+
return ((($receiver = smalltalk.send(self, "_includesKey_", [aKey])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(aBlock, "_value", []);})() : (function(){return smalltalk.send(self, "_basicDelete_", [aKey]);})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return smalltalk.send(aBlock, "_value", []);}), (function(){return smalltalk.send(self, "_basicDelete_", [aKey]);})]));
|
810
837
|
return self;}
|
811
838
|
}),
|
812
|
-
smalltalk.
|
839
|
+
smalltalk.HashedCollection);
|
813
840
|
|
814
841
|
smalltalk.addMethod(
|
815
|
-
|
842
|
+
"_select_",
|
816
843
|
smalltalk.method({
|
817
|
-
selector:
|
818
|
-
fn: function (
|
844
|
+
selector: "select:",
|
845
|
+
fn: function (aBlock){
|
819
846
|
var self=this;
|
820
|
-
|
847
|
+
var newDict=nil;
|
848
|
+
(newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
|
849
|
+
smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return ((($receiver = smalltalk.send(aBlock, "_value_", [value])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(newDict, "_at_put_", [key, value]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(newDict, "_at_put_", [key, value]);})]));})]);
|
850
|
+
return newDict;
|
821
851
|
return self;}
|
822
852
|
}),
|
823
|
-
smalltalk.
|
853
|
+
smalltalk.HashedCollection);
|
824
854
|
|
825
855
|
smalltalk.addMethod(
|
826
|
-
|
856
|
+
"_shallowCopy",
|
827
857
|
smalltalk.method({
|
828
|
-
selector:
|
829
|
-
fn: function (
|
858
|
+
selector: "shallowCopy",
|
859
|
+
fn: function (){
|
830
860
|
var self=this;
|
831
|
-
|
861
|
+
var copy=nil;
|
862
|
+
(copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
|
863
|
+
smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
|
864
|
+
return copy;
|
832
865
|
return self;}
|
833
866
|
}),
|
834
|
-
smalltalk.
|
867
|
+
smalltalk.HashedCollection);
|
835
868
|
|
836
869
|
smalltalk.addMethod(
|
837
|
-
|
870
|
+
"_size",
|
838
871
|
smalltalk.method({
|
839
|
-
selector:
|
840
|
-
fn: function (
|
872
|
+
selector: "size",
|
873
|
+
fn: function (){
|
841
874
|
var self=this;
|
842
|
-
return smalltalk.send(self, "
|
875
|
+
return smalltalk.send(smalltalk.send(self, "_keys", []), "_size", []);
|
843
876
|
return self;}
|
844
877
|
}),
|
845
|
-
smalltalk.
|
878
|
+
smalltalk.HashedCollection);
|
846
879
|
|
880
|
+
smalltalk.addMethod(
|
881
|
+
"_storeOn_",
|
882
|
+
smalltalk.method({
|
883
|
+
selector: "storeOn:",
|
884
|
+
fn: function (aStream){
|
885
|
+
var self=this;
|
886
|
+
smalltalk.send(aStream, "_nextPutAll_", ["#{"]);
|
887
|
+
smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_storeOn_", [aStream]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [". "]);})]);
|
888
|
+
smalltalk.send(aStream, "_nextPutAll_", ["}"]);
|
889
|
+
return self;}
|
890
|
+
}),
|
891
|
+
smalltalk.HashedCollection);
|
847
892
|
|
848
|
-
smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel-Collections');
|
849
893
|
smalltalk.addMethod(
|
850
|
-
|
894
|
+
"_values",
|
851
895
|
smalltalk.method({
|
852
|
-
selector:
|
853
|
-
fn: function (
|
896
|
+
selector: "values",
|
897
|
+
fn: function (){
|
854
898
|
var self=this;
|
855
|
-
return smalltalk.send(self, "
|
899
|
+
return smalltalk.send(smalltalk.send(self, "_keys", []), "_collect_", [(function(each){return smalltalk.send(self, "_at_", [each]);})]);
|
856
900
|
return self;}
|
857
901
|
}),
|
858
|
-
smalltalk.
|
902
|
+
smalltalk.HashedCollection);
|
903
|
+
|
859
904
|
|
860
905
|
smalltalk.addMethod(
|
861
|
-
|
906
|
+
"_fromPairs_",
|
862
907
|
smalltalk.method({
|
863
|
-
selector:
|
864
|
-
fn: function (
|
908
|
+
selector: "fromPairs:",
|
909
|
+
fn: function (aCollection){
|
865
910
|
var self=this;
|
866
|
-
|
911
|
+
var dict=nil;
|
912
|
+
(dict=smalltalk.send(self, "_new", []));
|
913
|
+
smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(dict, "_add_", [each]);})]);
|
914
|
+
return dict;
|
867
915
|
return self;}
|
868
916
|
}),
|
869
|
-
smalltalk.
|
917
|
+
smalltalk.HashedCollection.klass);
|
918
|
+
|
870
919
|
|
920
|
+
smalltalk.addClass('Dictionary', smalltalk.HashedCollection, ['keys', 'values'], 'Kernel-Collections');
|
871
921
|
smalltalk.addMethod(
|
872
|
-
|
922
|
+
"_asHashedCollection",
|
873
923
|
smalltalk.method({
|
874
|
-
selector:
|
875
|
-
fn: function (
|
924
|
+
selector: "asHashedCollection",
|
925
|
+
fn: function (){
|
876
926
|
var self=this;
|
877
|
-
smalltalk.send(self, "
|
927
|
+
return smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_fromPairs_", [smalltalk.send(self, "_associations", [])]);
|
878
928
|
return self;}
|
879
929
|
}),
|
880
|
-
smalltalk.
|
930
|
+
smalltalk.Dictionary);
|
881
931
|
|
882
932
|
smalltalk.addMethod(
|
883
|
-
|
933
|
+
"_asJSON",
|
884
934
|
smalltalk.method({
|
885
|
-
selector:
|
886
|
-
fn: function (
|
935
|
+
selector: "asJSON",
|
936
|
+
fn: function (){
|
887
937
|
var self=this;
|
888
|
-
|
889
|
-
var newCollection=nil;
|
890
|
-
(range=smalltalk.send(anIndex, "_to_", [anotherIndex]));
|
891
|
-
(newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new_", [smalltalk.send(range, "_size", [])]));
|
892
|
-
smalltalk.send(range, "_withIndexDo_", [(function(each, i){return smalltalk.send(newCollection, "_at_put_", [i, smalltalk.send(self, "_at_", [each])]);})]);
|
893
|
-
return newCollection;
|
938
|
+
return smalltalk.send(smalltalk.send(self, "_asHashedCollection", []), "_asJSON", []);
|
894
939
|
return self;}
|
895
940
|
}),
|
896
|
-
smalltalk.
|
941
|
+
smalltalk.Dictionary);
|
897
942
|
|
898
943
|
smalltalk.addMethod(
|
899
|
-
|
944
|
+
"_at_ifAbsent_",
|
900
945
|
smalltalk.method({
|
901
|
-
selector:
|
902
|
-
fn: function ()
|
946
|
+
selector: "at:ifAbsent:",
|
947
|
+
fn: function (aKey, aBlock){
|
903
948
|
var self=this;
|
904
|
-
|
949
|
+
|
950
|
+
var index;
|
951
|
+
for(var i=0;i<self['@keys'].length;i++){
|
952
|
+
if(self['@keys'][i].__eq(aKey)) {index = i;}
|
953
|
+
};
|
954
|
+
if(typeof index === 'undefined') {
|
955
|
+
return aBlock();
|
956
|
+
} else {
|
957
|
+
return self['@values'][index];
|
958
|
+
}
|
959
|
+
;
|
905
960
|
return self;}
|
906
961
|
}),
|
907
|
-
smalltalk.
|
962
|
+
smalltalk.Dictionary);
|
908
963
|
|
909
964
|
smalltalk.addMethod(
|
910
|
-
|
965
|
+
"_at_put_",
|
911
966
|
smalltalk.method({
|
912
|
-
selector:
|
913
|
-
fn: function ()
|
967
|
+
selector: "at:put:",
|
968
|
+
fn: function (aKey, aValue){
|
914
969
|
var self=this;
|
915
|
-
|
970
|
+
|
971
|
+
var index = self['@keys'].indexOf(aKey);
|
972
|
+
if(index === -1) {
|
973
|
+
self['@values'].push(aValue);
|
974
|
+
self['@keys'].push(aKey);
|
975
|
+
} else {
|
976
|
+
self['@values'][index] = aValue;
|
977
|
+
};
|
978
|
+
|
979
|
+
return aValue;
|
980
|
+
;
|
916
981
|
return self;}
|
917
982
|
}),
|
918
|
-
smalltalk.
|
983
|
+
smalltalk.Dictionary);
|
919
984
|
|
920
985
|
smalltalk.addMethod(
|
921
|
-
|
986
|
+
"_includesKey_",
|
922
987
|
smalltalk.method({
|
923
|
-
selector:
|
924
|
-
fn: function ()
|
988
|
+
selector: "includesKey:",
|
989
|
+
fn: function (aKey){
|
925
990
|
var self=this;
|
926
|
-
return smalltalk.send(self
|
991
|
+
return smalltalk.send(self['@keys'], "_includes_", [aKey]);
|
927
992
|
return self;}
|
928
993
|
}),
|
929
|
-
smalltalk.
|
994
|
+
smalltalk.Dictionary);
|
930
995
|
|
931
996
|
smalltalk.addMethod(
|
932
|
-
|
997
|
+
"_initialize",
|
933
998
|
smalltalk.method({
|
934
|
-
selector:
|
935
|
-
fn: function ()
|
999
|
+
selector: "initialize",
|
1000
|
+
fn: function (){
|
936
1001
|
var self=this;
|
937
|
-
|
1002
|
+
smalltalk.send(self, "_initialize", [], smalltalk.Dictionary.superclass || nil);
|
1003
|
+
(self['@keys']=[]);
|
1004
|
+
(self['@values']=[]);
|
938
1005
|
return self;}
|
939
1006
|
}),
|
940
|
-
smalltalk.
|
1007
|
+
smalltalk.Dictionary);
|
941
1008
|
|
942
1009
|
smalltalk.addMethod(
|
943
|
-
|
1010
|
+
"_keys",
|
944
1011
|
smalltalk.method({
|
945
|
-
selector:
|
946
|
-
fn: function ()
|
1012
|
+
selector: "keys",
|
1013
|
+
fn: function (){
|
947
1014
|
var self=this;
|
948
|
-
return smalltalk.send(self, "
|
1015
|
+
return smalltalk.send(self['@keys'], "_copy", []);
|
949
1016
|
return self;}
|
950
1017
|
}),
|
951
|
-
smalltalk.
|
1018
|
+
smalltalk.Dictionary);
|
952
1019
|
|
953
1020
|
smalltalk.addMethod(
|
954
|
-
|
1021
|
+
"_removeKey_ifAbsent_",
|
955
1022
|
smalltalk.method({
|
956
|
-
selector:
|
957
|
-
fn: function ()
|
1023
|
+
selector: "removeKey:ifAbsent:",
|
1024
|
+
fn: function (aKey, aBlock){
|
958
1025
|
var self=this;
|
959
|
-
|
1026
|
+
|
1027
|
+
var index = self['@keys'].indexOf(aKey);
|
1028
|
+
if(index === -1) {
|
1029
|
+
return aBlock()
|
1030
|
+
} else {
|
1031
|
+
var value;
|
1032
|
+
self['@keys'].splice(index, 1);
|
1033
|
+
value = self['@values'].splice(index, 1);
|
1034
|
+
return value[0];
|
1035
|
+
};
|
1036
|
+
;
|
960
1037
|
return self;}
|
961
1038
|
}),
|
962
|
-
smalltalk.
|
1039
|
+
smalltalk.Dictionary);
|
963
1040
|
|
964
1041
|
smalltalk.addMethod(
|
965
|
-
|
1042
|
+
"_values",
|
966
1043
|
smalltalk.method({
|
967
|
-
selector:
|
968
|
-
fn: function (
|
1044
|
+
selector: "values",
|
1045
|
+
fn: function (){
|
969
1046
|
var self=this;
|
970
|
-
smalltalk.send(self, "
|
1047
|
+
return smalltalk.send(self['@values'], "_copy", []);
|
971
1048
|
return self;}
|
972
1049
|
}),
|
1050
|
+
smalltalk.Dictionary);
|
1051
|
+
|
1052
|
+
|
1053
|
+
|
1054
|
+
smalltalk.addClass('SequenceableCollection', smalltalk.Collection, [], 'Kernel-Collections');
|
1055
|
+
smalltalk.addMethod(
|
1056
|
+
"__eq",
|
1057
|
+
smalltalk.method({
|
1058
|
+
selector: "=",
|
1059
|
+
fn: function (aCollection){
|
1060
|
+
var self=this;
|
1061
|
+
var $early={};
|
1062
|
+
try{((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aCollection, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aCollection, "_size", [])]);})])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw $early=[false]})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw $early=[false]})();})]));
|
1063
|
+
smalltalk.send(self, "_withIndexDo_", [(function(each, i){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_at_", [i]), "__eq", [each])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw $early=[false]})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw $early=[false]})();})]));})]);
|
1064
|
+
return true;
|
1065
|
+
return self;
|
1066
|
+
} catch(e) {if(e===$early)return e[0]; throw e}}
|
1067
|
+
}),
|
973
1068
|
smalltalk.SequenceableCollection);
|
974
1069
|
|
975
1070
|
smalltalk.addMethod(
|
976
|
-
|
1071
|
+
"_addLast_",
|
977
1072
|
smalltalk.method({
|
978
|
-
selector:
|
979
|
-
fn: function (
|
1073
|
+
selector: "addLast:",
|
1074
|
+
fn: function (anObject){
|
980
1075
|
var self=this;
|
981
|
-
|
1076
|
+
smalltalk.send(self, "_add_", [anObject]);
|
982
1077
|
return self;}
|
983
1078
|
}),
|
984
1079
|
smalltalk.SequenceableCollection);
|
985
1080
|
|
986
1081
|
smalltalk.addMethod(
|
987
|
-
|
1082
|
+
"_allButFirst",
|
988
1083
|
smalltalk.method({
|
989
|
-
selector:
|
990
|
-
fn: function ()
|
1084
|
+
selector: "allButFirst",
|
1085
|
+
fn: function (){
|
991
1086
|
var self=this;
|
992
1087
|
return smalltalk.send(self, "_copyFrom_to_", [(2), smalltalk.send(self, "_size", [])]);
|
993
1088
|
return self;}
|
@@ -995,10 +1090,10 @@ return self;}
|
|
995
1090
|
smalltalk.SequenceableCollection);
|
996
1091
|
|
997
1092
|
smalltalk.addMethod(
|
998
|
-
|
1093
|
+
"_allButLast",
|
999
1094
|
smalltalk.method({
|
1000
|
-
selector:
|
1001
|
-
fn: function ()
|
1095
|
+
selector: "allButLast",
|
1096
|
+
fn: function (){
|
1002
1097
|
var self=this;
|
1003
1098
|
return smalltalk.send(self, "_copyFrom_to_", [(1), ((($receiver = smalltalk.send(self, "_size", [])).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]))]);
|
1004
1099
|
return self;}
|
@@ -1006,64 +1101,32 @@ return self;}
|
|
1006
1101
|
smalltalk.SequenceableCollection);
|
1007
1102
|
|
1008
1103
|
smalltalk.addMethod(
|
1009
|
-
|
1104
|
+
"_at_",
|
1010
1105
|
smalltalk.method({
|
1011
|
-
selector:
|
1012
|
-
fn: function (
|
1106
|
+
selector: "at:",
|
1107
|
+
fn: function (anIndex){
|
1013
1108
|
var self=this;
|
1014
|
-
return smalltalk.send(self, "
|
1109
|
+
return smalltalk.send(self, "_at_ifAbsent_", [anIndex, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
|
1015
1110
|
return self;}
|
1016
1111
|
}),
|
1017
1112
|
smalltalk.SequenceableCollection);
|
1018
1113
|
|
1019
1114
|
smalltalk.addMethod(
|
1020
|
-
|
1115
|
+
"_at_ifAbsent_",
|
1021
1116
|
smalltalk.method({
|
1022
|
-
selector:
|
1023
|
-
fn: function (
|
1117
|
+
selector: "at:ifAbsent:",
|
1118
|
+
fn: function (anIndex, aBlock){
|
1024
1119
|
var self=this;
|
1025
|
-
|
1026
|
-
for(var i=0;i<self.length;i++){
|
1027
|
-
if(self[i].__eq(anObject)) {return i+1}
|
1028
|
-
}
|
1029
|
-
return aBlock();
|
1030
|
-
;
|
1120
|
+
smalltalk.send(self, "_subclassResponsibility", []);
|
1031
1121
|
return self;}
|
1032
1122
|
}),
|
1033
1123
|
smalltalk.SequenceableCollection);
|
1034
1124
|
|
1035
1125
|
smalltalk.addMethod(
|
1036
|
-
|
1126
|
+
"_at_put_",
|
1037
1127
|
smalltalk.method({
|
1038
|
-
selector:
|
1039
|
-
fn: function (
|
1040
|
-
var self=this;
|
1041
|
-
|
1042
|
-
for(var i=start-1;i<self.length;i++){
|
1043
|
-
if(self[i].__eq(anObject)) {return i+1}
|
1044
|
-
}
|
1045
|
-
return aBlock();
|
1046
|
-
;
|
1047
|
-
return self;}
|
1048
|
-
}),
|
1049
|
-
smalltalk.SequenceableCollection);
|
1050
|
-
|
1051
|
-
smalltalk.addMethod(
|
1052
|
-
unescape('_indexOf_startingAt_'),
|
1053
|
-
smalltalk.method({
|
1054
|
-
selector: unescape('indexOf%3AstartingAt%3A'),
|
1055
|
-
fn: function (anObject, start) {
|
1056
|
-
var self=this;
|
1057
|
-
return smalltalk.send(self, "_indexOf_startingAt_ifAbsent_", [anObject, start, (function(){return (0);})]);
|
1058
|
-
return self;}
|
1059
|
-
}),
|
1060
|
-
smalltalk.SequenceableCollection);
|
1061
|
-
|
1062
|
-
smalltalk.addMethod(
|
1063
|
-
unescape('_reversed'),
|
1064
|
-
smalltalk.method({
|
1065
|
-
selector: unescape('reversed'),
|
1066
|
-
fn: function () {
|
1128
|
+
selector: "at:put:",
|
1129
|
+
fn: function (anIndex, anObject){
|
1067
1130
|
var self=this;
|
1068
1131
|
smalltalk.send(self, "_subclassResponsibility", []);
|
1069
1132
|
return self;}
|
@@ -1071,10 +1134,10 @@ return self;}
|
|
1071
1134
|
smalltalk.SequenceableCollection);
|
1072
1135
|
|
1073
1136
|
smalltalk.addMethod(
|
1074
|
-
|
1137
|
+
"_atRandom",
|
1075
1138
|
smalltalk.method({
|
1076
|
-
selector:
|
1077
|
-
fn: function ()
|
1139
|
+
selector: "atRandom",
|
1140
|
+
fn: function (){
|
1078
1141
|
var self=this;
|
1079
1142
|
return smalltalk.send(self, "_at_", [smalltalk.send(smalltalk.send(self, "_size", []), "_atRandom", [])]);
|
1080
1143
|
return self;}
|
@@ -1082,38 +1145,26 @@ return self;}
|
|
1082
1145
|
smalltalk.SequenceableCollection);
|
1083
1146
|
|
1084
1147
|
smalltalk.addMethod(
|
1085
|
-
|
1086
|
-
smalltalk.method({
|
1087
|
-
selector: unescape('%3D'),
|
1088
|
-
fn: function (aCollection) {
|
1089
|
-
var self=this;
|
1090
|
-
try{((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aCollection, "_class", [])]), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aCollection, "_size", [])]);})])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
|
1091
|
-
smalltalk.send(self, "_withIndexDo_", [(function(each, i){return ((($receiver = smalltalk.send(smalltalk.send(aCollection, "_at_", [i]), "__eq", [each])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));})]);
|
1092
|
-
(function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return true}})})();
|
1093
|
-
return self;
|
1094
|
-
} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
|
1095
|
-
}),
|
1096
|
-
smalltalk.SequenceableCollection);
|
1097
|
-
|
1098
|
-
smalltalk.addMethod(
|
1099
|
-
unescape('_shallowCopy'),
|
1148
|
+
"_copyFrom_to_",
|
1100
1149
|
smalltalk.method({
|
1101
|
-
selector:
|
1102
|
-
fn: function ()
|
1150
|
+
selector: "copyFrom:to:",
|
1151
|
+
fn: function (anIndex, anotherIndex){
|
1103
1152
|
var self=this;
|
1153
|
+
var range=nil;
|
1104
1154
|
var newCollection=nil;
|
1105
|
-
(
|
1106
|
-
smalltalk.send(self, "
|
1155
|
+
(range=smalltalk.send(anIndex, "_to_", [anotherIndex]));
|
1156
|
+
(newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new_", [smalltalk.send(range, "_size", [])]));
|
1157
|
+
smalltalk.send(range, "_withIndexDo_", [(function(each, i){return smalltalk.send(newCollection, "_at_put_", [i, smalltalk.send(self, "_at_", [each])]);})]);
|
1107
1158
|
return newCollection;
|
1108
1159
|
return self;}
|
1109
1160
|
}),
|
1110
1161
|
smalltalk.SequenceableCollection);
|
1111
1162
|
|
1112
1163
|
smalltalk.addMethod(
|
1113
|
-
|
1164
|
+
"_deepCopy",
|
1114
1165
|
smalltalk.method({
|
1115
|
-
selector:
|
1116
|
-
fn: function ()
|
1166
|
+
selector: "deepCopy",
|
1167
|
+
fn: function (){
|
1117
1168
|
var self=this;
|
1118
1169
|
var newCollection=nil;
|
1119
1170
|
(newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new_", [smalltalk.send(self, "_size", [])]));
|
@@ -1124,25 +1175,20 @@ return self;}
|
|
1124
1175
|
smalltalk.SequenceableCollection);
|
1125
1176
|
|
1126
1177
|
smalltalk.addMethod(
|
1127
|
-
|
1178
|
+
"_first",
|
1128
1179
|
smalltalk.method({
|
1129
|
-
selector:
|
1130
|
-
fn: function ()
|
1180
|
+
selector: "first",
|
1181
|
+
fn: function (){
|
1131
1182
|
var self=this;
|
1132
|
-
|
1133
|
-
(str=smalltalk.send("", "_writeStream", []));
|
1134
|
-
smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.Collection), "__comma", [unescape("%20%28")])]);
|
1135
|
-
smalltalk.send(self, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [" "]);})]);
|
1136
|
-
smalltalk.send(str, "_nextPutAll_", [unescape("%29")]);
|
1137
|
-
return smalltalk.send(str, "_contents", []);
|
1183
|
+
return smalltalk.send(self, "_at_", [(1)]);
|
1138
1184
|
return self;}
|
1139
1185
|
}),
|
1140
1186
|
smalltalk.SequenceableCollection);
|
1141
1187
|
|
1142
1188
|
smalltalk.addMethod(
|
1143
|
-
|
1189
|
+
"_first_",
|
1144
1190
|
smalltalk.method({
|
1145
|
-
selector:
|
1191
|
+
selector: "first:",
|
1146
1192
|
fn: function (n){
|
1147
1193
|
var self=this;
|
1148
1194
|
return smalltalk.send(self, "_copyFrom_to_", [(1), n]);
|
@@ -1150,2171 +1196,1929 @@ return self;}
|
|
1150
1196
|
}),
|
1151
1197
|
smalltalk.SequenceableCollection);
|
1152
1198
|
|
1153
|
-
|
1154
|
-
|
1155
|
-
smalltalk.addClass('CharacterArray', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
|
1156
1199
|
smalltalk.addMethod(
|
1157
|
-
|
1200
|
+
"_fourth",
|
1158
1201
|
smalltalk.method({
|
1159
|
-
selector:
|
1160
|
-
fn: function (
|
1202
|
+
selector: "fourth",
|
1203
|
+
fn: function (){
|
1161
1204
|
var self=this;
|
1162
|
-
smalltalk.send(self, "
|
1205
|
+
return smalltalk.send(self, "_at_", [(4)]);
|
1163
1206
|
return self;}
|
1164
1207
|
}),
|
1165
|
-
smalltalk.
|
1208
|
+
smalltalk.SequenceableCollection);
|
1166
1209
|
|
1167
1210
|
smalltalk.addMethod(
|
1168
|
-
|
1211
|
+
"_indexOf_",
|
1169
1212
|
smalltalk.method({
|
1170
|
-
selector:
|
1171
|
-
fn: function (anObject)
|
1213
|
+
selector: "indexOf:",
|
1214
|
+
fn: function (anObject){
|
1172
1215
|
var self=this;
|
1173
|
-
smalltalk.send(self, "
|
1216
|
+
return smalltalk.send(self, "_indexOf_ifAbsent_", [anObject, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
|
1174
1217
|
return self;}
|
1175
1218
|
}),
|
1176
|
-
smalltalk.
|
1219
|
+
smalltalk.SequenceableCollection);
|
1177
1220
|
|
1178
1221
|
smalltalk.addMethod(
|
1179
|
-
|
1222
|
+
"_indexOf_ifAbsent_",
|
1180
1223
|
smalltalk.method({
|
1181
|
-
selector:
|
1182
|
-
fn: function (
|
1224
|
+
selector: "indexOf:ifAbsent:",
|
1225
|
+
fn: function (anObject, aBlock){
|
1183
1226
|
var self=this;
|
1184
|
-
|
1227
|
+
|
1228
|
+
for(var i=0;i<self.length;i++){
|
1229
|
+
if(self[i].__eq(anObject)) {return i+1}
|
1230
|
+
}
|
1231
|
+
return aBlock();
|
1232
|
+
;
|
1185
1233
|
return self;}
|
1186
1234
|
}),
|
1187
|
-
smalltalk.
|
1235
|
+
smalltalk.SequenceableCollection);
|
1188
1236
|
|
1189
1237
|
smalltalk.addMethod(
|
1190
|
-
|
1238
|
+
"_indexOf_startingAt_",
|
1191
1239
|
smalltalk.method({
|
1192
|
-
selector:
|
1193
|
-
fn: function ()
|
1240
|
+
selector: "indexOf:startingAt:",
|
1241
|
+
fn: function (anObject, start){
|
1194
1242
|
var self=this;
|
1195
|
-
return smalltalk.send(self, "
|
1243
|
+
return smalltalk.send(self, "_indexOf_startingAt_ifAbsent_", [anObject, start, (function(){return (0);})]);
|
1196
1244
|
return self;}
|
1197
1245
|
}),
|
1198
|
-
smalltalk.
|
1246
|
+
smalltalk.SequenceableCollection);
|
1199
1247
|
|
1200
1248
|
smalltalk.addMethod(
|
1201
|
-
|
1249
|
+
"_indexOf_startingAt_ifAbsent_",
|
1202
1250
|
smalltalk.method({
|
1203
|
-
selector:
|
1204
|
-
fn: function ()
|
1251
|
+
selector: "indexOf:startingAt:ifAbsent:",
|
1252
|
+
fn: function (anObject, start, aBlock){
|
1205
1253
|
var self=this;
|
1206
|
-
|
1254
|
+
|
1255
|
+
for(var i=start-1;i<self.length;i++){
|
1256
|
+
if(self[i].__eq(anObject)) {return i+1}
|
1257
|
+
}
|
1258
|
+
return aBlock();
|
1259
|
+
;
|
1207
1260
|
return self;}
|
1208
1261
|
}),
|
1209
|
-
smalltalk.
|
1262
|
+
smalltalk.SequenceableCollection);
|
1210
1263
|
|
1211
1264
|
smalltalk.addMethod(
|
1212
|
-
|
1265
|
+
"_last",
|
1213
1266
|
smalltalk.method({
|
1214
|
-
selector:
|
1215
|
-
fn: function ()
|
1267
|
+
selector: "last",
|
1268
|
+
fn: function (){
|
1216
1269
|
var self=this;
|
1217
|
-
smalltalk.send(self, "
|
1270
|
+
return smalltalk.send(self, "_at_", [smalltalk.send(self, "_size", [])]);
|
1218
1271
|
return self;}
|
1219
1272
|
}),
|
1220
|
-
smalltalk.
|
1273
|
+
smalltalk.SequenceableCollection);
|
1221
1274
|
|
1222
1275
|
smalltalk.addMethod(
|
1223
|
-
|
1276
|
+
"_printString",
|
1224
1277
|
smalltalk.method({
|
1225
|
-
selector:
|
1226
|
-
fn: function ()
|
1278
|
+
selector: "printString",
|
1279
|
+
fn: function (){
|
1227
1280
|
var self=this;
|
1228
|
-
|
1281
|
+
var str=nil;
|
1282
|
+
(str=smalltalk.send("", "_writeStream", []));
|
1283
|
+
smalltalk.send(str, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.SequenceableCollection.superclass || nil), "__comma", [" ("])]);
|
1284
|
+
smalltalk.send(self, "_do_separatedBy_", [(function(each){return smalltalk.send(str, "_nextPutAll_", [smalltalk.send(each, "_printString", [])]);}), (function(){return smalltalk.send(str, "_nextPutAll_", [" "]);})]);
|
1285
|
+
smalltalk.send(str, "_nextPutAll_", [")"]);
|
1286
|
+
return smalltalk.send(str, "_contents", []);
|
1229
1287
|
return self;}
|
1230
1288
|
}),
|
1231
|
-
smalltalk.
|
1289
|
+
smalltalk.SequenceableCollection);
|
1232
1290
|
|
1233
1291
|
smalltalk.addMethod(
|
1234
|
-
|
1292
|
+
"_removeLast",
|
1235
1293
|
smalltalk.method({
|
1236
|
-
selector:
|
1237
|
-
fn: function (
|
1294
|
+
selector: "removeLast",
|
1295
|
+
fn: function (){
|
1238
1296
|
var self=this;
|
1239
|
-
smalltalk.send(self, "
|
1297
|
+
smalltalk.send(self, "_remove_", [smalltalk.send(self, "_last", [])]);
|
1240
1298
|
return self;}
|
1241
1299
|
}),
|
1242
|
-
smalltalk.
|
1300
|
+
smalltalk.SequenceableCollection);
|
1243
1301
|
|
1244
1302
|
smalltalk.addMethod(
|
1245
|
-
|
1303
|
+
"_reversed",
|
1246
1304
|
smalltalk.method({
|
1247
|
-
selector:
|
1248
|
-
fn: function ()
|
1305
|
+
selector: "reversed",
|
1306
|
+
fn: function (){
|
1249
1307
|
var self=this;
|
1250
|
-
|
1308
|
+
smalltalk.send(self, "_subclassResponsibility", []);
|
1251
1309
|
return self;}
|
1252
1310
|
}),
|
1253
|
-
smalltalk.
|
1311
|
+
smalltalk.SequenceableCollection);
|
1254
1312
|
|
1255
1313
|
smalltalk.addMethod(
|
1256
|
-
|
1314
|
+
"_second",
|
1257
1315
|
smalltalk.method({
|
1258
|
-
selector:
|
1259
|
-
fn: function ()
|
1316
|
+
selector: "second",
|
1317
|
+
fn: function (){
|
1260
1318
|
var self=this;
|
1261
|
-
return smalltalk.send(self, "
|
1319
|
+
return smalltalk.send(self, "_at_", [(2)]);
|
1262
1320
|
return self;}
|
1263
1321
|
}),
|
1264
|
-
smalltalk.
|
1322
|
+
smalltalk.SequenceableCollection);
|
1265
1323
|
|
1266
1324
|
smalltalk.addMethod(
|
1267
|
-
|
1325
|
+
"_shallowCopy",
|
1268
1326
|
smalltalk.method({
|
1269
|
-
selector:
|
1270
|
-
fn: function ()
|
1327
|
+
selector: "shallowCopy",
|
1328
|
+
fn: function (){
|
1271
1329
|
var self=this;
|
1272
|
-
|
1330
|
+
var newCollection=nil;
|
1331
|
+
(newCollection=smalltalk.send(smalltalk.send(self, "_class", []), "_new_", [smalltalk.send(self, "_size", [])]));
|
1332
|
+
smalltalk.send(self, "_withIndexDo_", [(function(each, index){return smalltalk.send(newCollection, "_at_put_", [index, each]);})]);
|
1333
|
+
return newCollection;
|
1273
1334
|
return self;}
|
1274
1335
|
}),
|
1275
|
-
smalltalk.
|
1336
|
+
smalltalk.SequenceableCollection);
|
1276
1337
|
|
1338
|
+
smalltalk.addMethod(
|
1339
|
+
"_third",
|
1340
|
+
smalltalk.method({
|
1341
|
+
selector: "third",
|
1342
|
+
fn: function (){
|
1343
|
+
var self=this;
|
1344
|
+
return smalltalk.send(self, "_at_", [(3)]);
|
1345
|
+
return self;}
|
1346
|
+
}),
|
1347
|
+
smalltalk.SequenceableCollection);
|
1277
1348
|
|
1278
1349
|
smalltalk.addMethod(
|
1279
|
-
|
1350
|
+
"_withIndexDo_",
|
1280
1351
|
smalltalk.method({
|
1281
|
-
selector:
|
1282
|
-
fn: function (
|
1352
|
+
selector: "withIndexDo:",
|
1353
|
+
fn: function (aBlock){
|
1283
1354
|
var self=this;
|
1284
|
-
|
1355
|
+
for(var i=0;i<self.length;i++){aBlock(self[i], i+1);};
|
1285
1356
|
return self;}
|
1286
1357
|
}),
|
1287
|
-
smalltalk.
|
1358
|
+
smalltalk.SequenceableCollection);
|
1288
1359
|
|
1289
1360
|
|
1290
|
-
|
1361
|
+
|
1362
|
+
smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
|
1291
1363
|
smalltalk.addMethod(
|
1292
|
-
|
1364
|
+
"_add_",
|
1293
1365
|
smalltalk.method({
|
1294
|
-
selector:
|
1295
|
-
fn: function (
|
1366
|
+
selector: "add:",
|
1367
|
+
fn: function (anObject){
|
1296
1368
|
var self=this;
|
1297
|
-
|
1298
|
-
return
|
1299
|
-
return self;
|
1300
|
-
} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
|
1369
|
+
self.push(anObject); return anObject;;
|
1370
|
+
return self;}
|
1301
1371
|
}),
|
1302
|
-
smalltalk.
|
1372
|
+
smalltalk.Array);
|
1303
1373
|
|
1304
1374
|
smalltalk.addMethod(
|
1305
|
-
|
1375
|
+
"_asJavascript",
|
1306
1376
|
smalltalk.method({
|
1307
|
-
selector:
|
1308
|
-
fn: function ()
|
1377
|
+
selector: "asJavascript",
|
1378
|
+
fn: function (){
|
1309
1379
|
var self=this;
|
1310
|
-
return self.
|
1380
|
+
return smalltalk.send(smalltalk.send("[", "__comma", [smalltalk.send(smalltalk.send(self, "_collect_", [(function(each){return smalltalk.send(each, "_asJavascript", []);})]), "_join_", [", "])]), "__comma", ["]"]);
|
1311
1381
|
return self;}
|
1312
1382
|
}),
|
1313
|
-
smalltalk.
|
1383
|
+
smalltalk.Array);
|
1314
1384
|
|
1315
1385
|
smalltalk.addMethod(
|
1316
|
-
|
1386
|
+
"_at_ifAbsent_",
|
1317
1387
|
smalltalk.method({
|
1318
|
-
selector:
|
1319
|
-
fn: function (anIndex, aBlock)
|
1388
|
+
selector: "at:ifAbsent:",
|
1389
|
+
fn: function (anIndex, aBlock){
|
1320
1390
|
var self=this;
|
1321
|
-
|
1391
|
+
|
1392
|
+
if((anIndex < 1) || (self.length < anIndex)) {return aBlock()};
|
1393
|
+
return self[anIndex - 1];
|
1394
|
+
;
|
1322
1395
|
return self;}
|
1323
1396
|
}),
|
1324
|
-
smalltalk.
|
1397
|
+
smalltalk.Array);
|
1325
1398
|
|
1326
1399
|
smalltalk.addMethod(
|
1327
|
-
|
1400
|
+
"_at_put_",
|
1328
1401
|
smalltalk.method({
|
1329
|
-
selector:
|
1330
|
-
fn: function ()
|
1402
|
+
selector: "at:put:",
|
1403
|
+
fn: function (anIndex, anObject){
|
1331
1404
|
var self=this;
|
1332
|
-
return
|
1405
|
+
return self[anIndex - 1] = anObject;
|
1333
1406
|
return self;}
|
1334
1407
|
}),
|
1335
|
-
smalltalk.
|
1408
|
+
smalltalk.Array);
|
1336
1409
|
|
1337
1410
|
smalltalk.addMethod(
|
1338
|
-
|
1411
|
+
"_join_",
|
1339
1412
|
smalltalk.method({
|
1340
|
-
selector:
|
1341
|
-
fn: function ()
|
1413
|
+
selector: "join:",
|
1414
|
+
fn: function (aString){
|
1342
1415
|
var self=this;
|
1343
|
-
return
|
1416
|
+
return self.join(aString);
|
1344
1417
|
return self;}
|
1345
1418
|
}),
|
1346
|
-
smalltalk.
|
1419
|
+
smalltalk.Array);
|
1347
1420
|
|
1348
1421
|
smalltalk.addMethod(
|
1349
|
-
|
1422
|
+
"_remove_",
|
1350
1423
|
smalltalk.method({
|
1351
|
-
selector:
|
1352
|
-
fn: function (
|
1424
|
+
selector: "remove:",
|
1425
|
+
fn: function (anObject){
|
1353
1426
|
var self=this;
|
1354
|
-
|
1427
|
+
|
1428
|
+
for(var i=0;i<self.length;i++) {
|
1429
|
+
if(self[i] == anObject) {
|
1430
|
+
self.splice(i,1);
|
1431
|
+
break;
|
1432
|
+
}
|
1433
|
+
}
|
1434
|
+
;
|
1355
1435
|
return self;}
|
1356
1436
|
}),
|
1357
|
-
smalltalk.
|
1437
|
+
smalltalk.Array);
|
1358
1438
|
|
1359
1439
|
smalltalk.addMethod(
|
1360
|
-
|
1440
|
+
"_removeFrom_to_",
|
1361
1441
|
smalltalk.method({
|
1362
|
-
selector:
|
1363
|
-
fn: function (
|
1442
|
+
selector: "removeFrom:to:",
|
1443
|
+
fn: function (aNumber, anotherNumber){
|
1364
1444
|
var self=this;
|
1365
|
-
|
1445
|
+
self.splice(aNumber - 1,anotherNumber - 1);
|
1366
1446
|
return self;}
|
1367
1447
|
}),
|
1368
|
-
smalltalk.
|
1448
|
+
smalltalk.Array);
|
1369
1449
|
|
1370
1450
|
smalltalk.addMethod(
|
1371
|
-
|
1451
|
+
"_reversed",
|
1372
1452
|
smalltalk.method({
|
1373
|
-
selector:
|
1374
|
-
fn: function ()
|
1453
|
+
selector: "reversed",
|
1454
|
+
fn: function (){
|
1375
1455
|
var self=this;
|
1376
|
-
return
|
1456
|
+
return self._copy().reverse();
|
1377
1457
|
return self;}
|
1378
1458
|
}),
|
1379
|
-
smalltalk.
|
1459
|
+
smalltalk.Array);
|
1380
1460
|
|
1381
1461
|
smalltalk.addMethod(
|
1382
|
-
|
1462
|
+
"_size",
|
1383
1463
|
smalltalk.method({
|
1384
|
-
selector:
|
1385
|
-
fn: function ()
|
1464
|
+
selector: "size",
|
1465
|
+
fn: function (){
|
1386
1466
|
var self=this;
|
1387
|
-
return
|
1467
|
+
return self.length;
|
1388
1468
|
return self;}
|
1389
1469
|
}),
|
1390
|
-
smalltalk.
|
1470
|
+
smalltalk.Array);
|
1391
1471
|
|
1392
1472
|
smalltalk.addMethod(
|
1393
|
-
|
1473
|
+
"_sort",
|
1394
1474
|
smalltalk.method({
|
1395
|
-
selector:
|
1396
|
-
fn: function ()
|
1475
|
+
selector: "sort",
|
1476
|
+
fn: function (){
|
1397
1477
|
var self=this;
|
1398
|
-
|
1399
|
-
(selector=smalltalk.send("_", "__comma", [self]));
|
1400
|
-
(selector=smalltalk.send(selector, "_replace_with_", [":", "_"]));
|
1401
|
-
(selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B+%5D"), "_plus"]));
|
1402
|
-
(selector=smalltalk.send(selector, "_replace_with_", [unescape("-"), "_minus"]));
|
1403
|
-
(selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B*%5D"), "_star"]));
|
1404
|
-
(selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B/%5D"), "_slash"]));
|
1405
|
-
(selector=smalltalk.send(selector, "_replace_with_", [unescape("%3E"), "_gt"]));
|
1406
|
-
(selector=smalltalk.send(selector, "_replace_with_", [unescape("%3C"), "_lt"]));
|
1407
|
-
(selector=smalltalk.send(selector, "_replace_with_", [unescape("%3D"), "_eq"]));
|
1408
|
-
(selector=smalltalk.send(selector, "_replace_with_", [unescape("%2C"), "_comma"]));
|
1409
|
-
(selector=smalltalk.send(selector, "_replace_with_", [unescape("%5B@%5D"), "_at"]));
|
1410
|
-
return selector;
|
1478
|
+
return smalltalk.send(self, "_basicPerform_", ["sort"]);
|
1411
1479
|
return self;}
|
1412
1480
|
}),
|
1413
|
-
smalltalk.
|
1481
|
+
smalltalk.Array);
|
1414
1482
|
|
1415
1483
|
smalltalk.addMethod(
|
1416
|
-
|
1484
|
+
"_sort_",
|
1417
1485
|
smalltalk.method({
|
1418
|
-
selector:
|
1419
|
-
fn: function ()
|
1486
|
+
selector: "sort:",
|
1487
|
+
fn: function (aBlock){
|
1420
1488
|
var self=this;
|
1421
1489
|
|
1422
|
-
|
1423
|
-
return
|
1424
|
-
|
1425
|
-
return "\"" + self + "\"";
|
1490
|
+
return self.sort(function(a, b) {
|
1491
|
+
if(aBlock(a,b)) {return -1} else {return 1}
|
1492
|
+
})
|
1426
1493
|
;
|
1427
1494
|
return self;}
|
1428
1495
|
}),
|
1429
|
-
smalltalk.
|
1496
|
+
smalltalk.Array);
|
1430
1497
|
|
1431
1498
|
smalltalk.addMethod(
|
1432
|
-
|
1499
|
+
"_sorted",
|
1433
1500
|
smalltalk.method({
|
1434
|
-
selector:
|
1435
|
-
fn: function (
|
1501
|
+
selector: "sorted",
|
1502
|
+
fn: function (){
|
1436
1503
|
var self=this;
|
1437
|
-
return smalltalk.send(
|
1504
|
+
return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort", []);
|
1438
1505
|
return self;}
|
1439
1506
|
}),
|
1440
|
-
smalltalk.
|
1507
|
+
smalltalk.Array);
|
1441
1508
|
|
1442
1509
|
smalltalk.addMethod(
|
1443
|
-
|
1510
|
+
"_sorted_",
|
1444
1511
|
smalltalk.method({
|
1445
|
-
selector:
|
1446
|
-
fn: function (
|
1512
|
+
selector: "sorted:",
|
1513
|
+
fn: function (aBlock){
|
1447
1514
|
var self=this;
|
1448
|
-
return
|
1515
|
+
return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
|
1449
1516
|
return self;}
|
1450
1517
|
}),
|
1451
|
-
smalltalk.
|
1518
|
+
smalltalk.Array);
|
1519
|
+
|
1452
1520
|
|
1453
1521
|
smalltalk.addMethod(
|
1454
|
-
|
1522
|
+
"_new_",
|
1455
1523
|
smalltalk.method({
|
1456
|
-
selector:
|
1457
|
-
fn: function (
|
1524
|
+
selector: "new:",
|
1525
|
+
fn: function (anInteger){
|
1458
1526
|
var self=this;
|
1459
|
-
return
|
1527
|
+
return new Array(anInteger);
|
1460
1528
|
return self;}
|
1461
1529
|
}),
|
1462
|
-
smalltalk.
|
1530
|
+
smalltalk.Array.klass);
|
1463
1531
|
|
1464
1532
|
smalltalk.addMethod(
|
1465
|
-
|
1533
|
+
"_with_",
|
1466
1534
|
smalltalk.method({
|
1467
|
-
selector:
|
1468
|
-
fn: function (
|
1535
|
+
selector: "with:",
|
1536
|
+
fn: function (anObject){
|
1469
1537
|
var self=this;
|
1470
|
-
return
|
1538
|
+
return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(1)]));
|
1471
1539
|
return self;}
|
1472
1540
|
}),
|
1473
|
-
smalltalk.
|
1541
|
+
smalltalk.Array.klass);
|
1474
1542
|
|
1475
1543
|
smalltalk.addMethod(
|
1476
|
-
|
1544
|
+
"_with_with_",
|
1477
1545
|
smalltalk.method({
|
1478
|
-
selector:
|
1479
|
-
fn: function ()
|
1546
|
+
selector: "with:with:",
|
1547
|
+
fn: function (anObject, anObject2){
|
1480
1548
|
var self=this;
|
1481
|
-
return self;
|
1549
|
+
return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);smalltalk.send($rec, "_at_put_", [(2), anObject2]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(2)]));
|
1482
1550
|
return self;}
|
1483
1551
|
}),
|
1484
|
-
smalltalk.
|
1552
|
+
smalltalk.Array.klass);
|
1485
1553
|
|
1486
1554
|
smalltalk.addMethod(
|
1487
|
-
|
1555
|
+
"_with_with_with_",
|
1488
1556
|
smalltalk.method({
|
1489
|
-
selector:
|
1490
|
-
fn: function ()
|
1557
|
+
selector: "with:with:with:",
|
1558
|
+
fn: function (anObject, anObject2, anObject3){
|
1491
1559
|
var self=this;
|
1492
|
-
return
|
1560
|
+
return (function($rec){smalltalk.send($rec, "_at_put_", [(1), anObject]);smalltalk.send($rec, "_at_put_", [(2), anObject2]);smalltalk.send($rec, "_at_put_", [(3), anObject3]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new_", [(3)]));
|
1493
1561
|
return self;}
|
1494
1562
|
}),
|
1495
|
-
smalltalk.
|
1563
|
+
smalltalk.Array.klass);
|
1496
1564
|
|
1497
1565
|
smalltalk.addMethod(
|
1498
|
-
|
1566
|
+
"_withAll_",
|
1499
1567
|
smalltalk.method({
|
1500
|
-
selector:
|
1501
|
-
fn: function ()
|
1568
|
+
selector: "withAll:",
|
1569
|
+
fn: function (aCollection){
|
1502
1570
|
var self=this;
|
1503
|
-
|
1571
|
+
var instance=nil;
|
1572
|
+
(instance=smalltalk.send(self, "_new_", [smalltalk.send(aCollection, "_size", [])]));
|
1573
|
+
smalltalk.send(aCollection, "_withIndexDo_", [(function(each, index){return smalltalk.send(instance, "_at_put_", [index, each]);})]);
|
1574
|
+
return instance;
|
1504
1575
|
return self;}
|
1505
1576
|
}),
|
1506
|
-
smalltalk.
|
1577
|
+
smalltalk.Array.klass);
|
1578
|
+
|
1507
1579
|
|
1580
|
+
smalltalk.addClass('CharacterArray', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
|
1508
1581
|
smalltalk.addMethod(
|
1509
|
-
|
1582
|
+
"__comma",
|
1510
1583
|
smalltalk.method({
|
1511
|
-
selector:
|
1512
|
-
fn: function ()
|
1584
|
+
selector: ",",
|
1585
|
+
fn: function (aString){
|
1513
1586
|
var self=this;
|
1514
|
-
|
1587
|
+
return smalltalk.send(smalltalk.send(self, "_asString", []), "__comma", [smalltalk.send(aString, "_asString", [])]);
|
1515
1588
|
return self;}
|
1516
1589
|
}),
|
1517
|
-
smalltalk.
|
1590
|
+
smalltalk.CharacterArray);
|
1518
1591
|
|
1519
1592
|
smalltalk.addMethod(
|
1520
|
-
|
1593
|
+
"_add_",
|
1521
1594
|
smalltalk.method({
|
1522
|
-
selector:
|
1523
|
-
fn: function ()
|
1595
|
+
selector: "add:",
|
1596
|
+
fn: function (anObject){
|
1524
1597
|
var self=this;
|
1525
|
-
|
1598
|
+
smalltalk.send(self, "_errorReadOnly", []);
|
1526
1599
|
return self;}
|
1527
1600
|
}),
|
1528
|
-
smalltalk.
|
1601
|
+
smalltalk.CharacterArray);
|
1529
1602
|
|
1530
1603
|
smalltalk.addMethod(
|
1531
|
-
|
1604
|
+
"_asLowercase",
|
1532
1605
|
smalltalk.method({
|
1533
|
-
selector:
|
1534
|
-
fn: function (
|
1606
|
+
selector: "asLowercase",
|
1607
|
+
fn: function (){
|
1535
1608
|
var self=this;
|
1536
|
-
return
|
1609
|
+
return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [smalltalk.send(smalltalk.send(self, "_asString", []), "_asLowercase", [])]);
|
1537
1610
|
return self;}
|
1538
1611
|
}),
|
1539
|
-
smalltalk.
|
1612
|
+
smalltalk.CharacterArray);
|
1540
1613
|
|
1541
1614
|
smalltalk.addMethod(
|
1542
|
-
|
1615
|
+
"_asNumber",
|
1543
1616
|
smalltalk.method({
|
1544
|
-
selector:
|
1545
|
-
fn: function (
|
1617
|
+
selector: "asNumber",
|
1618
|
+
fn: function (){
|
1546
1619
|
var self=this;
|
1547
|
-
return
|
1620
|
+
return smalltalk.send(smalltalk.send(self, "_asString", []), "_asNumber", []);
|
1548
1621
|
return self;}
|
1549
1622
|
}),
|
1550
|
-
smalltalk.
|
1623
|
+
smalltalk.CharacterArray);
|
1551
1624
|
|
1552
1625
|
smalltalk.addMethod(
|
1553
|
-
|
1626
|
+
"_asString",
|
1554
1627
|
smalltalk.method({
|
1555
|
-
selector:
|
1556
|
-
fn: function (
|
1628
|
+
selector: "asString",
|
1629
|
+
fn: function (){
|
1557
1630
|
var self=this;
|
1558
|
-
return
|
1631
|
+
return smalltalk.send(self, "_subclassResponsibility", []);
|
1559
1632
|
return self;}
|
1560
1633
|
}),
|
1561
|
-
smalltalk.
|
1634
|
+
smalltalk.CharacterArray);
|
1562
1635
|
|
1563
1636
|
smalltalk.addMethod(
|
1564
|
-
|
1637
|
+
"_asSymbol",
|
1565
1638
|
smalltalk.method({
|
1566
|
-
selector:
|
1567
|
-
fn: function (
|
1639
|
+
selector: "asSymbol",
|
1640
|
+
fn: function (){
|
1568
1641
|
var self=this;
|
1569
|
-
return
|
1642
|
+
return smalltalk.send(self, "_subclassResponsibility", []);
|
1570
1643
|
return self;}
|
1571
1644
|
}),
|
1572
|
-
smalltalk.
|
1645
|
+
smalltalk.CharacterArray);
|
1573
1646
|
|
1574
1647
|
smalltalk.addMethod(
|
1575
|
-
|
1648
|
+
"_asUppercase",
|
1576
1649
|
smalltalk.method({
|
1577
|
-
selector:
|
1578
|
-
fn: function (
|
1650
|
+
selector: "asUppercase",
|
1651
|
+
fn: function (){
|
1579
1652
|
var self=this;
|
1580
|
-
return smalltalk.send(self, "
|
1653
|
+
return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [smalltalk.send(smalltalk.send(self, "_asString", []), "_asUppercase", [])]);
|
1581
1654
|
return self;}
|
1582
1655
|
}),
|
1583
|
-
smalltalk.
|
1656
|
+
smalltalk.CharacterArray);
|
1584
1657
|
|
1585
1658
|
smalltalk.addMethod(
|
1586
|
-
|
1659
|
+
"_at_put_",
|
1587
1660
|
smalltalk.method({
|
1588
|
-
selector:
|
1589
|
-
fn: function (
|
1661
|
+
selector: "at:put:",
|
1662
|
+
fn: function (anIndex, anObject){
|
1590
1663
|
var self=this;
|
1591
|
-
|
1664
|
+
smalltalk.send(self, "_errorReadOnly", []);
|
1592
1665
|
return self;}
|
1593
1666
|
}),
|
1594
|
-
smalltalk.
|
1667
|
+
smalltalk.CharacterArray);
|
1595
1668
|
|
1596
1669
|
smalltalk.addMethod(
|
1597
|
-
|
1670
|
+
"_errorReadOnly",
|
1598
1671
|
smalltalk.method({
|
1599
|
-
selector:
|
1600
|
-
fn: function ()
|
1672
|
+
selector: "errorReadOnly",
|
1673
|
+
fn: function (){
|
1601
1674
|
var self=this;
|
1602
|
-
|
1675
|
+
smalltalk.send(self, "_error_", ["Object is read-only"]);
|
1603
1676
|
return self;}
|
1604
1677
|
}),
|
1605
|
-
smalltalk.
|
1678
|
+
smalltalk.CharacterArray);
|
1606
1679
|
|
1607
1680
|
smalltalk.addMethod(
|
1608
|
-
|
1681
|
+
"_printString",
|
1609
1682
|
smalltalk.method({
|
1610
|
-
selector:
|
1611
|
-
fn: function ()
|
1683
|
+
selector: "printString",
|
1684
|
+
fn: function (){
|
1612
1685
|
var self=this;
|
1613
|
-
return smalltalk.send(self, "
|
1686
|
+
return smalltalk.send(smalltalk.send(self, "_asString", []), "_printString", []);
|
1614
1687
|
return self;}
|
1615
1688
|
}),
|
1616
|
-
smalltalk.
|
1689
|
+
smalltalk.CharacterArray);
|
1617
1690
|
|
1618
1691
|
smalltalk.addMethod(
|
1619
|
-
|
1692
|
+
"_remove_",
|
1620
1693
|
smalltalk.method({
|
1621
|
-
selector:
|
1622
|
-
fn: function ()
|
1694
|
+
selector: "remove:",
|
1695
|
+
fn: function (anObject){
|
1623
1696
|
var self=this;
|
1624
|
-
|
1697
|
+
smalltalk.send(self, "_errorReadOnly", []);
|
1625
1698
|
return self;}
|
1626
1699
|
}),
|
1627
|
-
smalltalk.
|
1700
|
+
smalltalk.CharacterArray);
|
1701
|
+
|
1628
1702
|
|
1629
1703
|
smalltalk.addMethod(
|
1630
|
-
|
1704
|
+
"_fromString_",
|
1631
1705
|
smalltalk.method({
|
1632
|
-
selector:
|
1633
|
-
fn: function (
|
1706
|
+
selector: "fromString:",
|
1707
|
+
fn: function (aString){
|
1634
1708
|
var self=this;
|
1635
|
-
|
1709
|
+
smalltalk.send(self, "_subclassResponsibility", []);
|
1636
1710
|
return self;}
|
1637
1711
|
}),
|
1638
|
-
smalltalk.
|
1712
|
+
smalltalk.CharacterArray.klass);
|
1713
|
+
|
1639
1714
|
|
1715
|
+
smalltalk.addClass('String', smalltalk.CharacterArray, [], 'Kernel-Collections');
|
1640
1716
|
smalltalk.addMethod(
|
1641
|
-
|
1717
|
+
"__comma",
|
1642
1718
|
smalltalk.method({
|
1643
|
-
selector:
|
1644
|
-
fn: function ()
|
1719
|
+
selector: ",",
|
1720
|
+
fn: function (aString){
|
1645
1721
|
var self=this;
|
1646
|
-
return self
|
1722
|
+
return self + aString;
|
1647
1723
|
return self;}
|
1648
1724
|
}),
|
1649
1725
|
smalltalk.String);
|
1650
1726
|
|
1651
1727
|
smalltalk.addMethod(
|
1652
|
-
|
1728
|
+
"__lt",
|
1653
1729
|
smalltalk.method({
|
1654
|
-
selector:
|
1655
|
-
fn: function ()
|
1730
|
+
selector: "<",
|
1731
|
+
fn: function (aString){
|
1656
1732
|
var self=this;
|
1657
|
-
return self.
|
1733
|
+
return String(self) < aString._asString();
|
1658
1734
|
return self;}
|
1659
1735
|
}),
|
1660
1736
|
smalltalk.String);
|
1661
1737
|
|
1662
1738
|
smalltalk.addMethod(
|
1663
|
-
|
1739
|
+
"__lt_eq",
|
1664
1740
|
smalltalk.method({
|
1665
|
-
selector:
|
1666
|
-
fn: function (
|
1741
|
+
selector: "<=",
|
1742
|
+
fn: function (aString){
|
1667
1743
|
var self=this;
|
1668
|
-
return
|
1744
|
+
return String(self) <= aString._asString();
|
1669
1745
|
return self;}
|
1670
1746
|
}),
|
1671
1747
|
smalltalk.String);
|
1672
1748
|
|
1673
1749
|
smalltalk.addMethod(
|
1674
|
-
|
1750
|
+
"__eq",
|
1675
1751
|
smalltalk.method({
|
1676
|
-
selector:
|
1677
|
-
fn: function (
|
1752
|
+
selector: "=",
|
1753
|
+
fn: function (aString){
|
1678
1754
|
var self=this;
|
1679
|
-
|
1680
|
-
return
|
1755
|
+
var $early={};
|
1756
|
+
try{((($receiver = smalltalk.send(smalltalk.send(aString, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw $early=[false]})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw $early=[false]})();})]));
|
1757
|
+
return String(self) === String(aString);
|
1758
|
+
return self;
|
1759
|
+
} catch(e) {if(e===$early)return e[0]; throw e}}
|
1681
1760
|
}),
|
1682
1761
|
smalltalk.String);
|
1683
1762
|
|
1684
1763
|
smalltalk.addMethod(
|
1685
|
-
|
1764
|
+
"__eq_eq",
|
1686
1765
|
smalltalk.method({
|
1687
|
-
selector:
|
1688
|
-
fn: function ()
|
1766
|
+
selector: "==",
|
1767
|
+
fn: function (aString){
|
1689
1768
|
var self=this;
|
1690
|
-
return
|
1769
|
+
return smalltalk.send(self, "__eq", [aString]);
|
1691
1770
|
return self;}
|
1692
1771
|
}),
|
1693
1772
|
smalltalk.String);
|
1694
1773
|
|
1695
1774
|
smalltalk.addMethod(
|
1696
|
-
|
1775
|
+
"__gt",
|
1697
1776
|
smalltalk.method({
|
1698
|
-
selector:
|
1699
|
-
fn: function (
|
1777
|
+
selector: ">",
|
1778
|
+
fn: function (aString){
|
1700
1779
|
var self=this;
|
1701
|
-
|
1702
|
-
|
1703
|
-
var start=nil;
|
1704
|
-
var sz=nil;
|
1705
|
-
var nextLF=nil;
|
1706
|
-
var nextCR=nil;
|
1707
|
-
(start=(1));
|
1708
|
-
(sz=smalltalk.send(self, "_size", []));
|
1709
|
-
(cr=smalltalk.send((smalltalk.String || String), "_cr", []));
|
1710
|
-
(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, (1)]));
|
1711
|
-
(lf=smalltalk.send((smalltalk.String || String), "_lf", []));
|
1712
|
-
(nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, (1)]));
|
1713
|
-
(function(){while((function(){return ((($receiver = start).klass === smalltalk.Number) ? $receiver <=sz : smalltalk.send($receiver, "__lt_eq", [sz]));})()) {(function(){((($receiver = smalltalk.send(smalltalk.send(nextLF, "__eq", [(0)]), "_and_", [(function(){return smalltalk.send(nextCR, "__eq", [(0)]);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, sz, sz]);return (function(){throw({name: 'stReturn', selector: '_lineIndicesDo_', fn: function(){return self}})})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, sz, sz]);return (function(){throw({name: 'stReturn', selector: '_lineIndicesDo_', fn: function(){return self}})})();})]));return ((($receiver = smalltalk.send(smalltalk.send(nextCR, "__eq", [(0)]), "_or_", [(function(){return smalltalk.send((0) < nextLF, "_and_", [(function(){return ((($receiver = nextLF).klass === smalltalk.Number) ? $receiver <nextCR : smalltalk.send($receiver, "__lt", [nextCR]));})]);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextLF).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));})() : (function(){return ((($receiver = smalltalk.send((1) + nextCR, "__eq", [nextLF])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));})() : (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);(start=(1) + nextCR);return (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));}), (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);(start=(1) + nextCR);return (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextLF).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));}), (function(){return ((($receiver = smalltalk.send((1) + nextCR, "__eq", [nextLF])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));})() : (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);(start=(1) + nextCR);return (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));}), (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);(start=(1) + nextCR);return (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));})]));})]));})()}})();
|
1714
|
-
return self;
|
1715
|
-
} catch(e) {if(e.name === 'stReturn' && e.selector === '_lineIndicesDo_'){return e.fn()} throw(e)}}
|
1780
|
+
return String(self) > aString._asString();
|
1781
|
+
return self;}
|
1716
1782
|
}),
|
1717
1783
|
smalltalk.String);
|
1718
1784
|
|
1719
1785
|
smalltalk.addMethod(
|
1720
|
-
|
1786
|
+
"__gt_eq",
|
1721
1787
|
smalltalk.method({
|
1722
|
-
selector:
|
1723
|
-
fn: function (
|
1788
|
+
selector: ">=",
|
1789
|
+
fn: function (aString){
|
1724
1790
|
var self=this;
|
1725
|
-
|
1791
|
+
return String(self) >= aString._asString();
|
1726
1792
|
return self;}
|
1727
1793
|
}),
|
1728
1794
|
smalltalk.String);
|
1729
1795
|
|
1730
1796
|
smalltalk.addMethod(
|
1731
|
-
|
1797
|
+
"_asJSON",
|
1732
1798
|
smalltalk.method({
|
1733
|
-
selector:
|
1734
|
-
fn: function ()
|
1799
|
+
selector: "asJSON",
|
1800
|
+
fn: function (){
|
1735
1801
|
var self=this;
|
1736
|
-
|
1737
|
-
(lines=smalltalk.send((smalltalk.Array || Array), "_new", []));
|
1738
|
-
smalltalk.send(self, "_linesDo_", [(function(aLine){return smalltalk.send(lines, "_add_", [aLine]);})]);
|
1739
|
-
return lines;
|
1802
|
+
return self;
|
1740
1803
|
return self;}
|
1741
1804
|
}),
|
1742
1805
|
smalltalk.String);
|
1743
1806
|
|
1744
1807
|
smalltalk.addMethod(
|
1745
|
-
|
1808
|
+
"_asJavaScriptSelector",
|
1746
1809
|
smalltalk.method({
|
1747
|
-
selector:
|
1748
|
-
fn: function (
|
1810
|
+
selector: "asJavaScriptSelector",
|
1811
|
+
fn: function (){
|
1749
1812
|
var self=this;
|
1750
|
-
|
1751
|
-
|
1752
|
-
smalltalk.send(self, "_lineIndicesDo_", [(function(start, endWithoutDelimiters, end){return ((($receiver = smalltalk.send((lineCount=((($receiver = lineCount).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))), "__eq", [anIndex])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])}})})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])}})})();})]));})]);
|
1753
|
-
(function(){throw({name: 'stReturn', selector: '_lineNumber_', fn: function(){return nil}})})();
|
1754
|
-
return self;
|
1755
|
-
} catch(e) {if(e.name === 'stReturn' && e.selector === '_lineNumber_'){return e.fn()} throw(e)}}
|
1813
|
+
return smalltalk.send(smalltalk.send(smalltalk.send(self, "_asSelector", []), "_replace_with_", ["^_", ""]), "_replace_with_", ["_.*", ""]);
|
1814
|
+
return self;}
|
1756
1815
|
}),
|
1757
1816
|
smalltalk.String);
|
1758
1817
|
|
1759
1818
|
smalltalk.addMethod(
|
1760
|
-
|
1819
|
+
"_asJavascript",
|
1761
1820
|
smalltalk.method({
|
1762
|
-
selector:
|
1763
|
-
fn: function ()
|
1821
|
+
selector: "asJavascript",
|
1822
|
+
fn: function (){
|
1764
1823
|
var self=this;
|
1765
|
-
|
1824
|
+
|
1825
|
+
if(self.search(/^[a-zA-Z0-9_:.$ ]*$/) == -1)
|
1826
|
+
return "\"" + self.replace(/[\x00-\x1f"\\\x7f-\x9f]/g, function(ch){var c=ch.charCodeAt(0);return "\\x"+("0"+c.toString(16)).slice(-2)}) + "\"";
|
1827
|
+
else
|
1828
|
+
return "\"" + self + "\"";
|
1829
|
+
;
|
1766
1830
|
return self;}
|
1767
1831
|
}),
|
1768
1832
|
smalltalk.String);
|
1769
1833
|
|
1770
1834
|
smalltalk.addMethod(
|
1771
|
-
|
1835
|
+
"_asLowercase",
|
1772
1836
|
smalltalk.method({
|
1773
|
-
selector:
|
1774
|
-
fn: function ()
|
1837
|
+
selector: "asLowercase",
|
1838
|
+
fn: function (){
|
1775
1839
|
var self=this;
|
1776
|
-
return
|
1840
|
+
return self.toLowerCase();
|
1777
1841
|
return self;}
|
1778
1842
|
}),
|
1779
1843
|
smalltalk.String);
|
1780
1844
|
|
1781
1845
|
smalltalk.addMethod(
|
1782
|
-
|
1846
|
+
"_asNumber",
|
1783
1847
|
smalltalk.method({
|
1784
|
-
selector:
|
1785
|
-
fn: function ()
|
1848
|
+
selector: "asNumber",
|
1849
|
+
fn: function (){
|
1786
1850
|
var self=this;
|
1787
|
-
return
|
1851
|
+
return Number(self);
|
1788
1852
|
return self;}
|
1789
1853
|
}),
|
1790
1854
|
smalltalk.String);
|
1791
1855
|
|
1792
1856
|
smalltalk.addMethod(
|
1793
|
-
|
1857
|
+
"_asSelector",
|
1794
1858
|
smalltalk.method({
|
1795
|
-
selector:
|
1859
|
+
selector: "asSelector",
|
1796
1860
|
fn: function (){
|
1797
1861
|
var self=this;
|
1798
|
-
|
1862
|
+
var selector=nil;
|
1863
|
+
(selector=smalltalk.send("_", "__comma", [self]));
|
1864
|
+
(selector=smalltalk.send(selector, "_replace_with_", [":", "_"]));
|
1865
|
+
(selector=smalltalk.send(selector, "_replace_with_", ["[+]", "_plus"]));
|
1866
|
+
(selector=smalltalk.send(selector, "_replace_with_", ["-", "_minus"]));
|
1867
|
+
(selector=smalltalk.send(selector, "_replace_with_", ["[*]", "_star"]));
|
1868
|
+
(selector=smalltalk.send(selector, "_replace_with_", ["[/]", "_slash"]));
|
1869
|
+
(selector=smalltalk.send(selector, "_replace_with_", [">", "_gt"]));
|
1870
|
+
(selector=smalltalk.send(selector, "_replace_with_", ["<", "_lt"]));
|
1871
|
+
(selector=smalltalk.send(selector, "_replace_with_", ["=", "_eq"]));
|
1872
|
+
(selector=smalltalk.send(selector, "_replace_with_", [",", "_comma"]));
|
1873
|
+
(selector=smalltalk.send(selector, "_replace_with_", ["[@]", "_at"]));
|
1874
|
+
return selector;
|
1799
1875
|
return self;}
|
1800
1876
|
}),
|
1801
1877
|
smalltalk.String);
|
1802
1878
|
|
1803
|
-
|
1804
1879
|
smalltalk.addMethod(
|
1805
|
-
|
1880
|
+
"_asString",
|
1806
1881
|
smalltalk.method({
|
1807
|
-
selector:
|
1808
|
-
fn: function ()
|
1882
|
+
selector: "asString",
|
1883
|
+
fn: function (){
|
1809
1884
|
var self=this;
|
1810
|
-
return
|
1885
|
+
return self;
|
1811
1886
|
return self;}
|
1812
1887
|
}),
|
1813
|
-
smalltalk.String
|
1888
|
+
smalltalk.String);
|
1814
1889
|
|
1815
1890
|
smalltalk.addMethod(
|
1816
|
-
|
1891
|
+
"_asSymbol",
|
1817
1892
|
smalltalk.method({
|
1818
|
-
selector:
|
1819
|
-
fn: function (
|
1893
|
+
selector: "asSymbol",
|
1894
|
+
fn: function (){
|
1820
1895
|
var self=this;
|
1821
|
-
return
|
1896
|
+
return smalltalk.send((smalltalk.Symbol || Symbol), "_lookup_", [self]);
|
1822
1897
|
return self;}
|
1823
1898
|
}),
|
1824
|
-
smalltalk.String
|
1899
|
+
smalltalk.String);
|
1825
1900
|
|
1826
1901
|
smalltalk.addMethod(
|
1827
|
-
|
1902
|
+
"_asUppercase",
|
1828
1903
|
smalltalk.method({
|
1829
|
-
selector:
|
1830
|
-
fn: function ()
|
1904
|
+
selector: "asUppercase",
|
1905
|
+
fn: function (){
|
1831
1906
|
var self=this;
|
1832
|
-
return
|
1907
|
+
return self.toUpperCase();
|
1833
1908
|
return self;}
|
1834
1909
|
}),
|
1835
|
-
smalltalk.String
|
1910
|
+
smalltalk.String);
|
1836
1911
|
|
1837
1912
|
smalltalk.addMethod(
|
1838
|
-
|
1913
|
+
"_asciiValue",
|
1839
1914
|
smalltalk.method({
|
1840
|
-
selector:
|
1841
|
-
fn: function ()
|
1915
|
+
selector: "asciiValue",
|
1916
|
+
fn: function (){
|
1842
1917
|
var self=this;
|
1843
|
-
return
|
1918
|
+
return self.charCodeAt(0);;
|
1844
1919
|
return self;}
|
1845
1920
|
}),
|
1846
|
-
smalltalk.String
|
1921
|
+
smalltalk.String);
|
1847
1922
|
|
1848
1923
|
smalltalk.addMethod(
|
1849
|
-
|
1924
|
+
"_at_ifAbsent_",
|
1850
1925
|
smalltalk.method({
|
1851
|
-
selector:
|
1852
|
-
fn: function ()
|
1926
|
+
selector: "at:ifAbsent:",
|
1927
|
+
fn: function (anIndex, aBlock){
|
1853
1928
|
var self=this;
|
1854
|
-
return
|
1929
|
+
return self[anIndex - 1] || aBlock();
|
1855
1930
|
return self;}
|
1856
1931
|
}),
|
1857
|
-
smalltalk.String
|
1932
|
+
smalltalk.String);
|
1858
1933
|
|
1859
1934
|
smalltalk.addMethod(
|
1860
|
-
|
1935
|
+
"_copyFrom_to_",
|
1861
1936
|
smalltalk.method({
|
1862
|
-
selector:
|
1863
|
-
fn: function ()
|
1937
|
+
selector: "copyFrom:to:",
|
1938
|
+
fn: function (anIndex, anotherIndex){
|
1864
1939
|
var self=this;
|
1865
|
-
return
|
1940
|
+
return self.substring(anIndex - 1, anotherIndex);
|
1866
1941
|
return self;}
|
1867
1942
|
}),
|
1868
|
-
smalltalk.String
|
1943
|
+
smalltalk.String);
|
1869
1944
|
|
1870
1945
|
smalltalk.addMethod(
|
1871
|
-
|
1946
|
+
"_deepCopy",
|
1872
1947
|
smalltalk.method({
|
1873
|
-
selector:
|
1874
|
-
fn: function ()
|
1948
|
+
selector: "deepCopy",
|
1949
|
+
fn: function (){
|
1875
1950
|
var self=this;
|
1876
|
-
return
|
1951
|
+
return smalltalk.send(self, "_shallowCopy", []);
|
1877
1952
|
return self;}
|
1878
1953
|
}),
|
1879
|
-
smalltalk.String
|
1954
|
+
smalltalk.String);
|
1880
1955
|
|
1881
1956
|
smalltalk.addMethod(
|
1882
|
-
|
1957
|
+
"_escaped",
|
1883
1958
|
smalltalk.method({
|
1884
|
-
selector:
|
1885
|
-
fn: function (
|
1959
|
+
selector: "escaped",
|
1960
|
+
fn: function (){
|
1886
1961
|
var self=this;
|
1887
|
-
|
1888
|
-
(stream=smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [smalltalk.send((smalltalk.String || String), "_new", [])]));
|
1889
|
-
smalltalk.send(blockWithArg, "_value_", [stream]);
|
1890
|
-
return smalltalk.send(stream, "_contents", []);
|
1962
|
+
return escape(self);
|
1891
1963
|
return self;}
|
1892
1964
|
}),
|
1893
|
-
smalltalk.String
|
1965
|
+
smalltalk.String);
|
1894
1966
|
|
1895
1967
|
smalltalk.addMethod(
|
1896
|
-
|
1968
|
+
"_includesSubString_",
|
1897
1969
|
smalltalk.method({
|
1898
|
-
selector:
|
1899
|
-
fn: function (
|
1970
|
+
selector: "includesSubString:",
|
1971
|
+
fn: function (subString){
|
1900
1972
|
var self=this;
|
1901
|
-
return
|
1973
|
+
return self.indexOf(subString) != -1 ;
|
1902
1974
|
return self;}
|
1903
1975
|
}),
|
1904
|
-
smalltalk.String
|
1905
|
-
|
1976
|
+
smalltalk.String);
|
1906
1977
|
|
1907
|
-
smalltalk.addClass('Symbol', smalltalk.CharacterArray, [], 'Kernel-Collections');
|
1908
1978
|
smalltalk.addMethod(
|
1909
|
-
|
1979
|
+
"_isString",
|
1910
1980
|
smalltalk.method({
|
1911
|
-
selector:
|
1912
|
-
fn: function (
|
1981
|
+
selector: "isString",
|
1982
|
+
fn: function (){
|
1913
1983
|
var self=this;
|
1914
|
-
return
|
1984
|
+
return true;
|
1915
1985
|
return self;}
|
1916
1986
|
}),
|
1917
|
-
smalltalk.
|
1987
|
+
smalltalk.String);
|
1918
1988
|
|
1919
1989
|
smalltalk.addMethod(
|
1920
|
-
|
1990
|
+
"_join_",
|
1921
1991
|
smalltalk.method({
|
1922
|
-
selector:
|
1923
|
-
fn: function ()
|
1992
|
+
selector: "join:",
|
1993
|
+
fn: function (aCollection){
|
1924
1994
|
var self=this;
|
1925
|
-
return
|
1995
|
+
return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(stream){return smalltalk.send(aCollection, "_do_separatedBy_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(each, "_asString", [])]);}), (function(){return smalltalk.send(stream, "_nextPutAll_", [self]);})]);})]);
|
1926
1996
|
return self;}
|
1927
1997
|
}),
|
1928
|
-
smalltalk.
|
1998
|
+
smalltalk.String);
|
1929
1999
|
|
1930
2000
|
smalltalk.addMethod(
|
1931
|
-
|
2001
|
+
"_lineIndicesDo_",
|
1932
2002
|
smalltalk.method({
|
1933
|
-
selector:
|
1934
|
-
fn: function ()
|
2003
|
+
selector: "lineIndicesDo:",
|
2004
|
+
fn: function (aBlock){
|
1935
2005
|
var self=this;
|
1936
|
-
|
1937
|
-
|
2006
|
+
var $early={};
|
2007
|
+
try{var cr=nil;
|
2008
|
+
var lf=nil;
|
2009
|
+
var start=nil;
|
2010
|
+
var sz=nil;
|
2011
|
+
var nextLF=nil;
|
2012
|
+
var nextCR=nil;
|
2013
|
+
(start=(1));
|
2014
|
+
(sz=smalltalk.send(self, "_size", []));
|
2015
|
+
(cr=smalltalk.send((smalltalk.String || String), "_cr", []));
|
2016
|
+
(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, (1)]));
|
2017
|
+
(lf=smalltalk.send((smalltalk.String || String), "_lf", []));
|
2018
|
+
(nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, (1)]));
|
2019
|
+
(function(){while((function(){return ((($receiver = start).klass === smalltalk.Number) ? $receiver <=sz : smalltalk.send($receiver, "__lt_eq", [sz]));})()) {(function(){((($receiver = smalltalk.send(smalltalk.send(nextLF, "__eq", [(0)]), "_and_", [(function(){return smalltalk.send(nextCR, "__eq", [(0)]);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, sz, sz]);return (function(){throw $early=[self]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, sz, sz]);return (function(){throw $early=[self]})();})]));return ((($receiver = smalltalk.send(smalltalk.send(nextCR, "__eq", [(0)]), "_or_", [(function(){return smalltalk.send((0) < nextLF, "_and_", [(function(){return ((($receiver = nextLF).klass === smalltalk.Number) ? $receiver <nextCR : smalltalk.send($receiver, "__lt", [nextCR]));})]);})])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextLF).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));})() : (function(){return ((($receiver = smalltalk.send((1) + nextCR, "__eq", [nextLF])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));})() : (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);(start=(1) + nextCR);return (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));}), (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);(start=(1) + nextCR);return (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextLF).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));}), (function(){return ((($receiver = smalltalk.send((1) + nextCR, "__eq", [nextLF])).klass === smalltalk.Boolean) ? ($receiver ? (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));})() : (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);(start=(1) + nextCR);return (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextLF]);(start=(1) + nextLF);(nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));return (nextLF=smalltalk.send(self, "_indexOf_startingAt_", [lf, start]));}), (function(){smalltalk.send(aBlock, "_value_value_value_", [start, ((($receiver = nextCR).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), nextCR]);(start=(1) + nextCR);return (nextCR=smalltalk.send(self, "_indexOf_startingAt_", [cr, start]));})]));})]));})()}})();
|
2020
|
+
return self;
|
2021
|
+
} catch(e) {if(e===$early)return e[0]; throw e}}
|
1938
2022
|
}),
|
1939
|
-
smalltalk.
|
2023
|
+
smalltalk.String);
|
1940
2024
|
|
1941
2025
|
smalltalk.addMethod(
|
1942
|
-
|
2026
|
+
"_lineNumber_",
|
1943
2027
|
smalltalk.method({
|
1944
|
-
selector:
|
1945
|
-
fn: function ()
|
2028
|
+
selector: "lineNumber:",
|
2029
|
+
fn: function (anIndex){
|
1946
2030
|
var self=this;
|
1947
|
-
|
1948
|
-
|
2031
|
+
var $early={};
|
2032
|
+
try{var lineCount=nil;
|
2033
|
+
(lineCount=(0));
|
2034
|
+
smalltalk.send(self, "_lineIndicesDo_", [(function(start, endWithoutDelimiters, end){return ((($receiver = smalltalk.send((lineCount=((($receiver = lineCount).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))), "__eq", [anIndex])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function(){throw $early=[smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])]})();})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return (function(){throw $early=[smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])]})();})]));})]);
|
2035
|
+
return nil;
|
2036
|
+
return self;
|
2037
|
+
} catch(e) {if(e===$early)return e[0]; throw e}}
|
1949
2038
|
}),
|
1950
|
-
smalltalk.
|
2039
|
+
smalltalk.String);
|
1951
2040
|
|
1952
2041
|
smalltalk.addMethod(
|
1953
|
-
|
2042
|
+
"_lines",
|
1954
2043
|
smalltalk.method({
|
1955
|
-
selector:
|
1956
|
-
fn: function ()
|
2044
|
+
selector: "lines",
|
2045
|
+
fn: function (){
|
1957
2046
|
var self=this;
|
1958
|
-
|
2047
|
+
var lines=nil;
|
2048
|
+
(lines=smalltalk.send((smalltalk.Array || Array), "_new", []));
|
2049
|
+
smalltalk.send(self, "_linesDo_", [(function(aLine){return smalltalk.send(lines, "_add_", [aLine]);})]);
|
2050
|
+
return lines;
|
1959
2051
|
return self;}
|
1960
2052
|
}),
|
1961
|
-
smalltalk.
|
2053
|
+
smalltalk.String);
|
1962
2054
|
|
1963
2055
|
smalltalk.addMethod(
|
1964
|
-
|
2056
|
+
"_linesDo_",
|
1965
2057
|
smalltalk.method({
|
1966
|
-
selector:
|
1967
|
-
fn: function (
|
2058
|
+
selector: "linesDo:",
|
2059
|
+
fn: function (aBlock){
|
1968
2060
|
var self=this;
|
1969
|
-
|
2061
|
+
smalltalk.send(self, "_lineIndicesDo_", [(function(start, endWithoutDelimiters, end){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_copyFrom_to_", [start, endWithoutDelimiters])]);})]);
|
1970
2062
|
return self;}
|
1971
2063
|
}),
|
1972
|
-
smalltalk.
|
2064
|
+
smalltalk.String);
|
1973
2065
|
|
1974
2066
|
smalltalk.addMethod(
|
1975
|
-
|
2067
|
+
"_match_",
|
1976
2068
|
smalltalk.method({
|
1977
|
-
selector:
|
1978
|
-
fn: function ()
|
2069
|
+
selector: "match:",
|
2070
|
+
fn: function (aRegexp){
|
1979
2071
|
var self=this;
|
1980
|
-
return self;
|
2072
|
+
return self.search(aRegexp) != -1;
|
1981
2073
|
return self;}
|
1982
2074
|
}),
|
1983
|
-
smalltalk.
|
2075
|
+
smalltalk.String);
|
1984
2076
|
|
1985
2077
|
smalltalk.addMethod(
|
1986
|
-
|
2078
|
+
"_matchesOf_",
|
1987
2079
|
smalltalk.method({
|
1988
|
-
selector:
|
1989
|
-
fn: function (
|
2080
|
+
selector: "matchesOf:",
|
2081
|
+
fn: function (aRegularExpression){
|
1990
2082
|
var self=this;
|
1991
|
-
return
|
2083
|
+
return self.match(aRegularExpression);
|
1992
2084
|
return self;}
|
1993
2085
|
}),
|
1994
|
-
smalltalk.
|
2086
|
+
smalltalk.String);
|
1995
2087
|
|
1996
2088
|
smalltalk.addMethod(
|
1997
|
-
|
2089
|
+
"_printNl",
|
1998
2090
|
smalltalk.method({
|
1999
|
-
selector:
|
2000
|
-
fn: function (
|
2091
|
+
selector: "printNl",
|
2092
|
+
fn: function (){
|
2001
2093
|
var self=this;
|
2002
|
-
|
2094
|
+
console.log(self);
|
2003
2095
|
return self;}
|
2004
2096
|
}),
|
2005
|
-
smalltalk.
|
2097
|
+
smalltalk.String);
|
2006
2098
|
|
2007
2099
|
smalltalk.addMethod(
|
2008
|
-
|
2100
|
+
"_printString",
|
2009
2101
|
smalltalk.method({
|
2010
|
-
selector:
|
2011
|
-
fn: function (
|
2102
|
+
selector: "printString",
|
2103
|
+
fn: function (){
|
2012
2104
|
var self=this;
|
2013
|
-
return
|
2105
|
+
return smalltalk.send(smalltalk.send("'", "__comma", [self]), "__comma", ["'"]);
|
2014
2106
|
return self;}
|
2015
2107
|
}),
|
2016
|
-
smalltalk.
|
2108
|
+
smalltalk.String);
|
2017
2109
|
|
2018
2110
|
smalltalk.addMethod(
|
2019
|
-
|
2111
|
+
"_replace_with_",
|
2020
2112
|
smalltalk.method({
|
2021
|
-
selector:
|
2022
|
-
fn: function (
|
2113
|
+
selector: "replace:with:",
|
2114
|
+
fn: function (aString, anotherString){
|
2023
2115
|
var self=this;
|
2024
|
-
|
2025
|
-
|
2026
|
-
return self;
|
2027
|
-
} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
|
2116
|
+
return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [aString, "g"]), anotherString]);
|
2117
|
+
return self;}
|
2028
2118
|
}),
|
2029
|
-
smalltalk.
|
2119
|
+
smalltalk.String);
|
2030
2120
|
|
2031
2121
|
smalltalk.addMethod(
|
2032
|
-
|
2122
|
+
"_replaceRegexp_with_",
|
2033
2123
|
smalltalk.method({
|
2034
|
-
selector:
|
2035
|
-
fn: function ()
|
2124
|
+
selector: "replaceRegexp:with:",
|
2125
|
+
fn: function (aRegexp, aString){
|
2036
2126
|
var self=this;
|
2037
|
-
return
|
2127
|
+
return self.replace(aRegexp, aString);
|
2038
2128
|
return self;}
|
2039
2129
|
}),
|
2040
|
-
smalltalk.
|
2130
|
+
smalltalk.String);
|
2041
2131
|
|
2042
2132
|
smalltalk.addMethod(
|
2043
|
-
|
2133
|
+
"_reversed",
|
2044
2134
|
smalltalk.method({
|
2045
|
-
selector:
|
2046
|
-
fn: function ()
|
2135
|
+
selector: "reversed",
|
2136
|
+
fn: function (){
|
2047
2137
|
var self=this;
|
2048
|
-
return
|
2138
|
+
return self.split("").reverse().join("");
|
2049
2139
|
return self;}
|
2050
2140
|
}),
|
2051
|
-
smalltalk.
|
2141
|
+
smalltalk.String);
|
2052
2142
|
|
2053
2143
|
smalltalk.addMethod(
|
2054
|
-
|
2144
|
+
"_shallowCopy",
|
2055
2145
|
smalltalk.method({
|
2056
|
-
selector:
|
2057
|
-
fn: function (
|
2146
|
+
selector: "shallowCopy",
|
2147
|
+
fn: function (){
|
2058
2148
|
var self=this;
|
2059
|
-
return
|
2149
|
+
return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [self]);
|
2060
2150
|
return self;}
|
2061
2151
|
}),
|
2062
|
-
smalltalk.
|
2152
|
+
smalltalk.String);
|
2063
2153
|
|
2064
2154
|
smalltalk.addMethod(
|
2065
|
-
|
2155
|
+
"_size",
|
2066
2156
|
smalltalk.method({
|
2067
|
-
selector:
|
2068
|
-
fn: function ()
|
2157
|
+
selector: "size",
|
2158
|
+
fn: function (){
|
2069
2159
|
var self=this;
|
2070
|
-
return self;
|
2160
|
+
return self.length;
|
2071
2161
|
return self;}
|
2072
2162
|
}),
|
2073
|
-
smalltalk.
|
2163
|
+
smalltalk.String);
|
2074
2164
|
|
2075
2165
|
smalltalk.addMethod(
|
2076
|
-
|
2166
|
+
"_tokenize_",
|
2077
2167
|
smalltalk.method({
|
2078
|
-
selector:
|
2079
|
-
fn: function ()
|
2168
|
+
selector: "tokenize:",
|
2169
|
+
fn: function (aString){
|
2080
2170
|
var self=this;
|
2081
|
-
return
|
2171
|
+
return self.split(aString);
|
2082
2172
|
return self;}
|
2083
2173
|
}),
|
2084
|
-
smalltalk.
|
2174
|
+
smalltalk.String);
|
2085
2175
|
|
2086
2176
|
smalltalk.addMethod(
|
2087
|
-
|
2177
|
+
"_trimBoth",
|
2088
2178
|
smalltalk.method({
|
2089
|
-
selector:
|
2179
|
+
selector: "trimBoth",
|
2090
2180
|
fn: function (){
|
2091
2181
|
var self=this;
|
2092
|
-
return smalltalk.send(
|
2182
|
+
return smalltalk.send(self, "_trimBoth_", ["\x5cs"]);
|
2093
2183
|
return self;}
|
2094
2184
|
}),
|
2095
|
-
smalltalk.
|
2096
|
-
|
2185
|
+
smalltalk.String);
|
2097
2186
|
|
2098
2187
|
smalltalk.addMethod(
|
2099
|
-
|
2188
|
+
"_trimBoth_",
|
2100
2189
|
smalltalk.method({
|
2101
|
-
selector:
|
2102
|
-
fn: function (
|
2190
|
+
selector: "trimBoth:",
|
2191
|
+
fn: function (separators){
|
2103
2192
|
var self=this;
|
2104
|
-
return smalltalk.
|
2193
|
+
return smalltalk.send(smalltalk.send(self, "_trimLeft_", [separators]), "_trimRight_", [separators]);
|
2105
2194
|
return self;}
|
2106
2195
|
}),
|
2107
|
-
smalltalk.
|
2196
|
+
smalltalk.String);
|
2108
2197
|
|
2109
2198
|
smalltalk.addMethod(
|
2110
|
-
|
2199
|
+
"_trimLeft",
|
2111
2200
|
smalltalk.method({
|
2112
|
-
selector:
|
2113
|
-
fn: function ()
|
2201
|
+
selector: "trimLeft",
|
2202
|
+
fn: function (){
|
2114
2203
|
var self=this;
|
2115
|
-
smalltalk.send(self, "
|
2204
|
+
return smalltalk.send(self, "_trimLeft_", ["\x5cs"]);
|
2116
2205
|
return self;}
|
2117
2206
|
}),
|
2118
|
-
smalltalk.
|
2207
|
+
smalltalk.String);
|
2119
2208
|
|
2120
2209
|
smalltalk.addMethod(
|
2121
|
-
|
2210
|
+
"_trimLeft_",
|
2122
2211
|
smalltalk.method({
|
2123
|
-
selector:
|
2124
|
-
fn: function (
|
2212
|
+
selector: "trimLeft:",
|
2213
|
+
fn: function (separators){
|
2125
2214
|
var self=this;
|
2126
|
-
return smalltalk.send(self, "
|
2215
|
+
return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [smalltalk.send(smalltalk.send("^[", "__comma", [separators]), "__comma", ["]+"]), "g"]), ""]);
|
2127
2216
|
return self;}
|
2128
2217
|
}),
|
2129
|
-
smalltalk.
|
2130
|
-
|
2218
|
+
smalltalk.String);
|
2131
2219
|
|
2132
|
-
smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
|
2133
2220
|
smalltalk.addMethod(
|
2134
|
-
|
2221
|
+
"_trimRight",
|
2135
2222
|
smalltalk.method({
|
2136
|
-
selector:
|
2137
|
-
fn: function ()
|
2223
|
+
selector: "trimRight",
|
2224
|
+
fn: function (){
|
2138
2225
|
var self=this;
|
2139
|
-
return self
|
2226
|
+
return smalltalk.send(self, "_trimRight_", ["\x5cs"]);
|
2140
2227
|
return self;}
|
2141
2228
|
}),
|
2142
|
-
smalltalk.
|
2229
|
+
smalltalk.String);
|
2143
2230
|
|
2144
2231
|
smalltalk.addMethod(
|
2145
|
-
|
2232
|
+
"_trimRight_",
|
2146
2233
|
smalltalk.method({
|
2147
|
-
selector:
|
2148
|
-
fn: function (
|
2234
|
+
selector: "trimRight:",
|
2235
|
+
fn: function (separators){
|
2149
2236
|
var self=this;
|
2150
|
-
return self[
|
2237
|
+
return smalltalk.send(self, "_replaceRegexp_with_", [smalltalk.send((smalltalk.RegularExpression || RegularExpression), "_fromString_flag_", [smalltalk.send(smalltalk.send("[", "__comma", [separators]), "__comma", ["]+$"]), "g"]), ""]);
|
2151
2238
|
return self;}
|
2152
2239
|
}),
|
2153
|
-
smalltalk.
|
2240
|
+
smalltalk.String);
|
2154
2241
|
|
2155
2242
|
smalltalk.addMethod(
|
2156
|
-
|
2243
|
+
"_unescaped",
|
2157
2244
|
smalltalk.method({
|
2158
|
-
selector:
|
2159
|
-
fn: function (
|
2245
|
+
selector: "unescaped",
|
2246
|
+
fn: function (){
|
2160
2247
|
var self=this;
|
2161
|
-
|
2162
|
-
var value = self[anIndex - 1];
|
2163
|
-
if(value === undefined) {
|
2164
|
-
return aBlock();
|
2165
|
-
} else {
|
2166
|
-
return value;
|
2167
|
-
}
|
2168
|
-
;
|
2248
|
+
return unescape(self);
|
2169
2249
|
return self;}
|
2170
2250
|
}),
|
2171
|
-
smalltalk.
|
2251
|
+
smalltalk.String);
|
2252
|
+
|
2172
2253
|
|
2173
2254
|
smalltalk.addMethod(
|
2174
|
-
|
2255
|
+
"_cr",
|
2175
2256
|
smalltalk.method({
|
2176
|
-
selector:
|
2177
|
-
fn: function (
|
2257
|
+
selector: "cr",
|
2258
|
+
fn: function (){
|
2178
2259
|
var self=this;
|
2179
|
-
|
2260
|
+
return '\r';
|
2180
2261
|
return self;}
|
2181
2262
|
}),
|
2182
|
-
smalltalk.
|
2263
|
+
smalltalk.String.klass);
|
2183
2264
|
|
2184
2265
|
smalltalk.addMethod(
|
2185
|
-
|
2266
|
+
"_crlf",
|
2186
2267
|
smalltalk.method({
|
2187
|
-
selector:
|
2188
|
-
fn: function (
|
2268
|
+
selector: "crlf",
|
2269
|
+
fn: function (){
|
2189
2270
|
var self=this;
|
2190
|
-
return
|
2271
|
+
return '\r\n';
|
2191
2272
|
return self;}
|
2192
2273
|
}),
|
2193
|
-
smalltalk.
|
2274
|
+
smalltalk.String.klass);
|
2194
2275
|
|
2195
2276
|
smalltalk.addMethod(
|
2196
|
-
|
2277
|
+
"_fromString_",
|
2197
2278
|
smalltalk.method({
|
2198
|
-
selector:
|
2199
|
-
fn: function ()
|
2279
|
+
selector: "fromString:",
|
2280
|
+
fn: function (aString){
|
2200
2281
|
var self=this;
|
2201
|
-
return
|
2202
|
-
return self;}
|
2203
|
-
}),
|
2204
|
-
smalltalk.Array);
|
2205
|
-
|
2206
|
-
smalltalk.addMethod(
|
2207
|
-
unescape('_sort'),
|
2208
|
-
smalltalk.method({
|
2209
|
-
selector: unescape('sort'),
|
2210
|
-
fn: function () {
|
2211
|
-
var self=this;
|
2212
|
-
return smalltalk.send(self, "_basicPerform_", ["sort"]);
|
2282
|
+
return new self.fn(aString);
|
2213
2283
|
return self;}
|
2214
2284
|
}),
|
2215
|
-
smalltalk.
|
2285
|
+
smalltalk.String.klass);
|
2216
2286
|
|
2217
2287
|
smalltalk.addMethod(
|
2218
|
-
|
2288
|
+
"_lf",
|
2219
2289
|
smalltalk.method({
|
2220
|
-
selector:
|
2221
|
-
fn: function (
|
2290
|
+
selector: "lf",
|
2291
|
+
fn: function (){
|
2222
2292
|
var self=this;
|
2223
|
-
|
2224
|
-
return self.sort(function(a, b) {
|
2225
|
-
if(aBlock(a,b)) {return -1} else {return 1}
|
2226
|
-
})
|
2227
|
-
;
|
2293
|
+
return '\n';
|
2228
2294
|
return self;}
|
2229
2295
|
}),
|
2230
|
-
smalltalk.
|
2296
|
+
smalltalk.String.klass);
|
2231
2297
|
|
2232
2298
|
smalltalk.addMethod(
|
2233
|
-
|
2299
|
+
"_space",
|
2234
2300
|
smalltalk.method({
|
2235
|
-
selector:
|
2236
|
-
fn: function (
|
2301
|
+
selector: "space",
|
2302
|
+
fn: function (){
|
2237
2303
|
var self=this;
|
2238
|
-
|
2239
|
-
for(var i=0;i<self.length;i++) {
|
2240
|
-
if(self[i] == anObject) {
|
2241
|
-
self.splice(i,1);
|
2242
|
-
break;
|
2243
|
-
}
|
2244
|
-
}
|
2245
|
-
;
|
2304
|
+
return ' ';
|
2246
2305
|
return self;}
|
2247
2306
|
}),
|
2248
|
-
smalltalk.
|
2307
|
+
smalltalk.String.klass);
|
2249
2308
|
|
2250
2309
|
smalltalk.addMethod(
|
2251
|
-
|
2310
|
+
"_streamClass",
|
2252
2311
|
smalltalk.method({
|
2253
|
-
selector:
|
2254
|
-
fn: function ()
|
2312
|
+
selector: "streamClass",
|
2313
|
+
fn: function (){
|
2255
2314
|
var self=this;
|
2256
|
-
return
|
2315
|
+
return (smalltalk.StringStream || StringStream);
|
2257
2316
|
return self;}
|
2258
2317
|
}),
|
2259
|
-
smalltalk.
|
2318
|
+
smalltalk.String.klass);
|
2260
2319
|
|
2261
2320
|
smalltalk.addMethod(
|
2262
|
-
|
2321
|
+
"_streamContents_",
|
2263
2322
|
smalltalk.method({
|
2264
|
-
selector:
|
2265
|
-
fn: function (
|
2323
|
+
selector: "streamContents:",
|
2324
|
+
fn: function (blockWithArg){
|
2266
2325
|
var self=this;
|
2267
|
-
|
2326
|
+
var stream=nil;
|
2327
|
+
(stream=smalltalk.send(smalltalk.send(self, "_streamClass", []), "_on_", [smalltalk.send((smalltalk.String || String), "_new", [])]));
|
2328
|
+
smalltalk.send(blockWithArg, "_value_", [stream]);
|
2329
|
+
return smalltalk.send(stream, "_contents", []);
|
2268
2330
|
return self;}
|
2269
2331
|
}),
|
2270
|
-
smalltalk.
|
2332
|
+
smalltalk.String.klass);
|
2271
2333
|
|
2272
2334
|
smalltalk.addMethod(
|
2273
|
-
|
2335
|
+
"_tab",
|
2274
2336
|
smalltalk.method({
|
2275
|
-
selector:
|
2276
|
-
fn: function (
|
2337
|
+
selector: "tab",
|
2338
|
+
fn: function (){
|
2277
2339
|
var self=this;
|
2278
|
-
|
2340
|
+
return '\t';
|
2279
2341
|
return self;}
|
2280
2342
|
}),
|
2281
|
-
smalltalk.
|
2343
|
+
smalltalk.String.klass);
|
2282
2344
|
|
2283
2345
|
smalltalk.addMethod(
|
2284
|
-
|
2346
|
+
"_value_",
|
2285
2347
|
smalltalk.method({
|
2286
|
-
selector:
|
2287
|
-
fn: function ()
|
2348
|
+
selector: "value:",
|
2349
|
+
fn: function (aUTFCharCode){
|
2288
2350
|
var self=this;
|
2289
|
-
return
|
2351
|
+
return String.fromCharCode(aUTFCharCode);;
|
2290
2352
|
return self;}
|
2291
2353
|
}),
|
2292
|
-
smalltalk.
|
2354
|
+
smalltalk.String.klass);
|
2293
2355
|
|
2294
2356
|
|
2357
|
+
smalltalk.addClass('Symbol', smalltalk.CharacterArray, [], 'Kernel-Collections');
|
2295
2358
|
smalltalk.addMethod(
|
2296
|
-
|
2359
|
+
"__lt",
|
2297
2360
|
smalltalk.method({
|
2298
|
-
selector:
|
2299
|
-
fn: function (
|
2361
|
+
selector: "<",
|
2362
|
+
fn: function (aSymbol){
|
2300
2363
|
var self=this;
|
2301
|
-
return
|
2364
|
+
return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver <smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__lt", [smalltalk.send(aSymbol, "_asString", [])]));
|
2302
2365
|
return self;}
|
2303
2366
|
}),
|
2304
|
-
smalltalk.
|
2367
|
+
smalltalk.Symbol);
|
2305
2368
|
|
2306
2369
|
smalltalk.addMethod(
|
2307
|
-
|
2370
|
+
"__lt_eq",
|
2308
2371
|
smalltalk.method({
|
2309
|
-
selector:
|
2310
|
-
fn: function (
|
2372
|
+
selector: "<=",
|
2373
|
+
fn: function (aSymbol){
|
2311
2374
|
var self=this;
|
2312
|
-
return (
|
2375
|
+
return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(aSymbol, "_asString", [])]));
|
2313
2376
|
return self;}
|
2314
2377
|
}),
|
2315
|
-
smalltalk.
|
2378
|
+
smalltalk.Symbol);
|
2316
2379
|
|
2317
2380
|
smalltalk.addMethod(
|
2318
|
-
|
2381
|
+
"__eq",
|
2319
2382
|
smalltalk.method({
|
2320
|
-
selector:
|
2321
|
-
fn: function (
|
2383
|
+
selector: "=",
|
2384
|
+
fn: function (aSymbol){
|
2322
2385
|
var self=this;
|
2323
|
-
|
2324
|
-
return
|
2386
|
+
var $early={};
|
2387
|
+
try{((($receiver = smalltalk.send(smalltalk.send(aSymbol, "_class", []), "__eq", [smalltalk.send(self, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw $early=[false]})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw $early=[false]})();})]));
|
2388
|
+
return smalltalk.send(smalltalk.send(self, "_asString", []), "__eq", [smalltalk.send(aSymbol, "_asString", [])]);
|
2389
|
+
return self;
|
2390
|
+
} catch(e) {if(e===$early)return e[0]; throw e}}
|
2325
2391
|
}),
|
2326
|
-
smalltalk.
|
2392
|
+
smalltalk.Symbol);
|
2327
2393
|
|
2328
2394
|
smalltalk.addMethod(
|
2329
|
-
|
2395
|
+
"__gt",
|
2330
2396
|
smalltalk.method({
|
2331
|
-
selector:
|
2332
|
-
fn: function (
|
2397
|
+
selector: ">",
|
2398
|
+
fn: function (aSymbol){
|
2333
2399
|
var self=this;
|
2334
|
-
return (
|
2400
|
+
return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver >smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__gt", [smalltalk.send(aSymbol, "_asString", [])]));
|
2335
2401
|
return self;}
|
2336
2402
|
}),
|
2337
|
-
smalltalk.
|
2403
|
+
smalltalk.Symbol);
|
2338
2404
|
|
2339
2405
|
smalltalk.addMethod(
|
2340
|
-
|
2406
|
+
"__gt_eq",
|
2341
2407
|
smalltalk.method({
|
2342
|
-
selector:
|
2343
|
-
fn: function (
|
2408
|
+
selector: ">=",
|
2409
|
+
fn: function (aSymbol){
|
2344
2410
|
var self=this;
|
2345
|
-
|
2346
|
-
(instance=smalltalk.send(self, "_new_", [smalltalk.send(aCollection, "_size", [])]));
|
2347
|
-
smalltalk.send(aCollection, "_withIndexDo_", [(function(each, index){return smalltalk.send(instance, "_at_put_", [index, each]);})]);
|
2348
|
-
return instance;
|
2411
|
+
return ((($receiver = smalltalk.send(self, "_asString", [])).klass === smalltalk.Number) ? $receiver >=smalltalk.send(aSymbol, "_asString", []) : smalltalk.send($receiver, "__gt_eq", [smalltalk.send(aSymbol, "_asString", [])]));
|
2349
2412
|
return self;}
|
2350
2413
|
}),
|
2351
|
-
smalltalk.
|
2352
|
-
|
2414
|
+
smalltalk.Symbol);
|
2353
2415
|
|
2354
|
-
smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel-Collections');
|
2355
2416
|
smalltalk.addMethod(
|
2356
|
-
|
2417
|
+
"_asJSON",
|
2357
2418
|
smalltalk.method({
|
2358
|
-
selector:
|
2359
|
-
fn: function ()
|
2419
|
+
selector: "asJSON",
|
2420
|
+
fn: function (){
|
2360
2421
|
var self=this;
|
2361
|
-
return self
|
2422
|
+
return smalltalk.send(smalltalk.send(self, "_asString", []), "_asJSON", []);
|
2362
2423
|
return self;}
|
2363
2424
|
}),
|
2364
|
-
smalltalk.
|
2425
|
+
smalltalk.Symbol);
|
2365
2426
|
|
2366
2427
|
smalltalk.addMethod(
|
2367
|
-
|
2428
|
+
"_asJavascript",
|
2368
2429
|
smalltalk.method({
|
2369
|
-
selector:
|
2370
|
-
fn: function (
|
2430
|
+
selector: "asJavascript",
|
2431
|
+
fn: function (){
|
2371
2432
|
var self=this;
|
2372
|
-
return self
|
2433
|
+
return smalltalk.send(smalltalk.send("smalltalk.symbolFor(\x22", "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", ["\x22)"]);
|
2373
2434
|
return self;}
|
2374
2435
|
}),
|
2375
|
-
smalltalk.
|
2436
|
+
smalltalk.Symbol);
|
2376
2437
|
|
2377
2438
|
smalltalk.addMethod(
|
2378
|
-
|
2439
|
+
"_asSelector",
|
2379
2440
|
smalltalk.method({
|
2380
|
-
selector:
|
2381
|
-
fn: function (
|
2441
|
+
selector: "asSelector",
|
2442
|
+
fn: function (){
|
2382
2443
|
var self=this;
|
2383
|
-
|
2384
|
-
var value = self[anIndex - 1];
|
2385
|
-
if(value === undefined) {
|
2386
|
-
return aBlock();
|
2387
|
-
} else {
|
2388
|
-
return value;
|
2389
|
-
}
|
2390
|
-
;
|
2444
|
+
return smalltalk.send(smalltalk.send(self, "_asString", []), "_asSelector", []);
|
2391
2445
|
return self;}
|
2392
2446
|
}),
|
2393
|
-
smalltalk.
|
2447
|
+
smalltalk.Symbol);
|
2394
2448
|
|
2395
2449
|
smalltalk.addMethod(
|
2396
|
-
|
2450
|
+
"_asString",
|
2397
2451
|
smalltalk.method({
|
2398
|
-
selector:
|
2399
|
-
fn: function (
|
2452
|
+
selector: "asString",
|
2453
|
+
fn: function (){
|
2400
2454
|
var self=this;
|
2401
|
-
self.
|
2455
|
+
return self.value;
|
2402
2456
|
return self;}
|
2403
2457
|
}),
|
2404
|
-
smalltalk.
|
2458
|
+
smalltalk.Symbol);
|
2405
2459
|
|
2406
2460
|
smalltalk.addMethod(
|
2407
|
-
|
2461
|
+
"_asSymbol",
|
2408
2462
|
smalltalk.method({
|
2409
|
-
selector:
|
2410
|
-
fn: function (
|
2463
|
+
selector: "asSymbol",
|
2464
|
+
fn: function (){
|
2411
2465
|
var self=this;
|
2412
|
-
return self
|
2466
|
+
return self;
|
2413
2467
|
return self;}
|
2414
2468
|
}),
|
2415
|
-
smalltalk.
|
2469
|
+
smalltalk.Symbol);
|
2416
2470
|
|
2417
2471
|
smalltalk.addMethod(
|
2418
|
-
|
2472
|
+
"_at_ifAbsent_",
|
2419
2473
|
smalltalk.method({
|
2420
|
-
selector:
|
2421
|
-
fn: function ()
|
2474
|
+
selector: "at:ifAbsent:",
|
2475
|
+
fn: function (anIndex, aBlock){
|
2422
2476
|
var self=this;
|
2423
|
-
return smalltalk.send(smalltalk.send(
|
2477
|
+
return smalltalk.send(smalltalk.send(self, "_asString", []), "_at_ifAbsent_", [anIndex, aBlock]);
|
2424
2478
|
return self;}
|
2425
2479
|
}),
|
2426
|
-
smalltalk.
|
2480
|
+
smalltalk.Symbol);
|
2427
2481
|
|
2428
2482
|
smalltalk.addMethod(
|
2429
|
-
|
2483
|
+
"_copyFrom_to_",
|
2430
2484
|
smalltalk.method({
|
2431
|
-
selector:
|
2432
|
-
fn: function ()
|
2485
|
+
selector: "copyFrom:to:",
|
2486
|
+
fn: function (anIndex, anotherIndex){
|
2433
2487
|
var self=this;
|
2434
|
-
return smalltalk.send(self, "
|
2488
|
+
return smalltalk.send(smalltalk.send(self, "_class", []), "_fromString_", [smalltalk.send(smalltalk.send(self, "_asString", []), "_copyFrom_to_", [anIndex, anotherIndex])]);
|
2435
2489
|
return self;}
|
2436
2490
|
}),
|
2437
|
-
smalltalk.
|
2491
|
+
smalltalk.Symbol);
|
2438
2492
|
|
2439
2493
|
smalltalk.addMethod(
|
2440
|
-
|
2494
|
+
"_deepCopy",
|
2441
2495
|
smalltalk.method({
|
2442
|
-
selector:
|
2443
|
-
fn: function (
|
2496
|
+
selector: "deepCopy",
|
2497
|
+
fn: function (){
|
2444
2498
|
var self=this;
|
2445
|
-
|
2446
|
-
return self.sort(function(a, b) {
|
2447
|
-
if(aBlock(a,b)) {return -1} else {return 1}
|
2448
|
-
})
|
2449
|
-
;
|
2499
|
+
return self;
|
2450
2500
|
return self;}
|
2451
2501
|
}),
|
2452
|
-
smalltalk.
|
2502
|
+
smalltalk.Symbol);
|
2453
2503
|
|
2454
2504
|
smalltalk.addMethod(
|
2455
|
-
|
2505
|
+
"_isSymbol",
|
2456
2506
|
smalltalk.method({
|
2457
|
-
selector:
|
2458
|
-
fn: function (
|
2507
|
+
selector: "isSymbol",
|
2508
|
+
fn: function (){
|
2459
2509
|
var self=this;
|
2460
|
-
|
2461
|
-
for(var i=0;i<self.length;i++) {
|
2462
|
-
if(self[i] == anObject) {
|
2463
|
-
self.splice(i,1);
|
2464
|
-
break;
|
2465
|
-
}
|
2466
|
-
}
|
2467
|
-
;
|
2510
|
+
return true;
|
2468
2511
|
return self;}
|
2469
2512
|
}),
|
2470
|
-
smalltalk.
|
2513
|
+
smalltalk.Symbol);
|
2471
2514
|
|
2472
2515
|
smalltalk.addMethod(
|
2473
|
-
|
2516
|
+
"_printString",
|
2474
2517
|
smalltalk.method({
|
2475
|
-
selector:
|
2476
|
-
fn: function ()
|
2518
|
+
selector: "printString",
|
2519
|
+
fn: function (){
|
2477
2520
|
var self=this;
|
2478
|
-
return smalltalk.send(
|
2521
|
+
return smalltalk.send("#", "__comma", [smalltalk.send(self, "_asString", [])]);
|
2479
2522
|
return self;}
|
2480
2523
|
}),
|
2481
|
-
smalltalk.
|
2524
|
+
smalltalk.Symbol);
|
2482
2525
|
|
2483
2526
|
smalltalk.addMethod(
|
2484
|
-
|
2527
|
+
"_shallowCopy",
|
2485
2528
|
smalltalk.method({
|
2486
|
-
selector:
|
2487
|
-
fn: function (
|
2529
|
+
selector: "shallowCopy",
|
2530
|
+
fn: function (){
|
2488
2531
|
var self=this;
|
2489
|
-
return
|
2532
|
+
return self;
|
2490
2533
|
return self;}
|
2491
2534
|
}),
|
2492
|
-
smalltalk.
|
2535
|
+
smalltalk.Symbol);
|
2493
2536
|
|
2494
2537
|
smalltalk.addMethod(
|
2495
|
-
|
2538
|
+
"_size",
|
2496
2539
|
smalltalk.method({
|
2497
|
-
selector:
|
2498
|
-
fn: function (
|
2540
|
+
selector: "size",
|
2541
|
+
fn: function (){
|
2499
2542
|
var self=this;
|
2500
|
-
|
2543
|
+
return smalltalk.send(smalltalk.send(self, "_asString", []), "_size", []);
|
2501
2544
|
return self;}
|
2502
2545
|
}),
|
2503
|
-
smalltalk.
|
2546
|
+
smalltalk.Symbol);
|
2547
|
+
|
2504
2548
|
|
2505
2549
|
smalltalk.addMethod(
|
2506
|
-
|
2550
|
+
"_basicNew",
|
2507
2551
|
smalltalk.method({
|
2508
|
-
selector:
|
2509
|
-
fn: function ()
|
2552
|
+
selector: "basicNew",
|
2553
|
+
fn: function (){
|
2510
2554
|
var self=this;
|
2511
|
-
|
2555
|
+
smalltalk.send(self, "_shouldNotImplement", []);
|
2512
2556
|
return self;}
|
2513
2557
|
}),
|
2514
|
-
smalltalk.
|
2515
|
-
|
2558
|
+
smalltalk.Symbol.klass);
|
2516
2559
|
|
2517
2560
|
smalltalk.addMethod(
|
2518
|
-
|
2561
|
+
"_fromString_",
|
2519
2562
|
smalltalk.method({
|
2520
|
-
selector:
|
2521
|
-
fn: function (
|
2563
|
+
selector: "fromString:",
|
2564
|
+
fn: function (aString){
|
2522
2565
|
var self=this;
|
2523
|
-
return
|
2566
|
+
return smalltalk.send(self, "_lookup_", [aString]);
|
2524
2567
|
return self;}
|
2525
2568
|
}),
|
2526
|
-
smalltalk.
|
2569
|
+
smalltalk.Symbol.klass);
|
2527
2570
|
|
2528
2571
|
smalltalk.addMethod(
|
2529
|
-
|
2572
|
+
"_lookup_",
|
2530
2573
|
smalltalk.method({
|
2531
|
-
selector:
|
2532
|
-
fn: function (
|
2574
|
+
selector: "lookup:",
|
2575
|
+
fn: function (aString){
|
2533
2576
|
var self=this;
|
2534
|
-
return
|
2577
|
+
return smalltalk.symbolFor(aString);;
|
2535
2578
|
return self;}
|
2536
2579
|
}),
|
2537
|
-
smalltalk.
|
2580
|
+
smalltalk.Symbol.klass);
|
2581
|
+
|
2538
2582
|
|
2583
|
+
smalltalk.addClass('Set', smalltalk.Collection, ['elements'], 'Kernel-Collections');
|
2539
2584
|
smalltalk.addMethod(
|
2540
|
-
|
2585
|
+
"__eq",
|
2541
2586
|
smalltalk.method({
|
2542
|
-
selector:
|
2543
|
-
fn: function (
|
2587
|
+
selector: "=",
|
2588
|
+
fn: function (aCollection){
|
2544
2589
|
var self=this;
|
2545
|
-
return (
|
2590
|
+
return smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aCollection, "_class", [])]), "_and_", [(function(){return smalltalk.send(self['@elements'], "__eq", [smalltalk.send(aCollection, "_asArray", [])]);})]);
|
2546
2591
|
return self;}
|
2547
2592
|
}),
|
2548
|
-
smalltalk.
|
2593
|
+
smalltalk.Set);
|
2549
2594
|
|
2550
2595
|
smalltalk.addMethod(
|
2551
|
-
|
2596
|
+
"_add_",
|
2552
2597
|
smalltalk.method({
|
2553
|
-
selector:
|
2554
|
-
fn: function (anObject
|
2598
|
+
selector: "add:",
|
2599
|
+
fn: function (anObject){
|
2555
2600
|
var self=this;
|
2556
|
-
|
2601
|
+
|
2602
|
+
var found;
|
2603
|
+
for(var i=0; i < self['@elements'].length; i++) {
|
2604
|
+
if(anObject == self['@elements'][i]) {
|
2605
|
+
found = true;
|
2606
|
+
break;
|
2607
|
+
}
|
2608
|
+
}
|
2609
|
+
if(!found) {self['@elements'].push(anObject)}
|
2610
|
+
;
|
2557
2611
|
return self;}
|
2558
2612
|
}),
|
2559
|
-
smalltalk.
|
2613
|
+
smalltalk.Set);
|
2560
2614
|
|
2561
2615
|
smalltalk.addMethod(
|
2562
|
-
|
2616
|
+
"_asArray",
|
2563
2617
|
smalltalk.method({
|
2564
|
-
selector:
|
2565
|
-
fn: function (
|
2618
|
+
selector: "asArray",
|
2619
|
+
fn: function (){
|
2566
2620
|
var self=this;
|
2567
|
-
|
2568
|
-
(instance=smalltalk.send(self, "_new_", [smalltalk.send(aCollection, "_size", [])]));
|
2569
|
-
smalltalk.send(aCollection, "_withIndexDo_", [(function(each, index){return smalltalk.send(instance, "_at_put_", [index, each]);})]);
|
2570
|
-
return instance;
|
2621
|
+
return smalltalk.send(self['@elements'], "_copy", []);
|
2571
2622
|
return self;}
|
2572
2623
|
}),
|
2573
|
-
smalltalk.
|
2574
|
-
|
2624
|
+
smalltalk.Set);
|
2575
2625
|
|
2576
|
-
smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel-Collections');
|
2577
2626
|
smalltalk.addMethod(
|
2578
|
-
|
2627
|
+
"_detect_ifNone_",
|
2579
2628
|
smalltalk.method({
|
2580
|
-
selector:
|
2581
|
-
fn: function (
|
2629
|
+
selector: "detect:ifNone:",
|
2630
|
+
fn: function (aBlock, anotherBlock){
|
2582
2631
|
var self=this;
|
2583
|
-
|
2584
|
-
(tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []));
|
2585
|
-
smalltalk.send(anInteger, "_timesRepeat_", [(function(){return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (tempCollection=smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]));})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (tempCollection=smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]));})]));})]);
|
2586
|
-
return tempCollection;
|
2632
|
+
return smalltalk.send(self['@elements'], "_detect_ifNone_", [aBlock, anotherBlock]);
|
2587
2633
|
return self;}
|
2588
2634
|
}),
|
2589
|
-
smalltalk.
|
2635
|
+
smalltalk.Set);
|
2590
2636
|
|
2591
2637
|
smalltalk.addMethod(
|
2592
|
-
|
2638
|
+
"_do_",
|
2593
2639
|
smalltalk.method({
|
2594
|
-
selector:
|
2595
|
-
fn: function (
|
2640
|
+
selector: "do:",
|
2641
|
+
fn: function (aBlock){
|
2596
2642
|
var self=this;
|
2597
|
-
smalltalk.send(self, "
|
2643
|
+
smalltalk.send(self['@elements'], "_do_", [aBlock]);
|
2598
2644
|
return self;}
|
2599
2645
|
}),
|
2600
|
-
smalltalk.
|
2646
|
+
smalltalk.Set);
|
2601
2647
|
|
2602
2648
|
smalltalk.addMethod(
|
2603
|
-
|
2649
|
+
"_includes_",
|
2604
2650
|
smalltalk.method({
|
2605
|
-
selector:
|
2606
|
-
fn: function (
|
2651
|
+
selector: "includes:",
|
2652
|
+
fn: function (anObject){
|
2607
2653
|
var self=this;
|
2608
|
-
|
2609
|
-
smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(aString, "_size", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(aString, "_size", [])]))]);
|
2610
|
-
smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
|
2654
|
+
return smalltalk.send(self['@elements'], "_includes_", [anObject]);
|
2611
2655
|
return self;}
|
2612
2656
|
}),
|
2613
|
-
smalltalk.
|
2657
|
+
smalltalk.Set);
|
2614
2658
|
|
2615
2659
|
smalltalk.addMethod(
|
2616
|
-
|
2660
|
+
"_initialize",
|
2617
2661
|
smalltalk.method({
|
2618
|
-
selector:
|
2619
|
-
fn: function ()
|
2662
|
+
selector: "initialize",
|
2663
|
+
fn: function (){
|
2620
2664
|
var self=this;
|
2621
|
-
|
2665
|
+
smalltalk.send(self, "_initialize", [], smalltalk.Set.superclass || nil);
|
2666
|
+
(self['@elements']=[]);
|
2622
2667
|
return self;}
|
2623
2668
|
}),
|
2624
|
-
smalltalk.
|
2669
|
+
smalltalk.Set);
|
2625
2670
|
|
2626
2671
|
smalltalk.addMethod(
|
2627
|
-
|
2672
|
+
"_remove_",
|
2628
2673
|
smalltalk.method({
|
2629
|
-
selector:
|
2630
|
-
fn: function ()
|
2674
|
+
selector: "remove:",
|
2675
|
+
fn: function (anObject){
|
2631
2676
|
var self=this;
|
2632
|
-
|
2677
|
+
smalltalk.send(self['@elements'], "_remove_", [anObject]);
|
2633
2678
|
return self;}
|
2634
2679
|
}),
|
2635
|
-
smalltalk.
|
2680
|
+
smalltalk.Set);
|
2636
2681
|
|
2637
2682
|
smalltalk.addMethod(
|
2638
|
-
|
2683
|
+
"_select_",
|
2639
2684
|
smalltalk.method({
|
2640
|
-
selector:
|
2641
|
-
fn: function ()
|
2685
|
+
selector: "select:",
|
2686
|
+
fn: function (aBlock){
|
2642
2687
|
var self=this;
|
2643
|
-
|
2688
|
+
var collection=nil;
|
2689
|
+
(collection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
|
2690
|
+
smalltalk.send(self, "_do_", [(function(each){return ((($receiver = smalltalk.send(aBlock, "_value_", [each])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(collection, "_add_", [each]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(collection, "_add_", [each]);})]));})]);
|
2691
|
+
return collection;
|
2644
2692
|
return self;}
|
2645
2693
|
}),
|
2646
|
-
smalltalk.
|
2694
|
+
smalltalk.Set);
|
2647
2695
|
|
2648
2696
|
smalltalk.addMethod(
|
2649
|
-
|
2697
|
+
"_size",
|
2650
2698
|
smalltalk.method({
|
2651
|
-
selector:
|
2652
|
-
fn: function ()
|
2699
|
+
selector: "size",
|
2700
|
+
fn: function (){
|
2653
2701
|
var self=this;
|
2654
|
-
smalltalk.send(self, "
|
2702
|
+
return smalltalk.send(self['@elements'], "_size", []);
|
2655
2703
|
return self;}
|
2656
2704
|
}),
|
2657
|
-
smalltalk.
|
2705
|
+
smalltalk.Set);
|
2658
2706
|
|
2659
2707
|
|
2660
2708
|
|
2661
|
-
smalltalk.addClass('
|
2709
|
+
smalltalk.addClass('RegularExpression', smalltalk.Object, [], 'Kernel-Collections');
|
2662
2710
|
smalltalk.addMethod(
|
2663
|
-
|
2711
|
+
"_compile_",
|
2664
2712
|
smalltalk.method({
|
2665
|
-
selector:
|
2666
|
-
fn: function (
|
2713
|
+
selector: "compile:",
|
2714
|
+
fn: function (aString){
|
2667
2715
|
var self=this;
|
2668
|
-
|
2669
|
-
var found;
|
2670
|
-
for(var i=0; i < self['@elements'].length; i++) {
|
2671
|
-
if(anObject == self['@elements'][i]) {
|
2672
|
-
found = true;
|
2673
|
-
break;
|
2674
|
-
}
|
2675
|
-
}
|
2676
|
-
if(!found) {self['@elements'].push(anObject)}
|
2677
|
-
;
|
2716
|
+
return self.compile(aString);
|
2678
2717
|
return self;}
|
2679
2718
|
}),
|
2680
|
-
smalltalk.
|
2719
|
+
smalltalk.RegularExpression);
|
2681
2720
|
|
2682
2721
|
smalltalk.addMethod(
|
2683
|
-
|
2722
|
+
"_exec_",
|
2684
2723
|
smalltalk.method({
|
2685
|
-
selector:
|
2686
|
-
fn: function (
|
2724
|
+
selector: "exec:",
|
2725
|
+
fn: function (aString){
|
2687
2726
|
var self=this;
|
2688
|
-
|
2727
|
+
return self.exec(aString) || nil;
|
2689
2728
|
return self;}
|
2690
2729
|
}),
|
2691
|
-
smalltalk.
|
2730
|
+
smalltalk.RegularExpression);
|
2692
2731
|
|
2693
2732
|
smalltalk.addMethod(
|
2694
|
-
|
2733
|
+
"_test_",
|
2695
2734
|
smalltalk.method({
|
2696
|
-
selector:
|
2697
|
-
fn: function ()
|
2735
|
+
selector: "test:",
|
2736
|
+
fn: function (aString){
|
2698
2737
|
var self=this;
|
2699
|
-
|
2700
|
-
(self['@elements']=[]);
|
2738
|
+
return self.test(aString);
|
2701
2739
|
return self;}
|
2702
2740
|
}),
|
2703
|
-
smalltalk.
|
2741
|
+
smalltalk.RegularExpression);
|
2742
|
+
|
2704
2743
|
|
2705
2744
|
smalltalk.addMethod(
|
2706
|
-
|
2745
|
+
"_fromString_",
|
2707
2746
|
smalltalk.method({
|
2708
|
-
selector:
|
2709
|
-
fn: function ()
|
2747
|
+
selector: "fromString:",
|
2748
|
+
fn: function (aString){
|
2710
2749
|
var self=this;
|
2711
|
-
return smalltalk.send(self
|
2712
|
-
return self;}
|
2713
|
-
}),
|
2714
|
-
smalltalk.Set);
|
2715
|
-
|
2716
|
-
smalltalk.addMethod(
|
2717
|
-
unescape('_asArray'),
|
2718
|
-
smalltalk.method({
|
2719
|
-
selector: unescape('asArray'),
|
2720
|
-
fn: function () {
|
2721
|
-
var self=this;
|
2722
|
-
return smalltalk.send(self['@elements'], "_copy", []);
|
2723
|
-
return self;}
|
2724
|
-
}),
|
2725
|
-
smalltalk.Set);
|
2726
|
-
|
2727
|
-
smalltalk.addMethod(
|
2728
|
-
unescape('_detect_ifNone_'),
|
2729
|
-
smalltalk.method({
|
2730
|
-
selector: unescape('detect%3AifNone%3A'),
|
2731
|
-
fn: function (aBlock, anotherBlock) {
|
2732
|
-
var self=this;
|
2733
|
-
return smalltalk.send(self['@elements'], "_detect_ifNone_", [aBlock, anotherBlock]);
|
2734
|
-
return self;}
|
2735
|
-
}),
|
2736
|
-
smalltalk.Set);
|
2737
|
-
|
2738
|
-
smalltalk.addMethod(
|
2739
|
-
unescape('_do_'),
|
2740
|
-
smalltalk.method({
|
2741
|
-
selector: unescape('do%3A'),
|
2742
|
-
fn: function (aBlock) {
|
2743
|
-
var self=this;
|
2744
|
-
smalltalk.send(self['@elements'], "_do_", [aBlock]);
|
2745
|
-
return self;}
|
2746
|
-
}),
|
2747
|
-
smalltalk.Set);
|
2748
|
-
|
2749
|
-
smalltalk.addMethod(
|
2750
|
-
unescape('_includes_'),
|
2751
|
-
smalltalk.method({
|
2752
|
-
selector: unescape('includes%3A'),
|
2753
|
-
fn: function (anObject) {
|
2754
|
-
var self=this;
|
2755
|
-
return smalltalk.send(self['@elements'], "_includes_", [anObject]);
|
2756
|
-
return self;}
|
2757
|
-
}),
|
2758
|
-
smalltalk.Set);
|
2759
|
-
|
2760
|
-
smalltalk.addMethod(
|
2761
|
-
unescape('__eq'),
|
2762
|
-
smalltalk.method({
|
2763
|
-
selector: unescape('%3D'),
|
2764
|
-
fn: function (aCollection) {
|
2765
|
-
var self=this;
|
2766
|
-
return smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aCollection, "_class", [])]), "_and_", [(function(){return smalltalk.send(self['@elements'], "__eq", [smalltalk.send(aCollection, "_asArray", [])]);})]);
|
2767
|
-
return self;}
|
2768
|
-
}),
|
2769
|
-
smalltalk.Set);
|
2770
|
-
|
2771
|
-
smalltalk.addMethod(
|
2772
|
-
unescape('_select_'),
|
2773
|
-
smalltalk.method({
|
2774
|
-
selector: unescape('select%3A'),
|
2775
|
-
fn: function (aBlock) {
|
2776
|
-
var self=this;
|
2777
|
-
var collection=nil;
|
2778
|
-
(collection=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
|
2779
|
-
smalltalk.send(self, "_do_", [(function(each){return ((($receiver = smalltalk.send(aBlock, "_value_", [each])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(collection, "_add_", [each]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(collection, "_add_", [each]);})]));})]);
|
2780
|
-
return collection;
|
2781
|
-
return self;}
|
2782
|
-
}),
|
2783
|
-
smalltalk.Set);
|
2784
|
-
|
2785
|
-
|
2786
|
-
|
2787
|
-
smalltalk.addClass('HashedCollection', smalltalk.Collection, [], 'Kernel-Collections');
|
2788
|
-
smalltalk.addMethod(
|
2789
|
-
unescape('_size'),
|
2790
|
-
smalltalk.method({
|
2791
|
-
selector: unescape('size'),
|
2792
|
-
fn: function () {
|
2793
|
-
var self=this;
|
2794
|
-
return smalltalk.send(smalltalk.send(self, "_keys", []), "_size", []);
|
2795
|
-
return self;}
|
2796
|
-
}),
|
2797
|
-
smalltalk.HashedCollection);
|
2798
|
-
|
2799
|
-
smalltalk.addMethod(
|
2800
|
-
unescape('_associations'),
|
2801
|
-
smalltalk.method({
|
2802
|
-
selector: unescape('associations'),
|
2803
|
-
fn: function () {
|
2804
|
-
var self=this;
|
2805
|
-
var associations=nil;
|
2806
|
-
(associations=[]);
|
2807
|
-
smalltalk.send(smalltalk.send(self, "_keys", []), "_do_", [(function(each){return smalltalk.send(associations, "_add_", [smalltalk.send((smalltalk.Association || Association), "_key_value_", [each, smalltalk.send(self, "_at_", [each])])]);})]);
|
2808
|
-
return associations;
|
2809
|
-
return self;}
|
2810
|
-
}),
|
2811
|
-
smalltalk.HashedCollection);
|
2812
|
-
|
2813
|
-
smalltalk.addMethod(
|
2814
|
-
unescape('_keys'),
|
2815
|
-
smalltalk.method({
|
2816
|
-
selector: unescape('keys'),
|
2817
|
-
fn: function () {
|
2818
|
-
var self=this;
|
2819
|
-
|
2820
|
-
var keys = [];
|
2821
|
-
for(var i in self) {
|
2822
|
-
if(self.hasOwnProperty(i)) {
|
2823
|
-
keys.push(i);
|
2824
|
-
}
|
2825
|
-
};
|
2826
|
-
return keys;
|
2827
|
-
;
|
2750
|
+
return smalltalk.send(self, "_fromString_flag_", [aString, ""]);
|
2828
2751
|
return self;}
|
2829
2752
|
}),
|
2830
|
-
smalltalk.
|
2753
|
+
smalltalk.RegularExpression.klass);
|
2831
2754
|
|
2832
2755
|
smalltalk.addMethod(
|
2833
|
-
|
2756
|
+
"_fromString_flag_",
|
2834
2757
|
smalltalk.method({
|
2835
|
-
selector:
|
2836
|
-
fn: function ()
|
2758
|
+
selector: "fromString:flag:",
|
2759
|
+
fn: function (aString, anotherString){
|
2837
2760
|
var self=this;
|
2838
|
-
return
|
2761
|
+
return new RegExp(aString, anotherString);
|
2839
2762
|
return self;}
|
2840
2763
|
}),
|
2841
|
-
smalltalk.
|
2764
|
+
smalltalk.RegularExpression.klass);
|
2842
2765
|
|
2843
|
-
smalltalk.addMethod(
|
2844
|
-
unescape('_at_put_'),
|
2845
|
-
smalltalk.method({
|
2846
|
-
selector: unescape('at%3Aput%3A'),
|
2847
|
-
fn: function (aKey, aValue) {
|
2848
|
-
var self=this;
|
2849
|
-
return smalltalk.send(self, "_basicAt_put_", [aKey, aValue]);
|
2850
|
-
return self;}
|
2851
|
-
}),
|
2852
|
-
smalltalk.HashedCollection);
|
2853
|
-
|
2854
|
-
smalltalk.addMethod(
|
2855
|
-
unescape('_at_ifAbsent_'),
|
2856
|
-
smalltalk.method({
|
2857
|
-
selector: unescape('at%3AifAbsent%3A'),
|
2858
|
-
fn: function (aKey, aBlock) {
|
2859
|
-
var self=this;
|
2860
|
-
return smalltalk.send(smalltalk.send(self, "_includesKey_", [aKey]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_basicAt_", [aKey]);}), aBlock]);
|
2861
|
-
return self;}
|
2862
|
-
}),
|
2863
|
-
smalltalk.HashedCollection);
|
2864
2766
|
|
2767
|
+
smalltalk.addClass('Stream', smalltalk.Object, ['collection', 'position', 'streamSize'], 'Kernel-Collections');
|
2865
2768
|
smalltalk.addMethod(
|
2866
|
-
|
2769
|
+
"_atEnd",
|
2867
2770
|
smalltalk.method({
|
2868
|
-
selector:
|
2869
|
-
fn: function (
|
2771
|
+
selector: "atEnd",
|
2772
|
+
fn: function (){
|
2870
2773
|
var self=this;
|
2871
|
-
return smalltalk.send(self, "
|
2774
|
+
return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [smalltalk.send(self, "_size", [])]);
|
2872
2775
|
return self;}
|
2873
2776
|
}),
|
2874
|
-
smalltalk.
|
2777
|
+
smalltalk.Stream);
|
2875
2778
|
|
2876
2779
|
smalltalk.addMethod(
|
2877
|
-
|
2780
|
+
"_atStart",
|
2878
2781
|
smalltalk.method({
|
2879
|
-
selector:
|
2880
|
-
fn: function (
|
2782
|
+
selector: "atStart",
|
2783
|
+
fn: function (){
|
2881
2784
|
var self=this;
|
2882
|
-
return (
|
2785
|
+
return smalltalk.send(smalltalk.send(self, "_position", []), "__eq", [(0)]);
|
2883
2786
|
return self;}
|
2884
2787
|
}),
|
2885
|
-
smalltalk.
|
2788
|
+
smalltalk.Stream);
|
2886
2789
|
|
2887
2790
|
smalltalk.addMethod(
|
2888
|
-
|
2791
|
+
"_close",
|
2889
2792
|
smalltalk.method({
|
2890
|
-
selector:
|
2891
|
-
fn: function (
|
2793
|
+
selector: "close",
|
2794
|
+
fn: function (){
|
2892
2795
|
var self=this;
|
2893
|
-
return smalltalk.send(smalltalk.send(self, "_basicAt_", [aKey]), "_ifNil_ifNotNil_", [anotherBlock, (function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_at_", [aKey])]);})]);
|
2894
|
-
return self;}
|
2895
|
-
}),
|
2896
|
-
smalltalk.HashedCollection);
|
2897
2796
|
|
2898
|
-
smalltalk.addMethod(
|
2899
|
-
unescape('_at_'),
|
2900
|
-
smalltalk.method({
|
2901
|
-
selector: unescape('at%3A'),
|
2902
|
-
fn: function (aKey) {
|
2903
|
-
var self=this;
|
2904
|
-
return smalltalk.send(self, "_at_ifAbsent_", [aKey, (function(){return smalltalk.send(self, "_errorNotFound", []);})]);
|
2905
2797
|
return self;}
|
2906
2798
|
}),
|
2907
|
-
smalltalk.
|
2799
|
+
smalltalk.Stream);
|
2908
2800
|
|
2909
2801
|
smalltalk.addMethod(
|
2910
|
-
|
2802
|
+
"_collection",
|
2911
2803
|
smalltalk.method({
|
2912
|
-
selector:
|
2913
|
-
fn: function (
|
2804
|
+
selector: "collection",
|
2805
|
+
fn: function (){
|
2914
2806
|
var self=this;
|
2915
|
-
|
2807
|
+
return self['@collection'];
|
2916
2808
|
return self;}
|
2917
2809
|
}),
|
2918
|
-
smalltalk.
|
2810
|
+
smalltalk.Stream);
|
2919
2811
|
|
2920
2812
|
smalltalk.addMethod(
|
2921
|
-
|
2813
|
+
"_contents",
|
2922
2814
|
smalltalk.method({
|
2923
|
-
selector:
|
2924
|
-
fn: function (
|
2815
|
+
selector: "contents",
|
2816
|
+
fn: function (){
|
2925
2817
|
var self=this;
|
2926
|
-
smalltalk.send(self, "
|
2927
|
-
return aHashedCollection;
|
2818
|
+
return smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_streamSize", [])]);
|
2928
2819
|
return self;}
|
2929
2820
|
}),
|
2930
|
-
smalltalk.
|
2821
|
+
smalltalk.Stream);
|
2931
2822
|
|
2932
2823
|
smalltalk.addMethod(
|
2933
|
-
|
2824
|
+
"_do_",
|
2934
2825
|
smalltalk.method({
|
2935
|
-
selector:
|
2936
|
-
fn: function (
|
2826
|
+
selector: "do:",
|
2827
|
+
fn: function (aBlock){
|
2937
2828
|
var self=this;
|
2938
|
-
smalltalk.send(self, "
|
2829
|
+
(function(){while(!(function(){return smalltalk.send(self, "_atEnd", []);})()) {(function(){return smalltalk.send(aBlock, "_value_", [smalltalk.send(self, "_next", [])]);})()}})();
|
2939
2830
|
return self;}
|
2940
2831
|
}),
|
2941
|
-
smalltalk.
|
2832
|
+
smalltalk.Stream);
|
2942
2833
|
|
2943
2834
|
smalltalk.addMethod(
|
2944
|
-
|
2835
|
+
"_flush",
|
2945
2836
|
smalltalk.method({
|
2946
|
-
selector:
|
2947
|
-
fn: function (
|
2837
|
+
selector: "flush",
|
2838
|
+
fn: function (){
|
2948
2839
|
var self=this;
|
2949
|
-
return smalltalk.send(self, "_removeKey_ifAbsent_", [aKey, aBlock]);
|
2950
|
-
return self;}
|
2951
|
-
}),
|
2952
|
-
smalltalk.HashedCollection);
|
2953
2840
|
|
2954
|
-
smalltalk.addMethod(
|
2955
|
-
unescape('_removeKey_ifAbsent_'),
|
2956
|
-
smalltalk.method({
|
2957
|
-
selector: unescape('removeKey%3AifAbsent%3A'),
|
2958
|
-
fn: function (aKey, aBlock) {
|
2959
|
-
var self=this;
|
2960
|
-
return ((($receiver = smalltalk.send(self, "_includesKey_", [aKey])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(aBlock, "_value", []);})() : (function(){return smalltalk.send(self, "_basicDelete_", [aKey]);})()) : smalltalk.send($receiver, "_ifFalse_ifTrue_", [(function(){return smalltalk.send(aBlock, "_value", []);}), (function(){return smalltalk.send(self, "_basicDelete_", [aKey]);})]));
|
2961
2841
|
return self;}
|
2962
2842
|
}),
|
2963
|
-
smalltalk.
|
2964
|
-
|
2965
|
-
smalltalk.addMethod(
|
2966
|
-
unescape('__eq'),
|
2967
|
-
smalltalk.method({
|
2968
|
-
selector: unescape('%3D'),
|
2969
|
-
fn: function (aHashedCollection) {
|
2970
|
-
var self=this;
|
2971
|
-
try{((($receiver = smalltalk.send(smalltalk.send(self, "_class", []), "__eq", [smalltalk.send(aHashedCollection, "_class", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
|
2972
|
-
((($receiver = smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [smalltalk.send(aHashedCollection, "_size", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return false}})})();})]));
|
2973
|
-
(function(){throw({name: 'stReturn', selector: '__eq', fn: function(){return smalltalk.send(smalltalk.send(self, "_associations", []), "__eq", [smalltalk.send(aHashedCollection, "_associations", [])])}})})();
|
2974
|
-
return self;
|
2975
|
-
} catch(e) {if(e.name === 'stReturn' && e.selector === '__eq'){return e.fn()} throw(e)}}
|
2976
|
-
}),
|
2977
|
-
smalltalk.HashedCollection);
|
2843
|
+
smalltalk.Stream);
|
2978
2844
|
|
2979
2845
|
smalltalk.addMethod(
|
2980
|
-
|
2846
|
+
"_isEmpty",
|
2981
2847
|
smalltalk.method({
|
2982
|
-
selector:
|
2983
|
-
fn: function ()
|
2848
|
+
selector: "isEmpty",
|
2849
|
+
fn: function (){
|
2984
2850
|
var self=this;
|
2985
|
-
|
2986
|
-
(copy=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
|
2987
|
-
smalltalk.send(self, "_associationsDo_", [(function(each){return smalltalk.send(copy, "_at_put_", [smalltalk.send(each, "_key", []), smalltalk.send(each, "_value", [])]);})]);
|
2988
|
-
return copy;
|
2851
|
+
return smalltalk.send(smalltalk.send(self, "_size", []), "__eq", [(0)]);
|
2989
2852
|
return self;}
|
2990
2853
|
}),
|
2991
|
-
smalltalk.
|
2854
|
+
smalltalk.Stream);
|
2992
2855
|
|
2993
2856
|
smalltalk.addMethod(
|
2994
|
-
|
2857
|
+
"_next",
|
2995
2858
|
smalltalk.method({
|
2996
|
-
selector:
|
2997
|
-
fn: function (
|
2859
|
+
selector: "next",
|
2860
|
+
fn: function (){
|
2998
2861
|
var self=this;
|
2999
|
-
smalltalk.send(self, "
|
2862
|
+
return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return nil;})() : (function(){smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return nil;}), (function(){smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);return smalltalk.send(self['@collection'], "_at_", [smalltalk.send(self, "_position", [])]);})]));
|
3000
2863
|
return self;}
|
3001
2864
|
}),
|
3002
|
-
smalltalk.
|
2865
|
+
smalltalk.Stream);
|
3003
2866
|
|
3004
2867
|
smalltalk.addMethod(
|
3005
|
-
|
2868
|
+
"_next_",
|
3006
2869
|
smalltalk.method({
|
3007
|
-
selector:
|
3008
|
-
fn: function (
|
2870
|
+
selector: "next:",
|
2871
|
+
fn: function (anInteger){
|
3009
2872
|
var self=this;
|
3010
|
-
|
2873
|
+
var tempCollection=nil;
|
2874
|
+
(tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []));
|
2875
|
+
smalltalk.send(anInteger, "_timesRepeat_", [(function(){return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(tempCollection, "_add_", [smalltalk.send(self, "_next", [])]);})]));})]);
|
2876
|
+
return tempCollection;
|
3011
2877
|
return self;}
|
3012
2878
|
}),
|
3013
|
-
smalltalk.
|
2879
|
+
smalltalk.Stream);
|
3014
2880
|
|
3015
2881
|
smalltalk.addMethod(
|
3016
|
-
|
2882
|
+
"_nextPut_",
|
3017
2883
|
smalltalk.method({
|
3018
|
-
selector:
|
3019
|
-
fn: function ()
|
2884
|
+
selector: "nextPut:",
|
2885
|
+
fn: function (anObject){
|
3020
2886
|
var self=this;
|
3021
|
-
|
3022
|
-
|
3023
|
-
smalltalk.send(self, "
|
3024
|
-
return copy;
|
2887
|
+
smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);
|
2888
|
+
smalltalk.send(smalltalk.send(self, "_collection", []), "_at_put_", [smalltalk.send(self, "_position", []), anObject]);
|
2889
|
+
smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
|
3025
2890
|
return self;}
|
3026
2891
|
}),
|
3027
|
-
smalltalk.
|
2892
|
+
smalltalk.Stream);
|
3028
2893
|
|
3029
2894
|
smalltalk.addMethod(
|
3030
|
-
|
2895
|
+
"_nextPutAll_",
|
3031
2896
|
smalltalk.method({
|
3032
|
-
selector:
|
3033
|
-
fn: function (
|
2897
|
+
selector: "nextPutAll:",
|
2898
|
+
fn: function (aCollection){
|
3034
2899
|
var self=this;
|
3035
|
-
smalltalk.send(
|
2900
|
+
smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_nextPut_", [each]);})]);
|
3036
2901
|
return self;}
|
3037
2902
|
}),
|
3038
|
-
smalltalk.
|
2903
|
+
smalltalk.Stream);
|
3039
2904
|
|
3040
2905
|
smalltalk.addMethod(
|
3041
|
-
|
2906
|
+
"_peek",
|
3042
2907
|
smalltalk.method({
|
3043
|
-
selector:
|
3044
|
-
fn: function (
|
2908
|
+
selector: "peek",
|
2909
|
+
fn: function (){
|
3045
2910
|
var self=this;
|
3046
|
-
smalltalk.send(self, "
|
2911
|
+
return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_at_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(self, "_collection", []), "_at_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);})]));
|
3047
2912
|
return self;}
|
3048
2913
|
}),
|
3049
|
-
smalltalk.
|
2914
|
+
smalltalk.Stream);
|
3050
2915
|
|
3051
2916
|
smalltalk.addMethod(
|
3052
|
-
|
2917
|
+
"_position",
|
3053
2918
|
smalltalk.method({
|
3054
|
-
selector:
|
3055
|
-
fn: function (
|
2919
|
+
selector: "position",
|
2920
|
+
fn: function (){
|
3056
2921
|
var self=this;
|
3057
|
-
|
2922
|
+
return (($receiver = self['@position']) == nil || $receiver == undefined) ? (function(){return (self['@position']=(0));})() : $receiver;
|
3058
2923
|
return self;}
|
3059
2924
|
}),
|
3060
|
-
smalltalk.
|
2925
|
+
smalltalk.Stream);
|
3061
2926
|
|
3062
2927
|
smalltalk.addMethod(
|
3063
|
-
|
2928
|
+
"_position_",
|
3064
2929
|
smalltalk.method({
|
3065
|
-
selector:
|
3066
|
-
fn: function (
|
2930
|
+
selector: "position:",
|
2931
|
+
fn: function (anInteger){
|
3067
2932
|
var self=this;
|
3068
|
-
|
3069
|
-
(newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
|
3070
|
-
smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return ((($receiver = smalltalk.send(aBlock, "_value_", [value])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(newDict, "_at_put_", [key, value]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(newDict, "_at_put_", [key, value]);})]));})]);
|
3071
|
-
return newDict;
|
2933
|
+
(self['@position']=anInteger);
|
3072
2934
|
return self;}
|
3073
2935
|
}),
|
3074
|
-
smalltalk.
|
2936
|
+
smalltalk.Stream);
|
3075
2937
|
|
3076
2938
|
smalltalk.addMethod(
|
3077
|
-
|
2939
|
+
"_reset",
|
3078
2940
|
smalltalk.method({
|
3079
|
-
selector:
|
3080
|
-
fn: function (
|
2941
|
+
selector: "reset",
|
2942
|
+
fn: function (){
|
3081
2943
|
var self=this;
|
3082
|
-
|
3083
|
-
(newDict=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
|
3084
|
-
smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(newDict, "_at_put_", [key, smalltalk.send(aBlock, "_value_", [value])]);})]);
|
3085
|
-
return newDict;
|
2944
|
+
smalltalk.send(self, "_position_", [(0)]);
|
3086
2945
|
return self;}
|
3087
2946
|
}),
|
3088
|
-
smalltalk.
|
2947
|
+
smalltalk.Stream);
|
3089
2948
|
|
3090
2949
|
smalltalk.addMethod(
|
3091
|
-
|
2950
|
+
"_resetContents",
|
3092
2951
|
smalltalk.method({
|
3093
|
-
selector:
|
3094
|
-
fn: function (
|
2952
|
+
selector: "resetContents",
|
2953
|
+
fn: function (){
|
3095
2954
|
var self=this;
|
3096
|
-
|
2955
|
+
smalltalk.send(self, "_reset", []);
|
2956
|
+
smalltalk.send(self, "_setStreamSize_", [(0)]);
|
3097
2957
|
return self;}
|
3098
2958
|
}),
|
3099
|
-
smalltalk.
|
2959
|
+
smalltalk.Stream);
|
3100
2960
|
|
3101
2961
|
smalltalk.addMethod(
|
3102
|
-
|
2962
|
+
"_setCollection_",
|
3103
2963
|
smalltalk.method({
|
3104
|
-
selector:
|
3105
|
-
fn: function (
|
2964
|
+
selector: "setCollection:",
|
2965
|
+
fn: function (aCollection){
|
3106
2966
|
var self=this;
|
3107
|
-
|
2967
|
+
(self['@collection']=aCollection);
|
3108
2968
|
return self;}
|
3109
2969
|
}),
|
3110
|
-
smalltalk.
|
2970
|
+
smalltalk.Stream);
|
3111
2971
|
|
3112
2972
|
smalltalk.addMethod(
|
3113
|
-
|
2973
|
+
"_setStreamSize_",
|
3114
2974
|
smalltalk.method({
|
3115
|
-
selector:
|
3116
|
-
fn: function ()
|
2975
|
+
selector: "setStreamSize:",
|
2976
|
+
fn: function (anInteger){
|
3117
2977
|
var self=this;
|
3118
|
-
|
2978
|
+
(self['@streamSize']=anInteger);
|
3119
2979
|
return self;}
|
3120
2980
|
}),
|
3121
|
-
smalltalk.
|
2981
|
+
smalltalk.Stream);
|
3122
2982
|
|
3123
2983
|
smalltalk.addMethod(
|
3124
|
-
|
2984
|
+
"_setToEnd",
|
3125
2985
|
smalltalk.method({
|
3126
|
-
selector:
|
3127
|
-
fn: function (
|
2986
|
+
selector: "setToEnd",
|
2987
|
+
fn: function (){
|
3128
2988
|
var self=this;
|
3129
|
-
smalltalk.send(
|
3130
|
-
smalltalk.send(smalltalk.send(self, "_associations", []), "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_storeOn_", [aStream]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [". "]);})]);
|
3131
|
-
smalltalk.send(aStream, "_nextPutAll_", [unescape("%7D")]);
|
2989
|
+
smalltalk.send(self, "_position_", [smalltalk.send(self, "_size", [])]);
|
3132
2990
|
return self;}
|
3133
2991
|
}),
|
3134
|
-
smalltalk.
|
2992
|
+
smalltalk.Stream);
|
3135
2993
|
|
3136
2994
|
smalltalk.addMethod(
|
3137
|
-
|
2995
|
+
"_size",
|
3138
2996
|
smalltalk.method({
|
3139
|
-
selector:
|
3140
|
-
fn: function (
|
2997
|
+
selector: "size",
|
2998
|
+
fn: function (){
|
3141
2999
|
var self=this;
|
3142
|
-
return
|
3000
|
+
return smalltalk.send(self, "_streamSize", []);
|
3143
3001
|
return self;}
|
3144
3002
|
}),
|
3145
|
-
smalltalk.
|
3003
|
+
smalltalk.Stream);
|
3146
3004
|
|
3147
3005
|
smalltalk.addMethod(
|
3148
|
-
|
3006
|
+
"_skip_",
|
3149
3007
|
smalltalk.method({
|
3150
|
-
selector:
|
3151
|
-
fn: function ()
|
3008
|
+
selector: "skip:",
|
3009
|
+
fn: function (anInteger){
|
3152
3010
|
var self=this;
|
3153
|
-
|
3011
|
+
smalltalk.send(self, "_position_", [smalltalk.send(((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +anInteger : smalltalk.send($receiver, "__plus", [anInteger])), "_min_max_", [smalltalk.send(self, "_size", []), (0)])]);
|
3154
3012
|
return self;}
|
3155
3013
|
}),
|
3156
|
-
smalltalk.
|
3014
|
+
smalltalk.Stream);
|
3157
3015
|
|
3158
3016
|
smalltalk.addMethod(
|
3159
|
-
|
3017
|
+
"_streamSize",
|
3160
3018
|
smalltalk.method({
|
3161
|
-
selector:
|
3019
|
+
selector: "streamSize",
|
3162
3020
|
fn: function (){
|
3163
3021
|
var self=this;
|
3164
|
-
|
3165
|
-
(c=smalltalk.send(smalltalk.send(self, "_class", []), "_new", []));
|
3166
|
-
smalltalk.send(self, "_keysAndValuesDo_", [(function(key, value){return smalltalk.send(c, "_at_put_", [key, smalltalk.send(value, "_asJSON", [])]);})]);
|
3167
|
-
return c;
|
3168
|
-
return self;}
|
3169
|
-
}),
|
3170
|
-
smalltalk.HashedCollection);
|
3171
|
-
|
3172
|
-
|
3173
|
-
smalltalk.addMethod(
|
3174
|
-
unescape('_fromPairs_'),
|
3175
|
-
smalltalk.method({
|
3176
|
-
selector: unescape('fromPairs%3A'),
|
3177
|
-
fn: function (aCollection) {
|
3178
|
-
var self=this;
|
3179
|
-
var dict=nil;
|
3180
|
-
(dict=smalltalk.send(self, "_new", []));
|
3181
|
-
smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(dict, "_add_", [each]);})]);
|
3182
|
-
return dict;
|
3022
|
+
return self['@streamSize'];
|
3183
3023
|
return self;}
|
3184
3024
|
}),
|
3185
|
-
smalltalk.
|
3025
|
+
smalltalk.Stream);
|
3186
3026
|
|
3187
3027
|
|
3188
|
-
smalltalk.addClass('Dictionary', smalltalk.HashedCollection, ['keys', 'values'], 'Kernel-Collections');
|
3189
3028
|
smalltalk.addMethod(
|
3190
|
-
|
3029
|
+
"_on_",
|
3191
3030
|
smalltalk.method({
|
3192
|
-
selector:
|
3193
|
-
fn: function (
|
3031
|
+
selector: "on:",
|
3032
|
+
fn: function (aCollection){
|
3194
3033
|
var self=this;
|
3195
|
-
|
3196
|
-
var index;
|
3197
|
-
for(var i=0;i<self['@keys'].length;i++){
|
3198
|
-
if(self['@keys'][i].__eq(aKey)) {index = i;}
|
3199
|
-
};
|
3200
|
-
if(typeof index === 'undefined') {
|
3201
|
-
return aBlock();
|
3202
|
-
} else {
|
3203
|
-
return self['@values'][index];
|
3204
|
-
}
|
3205
|
-
;
|
3034
|
+
return (function($rec){smalltalk.send($rec, "_setCollection_", [aCollection]);smalltalk.send($rec, "_setStreamSize_", [smalltalk.send(aCollection, "_size", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
|
3206
3035
|
return self;}
|
3207
3036
|
}),
|
3208
|
-
smalltalk.
|
3037
|
+
smalltalk.Stream.klass);
|
3209
3038
|
|
3210
|
-
smalltalk.addMethod(
|
3211
|
-
unescape('_keys'),
|
3212
|
-
smalltalk.method({
|
3213
|
-
selector: unescape('keys'),
|
3214
|
-
fn: function () {
|
3215
|
-
var self=this;
|
3216
|
-
return smalltalk.send(self['@keys'], "_copy", []);
|
3217
|
-
return self;}
|
3218
|
-
}),
|
3219
|
-
smalltalk.Dictionary);
|
3220
3039
|
|
3040
|
+
smalltalk.addClass('StringStream', smalltalk.Stream, [], 'Kernel-Collections');
|
3221
3041
|
smalltalk.addMethod(
|
3222
|
-
|
3042
|
+
"_cr",
|
3223
3043
|
smalltalk.method({
|
3224
|
-
selector:
|
3225
|
-
fn: function ()
|
3044
|
+
selector: "cr",
|
3045
|
+
fn: function (){
|
3226
3046
|
var self=this;
|
3227
|
-
return smalltalk.send(self[
|
3047
|
+
return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_cr", [])]);
|
3228
3048
|
return self;}
|
3229
3049
|
}),
|
3230
|
-
smalltalk.
|
3050
|
+
smalltalk.StringStream);
|
3231
3051
|
|
3232
3052
|
smalltalk.addMethod(
|
3233
|
-
|
3053
|
+
"_crlf",
|
3234
3054
|
smalltalk.method({
|
3235
|
-
selector:
|
3236
|
-
fn: function (
|
3055
|
+
selector: "crlf",
|
3056
|
+
fn: function (){
|
3237
3057
|
var self=this;
|
3238
|
-
|
3239
|
-
var index = self['@keys'].indexOf(aKey);
|
3240
|
-
if(index === -1) {
|
3241
|
-
self['@values'].push(aValue);
|
3242
|
-
self['@keys'].push(aKey);
|
3243
|
-
} else {
|
3244
|
-
self['@values'][index] = aValue;
|
3245
|
-
};
|
3246
|
-
|
3247
|
-
return aValue;
|
3248
|
-
;
|
3058
|
+
return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_crlf", [])]);
|
3249
3059
|
return self;}
|
3250
3060
|
}),
|
3251
|
-
smalltalk.
|
3061
|
+
smalltalk.StringStream);
|
3252
3062
|
|
3253
3063
|
smalltalk.addMethod(
|
3254
|
-
|
3064
|
+
"_lf",
|
3255
3065
|
smalltalk.method({
|
3256
|
-
selector:
|
3257
|
-
fn: function (
|
3066
|
+
selector: "lf",
|
3067
|
+
fn: function (){
|
3258
3068
|
var self=this;
|
3259
|
-
|
3260
|
-
var index = self['@keys'].indexOf(aKey);
|
3261
|
-
if(index === -1) {
|
3262
|
-
return aBlock()
|
3263
|
-
} else {
|
3264
|
-
self['@keys'].splice(i, 1);
|
3265
|
-
self['@values'].splice(i, 1);
|
3266
|
-
return aKey
|
3267
|
-
};
|
3268
|
-
;
|
3069
|
+
return smalltalk.send(self, "_nextPutAll_", [smalltalk.send((smalltalk.String || String), "_lf", [])]);
|
3269
3070
|
return self;}
|
3270
3071
|
}),
|
3271
|
-
smalltalk.
|
3072
|
+
smalltalk.StringStream);
|
3272
3073
|
|
3273
3074
|
smalltalk.addMethod(
|
3274
|
-
|
3075
|
+
"_next_",
|
3275
3076
|
smalltalk.method({
|
3276
|
-
selector:
|
3277
|
-
fn: function ()
|
3077
|
+
selector: "next:",
|
3078
|
+
fn: function (anInteger){
|
3278
3079
|
var self=this;
|
3279
|
-
|
3280
|
-
(self[
|
3281
|
-
(self[
|
3080
|
+
var tempCollection=nil;
|
3081
|
+
(tempCollection=smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_class", []), "_new", []));
|
3082
|
+
smalltalk.send(anInteger, "_timesRepeat_", [(function(){return ((($receiver = smalltalk.send(self, "_atEnd", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return (tempCollection=smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]));})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return (tempCollection=smalltalk.send(tempCollection, "__comma", [smalltalk.send(self, "_next", [])]));})]));})]);
|
3083
|
+
return tempCollection;
|
3282
3084
|
return self;}
|
3283
3085
|
}),
|
3284
|
-
smalltalk.
|
3086
|
+
smalltalk.StringStream);
|
3285
3087
|
|
3286
3088
|
smalltalk.addMethod(
|
3287
|
-
|
3089
|
+
"_nextPut_",
|
3288
3090
|
smalltalk.method({
|
3289
|
-
selector:
|
3290
|
-
fn: function (
|
3091
|
+
selector: "nextPut:",
|
3092
|
+
fn: function (aString){
|
3291
3093
|
var self=this;
|
3292
|
-
|
3094
|
+
smalltalk.send(self, "_nextPutAll_", [aString]);
|
3293
3095
|
return self;}
|
3294
3096
|
}),
|
3295
|
-
smalltalk.
|
3097
|
+
smalltalk.StringStream);
|
3296
3098
|
|
3297
3099
|
smalltalk.addMethod(
|
3298
|
-
|
3100
|
+
"_nextPutAll_",
|
3299
3101
|
smalltalk.method({
|
3300
|
-
selector:
|
3301
|
-
fn: function ()
|
3102
|
+
selector: "nextPutAll:",
|
3103
|
+
fn: function (aString){
|
3302
3104
|
var self=this;
|
3303
|
-
|
3105
|
+
smalltalk.send(self, "_setCollection_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [(1), smalltalk.send(self, "_position", [])]), "__comma", [aString]), "__comma", [smalltalk.send(smalltalk.send(self, "_collection", []), "_copyFrom_to_", [((($receiver = ((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))).klass === smalltalk.Number) ? $receiver +smalltalk.send(aString, "_size", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(aString, "_size", [])])), smalltalk.send(smalltalk.send(self, "_collection", []), "_size", [])])])]);
|
3106
|
+
smalltalk.send(self, "_position_", [((($receiver = smalltalk.send(self, "_position", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send(aString, "_size", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(aString, "_size", [])]))]);
|
3107
|
+
smalltalk.send(self, "_setStreamSize_", [smalltalk.send(smalltalk.send(self, "_streamSize", []), "_max_", [smalltalk.send(self, "_position", [])])]);
|
3304
3108
|
return self;}
|
3305
3109
|
}),
|
3306
|
-
smalltalk.
|
3110
|
+
smalltalk.StringStream);
|
3307
3111
|
|
3308
3112
|
smalltalk.addMethod(
|
3309
|
-
|
3113
|
+
"_space",
|
3310
3114
|
smalltalk.method({
|
3311
|
-
selector:
|
3115
|
+
selector: "space",
|
3312
3116
|
fn: function (){
|
3313
3117
|
var self=this;
|
3314
|
-
|
3118
|
+
smalltalk.send(self, "_nextPut_", [" "]);
|
3315
3119
|
return self;}
|
3316
3120
|
}),
|
3317
|
-
smalltalk.
|
3121
|
+
smalltalk.StringStream);
|
3318
3122
|
|
3319
3123
|
|
3320
3124
|
|