resin 0.2.1 → 0.2.2

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