resin 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. data/amber/css/amber-normalize.css +73 -73
  2. data/amber/css/amber-normalize.less +1 -1
  3. data/amber/css/amber.css +106 -106
  4. data/amber/css/helios.css +242 -0
  5. data/amber/images/hsplitter.png +0 -0
  6. data/amber/images/vsplitter.png +0 -0
  7. data/amber/js/Benchfib.deploy.js +116 -38
  8. data/amber/js/Benchfib.js +120 -42
  9. data/amber/js/Canvas.deploy.js +674 -403
  10. data/amber/js/Canvas.js +682 -411
  11. data/amber/js/Compiler-AST.deploy.js +1150 -0
  12. data/amber/js/Compiler-AST.js +1591 -0
  13. data/amber/js/Compiler-Core.deploy.js +1562 -0
  14. data/amber/js/Compiler-Core.js +1972 -0
  15. data/amber/js/Compiler-Exceptions.deploy.js +114 -0
  16. data/amber/js/Compiler-Exceptions.js +161 -0
  17. data/amber/js/Compiler-IR.deploy.js +2326 -0
  18. data/amber/js/Compiler-IR.js +3146 -0
  19. data/amber/js/Compiler-Inlining.deploy.js +1147 -0
  20. data/amber/js/Compiler-Inlining.js +1514 -0
  21. data/amber/js/Compiler-Semantic.deploy.js +1207 -0
  22. data/amber/js/Compiler-Semantic.js +1628 -0
  23. data/amber/js/Compiler-Tests.deploy.js +646 -60
  24. data/amber/js/Compiler-Tests.js +843 -82
  25. data/amber/js/Compiler.deploy.js +1097 -159
  26. data/amber/js/Compiler.js +1414 -161
  27. data/amber/js/Examples.deploy.js +31 -15
  28. data/amber/js/Examples.js +33 -17
  29. data/amber/js/Helios-Announcements.deploy.js +127 -0
  30. data/amber/js/Helios-Announcements.js +157 -0
  31. data/amber/js/Helios-Browser.deploy.js +1473 -0
  32. data/amber/js/Helios-Browser.js +1953 -0
  33. data/amber/js/Helios-Commands.deploy.js +403 -0
  34. data/amber/js/Helios-Commands.js +563 -0
  35. data/amber/js/Helios-Core.deploy.js +1070 -0
  36. data/amber/js/Helios-Core.js +1445 -0
  37. data/amber/js/Helios-Environments.deploy.js +132 -0
  38. data/amber/js/Helios-Environments.js +179 -0
  39. data/amber/js/Helios-Inspector.deploy.js +855 -0
  40. data/amber/js/Helios-Inspector.js +1155 -0
  41. data/amber/js/Helios-KeyBindings.deploy.js +753 -0
  42. data/amber/js/Helios-KeyBindings.js +1023 -0
  43. data/amber/js/Helios-Layout.deploy.js +383 -0
  44. data/amber/js/Helios-Layout.js +523 -0
  45. data/amber/js/Helios-Workspace.deploy.js +799 -0
  46. data/amber/js/Helios-Workspace.js +1074 -0
  47. data/amber/js/IDE.deploy.js +2541 -1490
  48. data/amber/js/IDE.js +2721 -1660
  49. data/amber/js/Importer-Exporter.deploy.js +671 -0
  50. data/amber/js/Importer-Exporter.js +816 -0
  51. data/amber/js/Kernel-Announcements.deploy.js +137 -20
  52. data/amber/js/Kernel-Announcements.js +176 -22
  53. data/amber/js/Kernel-Classes.deploy.js +555 -168
  54. data/amber/js/Kernel-Classes.js +662 -205
  55. data/amber/js/Kernel-Collections.deploy.js +1403 -618
  56. data/amber/js/Kernel-Collections.js +1545 -690
  57. data/amber/js/Kernel-Exceptions.deploy.js +109 -45
  58. data/amber/js/Kernel-Exceptions.js +123 -49
  59. data/amber/js/Kernel-Methods.deploy.js +196 -81
  60. data/amber/js/Kernel-Methods.js +214 -89
  61. data/amber/js/Kernel-Objects.deploy.js +1542 -1117
  62. data/amber/js/Kernel-Objects.js +1593 -1148
  63. data/amber/js/Kernel-Tests.deploy.js +1725 -772
  64. data/amber/js/Kernel-Tests.js +2301 -1123
  65. data/amber/js/Kernel-Transcript.deploy.js +23 -25
  66. data/amber/js/Kernel-Transcript.js +24 -26
  67. data/amber/js/SUnit.deploy.js +204 -131
  68. data/amber/js/SUnit.js +222 -139
  69. data/amber/js/Spaces.deploy.js +240 -0
  70. data/amber/js/Spaces.js +326 -0
  71. data/amber/js/amber.js +26 -7
  72. data/amber/js/boot.js +65 -47
  73. data/amber/js/init.js +1 -1
  74. data/amber/js/lib/CodeMirror/amber.css +21 -21
  75. data/amber/js/lib/CodeMirror/codemirror.css +119 -13
  76. data/amber/js/lib/CodeMirror/codemirror.js +2219 -1220
  77. data/amber/js/lib/CodeMirror/smalltalk.js +134 -129
  78. data/amber/js/lib/bootstrap/css/bootstrap.css +5837 -0
  79. data/amber/js/lib/bootstrap/css/bootstrap.min.css +841 -0
  80. data/amber/js/lib/bootstrap/img/glyphicons-halflings-white.png +0 -0
  81. data/amber/js/lib/bootstrap/img/glyphicons-halflings.png +0 -0
  82. data/amber/js/lib/bootstrap/js/bootstrap.js +2038 -0
  83. data/amber/js/lib/bootstrap/js/bootstrap.min.js +7 -0
  84. data/amber/js/lib/jQuery/jquery-1.8.2.min.js +2 -0
  85. data/amber/js/lib/jQuery/jquery-ui-1.8.24.custom.min.js +125 -0
  86. data/amber/st/Compiler-AST.st +505 -0
  87. data/amber/st/Compiler-Core.st +835 -0
  88. data/amber/st/Compiler-Exceptions.st +87 -0
  89. data/amber/st/Compiler-IR.st +1097 -0
  90. data/amber/st/Compiler-Inlining.st +650 -0
  91. data/amber/st/Compiler-Semantic.st +558 -0
  92. data/amber/st/Compiler-Tests.st +285 -381
  93. data/amber/st/Compiler.st +725 -2
  94. data/amber/st/Helios-Announcements.st +104 -0
  95. data/amber/st/Helios-Browser.st +708 -0
  96. data/amber/st/Helios-Commands.st +223 -0
  97. data/amber/st/Helios-Core.st +532 -0
  98. data/amber/st/Helios-Environments.st +98 -0
  99. data/amber/st/Helios-Inspector.st +367 -0
  100. data/amber/st/Helios-KeyBindings.st +337 -0
  101. data/amber/st/Helios-Layout.st +199 -0
  102. data/amber/st/Helios-Workspace.st +367 -0
  103. data/amber/st/IDE.st +75 -53
  104. data/amber/st/Importer-Exporter.st +386 -0
  105. data/amber/st/Kernel-Announcements.st +92 -0
  106. data/amber/st/Kernel-Classes.st +137 -15
  107. data/amber/st/Kernel-Collections.st +137 -47
  108. data/amber/st/Kernel-Exceptions.st +14 -0
  109. data/amber/st/Kernel-Methods.st +9 -1
  110. data/amber/st/Kernel-Objects.st +29 -5
  111. data/amber/st/Kernel-Tests.st +545 -199
  112. data/amber/st/SUnit.st +10 -0
  113. data/amber/st/Spaces.st +142 -0
  114. data/lib/resin/app.rb +1 -1
  115. metadata +86 -31
  116. data/amber/js/lib/jQuery/jquery-1.4.4.min.js +0 -167
  117. data/amber/js/lib/jQuery/jquery-1.6.4.min.js +0 -4
@@ -8,12 +8,19 @@ selector: "addCompiledMethod:",
8
8
  category: 'compiling',
9
9
  fn: function (aMethod){
10
10
  var self=this;
11
+ var $1,$2;
11
12
  smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
12
- return self;},
13
+ ;
14
+ $1=smalltalk.send((smalltalk.MethodAdded || MethodAdded),"_new",[]);
15
+ smalltalk.send($1,"_theClass_",[self]);
16
+ smalltalk.send($1,"_method_",[aMethod]);
17
+ $2=smalltalk.send($1,"_yourself",[]);
18
+ smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$2]);
19
+ return self},
13
20
  args: ["aMethod"],
14
- source: "addCompiledMethod: aMethod\x0a\x09<smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self)>",
15
- messageSends: [],
16
- referencedClasses: []
21
+ source: "addCompiledMethod: aMethod\x0a\x09<smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self)>.\x0a \x0a SystemAnnouncer current\x0a \x09\x09announce: (MethodAdded new\x0a \x09theClass: self;\x0a method: aMethod;\x0a yourself)",
22
+ messageSends: ["announce:", "theClass:", "new", "method:", "yourself", "current"],
23
+ referencedClasses: ["MethodAdded", "SystemAnnouncer"]
17
24
  }),
18
25
  smalltalk.Behavior);
19
26
 
@@ -24,14 +31,20 @@ selector: "allInstanceVariableNames",
24
31
  category: 'accessing',
25
32
  fn: function (){
26
33
  var self=this;
27
- var result=nil;
28
- (result=smalltalk.send(smalltalk.send(self, "_instanceVariableNames", []), "_copy", []));
29
- (($receiver = smalltalk.send(self, "_superclass", [])) != nil && $receiver != undefined) ? (function(){return smalltalk.send(result, "_addAll_", [smalltalk.send(smalltalk.send(self, "_superclass", []), "_allInstanceVariableNames", [])]);})() : nil;
34
+ var $1;
35
+ var result;
36
+ result=smalltalk.send(smalltalk.send(self,"_instanceVariableNames",[]),"_copy",[]);
37
+ $1=smalltalk.send(self,"_superclass",[]);
38
+ if(($receiver = $1) == nil || $receiver == undefined){
39
+ $1;
40
+ } else {
41
+ smalltalk.send(result,"_addAll_",[smalltalk.send(smalltalk.send(self,"_superclass",[]),"_allInstanceVariableNames",[])]);
42
+ };
30
43
  return result;
31
- return self;},
44
+ },
32
45
  args: [],
33
46
  source: "allInstanceVariableNames\x0a\x09| result |\x0a\x09result := self instanceVariableNames copy.\x0a\x09self superclass ifNotNil: [\x0a\x09 result addAll: self superclass allInstanceVariableNames].\x0a\x09^result",
34
- messageSends: ["copy", "instanceVariableNames", "ifNotNil:", "superclass", "addAll:", "allInstanceVariableNames"],
47
+ messageSends: ["copy", "instanceVariableNames", "ifNotNil:", "addAll:", "allInstanceVariableNames", "superclass"],
35
48
  referencedClasses: []
36
49
  }),
37
50
  smalltalk.Behavior);
@@ -43,11 +56,13 @@ selector: "allSubclasses",
43
56
  category: 'accessing',
44
57
  fn: function (){
45
58
  var self=this;
46
- var result=nil;
47
- (result=smalltalk.send(self, "_subclasses", []));
48
- smalltalk.send(smalltalk.send(self, "_subclasses", []), "_do_", [(function(each){return smalltalk.send(result, "_addAll_", [smalltalk.send(each, "_allSubclasses", [])]);})]);
59
+ var result;
60
+ result=smalltalk.send(self,"_subclasses",[]);
61
+ smalltalk.send(smalltalk.send(self,"_subclasses",[]),"_do_",[(function(each){
62
+ return smalltalk.send(result,"_addAll_",[smalltalk.send(each,"_allSubclasses",[])]);
63
+ })]);
49
64
  return result;
50
- return self;},
65
+ },
51
66
  args: [],
52
67
  source: "allSubclasses\x0a\x09| result |\x0a\x09result := self subclasses.\x0a\x09self subclasses do: [:each |\x0a\x09 result addAll: each allSubclasses].\x0a\x09^result",
53
68
  messageSends: ["subclasses", "do:", "addAll:", "allSubclasses"],
@@ -55,6 +70,33 @@ referencedClasses: []
55
70
  }),
56
71
  smalltalk.Behavior);
57
72
 
73
+ smalltalk.addMethod(
74
+ "_allSuperclasses",
75
+ smalltalk.method({
76
+ selector: "allSuperclasses",
77
+ category: 'accessing',
78
+ fn: function (){
79
+ var self=this;
80
+ var $1,$3,$4,$2;
81
+ $1=smalltalk.send(self,"_superclass",[]);
82
+ if(($receiver = $1) == nil || $receiver == undefined){
83
+ return [];
84
+ } else {
85
+ $1;
86
+ };
87
+ $3=smalltalk.send((smalltalk.OrderedCollection || OrderedCollection),"_with_",[smalltalk.send(self,"_superclass",[])]);
88
+ smalltalk.send($3,"_addAll_",[smalltalk.send(smalltalk.send(self,"_superclass",[]),"_allSuperclasses",[])]);
89
+ $4=smalltalk.send($3,"_yourself",[]);
90
+ $2=$4;
91
+ return $2;
92
+ },
93
+ args: [],
94
+ source: "allSuperclasses\x0a\x09\x0a self superclass ifNil: [ ^ #() ].\x0a \x0a\x09^ (OrderedCollection with: self superclass) \x0a \x09addAll: self superclass allSuperclasses;\x0a yourself",
95
+ messageSends: ["ifNil:", "superclass", "addAll:", "allSuperclasses", "with:", "yourself"],
96
+ referencedClasses: ["OrderedCollection"]
97
+ }),
98
+ smalltalk.Behavior);
99
+
58
100
  smalltalk.addMethod(
59
101
  "_basicNew",
60
102
  smalltalk.method({
@@ -63,7 +105,8 @@ category: 'instance creation',
63
105
  fn: function (){
64
106
  var self=this;
65
107
  return new self.fn();
66
- return self;},
108
+ ;
109
+ return self},
67
110
  args: [],
68
111
  source: "basicNew\x0a\x09<return new self.fn()>",
69
112
  messageSends: [],
@@ -78,11 +121,17 @@ selector: "canUnderstand:",
78
121
  category: 'testing',
79
122
  fn: function (aSelector){
80
123
  var self=this;
81
- return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_keys", []), "_includes_", [smalltalk.send(aSelector, "_asString", [])]), "_or_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_superclass", []), "_notNil", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_superclass", []), "_canUnderstand_", [aSelector]);})]);})]);
82
- return self;},
124
+ var $1;
125
+ $1=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self,"_methodDictionary",[]),"_keys",[]),"_includes_",[smalltalk.send(aSelector,"_asString",[])]),"_or_",[(function(){
126
+ return smalltalk.send(smalltalk.send(smalltalk.send(self,"_superclass",[]),"_notNil",[]),"_and_",[(function(){
127
+ return smalltalk.send(smalltalk.send(self,"_superclass",[]),"_canUnderstand_",[aSelector]);
128
+ })]);
129
+ })]);
130
+ return $1;
131
+ },
83
132
  args: ["aSelector"],
84
133
  source: "canUnderstand: aSelector\x0a\x09^(self methodDictionary keys includes: aSelector asString) or: [\x0a\x09\x09self superclass notNil and: [self superclass canUnderstand: aSelector]]",
85
- messageSends: ["or:", "includes:", "keys", "methodDictionary", "asString", "and:", "notNil", "superclass", "canUnderstand:"],
134
+ messageSends: ["or:", "and:", "canUnderstand:", "superclass", "notNil", "includes:", "asString", "keys", "methodDictionary"],
86
135
  referencedClasses: []
87
136
  }),
88
137
  smalltalk.Behavior);
@@ -94,8 +143,15 @@ selector: "comment",
94
143
  category: 'accessing',
95
144
  fn: function (){
96
145
  var self=this;
97
- return (($receiver = smalltalk.send(self, "_basicAt_", ["comment"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
98
- return self;},
146
+ var $2,$1;
147
+ $2=smalltalk.send(self,"_basicAt_",["comment"]);
148
+ if(($receiver = $2) == nil || $receiver == undefined){
149
+ $1="";
150
+ } else {
151
+ $1=$2;
152
+ };
153
+ return $1;
154
+ },
99
155
  args: [],
100
156
  source: "comment\x0a ^(self basicAt: 'comment') ifNil: ['']",
101
157
  messageSends: ["ifNil:", "basicAt:"],
@@ -110,12 +166,17 @@ selector: "comment:",
110
166
  category: 'accessing',
111
167
  fn: function (aString){
112
168
  var self=this;
113
- smalltalk.send(self, "_basicAt_put_", ["comment", aString]);
114
- return self;},
169
+ var $1,$2;
170
+ smalltalk.send(self,"_basicAt_put_",["comment",aString]);
171
+ $1=smalltalk.send((smalltalk.ClassCommentChanged || ClassCommentChanged),"_new",[]);
172
+ smalltalk.send($1,"_theClass_",[self]);
173
+ $2=smalltalk.send($1,"_yourself",[]);
174
+ smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$2]);
175
+ return self},
115
176
  args: ["aString"],
116
- source: "comment: aString\x0a self basicAt: 'comment' put: aString",
117
- messageSends: ["basicAt:put:"],
118
- referencedClasses: []
177
+ source: "comment: aString\x0a self basicAt: 'comment' put: aString.\x0a SystemAnnouncer current\x0a \x09announce: (ClassCommentChanged new\x0a \x09theClass: self;\x0a yourself)",
178
+ messageSends: ["basicAt:put:", "announce:", "theClass:", "new", "yourself", "current"],
179
+ referencedClasses: ["ClassCommentChanged", "SystemAnnouncer"]
119
180
  }),
120
181
  smalltalk.Behavior);
121
182
 
@@ -126,11 +187,16 @@ selector: "commentStamp",
126
187
  category: 'accessing',
127
188
  fn: function (){
128
189
  var self=this;
129
- return (function($rec){smalltalk.send($rec, "_class_", [self]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCommentReader || ClassCommentReader), "_new", []));
130
- return self;},
190
+ var $2,$3,$1;
191
+ $2=smalltalk.send((smalltalk.ClassCommentReader || ClassCommentReader),"_new",[]);
192
+ smalltalk.send($2,"_class_",[self]);
193
+ $3=smalltalk.send($2,"_yourself",[]);
194
+ $1=$3;
195
+ return $1;
196
+ },
131
197
  args: [],
132
198
  source: "commentStamp\x0a ^ClassCommentReader new\x0a\x09class: self;\x0a\x09yourself",
133
- messageSends: ["class:", "yourself", "new"],
199
+ messageSends: ["class:", "new", "yourself"],
134
200
  referencedClasses: ["ClassCommentReader"]
135
201
  }),
136
202
  smalltalk.Behavior);
@@ -140,10 +206,12 @@ smalltalk.addMethod(
140
206
  smalltalk.method({
141
207
  selector: "commentStamp:prior:",
142
208
  category: 'accessing',
143
- fn: function (aStamp, prior){
209
+ fn: function (aStamp,prior){
144
210
  var self=this;
145
- return smalltalk.send(self, "_commentStamp", []);
146
- return self;},
211
+ var $1;
212
+ $1=smalltalk.send(self,"_commentStamp",[]);
213
+ return $1;
214
+ },
147
215
  args: ["aStamp", "prior"],
148
216
  source: "commentStamp: aStamp prior: prior\x0a ^self commentStamp",
149
217
  messageSends: ["commentStamp"],
@@ -158,8 +226,8 @@ selector: "compile:",
158
226
  category: 'compiling',
159
227
  fn: function (aString){
160
228
  var self=this;
161
- smalltalk.send(self, "_compile_category_", [aString, ""]);
162
- return self;},
229
+ smalltalk.send(self,"_compile_category_",[aString,""]);
230
+ return self},
163
231
  args: ["aString"],
164
232
  source: "compile: aString\x0a\x09self compile: aString category: ''",
165
233
  messageSends: ["compile:category:"],
@@ -172,17 +240,33 @@ smalltalk.addMethod(
172
240
  smalltalk.method({
173
241
  selector: "compile:category:",
174
242
  category: 'compiling',
175
- fn: function (aString, anotherString){
243
+ fn: function (aString,anotherString){
176
244
  var self=this;
177
- (function($rec){smalltalk.send($rec, "_install_forClass_category_", [aString, self, anotherString]);return smalltalk.send($rec, "_setupClass_", [self]);})(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []));
178
- return self;},
245
+ smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler),"_new",[]),"_install_forClass_category_",[aString,self,anotherString]);
246
+ return self},
179
247
  args: ["aString", "anotherString"],
180
- source: "compile: aString category: anotherString\x0a\x09Compiler new\x0a\x09\x09install: aString forClass: self category: anotherString;\x0a\x09\x09setupClass: self",
181
- messageSends: ["install:forClass:category:", "setupClass:", "new"],
248
+ source: "compile: aString category: anotherString\x0a\x09Compiler new\x0a\x09\x09install: aString \x0a forClass: self \x0a category: anotherString",
249
+ messageSends: ["install:forClass:category:", "new"],
182
250
  referencedClasses: ["Compiler"]
183
251
  }),
184
252
  smalltalk.Behavior);
185
253
 
254
+ smalltalk.addMethod(
255
+ "_definition",
256
+ smalltalk.method({
257
+ selector: "definition",
258
+ category: 'accessing',
259
+ fn: function (){
260
+ var self=this;
261
+ return "";
262
+ },
263
+ args: [],
264
+ source: "definition\x0a\x09^ ''",
265
+ messageSends: [],
266
+ referencedClasses: []
267
+ }),
268
+ smalltalk.Behavior);
269
+
186
270
  smalltalk.addMethod(
187
271
  "_inheritsFrom_",
188
272
  smalltalk.method({
@@ -190,8 +274,10 @@ selector: "inheritsFrom:",
190
274
  category: 'testing',
191
275
  fn: function (aClass){
192
276
  var self=this;
193
- return smalltalk.send(smalltalk.send(aClass, "_allSubclasses", []), "_includes_", [self]);
194
- return self;},
277
+ var $1;
278
+ $1=smalltalk.send(smalltalk.send(aClass,"_allSubclasses",[]),"_includes_",[self]);
279
+ return $1;
280
+ },
195
281
  args: ["aClass"],
196
282
  source: "inheritsFrom: aClass\x0a\x09^aClass allSubclasses includes: self",
197
283
  messageSends: ["includes:", "allSubclasses"],
@@ -207,7 +293,8 @@ category: 'accessing',
207
293
  fn: function (){
208
294
  var self=this;
209
295
  return self.iVarNames;
210
- return self;},
296
+ ;
297
+ return self},
211
298
  args: [],
212
299
  source: "instanceVariableNames\x0a\x09<return self.iVarNames>",
213
300
  messageSends: [],
@@ -220,12 +307,13 @@ smalltalk.addMethod(
220
307
  smalltalk.method({
221
308
  selector: "methodAt:",
222
309
  category: 'accessing',
223
- fn: function (aString){
310
+ fn: function (aSymbol){
224
311
  var self=this;
225
- return smalltalk.methods(self)[aString];
226
- return self;},
227
- args: ["aString"],
228
- source: "methodAt: aString\x0a\x09<return smalltalk.methods(self)[aString]>",
312
+ return smalltalk.methods(self)[aSymbol._asString()];
313
+ ;
314
+ return self},
315
+ args: ["aSymbol"],
316
+ source: "methodAt: aSymbol\x0a\x09<return smalltalk.methods(self)[aSymbol._asString()]>",
229
317
  messageSends: [],
230
318
  referencedClasses: []
231
319
  }),
@@ -246,7 +334,8 @@ var dict = smalltalk.HashedCollection._new();
246
334
  }
247
335
  };
248
336
  return dict;
249
- return self;},
337
+ ;
338
+ return self},
250
339
  args: [],
251
340
  source: "methodDictionary\x0a\x09<var dict = smalltalk.HashedCollection._new();\x0a\x09var methods = self.fn.prototype.methods;\x0a\x09for(var i in methods) {\x0a\x09\x09if(methods[i].selector) {\x0a\x09\x09\x09dict._at_put_(methods[i].selector, methods[i]);\x0a\x09\x09}\x0a\x09};\x0a\x09return dict>",
252
341
  messageSends: [],
@@ -254,6 +343,24 @@ referencedClasses: []
254
343
  }),
255
344
  smalltalk.Behavior);
256
345
 
346
+ smalltalk.addMethod(
347
+ "_methods",
348
+ smalltalk.method({
349
+ selector: "methods",
350
+ category: 'accessing',
351
+ fn: function (){
352
+ var self=this;
353
+ var $1;
354
+ $1=smalltalk.send(smalltalk.send(self,"_methodDictionary",[]),"_values",[]);
355
+ return $1;
356
+ },
357
+ args: [],
358
+ source: "methods\x0a\x09^ self methodDictionary values",
359
+ messageSends: ["values", "methodDictionary"],
360
+ referencedClasses: []
361
+ }),
362
+ smalltalk.Behavior);
363
+
257
364
  smalltalk.addMethod(
258
365
  "_methodsFor_",
259
366
  smalltalk.method({
@@ -261,11 +368,16 @@ selector: "methodsFor:",
261
368
  category: 'accessing',
262
369
  fn: function (aString){
263
370
  var self=this;
264
- return (function($rec){smalltalk.send($rec, "_class_category_", [self, aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCategoryReader || ClassCategoryReader), "_new", []));
265
- return self;},
371
+ var $2,$3,$1;
372
+ $2=smalltalk.send((smalltalk.ClassCategoryReader || ClassCategoryReader),"_new",[]);
373
+ smalltalk.send($2,"_class_category_",[self,aString]);
374
+ $3=smalltalk.send($2,"_yourself",[]);
375
+ $1=$3;
376
+ return $1;
377
+ },
266
378
  args: ["aString"],
267
379
  source: "methodsFor: aString\x0a\x09^ClassCategoryReader new\x0a\x09 class: self category: aString;\x0a\x09 yourself",
268
- messageSends: ["class:category:", "yourself", "new"],
380
+ messageSends: ["class:category:", "new", "yourself"],
269
381
  referencedClasses: ["ClassCategoryReader"]
270
382
  }),
271
383
  smalltalk.Behavior);
@@ -275,10 +387,12 @@ smalltalk.addMethod(
275
387
  smalltalk.method({
276
388
  selector: "methodsFor:stamp:",
277
389
  category: 'accessing',
278
- fn: function (aString, aStamp){
390
+ fn: function (aString,aStamp){
279
391
  var self=this;
280
- return smalltalk.send(self, "_methodsFor_", [aString]);
281
- return self;},
392
+ var $1;
393
+ $1=smalltalk.send(self,"_methodsFor_",[aString]);
394
+ return $1;
395
+ },
282
396
  args: ["aString", "aStamp"],
283
397
  source: "methodsFor: aString stamp: aStamp\x0a\x09\x22Added for compatibility, right now ignores stamp.\x22\x0a\x09^self methodsFor: aString",
284
398
  messageSends: ["methodsFor:"],
@@ -286,6 +400,26 @@ referencedClasses: []
286
400
  }),
287
401
  smalltalk.Behavior);
288
402
 
403
+ smalltalk.addMethod(
404
+ "_methodsInProtocol_",
405
+ smalltalk.method({
406
+ selector: "methodsInProtocol:",
407
+ category: 'accessing',
408
+ fn: function (aString){
409
+ var self=this;
410
+ var $1;
411
+ $1=smalltalk.send(smalltalk.send(smalltalk.send(self,"_methodDictionary",[]),"_values",[]),"_select_",[(function(each){
412
+ return smalltalk.send(smalltalk.send(each,"_protocol",[]),"__eq",[aString]);
413
+ })]);
414
+ return $1;
415
+ },
416
+ args: ["aString"],
417
+ source: "methodsInProtocol: aString\x0a\x09^ self methodDictionary values select: [ :each | each protocol = aString ]",
418
+ messageSends: ["select:", "=", "protocol", "values", "methodDictionary"],
419
+ referencedClasses: []
420
+ }),
421
+ smalltalk.Behavior);
422
+
289
423
  smalltalk.addMethod(
290
424
  "_name",
291
425
  smalltalk.method({
@@ -294,7 +428,8 @@ category: 'accessing',
294
428
  fn: function (){
295
429
  var self=this;
296
430
  return self.className || nil;
297
- return self;},
431
+ ;
432
+ return self},
298
433
  args: [],
299
434
  source: "name\x0a\x09<return self.className || nil>",
300
435
  messageSends: [],
@@ -309,8 +444,10 @@ selector: "new",
309
444
  category: 'instance creation',
310
445
  fn: function (){
311
446
  var self=this;
312
- return smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
313
- return self;},
447
+ var $1;
448
+ $1=smalltalk.send(smalltalk.send(self,"_basicNew",[]),"_initialize",[]);
449
+ return $1;
450
+ },
314
451
  args: [],
315
452
  source: "new\x0a\x09^self basicNew initialize",
316
453
  messageSends: ["initialize", "basicNew"],
@@ -325,14 +462,21 @@ selector: "protocols",
325
462
  category: 'accessing',
326
463
  fn: function (){
327
464
  var self=this;
328
- var protocols=nil;
329
- (protocols=smalltalk.send((smalltalk.Array || Array), "_new", []));
330
- smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_do_", [(function(each){return ((($receiver = smalltalk.send(protocols, "_includes_", [smalltalk.send(each, "_category", [])])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(protocols, "_add_", [smalltalk.send(each, "_category", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(protocols, "_add_", [smalltalk.send(each, "_category", [])]);})]));})]);
331
- return smalltalk.send(protocols, "_sort", []);
332
- return self;},
465
+ var $1,$2;
466
+ var protocols;
467
+ protocols=smalltalk.send((smalltalk.Array || Array),"_new",[]);
468
+ smalltalk.send(smalltalk.send(self,"_methodDictionary",[]),"_do_",[(function(each){
469
+ $1=smalltalk.send(protocols,"_includes_",[smalltalk.send(each,"_category",[])]);
470
+ if(! smalltalk.assert($1)){
471
+ return smalltalk.send(protocols,"_add_",[smalltalk.send(each,"_category",[])]);
472
+ };
473
+ })]);
474
+ $2=smalltalk.send(protocols,"_sort",[]);
475
+ return $2;
476
+ },
333
477
  args: [],
334
478
  source: "protocols\x0a | protocols |\x0a protocols := Array new.\x0a self methodDictionary do: [:each |\x0a\x09 (protocols includes: each category) ifFalse: [\x0a\x09\x09protocols add: each category]].\x0a ^protocols sort",
335
- messageSends: ["new", "do:", "methodDictionary", "ifFalse:", "includes:", "category", "add:", "sort"],
479
+ messageSends: ["new", "do:", "ifFalse:", "add:", "category", "includes:", "methodDictionary", "sort"],
336
480
  referencedClasses: ["Array"]
337
481
  }),
338
482
  smalltalk.Behavior);
@@ -344,14 +488,20 @@ selector: "protocolsDo:",
344
488
  category: 'accessing',
345
489
  fn: function (aBlock){
346
490
  var self=this;
347
- var methodsByCategory=nil;
348
- (methodsByCategory=smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_new", []));
349
- smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_values", []), "_do_", [(function(m){return smalltalk.send(smalltalk.send(methodsByCategory, "_at_ifAbsentPut_", [smalltalk.send(m, "_category", []), (function(){return smalltalk.send((smalltalk.Array || Array), "_new", []);})]), "_add_", [m]);})]);
350
- smalltalk.send(smalltalk.send(self, "_protocols", []), "_do_", [(function(category){return smalltalk.send(aBlock, "_value_value_", [category, smalltalk.send(methodsByCategory, "_at_", [category])]);})]);
351
- return self;},
491
+ var methodsByCategory;
492
+ methodsByCategory=smalltalk.send((smalltalk.HashedCollection || HashedCollection),"_new",[]);
493
+ smalltalk.send(smalltalk.send(smalltalk.send(self,"_methodDictionary",[]),"_values",[]),"_do_",[(function(m){
494
+ return smalltalk.send(smalltalk.send(methodsByCategory,"_at_ifAbsentPut_",[smalltalk.send(m,"_category",[]),(function(){
495
+ return smalltalk.send((smalltalk.Array || Array),"_new",[]);
496
+ })]),"_add_",[m]);
497
+ })]);
498
+ smalltalk.send(smalltalk.send(self,"_protocols",[]),"_do_",[(function(category){
499
+ return smalltalk.send(aBlock,"_value_value_",[category,smalltalk.send(methodsByCategory,"_at_",[category])]);
500
+ })]);
501
+ return self},
352
502
  args: ["aBlock"],
353
503
  source: "protocolsDo: aBlock\x0a\x09\x22Execute aBlock for each method category with\x0a\x09its collection of methods in the sort order of category name.\x22\x0a\x0a\x09| methodsByCategory |\x0a\x09methodsByCategory := HashedCollection new.\x0a\x09self methodDictionary values do: [:m |\x0a\x09\x09(methodsByCategory at: m category ifAbsentPut: [Array new])\x0a \x09\x09\x09add: m]. \x0a\x09self protocols do: [:category |\x0a\x09\x09aBlock value: category value: (methodsByCategory at: category)]",
354
- messageSends: ["new", "do:", "values", "methodDictionary", "add:", "at:ifAbsentPut:", "category", "protocols", "value:value:", "at:"],
504
+ messageSends: ["new", "do:", "add:", "at:ifAbsentPut:", "category", "values", "methodDictionary", "value:value:", "at:", "protocols"],
355
505
  referencedClasses: ["HashedCollection", "Array"]
356
506
  }),
357
507
  smalltalk.Behavior);
@@ -364,7 +514,8 @@ category: 'accessing',
364
514
  fn: function (){
365
515
  var self=this;
366
516
  return self.fn.prototype;
367
- return self;},
517
+ ;
518
+ return self},
368
519
  args: [],
369
520
  source: "prototype\x0a\x09<return self.fn.prototype>",
370
521
  messageSends: [],
@@ -379,13 +530,38 @@ selector: "removeCompiledMethod:",
379
530
  category: 'compiling',
380
531
  fn: function (aMethod){
381
532
  var self=this;
533
+ var $1,$2;
382
534
  delete self.fn.prototype[aMethod.selector._asSelector()];
383
535
  delete self.fn.prototype.methods[aMethod.selector];
384
536
  smalltalk.init(self);;
385
- return self;},
537
+ ;
538
+ $1=smalltalk.send((smalltalk.MethodRemoved || MethodRemoved),"_new",[]);
539
+ smalltalk.send($1,"_theClass_",[self]);
540
+ smalltalk.send($1,"_method_",[aMethod]);
541
+ $2=smalltalk.send($1,"_yourself",[]);
542
+ smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$2]);
543
+ return self},
386
544
  args: ["aMethod"],
387
- source: "removeCompiledMethod: aMethod\x0a\x09<delete self.fn.prototype[aMethod.selector._asSelector()];\x0a\x09delete self.fn.prototype.methods[aMethod.selector];\x0a\x09smalltalk.init(self);>",
388
- messageSends: [],
545
+ source: "removeCompiledMethod: aMethod\x0a\x09<delete self.fn.prototype[aMethod.selector._asSelector()];\x0a\x09delete self.fn.prototype.methods[aMethod.selector];\x0a\x09smalltalk.init(self);>.\x0a \x0a SystemAnnouncer current\x0a \x09\x09announce: (MethodRemoved new\x0a \x09theClass: self;\x0a method: aMethod;\x0a yourself)",
546
+ messageSends: ["announce:", "theClass:", "new", "method:", "yourself", "current"],
547
+ referencedClasses: ["MethodRemoved", "SystemAnnouncer"]
548
+ }),
549
+ smalltalk.Behavior);
550
+
551
+ smalltalk.addMethod(
552
+ "_selectors",
553
+ smalltalk.method({
554
+ selector: "selectors",
555
+ category: 'accessing',
556
+ fn: function (){
557
+ var self=this;
558
+ var $1;
559
+ $1=smalltalk.send(smalltalk.send(self,"_methodDictionary",[]),"_keys",[]);
560
+ return $1;
561
+ },
562
+ args: [],
563
+ source: "selectors\x0a\x09^ self methodDictionary keys",
564
+ messageSends: ["keys", "methodDictionary"],
389
565
  referencedClasses: []
390
566
  }),
391
567
  smalltalk.Behavior);
@@ -398,7 +574,8 @@ category: 'accessing',
398
574
  fn: function (){
399
575
  var self=this;
400
576
  return smalltalk.subclasses(self);
401
- return self;},
577
+ ;
578
+ return self},
402
579
  args: [],
403
580
  source: "subclasses\x0a\x09<return smalltalk.subclasses(self)>",
404
581
  messageSends: [],
@@ -414,7 +591,8 @@ category: 'accessing',
414
591
  fn: function (){
415
592
  var self=this;
416
593
  return self.superclass || nil;
417
- return self;},
594
+ ;
595
+ return self},
418
596
  args: [],
419
597
  source: "superclass\x0a\x09<return self.superclass || nil>",
420
598
  messageSends: [],
@@ -422,6 +600,40 @@ referencedClasses: []
422
600
  }),
423
601
  smalltalk.Behavior);
424
602
 
603
+ smalltalk.addMethod(
604
+ "_theMetaClass",
605
+ smalltalk.method({
606
+ selector: "theMetaClass",
607
+ category: 'accessing',
608
+ fn: function (){
609
+ var self=this;
610
+ var $1;
611
+ $1=smalltalk.send(self,"_class",[]);
612
+ return $1;
613
+ },
614
+ args: [],
615
+ source: "theMetaClass\x0a\x09^ self class",
616
+ messageSends: ["class"],
617
+ referencedClasses: []
618
+ }),
619
+ smalltalk.Behavior);
620
+
621
+ smalltalk.addMethod(
622
+ "_theNonMetaClass",
623
+ smalltalk.method({
624
+ selector: "theNonMetaClass",
625
+ category: 'accessing',
626
+ fn: function (){
627
+ var self=this;
628
+ return self;
629
+ },
630
+ args: [],
631
+ source: "theNonMetaClass\x0a\x09^ self",
632
+ messageSends: [],
633
+ referencedClasses: []
634
+ }),
635
+ smalltalk.Behavior);
636
+
425
637
  smalltalk.addMethod(
426
638
  "_withAllSubclasses",
427
639
  smalltalk.method({
@@ -429,11 +641,16 @@ selector: "withAllSubclasses",
429
641
  category: 'accessing',
430
642
  fn: function (){
431
643
  var self=this;
432
- return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_allSubclasses", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Array || Array), "_with_", [self]));
433
- return self;},
644
+ var $2,$3,$1;
645
+ $2=smalltalk.send((smalltalk.Array || Array),"_with_",[self]);
646
+ smalltalk.send($2,"_addAll_",[smalltalk.send(self,"_allSubclasses",[])]);
647
+ $3=smalltalk.send($2,"_yourself",[]);
648
+ $1=$3;
649
+ return $1;
650
+ },
434
651
  args: [],
435
652
  source: "withAllSubclasses\x0a\x09^(Array with: self) addAll: self allSubclasses; yourself",
436
- messageSends: ["addAll:", "allSubclasses", "yourself", "with:"],
653
+ messageSends: ["addAll:", "allSubclasses", "with:", "yourself"],
437
654
  referencedClasses: ["Array"]
438
655
  }),
439
656
  smalltalk.Behavior);
@@ -442,6 +659,24 @@ smalltalk.Behavior);
442
659
 
443
660
  smalltalk.addClass('Class', smalltalk.Behavior, [], 'Kernel-Classes');
444
661
  smalltalk.Class.comment="Class is __the__ class object. \x0a\x0aInstances are the classes of the system.\x0aClass creation is done throught a `ClassBuilder`"
662
+ smalltalk.addMethod(
663
+ "_asJavascript",
664
+ smalltalk.method({
665
+ selector: "asJavascript",
666
+ category: 'converting',
667
+ fn: function (){
668
+ var self=this;
669
+ var $1;
670
+ $1=smalltalk.send("smalltalk.","__comma",[smalltalk.send(self,"_name",[])]);
671
+ return $1;
672
+ },
673
+ args: [],
674
+ source: "asJavascript\x0a\x09^ 'smalltalk.', self name",
675
+ messageSends: [",", "name"],
676
+ referencedClasses: []
677
+ }),
678
+ smalltalk.Class);
679
+
445
680
  smalltalk.addMethod(
446
681
  "_category",
447
682
  smalltalk.method({
@@ -449,15 +684,57 @@ selector: "category",
449
684
  category: 'accessing',
450
685
  fn: function (){
451
686
  var self=this;
452
- return (($receiver = smalltalk.send(self, "_package", [])) == nil || $receiver == undefined) ? (function(){return "Unclassified";})() : (function(){return smalltalk.send(smalltalk.send(self, "_package", []), "_name", []);})();
453
- return self;},
687
+ var $2,$1;
688
+ $2=smalltalk.send(self,"_package",[]);
689
+ if(($receiver = $2) == nil || $receiver == undefined){
690
+ $1="Unclassified";
691
+ } else {
692
+ $1=smalltalk.send(smalltalk.send(self,"_package",[]),"_name",[]);
693
+ };
694
+ return $1;
695
+ },
454
696
  args: [],
455
697
  source: "category\x0a\x09^self package ifNil: ['Unclassified'] ifNotNil: [self package name]",
456
- messageSends: ["ifNil:ifNotNil:", "package", "name"],
698
+ messageSends: ["ifNil:ifNotNil:", "name", "package"],
457
699
  referencedClasses: []
458
700
  }),
459
701
  smalltalk.Class);
460
702
 
703
+ smalltalk.addMethod(
704
+ "_definition",
705
+ smalltalk.method({
706
+ selector: "definition",
707
+ category: 'accessing',
708
+ fn: function (){
709
+ var self=this;
710
+ var $2,$3,$1;
711
+ $1=smalltalk.send((smalltalk.String || String),"_streamContents_",[(function(stream){
712
+ smalltalk.send(stream,"_nextPutAll_",[smalltalk.send(smalltalk.send(self,"_superclass",[]),"_asString",[])]);
713
+ smalltalk.send(stream,"_nextPutAll_",[" subclass: #"]);
714
+ smalltalk.send(stream,"_nextPutAll_",[smalltalk.send(self,"_name",[])]);
715
+ smalltalk.send(stream,"_nextPutAll_",[smalltalk.send(smalltalk.send((smalltalk.String || String),"_lf",[]),"__comma",[smalltalk.send((smalltalk.String || String),"_tab",[])])]);
716
+ $2=smalltalk.send(stream,"_nextPutAll_",["instanceVariableNames: '"]);
717
+ $2;
718
+ smalltalk.send(smalltalk.send(self,"_instanceVariableNames",[]),"_do_separatedBy_",[(function(each){
719
+ return smalltalk.send(stream,"_nextPutAll_",[each]);
720
+ }),(function(){
721
+ return smalltalk.send(stream,"_nextPutAll_",[" "]);
722
+ })]);
723
+ smalltalk.send(stream,"_nextPutAll_",[smalltalk.send(smalltalk.send("'","__comma",[smalltalk.send((smalltalk.String || String),"_lf",[])]),"__comma",[smalltalk.send((smalltalk.String || String),"_tab",[])])]);
724
+ smalltalk.send(stream,"_nextPutAll_",["package: '"]);
725
+ smalltalk.send(stream,"_nextPutAll_",[smalltalk.send(self,"_category",[])]);
726
+ $3=smalltalk.send(stream,"_nextPutAll_",["'"]);
727
+ return $3;
728
+ })]);
729
+ return $1;
730
+ },
731
+ args: [],
732
+ source: "definition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09 \x09nextPutAll: self superclass asString;\x0a\x09 \x09nextPutAll: ' subclass: #';\x0a\x09 \x09nextPutAll: self name;\x0a\x09 \x09nextPutAll: String lf, String tab;\x0a\x09 \x09nextPutAll: 'instanceVariableNames: '''.\x0a\x09\x09self instanceVariableNames \x0a \x09do: [ :each | stream nextPutAll: each ] \x0a\x09 \x09separatedBy: [ stream nextPutAll: ' ' ].\x0a\x09\x09stream\x0a\x09 \x09nextPutAll: '''', String lf, String tab;\x0a\x09 \x09nextPutAll: 'package: ''';\x0a\x09 \x09nextPutAll: self category;\x0a\x09 \x09nextPutAll: '''' ]",
733
+ messageSends: ["streamContents:", "nextPutAll:", "asString", "superclass", "name", ",", "tab", "lf", "do:separatedBy:", "instanceVariableNames", "category"],
734
+ referencedClasses: ["String"]
735
+ }),
736
+ smalltalk.Class);
737
+
461
738
  smalltalk.addMethod(
462
739
  "_isClass",
463
740
  smalltalk.method({
@@ -466,7 +743,7 @@ category: 'testing',
466
743
  fn: function (){
467
744
  var self=this;
468
745
  return true;
469
- return self;},
746
+ },
470
747
  args: [],
471
748
  source: "isClass\x0a\x09^true",
472
749
  messageSends: [],
@@ -482,7 +759,8 @@ category: 'accessing',
482
759
  fn: function (){
483
760
  var self=this;
484
761
  return self.pkg;
485
- return self;},
762
+ ;
763
+ return self},
486
764
  args: [],
487
765
  source: "package\x0a\x09<return self.pkg>",
488
766
  messageSends: [],
@@ -498,7 +776,8 @@ category: 'accessing',
498
776
  fn: function (aPackage){
499
777
  var self=this;
500
778
  self.pkg = aPackage;
501
- return self;},
779
+ ;
780
+ return self},
502
781
  args: ["aPackage"],
503
782
  source: "package: aPackage\x0a\x09<self.pkg = aPackage>",
504
783
  messageSends: [],
@@ -513,8 +792,10 @@ selector: "printString",
513
792
  category: 'printing',
514
793
  fn: function (){
515
794
  var self=this;
516
- return smalltalk.send(self, "_name", []);
517
- return self;},
795
+ var $1;
796
+ $1=smalltalk.send(self,"_name",[]);
797
+ return $1;
798
+ },
518
799
  args: [],
519
800
  source: "printString\x0a\x09^self name",
520
801
  messageSends: ["name"],
@@ -529,16 +810,12 @@ selector: "rename:",
529
810
  category: 'accessing',
530
811
  fn: function (aString){
531
812
  var self=this;
532
-
533
- smalltalk[aString] = self;
534
- delete smalltalk[self.className];
535
- self.className = aString;
536
- ;
537
- return self;},
813
+ smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder),"_new",[]),"_renameClass_to_",[self,aString]);
814
+ return self},
538
815
  args: ["aString"],
539
- source: "rename: aString\x0a\x09<\x0a\x09\x09smalltalk[aString] = self;\x0a\x09\x09delete smalltalk[self.className];\x0a\x09\x09self.className = aString;\x0a\x09>",
540
- messageSends: [],
541
- referencedClasses: []
816
+ source: "rename: aString\x0a\x09ClassBuilder new renameClass: self to: aString",
817
+ messageSends: ["renameClass:to:", "new"],
818
+ referencedClasses: ["ClassBuilder"]
542
819
  }),
543
820
  smalltalk.Class);
544
821
 
@@ -547,10 +824,12 @@ smalltalk.addMethod(
547
824
  smalltalk.method({
548
825
  selector: "subclass:instanceVariableNames:",
549
826
  category: 'class creation',
550
- fn: function (aString, anotherString){
827
+ fn: function (aString,anotherString){
551
828
  var self=this;
552
- return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
553
- return self;},
829
+ var $1;
830
+ $1=smalltalk.send(self,"_subclass_instanceVariableNames_package_",[aString,anotherString,nil]);
831
+ return $1;
832
+ },
554
833
  args: ["aString", "anotherString"],
555
834
  source: "subclass: aString instanceVariableNames: anotherString\x0a\x09\x22Kept for compatibility.\x22\x0a\x09^self subclass: aString instanceVariableNames: anotherString package: nil",
556
835
  messageSends: ["subclass:instanceVariableNames:package:"],
@@ -563,11 +842,13 @@ smalltalk.addMethod(
563
842
  smalltalk.method({
564
843
  selector: "subclass:instanceVariableNames:category:",
565
844
  category: 'class creation',
566
- fn: function (aString, aString2, aString3){
845
+ fn: function (aString,aString2,aString3){
567
846
  var self=this;
568
- smalltalk.send(self, "_deprecatedAPI", []);
569
- return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
570
- return self;},
847
+ var $1;
848
+ smalltalk.send(self,"_deprecatedAPI",[]);
849
+ $1=smalltalk.send(self,"_subclass_instanceVariableNames_package_",[aString,aString2,aString3]);
850
+ return $1;
851
+ },
571
852
  args: ["aString", "aString2", "aString3"],
572
853
  source: "subclass: aString instanceVariableNames: aString2 category: aString3\x0a\x09\x22Kept for compatibility.\x22\x0a\x09self deprecatedAPI.\x0a\x09^self subclass: aString instanceVariableNames: aString2 package: aString3",
573
854
  messageSends: ["deprecatedAPI", "subclass:instanceVariableNames:package:"],
@@ -580,10 +861,12 @@ smalltalk.addMethod(
580
861
  smalltalk.method({
581
862
  selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",
582
863
  category: 'class creation',
583
- fn: function (aString, aString2, classVars, pools, aString3){
864
+ fn: function (aString,aString2,classVars,pools,aString3){
584
865
  var self=this;
585
- return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
586
- return self;},
866
+ var $1;
867
+ $1=smalltalk.send(self,"_subclass_instanceVariableNames_package_",[aString,aString2,aString3]);
868
+ return $1;
869
+ },
587
870
  args: ["aString", "aString2", "classVars", "pools", "aString3"],
588
871
  source: "subclass: aString instanceVariableNames: aString2 classVariableNames: classVars poolDictionaries: pools category: aString3\x0a\x09\x22Just ignore class variables and pools. Added for compatibility.\x22\x0a\x09^self subclass: aString instanceVariableNames: aString2 package: aString3",
589
872
  messageSends: ["subclass:instanceVariableNames:package:"],
@@ -596,13 +879,15 @@ smalltalk.addMethod(
596
879
  smalltalk.method({
597
880
  selector: "subclass:instanceVariableNames:package:",
598
881
  category: 'class creation',
599
- fn: function (aString, aString2, aString3){
882
+ fn: function (aString,aString2,aString3){
600
883
  var self=this;
601
- return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, smalltalk.send(aString, "_asString", []), aString2, aString3]);
602
- return self;},
884
+ var $1;
885
+ $1=smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder),"_new",[]),"_superclass_subclass_instanceVariableNames_package_",[self,smalltalk.send(aString,"_asString",[]),aString2,aString3]);
886
+ return $1;
887
+ },
603
888
  args: ["aString", "aString2", "aString3"],
604
889
  source: "subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09^ClassBuilder new\x0a\x09 superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3",
605
- messageSends: ["superclass:subclass:instanceVariableNames:package:", "new", "asString"],
890
+ messageSends: ["superclass:subclass:instanceVariableNames:package:", "asString", "new"],
606
891
  referencedClasses: ["ClassBuilder"]
607
892
  }),
608
893
  smalltalk.Class);
@@ -611,6 +896,53 @@ smalltalk.Class);
611
896
 
612
897
  smalltalk.addClass('Metaclass', smalltalk.Behavior, [], 'Kernel-Classes');
613
898
  smalltalk.Metaclass.comment="Metaclass is the root of the class hierarchy.\x0a\x0aMetaclass instances are metaclasses, one for each real class. \x0aMetaclass instances have a single instance, which they hold onto, which is the class that they are the metaclass of."
899
+ smalltalk.addMethod(
900
+ "_asJavascript",
901
+ smalltalk.method({
902
+ selector: "asJavascript",
903
+ category: 'converting',
904
+ fn: function (){
905
+ var self=this;
906
+ var $1;
907
+ $1=smalltalk.send(smalltalk.send("smalltalk.","__comma",[smalltalk.send(smalltalk.send(self,"_instanceClass",[]),"_name",[])]),"__comma",[".klass"]);
908
+ return $1;
909
+ },
910
+ args: [],
911
+ source: "asJavascript\x0a\x09^ 'smalltalk.', self instanceClass name, '.klass'",
912
+ messageSends: [",", "name", "instanceClass"],
913
+ referencedClasses: []
914
+ }),
915
+ smalltalk.Metaclass);
916
+
917
+ smalltalk.addMethod(
918
+ "_definition",
919
+ smalltalk.method({
920
+ selector: "definition",
921
+ category: 'accessing',
922
+ fn: function (){
923
+ var self=this;
924
+ var $2,$1;
925
+ $1=smalltalk.send((smalltalk.String || String),"_streamContents_",[(function(stream){
926
+ smalltalk.send(stream,"_nextPutAll_",[smalltalk.send(self,"_asString",[])]);
927
+ smalltalk.send(stream,"_nextPutAll_",[" class "]);
928
+ $2=smalltalk.send(stream,"_nextPutAll_",["instanceVariableNames: '"]);
929
+ $2;
930
+ smalltalk.send(smalltalk.send(self,"_instanceVariableNames",[]),"_do_separatedBy_",[(function(each){
931
+ return smalltalk.send(stream,"_nextPutAll_",[each]);
932
+ }),(function(){
933
+ return smalltalk.send(stream,"_nextPutAll_",[" "]);
934
+ })]);
935
+ return smalltalk.send(stream,"_nextPutAll_",["'"]);
936
+ })]);
937
+ return $1;
938
+ },
939
+ args: [],
940
+ source: "definition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09 \x09 \x09nextPutAll: self asString;\x0a\x09 \x09nextPutAll: ' class ';\x0a\x09 \x09nextPutAll: 'instanceVariableNames: '''.\x0a\x09\x09self instanceVariableNames\x0a\x09 \x09do: [ :each | stream nextPutAll: each ]\x0a\x09 \x09separatedBy: [ stream nextPutAll: ' ' ].\x0a\x09\x09stream nextPutAll: '''' ]",
941
+ messageSends: ["streamContents:", "nextPutAll:", "asString", "do:separatedBy:", "instanceVariableNames"],
942
+ referencedClasses: ["String"]
943
+ }),
944
+ smalltalk.Metaclass);
945
+
614
946
  smalltalk.addMethod(
615
947
  "_instanceClass",
616
948
  smalltalk.method({
@@ -619,7 +951,8 @@ category: 'accessing',
619
951
  fn: function (){
620
952
  var self=this;
621
953
  return self.instanceClass;
622
- return self;},
954
+ ;
955
+ return self},
623
956
  args: [],
624
957
  source: "instanceClass\x0a\x09<return self.instanceClass>",
625
958
  messageSends: [],
@@ -634,8 +967,8 @@ selector: "instanceVariableNames:",
634
967
  category: 'accessing',
635
968
  fn: function (aCollection){
636
969
  var self=this;
637
- smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_class_instanceVariableNames_", [self, aCollection]);
638
- return self;},
970
+ smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder),"_new",[]),"_class_instanceVariableNames_",[self,aCollection]);
971
+ return self},
639
972
  args: ["aCollection"],
640
973
  source: "instanceVariableNames: aCollection\x0a\x09ClassBuilder new\x0a\x09 class: self instanceVariableNames: aCollection",
641
974
  messageSends: ["class:instanceVariableNames:", "new"],
@@ -651,7 +984,7 @@ category: 'testing',
651
984
  fn: function (){
652
985
  var self=this;
653
986
  return true;
654
- return self;},
987
+ },
655
988
  args: [],
656
989
  source: "isMetaclass\x0a\x09^true",
657
990
  messageSends: [],
@@ -666,8 +999,10 @@ selector: "printString",
666
999
  category: 'printing',
667
1000
  fn: function (){
668
1001
  var self=this;
669
- return smalltalk.send(smalltalk.send(smalltalk.send(self, "_instanceClass", []), "_name", []), "__comma", [" class"]);
670
- return self;},
1002
+ var $1;
1003
+ $1=smalltalk.send(smalltalk.send(smalltalk.send(self,"_instanceClass",[]),"_name",[]),"__comma",[" class"]);
1004
+ return $1;
1005
+ },
671
1006
  args: [],
672
1007
  source: "printString\x0a\x09^self instanceClass name, ' class'",
673
1008
  messageSends: [",", "name", "instanceClass"],
@@ -675,6 +1010,40 @@ referencedClasses: []
675
1010
  }),
676
1011
  smalltalk.Metaclass);
677
1012
 
1013
+ smalltalk.addMethod(
1014
+ "_theMetaClass",
1015
+ smalltalk.method({
1016
+ selector: "theMetaClass",
1017
+ category: 'accessing',
1018
+ fn: function (){
1019
+ var self=this;
1020
+ return self;
1021
+ },
1022
+ args: [],
1023
+ source: "theMetaClass\x0a\x09^ self",
1024
+ messageSends: [],
1025
+ referencedClasses: []
1026
+ }),
1027
+ smalltalk.Metaclass);
1028
+
1029
+ smalltalk.addMethod(
1030
+ "_theNonMetaClass",
1031
+ smalltalk.method({
1032
+ selector: "theNonMetaClass",
1033
+ category: 'accessing',
1034
+ fn: function (){
1035
+ var self=this;
1036
+ var $1;
1037
+ $1=smalltalk.send(self,"_instanceClass",[]);
1038
+ return $1;
1039
+ },
1040
+ args: [],
1041
+ source: "theNonMetaClass\x0a\x09^ self instanceClass",
1042
+ messageSends: ["instanceClass"],
1043
+ referencedClasses: []
1044
+ }),
1045
+ smalltalk.Metaclass);
1046
+
678
1047
 
679
1048
 
680
1049
  smalltalk.addClass('ClassBuilder', smalltalk.Object, [], 'Kernel-Classes');
@@ -684,11 +1053,12 @@ smalltalk.addMethod(
684
1053
  smalltalk.method({
685
1054
  selector: "addSubclassOf:named:instanceVariableNames:",
686
1055
  category: 'private',
687
- fn: function (aClass, aString, aCollection){
1056
+ fn: function (aClass,aString,aCollection){
688
1057
  var self=this;
689
1058
  smalltalk.addClass(aString, aClass, aCollection);
690
1059
  return smalltalk[aString];
691
- return self;},
1060
+ ;
1061
+ return self},
692
1062
  args: ["aClass", "aString", "aCollection"],
693
1063
  source: "addSubclassOf: aClass named: aString instanceVariableNames: aCollection\x0a\x09<smalltalk.addClass(aString, aClass, aCollection);\x0a\x09 return smalltalk[aString]>",
694
1064
  messageSends: [],
@@ -701,11 +1071,12 @@ smalltalk.addMethod(
701
1071
  smalltalk.method({
702
1072
  selector: "addSubclassOf:named:instanceVariableNames:package:",
703
1073
  category: 'private',
704
- fn: function (aClass, aString, aCollection, packageName){
1074
+ fn: function (aClass,aString,aCollection,packageName){
705
1075
  var self=this;
706
1076
  smalltalk.addClass(aString, aClass, aCollection, packageName);
707
1077
  return smalltalk[aString];
708
- return self;},
1078
+ ;
1079
+ return self},
709
1080
  args: ["aClass", "aString", "aCollection", "packageName"],
710
1081
  source: "addSubclassOf: aClass named: aString instanceVariableNames: aCollection package: packageName\x0a\x09<smalltalk.addClass(aString, aClass, aCollection, packageName);\x0a\x09 return smalltalk[aString]>",
711
1082
  messageSends: [],
@@ -718,16 +1089,24 @@ smalltalk.addMethod(
718
1089
  smalltalk.method({
719
1090
  selector: "class:instanceVariableNames:",
720
1091
  category: 'class creation',
721
- fn: function (aClass, aString){
722
- var self=this;
723
- ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);})]));
724
- smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
725
- smalltalk.send(self, "_setupClass_", [aClass]);
726
- return self;},
1092
+ fn: function (aClass,aString){
1093
+ var self=this;
1094
+ var $1,$2,$3;
1095
+ $1=smalltalk.send(aClass,"_isMetaclass",[]);
1096
+ if(! smalltalk.assert($1)){
1097
+ smalltalk.send(self,"_error_",[smalltalk.send(smalltalk.send(aClass,"_name",[]),"__comma",[" is not a metaclass"])]);
1098
+ };
1099
+ smalltalk.send(aClass,"_basicAt_put_",["iVarNames",smalltalk.send(self,"_instanceVariableNamesFor_",[aString])]);
1100
+ $2=smalltalk.send((smalltalk.ClassDefinitionChanged || ClassDefinitionChanged),"_new",[]);
1101
+ smalltalk.send($2,"_theClass_",[aClass]);
1102
+ $3=smalltalk.send($2,"_yourself",[]);
1103
+ smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$3]);
1104
+ smalltalk.send(self,"_setupClass_",[aClass]);
1105
+ return self},
727
1106
  args: ["aClass", "aString"],
728
- source: "class: aClass instanceVariableNames: aString\x0a\x09aClass isMetaclass ifFalse: [self error: aClass name, ' is not a metaclass'].\x0a\x09aClass basicAt: 'iVarNames' put: (self instanceVariableNamesFor: aString).\x0a\x09self setupClass: aClass",
729
- messageSends: ["ifFalse:", "isMetaclass", "error:", ",", "name", "basicAt:put:", "instanceVariableNamesFor:", "setupClass:"],
730
- referencedClasses: []
1107
+ source: "class: aClass instanceVariableNames: aString\x0a\x09aClass isMetaclass ifFalse: [self error: aClass name, ' is not a metaclass'].\x0a\x09aClass basicAt: 'iVarNames' put: (self instanceVariableNamesFor: aString).\x0a \x0a SystemAnnouncer current\x0a \x09announce: (ClassDefinitionChanged new\x0a \x09theClass: aClass;\x0a yourself).\x0a \x0a\x09self setupClass: aClass",
1108
+ messageSends: ["ifFalse:", "error:", ",", "name", "isMetaclass", "basicAt:put:", "instanceVariableNamesFor:", "announce:", "theClass:", "new", "yourself", "current", "setupClass:"],
1109
+ referencedClasses: ["ClassDefinitionChanged", "SystemAnnouncer"]
731
1110
  }),
732
1111
  smalltalk.ClassBuilder);
733
1112
 
@@ -736,19 +1115,23 @@ smalltalk.addMethod(
736
1115
  smalltalk.method({
737
1116
  selector: "copyClass:named:",
738
1117
  category: 'private',
739
- fn: function (aClass, aString){
740
- var self=this;
741
- var newClass=nil;
742
- (newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [smalltalk.send(aClass, "_superclass", []), aString, smalltalk.send(aClass, "_instanceVariableNames", []), smalltalk.send(smalltalk.send(aClass, "_package", []), "_name", [])]));
743
- smalltalk.send(self, "_setupClass_", [newClass]);
744
- smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_install_forClass_category_", [smalltalk.send(each, "_source", []), newClass, smalltalk.send(each, "_category", [])]);})]);
745
- smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_install_forClass_category_", [smalltalk.send(each, "_source", []), smalltalk.send(newClass, "_class", []), smalltalk.send(each, "_category", [])]);})]);
746
- smalltalk.send(self, "_setupClass_", [newClass]);
1118
+ fn: function (aClass,aString){
1119
+ var self=this;
1120
+ var newClass;
1121
+ newClass=smalltalk.send(self,"_addSubclassOf_named_instanceVariableNames_package_",[smalltalk.send(aClass,"_superclass",[]),aString,smalltalk.send(aClass,"_instanceVariableNames",[]),smalltalk.send(smalltalk.send(aClass,"_package",[]),"_name",[])]);
1122
+ smalltalk.send(self,"_setupClass_",[newClass]);
1123
+ smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_methodDictionary",[]),"_values",[]),"_do_",[(function(each){
1124
+ return smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler),"_new",[]),"_install_forClass_category_",[smalltalk.send(each,"_source",[]),newClass,smalltalk.send(each,"_category",[])]);
1125
+ })]);
1126
+ smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_class",[]),"_methodDictionary",[]),"_values",[]),"_do_",[(function(each){
1127
+ return smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler),"_new",[]),"_install_forClass_category_",[smalltalk.send(each,"_source",[]),smalltalk.send(newClass,"_class",[]),smalltalk.send(each,"_category",[])]);
1128
+ })]);
1129
+ smalltalk.send(self,"_setupClass_",[newClass]);
747
1130
  return newClass;
748
- return self;},
1131
+ },
749
1132
  args: ["aClass", "aString"],
750
1133
  source: "copyClass: aClass named: aString\x0a\x09| newClass |\x0a\x0a\x09newClass := self \x0a\x09\x09addSubclassOf: aClass superclass\x0a\x09\x09named: aString \x0a\x09\x09instanceVariableNames: aClass instanceVariableNames \x0a\x09\x09package: aClass package name.\x0a\x0a\x09self setupClass: newClass.\x0a\x0a\x09aClass methodDictionary values do: [:each |\x0a\x09\x09Compiler new install: each source forClass: newClass category: each category].\x0a\x0a\x09aClass class methodDictionary values do: [:each |\x0a\x09\x09Compiler new install: each source forClass: newClass class category: each category].\x0a\x0a\x09self setupClass: newClass.\x0a\x09^newClass",
751
- messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "instanceVariableNames", "name", "package", "setupClass:", "do:", "values", "methodDictionary", "install:forClass:category:", "new", "source", "category", "class"],
1134
+ messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "instanceVariableNames", "name", "package", "setupClass:", "do:", "install:forClass:category:", "source", "category", "new", "values", "methodDictionary", "class"],
752
1135
  referencedClasses: ["Compiler"]
753
1136
  }),
754
1137
  smalltalk.ClassBuilder);
@@ -760,15 +1143,45 @@ selector: "instanceVariableNamesFor:",
760
1143
  category: 'private',
761
1144
  fn: function (aString){
762
1145
  var self=this;
763
- return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [(function(each){return smalltalk.send(each, "_isEmpty", []);})]);
764
- return self;},
1146
+ var $1;
1147
+ $1=smalltalk.send(smalltalk.send(aString,"_tokenize_",[" "]),"_reject_",[(function(each){
1148
+ return smalltalk.send(each,"_isEmpty",[]);
1149
+ })]);
1150
+ return $1;
1151
+ },
765
1152
  args: ["aString"],
766
1153
  source: "instanceVariableNamesFor: aString\x0a\x09^(aString tokenize: ' ') reject: [:each | each isEmpty]",
767
- messageSends: ["reject:", "tokenize:", "isEmpty"],
1154
+ messageSends: ["reject:", "isEmpty", "tokenize:"],
768
1155
  referencedClasses: []
769
1156
  }),
770
1157
  smalltalk.ClassBuilder);
771
1158
 
1159
+ smalltalk.addMethod(
1160
+ "_renameClass_to_",
1161
+ smalltalk.method({
1162
+ selector: "renameClass:to:",
1163
+ category: 'class creation',
1164
+ fn: function (aClass,aString){
1165
+ var self=this;
1166
+ var $1,$2;
1167
+
1168
+ smalltalk[aString] = aClass;
1169
+ delete smalltalk[aClass.className];
1170
+ aClass.className = aString;
1171
+ ;
1172
+ ;
1173
+ $1=smalltalk.send((smalltalk.ClassRenamed || ClassRenamed),"_new",[]);
1174
+ smalltalk.send($1,"_theClass_",[aClass]);
1175
+ $2=smalltalk.send($1,"_yourself",[]);
1176
+ smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$2]);
1177
+ return self},
1178
+ args: ["aClass", "aString"],
1179
+ source: "renameClass: aClass to: aString\x0a\x09<\x0a\x09\x09smalltalk[aString] = aClass;\x0a\x09\x09delete smalltalk[aClass.className];\x0a\x09\x09aClass.className = aString;\x0a\x09>.\x0a \x0a SystemAnnouncer current\x0a \x09announce: (ClassRenamed new\x0a \x09theClass: aClass;\x0a yourself)\x0a \x09",
1180
+ messageSends: ["announce:", "theClass:", "new", "yourself", "current"],
1181
+ referencedClasses: ["ClassRenamed", "SystemAnnouncer"]
1182
+ }),
1183
+ smalltalk.ClassBuilder);
1184
+
772
1185
  smalltalk.addMethod(
773
1186
  "_setupClass_",
774
1187
  smalltalk.method({
@@ -777,7 +1190,8 @@ category: 'private',
777
1190
  fn: function (aClass){
778
1191
  var self=this;
779
1192
  smalltalk.init(aClass);;
780
- return self;},
1193
+ ;
1194
+ return self},
781
1195
  args: ["aClass"],
782
1196
  source: "setupClass: aClass\x0a\x09<smalltalk.init(aClass);>",
783
1197
  messageSends: [],
@@ -790,10 +1204,12 @@ smalltalk.addMethod(
790
1204
  smalltalk.method({
791
1205
  selector: "superclass:subclass:",
792
1206
  category: 'class creation',
793
- fn: function (aClass, aString){
1207
+ fn: function (aClass,aString){
794
1208
  var self=this;
795
- return smalltalk.send(self, "_superclass_subclass_instanceVariableNames_package_", [aClass, aString, "", nil]);
796
- return self;},
1209
+ var $1;
1210
+ $1=smalltalk.send(self,"_superclass_subclass_instanceVariableNames_package_",[aClass,aString,"",nil]);
1211
+ return $1;
1212
+ },
797
1213
  args: ["aClass", "aString"],
798
1214
  source: "superclass: aClass subclass: aString\x0a\x09^self superclass: aClass subclass: aString instanceVariableNames: '' package: nil",
799
1215
  messageSends: ["superclass:subclass:instanceVariableNames:package:"],
@@ -806,17 +1222,27 @@ smalltalk.addMethod(
806
1222
  smalltalk.method({
807
1223
  selector: "superclass:subclass:instanceVariableNames:package:",
808
1224
  category: 'class creation',
809
- fn: function (aClass, aString, aString2, aString3){
810
- var self=this;
811
- var newClass=nil;
812
- (newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2]), (($receiver = aString3) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : $receiver]));
813
- smalltalk.send(self, "_setupClass_", [newClass]);
1225
+ fn: function (aClass,aString,aString2,aString3){
1226
+ var self=this;
1227
+ var $1,$2,$3;
1228
+ var newClass;
1229
+ if(($receiver = aString3) == nil || $receiver == undefined){
1230
+ $1="unclassified";
1231
+ } else {
1232
+ $1=aString3;
1233
+ };
1234
+ newClass=smalltalk.send(self,"_addSubclassOf_named_instanceVariableNames_package_",[aClass,aString,smalltalk.send(self,"_instanceVariableNamesFor_",[aString2]),$1]);
1235
+ smalltalk.send(self,"_setupClass_",[newClass]);
1236
+ $2=smalltalk.send((smalltalk.ClassAdded || ClassAdded),"_new",[]);
1237
+ smalltalk.send($2,"_theClass_",[newClass]);
1238
+ $3=smalltalk.send($2,"_yourself",[]);
1239
+ smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$3]);
814
1240
  return newClass;
815
- return self;},
1241
+ },
816
1242
  args: ["aClass", "aString", "aString2", "aString3"],
817
- source: "superclass: aClass subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09| newClass |\x0a\x09newClass := self addSubclassOf: aClass\x0a\x09\x09\x09\x09named: aString instanceVariableNames: (self instanceVariableNamesFor: aString2)\x0a\x09\x09\x09\x09package: (aString3 ifNil: ['unclassified']).\x0a\x09self setupClass: newClass.\x0a\x09^newClass",
818
- messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "instanceVariableNamesFor:", "ifNil:", "setupClass:"],
819
- referencedClasses: []
1243
+ source: "superclass: aClass subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09| newClass |\x0a\x09\x0a newClass := self addSubclassOf: aClass\x0a\x09\x09named: aString instanceVariableNames: (self instanceVariableNamesFor: aString2)\x0a\x09\x09package: (aString3 ifNil: ['unclassified']).\x0a\x09self setupClass: newClass.\x0a \x0a SystemAnnouncer current \x0a \x09announce: (ClassAdded new\x0a \x09theClass: newClass;\x0a yourself).\x0a \x0a\x09^newClass",
1244
+ messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "instanceVariableNamesFor:", "ifNil:", "setupClass:", "announce:", "theClass:", "new", "yourself", "current"],
1245
+ referencedClasses: ["ClassAdded", "SystemAnnouncer"]
820
1246
  }),
821
1247
  smalltalk.ClassBuilder);
822
1248
 
@@ -829,11 +1255,11 @@ smalltalk.addMethod(
829
1255
  smalltalk.method({
830
1256
  selector: "class:category:",
831
1257
  category: 'accessing',
832
- fn: function (aClass, aString){
1258
+ fn: function (aClass,aString){
833
1259
  var self=this;
834
- (self['@class']=aClass);
835
- (self['@category']=aString);
836
- return self;},
1260
+ self["@class"]=aClass;
1261
+ self["@category"]=aString;
1262
+ return self},
837
1263
  args: ["aClass", "aString"],
838
1264
  source: "class: aClass category: aString\x0a\x09class := aClass.\x0a\x09category := aString",
839
1265
  messageSends: [],
@@ -848,8 +1274,8 @@ selector: "compileMethod:",
848
1274
  category: 'private',
849
1275
  fn: function (aString){
850
1276
  var self=this;
851
- smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_install_forClass_category_", [aString, self['@class'], self['@category']]);
852
- return self;},
1277
+ smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler),"_new",[]),"_install_forClass_category_",[aString,self["@class"],self["@category"]]);
1278
+ return self},
853
1279
  args: ["aString"],
854
1280
  source: "compileMethod: aString\x0a\x09Compiler new install: aString forClass: class category: category",
855
1281
  messageSends: ["install:forClass:category:", "new"],
@@ -864,9 +1290,9 @@ selector: "initialize",
864
1290
  category: 'initialization',
865
1291
  fn: function (){
866
1292
  var self=this;
867
- smalltalk.send(self, "_initialize", [], smalltalk.ClassCategoryReader.superclass || nil);
868
- (self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []));
869
- return self;},
1293
+ smalltalk.send(self,"_initialize",[],smalltalk.Object);
1294
+ self["@chunkParser"]=smalltalk.send((smalltalk.ChunkParser || ChunkParser),"_new",[]);
1295
+ return self},
870
1296
  args: [],
871
1297
  source: "initialize\x0a\x09super initialize.\x0a\x09chunkParser := ChunkParser new.",
872
1298
  messageSends: ["initialize", "new"],
@@ -881,13 +1307,19 @@ selector: "scanFrom:",
881
1307
  category: 'fileIn',
882
1308
  fn: function (aChunkParser){
883
1309
  var self=this;
884
- var chunk=nil;
885
- (function(){while(!(function(){(chunk=smalltalk.send(aChunkParser, "_nextChunk", []));return smalltalk.send(chunk, "_isEmpty", []);})()) {(function(){return smalltalk.send(self, "_compileMethod_", [chunk]);})()}})();
886
- smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_setupClass_", [self['@class']]);
887
- return self;},
1310
+ var chunk;
1311
+ smalltalk.send((function(){
1312
+ chunk=smalltalk.send(aChunkParser,"_nextChunk",[]);
1313
+ chunk;
1314
+ return smalltalk.send(chunk,"_isEmpty",[]);
1315
+ }),"_whileFalse_",[(function(){
1316
+ return smalltalk.send(self,"_compileMethod_",[chunk]);
1317
+ })]);
1318
+ smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler),"_new",[]),"_setupClass_",[self["@class"]]);
1319
+ return self},
888
1320
  args: ["aChunkParser"],
889
1321
  source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09[chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty] whileFalse: [\x0a\x09 self compileMethod: chunk].\x0a\x09Compiler new setupClass: class",
890
- messageSends: ["whileFalse:", "nextChunk", "isEmpty", "compileMethod:", "setupClass:", "new"],
1322
+ messageSends: ["whileFalse:", "compileMethod:", "nextChunk", "isEmpty", "setupClass:", "new"],
891
1323
  referencedClasses: ["Compiler"]
892
1324
  }),
893
1325
  smalltalk.ClassCategoryReader);
@@ -903,8 +1335,8 @@ selector: "class:",
903
1335
  category: 'accessing',
904
1336
  fn: function (aClass){
905
1337
  var self=this;
906
- (self['@class']=aClass);
907
- return self;},
1338
+ self["@class"]=aClass;
1339
+ return self},
908
1340
  args: ["aClass"],
909
1341
  source: "class: aClass\x0a\x09class := aClass",
910
1342
  messageSends: [],
@@ -919,9 +1351,9 @@ selector: "initialize",
919
1351
  category: 'initialization',
920
1352
  fn: function (){
921
1353
  var self=this;
922
- smalltalk.send(self, "_initialize", [], smalltalk.ClassCommentReader.superclass || nil);
923
- (self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []));
924
- return self;},
1354
+ smalltalk.send(self,"_initialize",[],smalltalk.Object);
1355
+ self["@chunkParser"]=smalltalk.send((smalltalk.ChunkParser || ChunkParser),"_new",[]);
1356
+ return self},
925
1357
  args: [],
926
1358
  source: "initialize\x0a\x09super initialize.\x0a\x09chunkParser := ChunkParser new.",
927
1359
  messageSends: ["initialize", "new"],
@@ -936,13 +1368,17 @@ selector: "scanFrom:",
936
1368
  category: 'fileIn',
937
1369
  fn: function (aChunkParser){
938
1370
  var self=this;
939
- var chunk=nil;
940
- (chunk=smalltalk.send(aChunkParser, "_nextChunk", []));
941
- ((($receiver = smalltalk.send(chunk, "_isEmpty", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_setComment_", [chunk]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_setComment_", [chunk]);})]));
942
- return self;},
1371
+ var $1;
1372
+ var chunk;
1373
+ chunk=smalltalk.send(aChunkParser,"_nextChunk",[]);
1374
+ $1=smalltalk.send(chunk,"_isEmpty",[]);
1375
+ if(! smalltalk.assert($1)){
1376
+ smalltalk.send(self,"_setComment_",[chunk]);
1377
+ };
1378
+ return self},
943
1379
  args: ["aChunkParser"],
944
1380
  source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty ifFalse: [\x0a\x09 self setComment: chunk].",
945
- messageSends: ["nextChunk", "ifFalse:", "isEmpty", "setComment:"],
1381
+ messageSends: ["nextChunk", "ifFalse:", "setComment:", "isEmpty"],
946
1382
  referencedClasses: []
947
1383
  }),
948
1384
  smalltalk.ClassCommentReader);
@@ -954,8 +1390,8 @@ selector: "setComment:",
954
1390
  category: 'private',
955
1391
  fn: function (aString){
956
1392
  var self=this;
957
- smalltalk.send(self['@class'], "_comment_", [aString]);
958
- return self;},
1393
+ smalltalk.send(self["@class"],"_comment_",[aString]);
1394
+ return self},
959
1395
  args: ["aString"],
960
1396
  source: "setComment: aString\x0a class comment: aString",
961
1397
  messageSends: ["comment:"],
@@ -973,16 +1409,26 @@ selector: "getNodesFrom:",
973
1409
  category: 'accessing',
974
1410
  fn: function (aCollection){
975
1411
  var self=this;
976
- var children=nil;
977
- var others=nil;
978
- (children=[]);
979
- (others=[]);
980
- smalltalk.send(aCollection, "_do_", [(function(each){return ((($receiver = smalltalk.send(smalltalk.send(each, "_superclass", []), "__eq", [smalltalk.send(self, "_theClass", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(children, "_add_", [each]);})() : (function(){return smalltalk.send(others, "_add_", [each]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(children, "_add_", [each]);}), (function(){return smalltalk.send(others, "_add_", [each]);})]));})]);
981
- (self['@nodes']=smalltalk.send(children, "_collect_", [(function(each){return smalltalk.send((smalltalk.ClassSorterNode || ClassSorterNode), "_on_classes_level_", [each, others, ((($receiver = smalltalk.send(self, "_level", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]))]);})]));
982
- return self;},
1412
+ var $1;
1413
+ var children;
1414
+ var others;
1415
+ children=[];
1416
+ others=[];
1417
+ smalltalk.send(aCollection,"_do_",[(function(each){
1418
+ $1=smalltalk.send(smalltalk.send(each,"_superclass",[]),"__eq",[smalltalk.send(self,"_theClass",[])]);
1419
+ if(smalltalk.assert($1)){
1420
+ return smalltalk.send(children,"_add_",[each]);
1421
+ } else {
1422
+ return smalltalk.send(others,"_add_",[each]);
1423
+ };
1424
+ })]);
1425
+ self["@nodes"]=smalltalk.send(children,"_collect_",[(function(each){
1426
+ return smalltalk.send((smalltalk.ClassSorterNode || ClassSorterNode),"_on_classes_level_",[each,others,smalltalk.send(smalltalk.send(self,"_level",[]),"__plus",[(1)])]);
1427
+ })]);
1428
+ return self},
983
1429
  args: ["aCollection"],
984
1430
  source: "getNodesFrom: aCollection\x0a\x09| children others |\x0a\x09children := #().\x0a\x09others := #().\x0a\x09aCollection do: [:each |\x0a\x09\x09(each superclass = self theClass)\x0a\x09\x09\x09ifTrue: [children add: each]\x0a\x09\x09\x09ifFalse: [others add: each]].\x0a\x09nodes:= children collect: [:each |\x0a\x09\x09ClassSorterNode on: each classes: others level: self level + 1]",
985
- messageSends: ["do:", "ifTrue:ifFalse:", "=", "superclass", "theClass", "add:", "collect:", "on:classes:level:", "+", "level"],
1431
+ messageSends: ["do:", "ifTrue:ifFalse:", "add:", "=", "theClass", "superclass", "collect:", "on:classes:level:", "+", "level"],
986
1432
  referencedClasses: ["ClassSorterNode"]
987
1433
  }),
988
1434
  smalltalk.ClassSorterNode);
@@ -994,8 +1440,8 @@ selector: "level",
994
1440
  category: 'accessing',
995
1441
  fn: function (){
996
1442
  var self=this;
997
- return self['@level'];
998
- return self;},
1443
+ return self["@level"];
1444
+ },
999
1445
  args: [],
1000
1446
  source: "level\x0a\x09^level",
1001
1447
  messageSends: [],
@@ -1010,8 +1456,8 @@ selector: "level:",
1010
1456
  category: 'accessing',
1011
1457
  fn: function (anInteger){
1012
1458
  var self=this;
1013
- (self['@level']=anInteger);
1014
- return self;},
1459
+ self["@level"]=anInteger;
1460
+ return self},
1015
1461
  args: ["anInteger"],
1016
1462
  source: "level: anInteger\x0a\x09level := anInteger",
1017
1463
  messageSends: [],
@@ -1026,8 +1472,8 @@ selector: "nodes",
1026
1472
  category: 'accessing',
1027
1473
  fn: function (){
1028
1474
  var self=this;
1029
- return self['@nodes'];
1030
- return self;},
1475
+ return self["@nodes"];
1476
+ },
1031
1477
  args: [],
1032
1478
  source: "nodes\x0a\x09^nodes",
1033
1479
  messageSends: [],
@@ -1042,8 +1488,8 @@ selector: "theClass",
1042
1488
  category: 'accessing',
1043
1489
  fn: function (){
1044
1490
  var self=this;
1045
- return self['@theClass'];
1046
- return self;},
1491
+ return self["@theClass"];
1492
+ },
1047
1493
  args: [],
1048
1494
  source: "theClass\x0a\x09^theClass",
1049
1495
  messageSends: [],
@@ -1058,8 +1504,8 @@ selector: "theClass:",
1058
1504
  category: 'accessing',
1059
1505
  fn: function (aClass){
1060
1506
  var self=this;
1061
- (self['@theClass']=aClass);
1062
- return self;},
1507
+ self["@theClass"]=aClass;
1508
+ return self},
1063
1509
  args: ["aClass"],
1064
1510
  source: "theClass: aClass\x0a\x09theClass := aClass",
1065
1511
  messageSends: [],
@@ -1074,12 +1520,16 @@ selector: "traverseClassesWith:",
1074
1520
  category: 'visiting',
1075
1521
  fn: function (aCollection){
1076
1522
  var self=this;
1077
- smalltalk.send(aCollection, "_add_", [smalltalk.send(self, "_theClass", [])]);
1078
- smalltalk.send(smalltalk.send(smalltalk.send(self, "_nodes", []), "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(smalltalk.send(a, "_theClass", []), "_name", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", [])]));})]), "_do_", [(function(aNode){return smalltalk.send(aNode, "_traverseClassesWith_", [aCollection]);})]);
1079
- return self;},
1523
+ smalltalk.send(aCollection,"_add_",[smalltalk.send(self,"_theClass",[])]);
1524
+ smalltalk.send(smalltalk.send(smalltalk.send(self,"_nodes",[]),"_sorted_",[(function(a,b){
1525
+ return smalltalk.send(smalltalk.send(smalltalk.send(a,"_theClass",[]),"_name",[]),"__lt_eq",[smalltalk.send(smalltalk.send(b,"_theClass",[]),"_name",[])]);
1526
+ })]),"_do_",[(function(aNode){
1527
+ return smalltalk.send(aNode,"_traverseClassesWith_",[aCollection]);
1528
+ })]);
1529
+ return self},
1080
1530
  args: ["aCollection"],
1081
1531
  source: "traverseClassesWith: aCollection\x0a\x09\x22sort classes alphabetically Issue #143\x22\x0a\x0a\x09aCollection add: self theClass.\x0a\x09(self nodes sorted: [:a :b | a theClass name <= b theClass name ]) do: [:aNode |\x0a\x09\x09aNode traverseClassesWith: aCollection ].",
1082
- messageSends: ["add:", "theClass", "do:", "sorted:", "nodes", "<=", "name", "traverseClassesWith:"],
1532
+ messageSends: ["add:", "theClass", "do:", "traverseClassesWith:", "sorted:", "<=", "name", "nodes"],
1083
1533
  referencedClasses: []
1084
1534
  }),
1085
1535
  smalltalk.ClassSorterNode);
@@ -1090,13 +1540,20 @@ smalltalk.addMethod(
1090
1540
  smalltalk.method({
1091
1541
  selector: "on:classes:level:",
1092
1542
  category: 'instance creation',
1093
- fn: function (aClass, aCollection, anInteger){
1094
- var self=this;
1095
- return (function($rec){smalltalk.send($rec, "_theClass_", [aClass]);smalltalk.send($rec, "_level_", [anInteger]);smalltalk.send($rec, "_getNodesFrom_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
1096
- return self;},
1543
+ fn: function (aClass,aCollection,anInteger){
1544
+ var self=this;
1545
+ var $2,$3,$1;
1546
+ $2=smalltalk.send(self,"_new",[]);
1547
+ smalltalk.send($2,"_theClass_",[aClass]);
1548
+ smalltalk.send($2,"_level_",[anInteger]);
1549
+ smalltalk.send($2,"_getNodesFrom_",[aCollection]);
1550
+ $3=smalltalk.send($2,"_yourself",[]);
1551
+ $1=$3;
1552
+ return $1;
1553
+ },
1097
1554
  args: ["aClass", "aCollection", "anInteger"],
1098
1555
  source: "on: aClass classes: aCollection level: anInteger\x0a\x09^self new\x0a\x09\x09theClass: aClass;\x0a\x09\x09level: anInteger;\x0a\x09\x09getNodesFrom: aCollection;\x0a\x09\x09yourself",
1099
- messageSends: ["theClass:", "level:", "getNodesFrom:", "yourself", "new"],
1556
+ messageSends: ["theClass:", "new", "level:", "getNodesFrom:", "yourself"],
1100
1557
  referencedClasses: []
1101
1558
  }),
1102
1559
  smalltalk.ClassSorterNode.klass);