resin 0.0.1

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