Procházet zdrojové kódy

Fixed the exporter for exporting package classes in dependency order

Nicolas Petton před 12 roky
rodič
revize
5262168b31

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 174 - 68
js/Compiler.deploy.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 495 - 492
js/Compiler.js


+ 37 - 37
js/Kernel-Announcements.deploy.js

@@ -1,41 +1,4 @@
 smalltalk.addPackage('Kernel-Announcements', {});
-smalltalk.addClass('Announcer', smalltalk.Object, ['registry', 'subscriptions'], 'Kernel-Announcements');
-smalltalk.addMethod(
-unescape('_announce_'),
-smalltalk.method({
-selector: unescape('announce%3A'),
-fn: function (anAnnouncement){
-var self=this;
-smalltalk.send(self['@subscriptions'], "_do_", [(function(each){return smalltalk.send(each, "_deliver_", [anAnnouncement]);})]);
-return self;}
-}),
-smalltalk.Announcer);
-
-smalltalk.addMethod(
-unescape('_initialize'),
-smalltalk.method({
-selector: unescape('initialize'),
-fn: function (){
-var self=this;
-smalltalk.send(self, "_initialize", [], smalltalk.Object);
-(self['@subscriptions']=smalltalk.send((smalltalk.OrderedCollection || OrderedCollection), "_new", []));
-return self;}
-}),
-smalltalk.Announcer);
-
-smalltalk.addMethod(
-unescape('_on_do_'),
-smalltalk.method({
-selector: unescape('on%3Ado%3A'),
-fn: function (aClass, aBlock){
-var self=this;
-smalltalk.send(self['@subscriptions'], "_add_", [(function($rec){smalltalk.send($rec, "_block_", [aBlock]);smalltalk.send($rec, "_announcementClass_", [aClass]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.AnnouncementSubscription || AnnouncementSubscription), "_new", []))]);
-return self;}
-}),
-smalltalk.Announcer);
-
-
-
 smalltalk.addClass('AnnouncementSubscription', smalltalk.Object, ['block', 'announcementClass'], 'Kernel-Announcements');
 smalltalk.addMethod(
 unescape('_announcementClass'),
@@ -105,3 +68,40 @@ smalltalk.AnnouncementSubscription);
 
 
 
+smalltalk.addClass('Announcer', smalltalk.Object, ['registry', 'subscriptions'], 'Kernel-Announcements');
+smalltalk.addMethod(
+unescape('_announce_'),
+smalltalk.method({
+selector: unescape('announce%3A'),
+fn: function (anAnnouncement){
+var self=this;
+smalltalk.send(self['@subscriptions'], "_do_", [(function(each){return smalltalk.send(each, "_deliver_", [anAnnouncement]);})]);
+return self;}
+}),
+smalltalk.Announcer);
+
+smalltalk.addMethod(
+unescape('_initialize'),
+smalltalk.method({
+selector: unescape('initialize'),
+fn: function (){
+var self=this;
+smalltalk.send(self, "_initialize", [], smalltalk.Object);
+(self['@subscriptions']=smalltalk.send((smalltalk.Array || Array), "_new", []));
+return self;}
+}),
+smalltalk.Announcer);
+
+smalltalk.addMethod(
+unescape('_on_do_'),
+smalltalk.method({
+selector: unescape('on%3Ado%3A'),
+fn: function (aClass, aBlock){
+var self=this;
+smalltalk.send(self['@subscriptions'], "_add_", [(function($rec){smalltalk.send($rec, "_block_", [aBlock]);smalltalk.send($rec, "_announcementClass_", [aClass]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.AnnouncementSubscription || AnnouncementSubscription), "_new", []))]);
+return self;}
+}),
+smalltalk.Announcer);
+
+
+

+ 52 - 52
js/Kernel-Announcements.js

@@ -1,56 +1,4 @@
 smalltalk.addPackage('Kernel-Announcements', {});
-smalltalk.addClass('Announcer', smalltalk.Object, ['registry', 'subscriptions'], 'Kernel-Announcements');
-smalltalk.addMethod(
-unescape('_announce_'),
-smalltalk.method({
-selector: unescape('announce%3A'),
-category: 'announcing',
-fn: function (anAnnouncement){
-var self=this;
-smalltalk.send(self['@subscriptions'], "_do_", [(function(each){return smalltalk.send(each, "_deliver_", [anAnnouncement]);})]);
-return self;},
-args: ["anAnnouncement"],
-source: unescape('announce%3A%20anAnnouncement%0A%09subscriptions%20do%3A%20%5B%3Aeach%20%7C%0A%09%09each%20deliver%3A%20anAnnouncement%5D'),
-messageSends: ["do:", "deliver:"],
-referencedClasses: []
-}),
-smalltalk.Announcer);
-
-smalltalk.addMethod(
-unescape('_initialize'),
-smalltalk.method({
-selector: unescape('initialize'),
-category: 'initialization',
-fn: function (){
-var self=this;
-smalltalk.send(self, "_initialize", [], smalltalk.Object);
-(self['@subscriptions']=smalltalk.send((smalltalk.OrderedCollection || OrderedCollection), "_new", []));
-return self;},
-args: [],
-source: unescape('initialize%0A%09super%20initialize.%0A%09subscriptions%20%3A%3D%20OrderedCollection%20new'),
-messageSends: ["initialize", "new"],
-referencedClasses: ["OrderedCollection"]
-}),
-smalltalk.Announcer);
-
-smalltalk.addMethod(
-unescape('_on_do_'),
-smalltalk.method({
-selector: unescape('on%3Ado%3A'),
-category: 'subscribing',
-fn: function (aClass, aBlock){
-var self=this;
-smalltalk.send(self['@subscriptions'], "_add_", [(function($rec){smalltalk.send($rec, "_block_", [aBlock]);smalltalk.send($rec, "_announcementClass_", [aClass]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.AnnouncementSubscription || AnnouncementSubscription), "_new", []))]);
-return self;},
-args: ["aClass", "aBlock"],
-source: unescape('on%3A%20aClass%20do%3A%20aBlock%0A%09subscriptions%20add%3A%20%28AnnouncementSubscription%20new%0A%09%09block%3A%20aBlock%3B%0A%09%09announcementClass%3A%20aClass%3B%0A%09%09yourself%29'),
-messageSends: ["add:", "block:", "announcementClass:", "yourself", "new"],
-referencedClasses: ["AnnouncementSubscription"]
-}),
-smalltalk.Announcer);
-
-
-
 smalltalk.addClass('AnnouncementSubscription', smalltalk.Object, ['block', 'announcementClass'], 'Kernel-Announcements');
 smalltalk.addMethod(
 unescape('_announcementClass'),
@@ -150,3 +98,55 @@ smalltalk.AnnouncementSubscription);
 
 
 
+smalltalk.addClass('Announcer', smalltalk.Object, ['registry', 'subscriptions'], 'Kernel-Announcements');
+smalltalk.addMethod(
+unescape('_announce_'),
+smalltalk.method({
+selector: unescape('announce%3A'),
+category: 'announcing',
+fn: function (anAnnouncement){
+var self=this;
+smalltalk.send(self['@subscriptions'], "_do_", [(function(each){return smalltalk.send(each, "_deliver_", [anAnnouncement]);})]);
+return self;},
+args: ["anAnnouncement"],
+source: unescape('announce%3A%20anAnnouncement%0A%09subscriptions%20do%3A%20%5B%3Aeach%20%7C%0A%09%09each%20deliver%3A%20anAnnouncement%5D'),
+messageSends: ["do:", "deliver:"],
+referencedClasses: []
+}),
+smalltalk.Announcer);
+
+smalltalk.addMethod(
+unescape('_initialize'),
+smalltalk.method({
+selector: unescape('initialize'),
+category: 'initialization',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_initialize", [], smalltalk.Object);
+(self['@subscriptions']=smalltalk.send((smalltalk.Array || Array), "_new", []));
+return self;},
+args: [],
+source: unescape('initialize%0A%09super%20initialize.%0A%09subscriptions%20%3A%3D%20Array%20new'),
+messageSends: ["initialize", "new"],
+referencedClasses: ["Array"]
+}),
+smalltalk.Announcer);
+
+smalltalk.addMethod(
+unescape('_on_do_'),
+smalltalk.method({
+selector: unescape('on%3Ado%3A'),
+category: 'subscribing',
+fn: function (aClass, aBlock){
+var self=this;
+smalltalk.send(self['@subscriptions'], "_add_", [(function($rec){smalltalk.send($rec, "_block_", [aBlock]);smalltalk.send($rec, "_announcementClass_", [aClass]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.AnnouncementSubscription || AnnouncementSubscription), "_new", []))]);
+return self;},
+args: ["aClass", "aBlock"],
+source: unescape('on%3A%20aClass%20do%3A%20aBlock%0A%09subscriptions%20add%3A%20%28AnnouncementSubscription%20new%0A%09%09block%3A%20aBlock%3B%0A%09%09announcementClass%3A%20aClass%3B%0A%09%09yourself%29'),
+messageSends: ["add:", "block:", "announcementClass:", "yourself", "new"],
+referencedClasses: ["AnnouncementSubscription"]
+}),
+smalltalk.Announcer);
+
+
+

+ 117 - 117
js/Kernel-Objects.deploy.js

@@ -1042,6 +1042,17 @@ return self;}
 }),
 smalltalk.Package);
 
+smalltalk.addMethod(
+unescape('_sortedClasses'),
+smalltalk.method({
+selector: unescape('sortedClasses'),
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_classes", []), "_inject_into_", [[], (function(acc, each){return ((($receiver = smalltalk.send(acc, "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_add_", [each]);return smalltalk.send($rec, "_yourself", []);})(acc);})() : (function(){return ((($receiver = smalltalk.send(acc, "_includes_", [smalltalk.send(each, "_superclass", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_add_", [each]);return smalltalk.send($rec, "_yourself", []);})(acc);})() : (function(){return smalltalk.send([each], "__comma", [acc]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (function($rec){smalltalk.send($rec, "_add_", [each]);return smalltalk.send($rec, "_yourself", []);})(acc);}), (function(){return smalltalk.send([each], "__comma", [acc]);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (function($rec){smalltalk.send($rec, "_add_", [each]);return smalltalk.send($rec, "_yourself", []);})(acc);}), (function(){return ((($receiver = smalltalk.send(acc, "_includes_", [smalltalk.send(each, "_superclass", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_add_", [each]);return smalltalk.send($rec, "_yourself", []);})(acc);})() : (function(){return smalltalk.send([each], "__comma", [acc]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (function($rec){smalltalk.send($rec, "_add_", [each]);return smalltalk.send($rec, "_yourself", []);})(acc);}), (function(){return smalltalk.send([each], "__comma", [acc]);})]));})]));})]);
+return self;}
+}),
+smalltalk.Package);
+
 
 smalltalk.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
 smalltalk.addMethod(
@@ -1510,17 +1521,6 @@ return self;}
 }),
 smalltalk.Number);
 
-smalltalk.addMethod(
-unescape('_%5C'),
-smalltalk.method({
-selector: unescape('%5C'),
-fn: function (aNumber){
-var self=this;
-return self % aNumber;
-return self;}
-}),
-smalltalk.Number);
-
 smalltalk.addMethod(
 unescape('_to_by_'),
 smalltalk.method({
@@ -2425,29 +2425,115 @@ return self;}
 smalltalk.UndefinedObject.klass);
 
 
-smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel-Objects');
+smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel-Objects');
 smalltalk.addMethod(
-unescape('_next'),
+unescape('_jsObject_'),
 smalltalk.method({
-selector: unescape('next'),
+selector: unescape('jsObject%3A'),
+fn: function (aJSObject){
+var self=this;
+(self['@jsObject']=aJSObject);
+return self;}
+}),
+smalltalk.JSObjectProxy);
+
+smalltalk.addMethod(
+unescape('_jsObject'),
+smalltalk.method({
+selector: unescape('jsObject'),
 fn: function (){
 var self=this;
-return Math.random();
+return self['@jsObject'];
 return self;}
 }),
-smalltalk.Random);
+smalltalk.JSObjectProxy);
 
 smalltalk.addMethod(
-unescape('_next_'),
+unescape('_printString'),
 smalltalk.method({
-selector: unescape('next%3A'),
-fn: function (anInteger){
+selector: unescape('printString'),
+fn: function (){
 var self=this;
-return smalltalk.send(smalltalk.send((1), "_to_", [anInteger]), "_collect_", [(function(each){return smalltalk.send(self, "_next", []);})]);
+return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_toString", []);
 return self;}
 }),
-smalltalk.Random);
+smalltalk.JSObjectProxy);
 
+smalltalk.addMethod(
+unescape('_inspectOn_'),
+smalltalk.method({
+selector: unescape('inspectOn%3A'),
+fn: function (anInspector){
+var self=this;
+var variables=nil;
+(variables=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
+smalltalk.send(variables, "_at_put_", [unescape("%23self"), smalltalk.send(self, "_jsObject", [])]);
+smalltalk.send(anInspector, "_setLabel_", [smalltalk.send(self, "_printString", [])]);
+for(var i in self['@jsObject']) {
+		variables._at_put_(i, self['@jsObject'][i]);
+	};
+smalltalk.send(anInspector, "_setVariables_", [variables]);
+return self;}
+}),
+smalltalk.JSObjectProxy);
+
+smalltalk.addMethod(
+unescape('_doesNotUnderstand_'),
+smalltalk.method({
+selector: unescape('doesNotUnderstand%3A'),
+fn: function (aMessage){
+var self=this;
+var obj=nil;
+var selector=nil;
+var jsSelector=nil;
+var arguments=nil;
+(obj=smalltalk.send(self, "_jsObject", []));
+(selector=smalltalk.send(aMessage, "_selector", []));
+(jsSelector=smalltalk.send(selector, "_asJavaScriptSelector", []));
+(arguments=smalltalk.send(aMessage, "_arguments", []));
+if(obj[jsSelector] != undefined) {return smalltalk.send(obj, jsSelector, arguments)};
+smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
+return self;}
+}),
+smalltalk.JSObjectProxy);
+
+smalltalk.addMethod(
+unescape('_at_'),
+smalltalk.method({
+selector: unescape('at%3A'),
+fn: function (aSymbol){
+var self=this;
+var attr=nil;
+(attr=smalltalk.send(aSymbol, "_asString", []));
+return self['@jsObject'][attr];
+return self;}
+}),
+smalltalk.JSObjectProxy);
+
+smalltalk.addMethod(
+unescape('_at_put_'),
+smalltalk.method({
+selector: unescape('at%3Aput%3A'),
+fn: function (aSymbol, anObject){
+var self=this;
+var attr=nil;
+(attr=smalltalk.send(aSymbol, "_asString", []));
+self['@jsObject'][attr] = anObject;
+return self;}
+}),
+smalltalk.JSObjectProxy);
+
+
+smalltalk.addMethod(
+unescape('_on_'),
+smalltalk.method({
+selector: unescape('on%3A'),
+fn: function (aJSObject){
+var self=this;
+return (function($rec){smalltalk.send($rec, "_jsObject_", [aJSObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
+return self;}
+}),
+smalltalk.JSObjectProxy.klass);
 
 
 smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel-Objects');
@@ -2585,114 +2671,28 @@ return self;}
 smalltalk.Point.klass);
 
 
-smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel-Objects');
-smalltalk.addMethod(
-unescape('_jsObject_'),
-smalltalk.method({
-selector: unescape('jsObject%3A'),
-fn: function (aJSObject){
-var self=this;
-(self['@jsObject']=aJSObject);
-return self;}
-}),
-smalltalk.JSObjectProxy);
-
-smalltalk.addMethod(
-unescape('_jsObject'),
-smalltalk.method({
-selector: unescape('jsObject'),
-fn: function (){
-var self=this;
-return self['@jsObject'];
-return self;}
-}),
-smalltalk.JSObjectProxy);
-
+smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel-Objects');
 smalltalk.addMethod(
-unescape('_printString'),
+unescape('_next'),
 smalltalk.method({
-selector: unescape('printString'),
+selector: unescape('next'),
 fn: function (){
 var self=this;
-return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_toString", []);
-return self;}
-}),
-smalltalk.JSObjectProxy);
-
-smalltalk.addMethod(
-unescape('_inspectOn_'),
-smalltalk.method({
-selector: unescape('inspectOn%3A'),
-fn: function (anInspector){
-var self=this;
-var variables=nil;
-(variables=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
-smalltalk.send(variables, "_at_put_", [unescape("%23self"), smalltalk.send(self, "_jsObject", [])]);
-smalltalk.send(anInspector, "_setLabel_", [smalltalk.send(self, "_printString", [])]);
-for(var i in self['@jsObject']) {
-		variables._at_put_(i, self['@jsObject'][i]);
-	};
-smalltalk.send(anInspector, "_setVariables_", [variables]);
-return self;}
-}),
-smalltalk.JSObjectProxy);
-
-smalltalk.addMethod(
-unescape('_doesNotUnderstand_'),
-smalltalk.method({
-selector: unescape('doesNotUnderstand%3A'),
-fn: function (aMessage){
-var self=this;
-var obj=nil;
-var selector=nil;
-var jsSelector=nil;
-var arguments=nil;
-(obj=smalltalk.send(self, "_jsObject", []));
-(selector=smalltalk.send(aMessage, "_selector", []));
-(jsSelector=smalltalk.send(selector, "_asJavaScriptSelector", []));
-(arguments=smalltalk.send(aMessage, "_arguments", []));
-if(obj[jsSelector] != undefined) {return smalltalk.send(obj, jsSelector, arguments)};
-smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
-return self;}
-}),
-smalltalk.JSObjectProxy);
-
-smalltalk.addMethod(
-unescape('_at_'),
-smalltalk.method({
-selector: unescape('at%3A'),
-fn: function (aSymbol){
-var self=this;
-var attr=nil;
-(attr=smalltalk.send(aSymbol, "_asString", []));
-return self['@jsObject'][attr];
+return Math.random();
 return self;}
 }),
-smalltalk.JSObjectProxy);
+smalltalk.Random);
 
 smalltalk.addMethod(
-unescape('_at_put_'),
+unescape('_next_'),
 smalltalk.method({
-selector: unescape('at%3Aput%3A'),
-fn: function (aSymbol, anObject){
+selector: unescape('next%3A'),
+fn: function (anInteger){
 var self=this;
-var attr=nil;
-(attr=smalltalk.send(aSymbol, "_asString", []));
-self['@jsObject'][attr] = anObject;
+return smalltalk.send(smalltalk.send((1), "_to_", [anInteger]), "_collect_", [(function(each){return smalltalk.send(self, "_next", []);})]);
 return self;}
 }),
-smalltalk.JSObjectProxy);
-
+smalltalk.Random);
 
-smalltalk.addMethod(
-unescape('_on_'),
-smalltalk.method({
-selector: unescape('on%3A'),
-fn: function (aJSObject){
-var self=this;
-return (function($rec){smalltalk.send($rec, "_jsObject_", [aJSObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
-return self;}
-}),
-smalltalk.JSObjectProxy.klass);
 
 

+ 162 - 162
js/Kernel-Objects.js

@@ -1490,6 +1490,22 @@ referencedClasses: []
 }),
 smalltalk.Package);
 
+smalltalk.addMethod(
+unescape('_sortedClasses'),
+smalltalk.method({
+selector: unescape('sortedClasses'),
+category: 'classes',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_classes", []), "_inject_into_", [[], (function(acc, each){return ((($receiver = smalltalk.send(acc, "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_add_", [each]);return smalltalk.send($rec, "_yourself", []);})(acc);})() : (function(){return ((($receiver = smalltalk.send(acc, "_includes_", [smalltalk.send(each, "_superclass", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_add_", [each]);return smalltalk.send($rec, "_yourself", []);})(acc);})() : (function(){return smalltalk.send([each], "__comma", [acc]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (function($rec){smalltalk.send($rec, "_add_", [each]);return smalltalk.send($rec, "_yourself", []);})(acc);}), (function(){return smalltalk.send([each], "__comma", [acc]);})]));})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (function($rec){smalltalk.send($rec, "_add_", [each]);return smalltalk.send($rec, "_yourself", []);})(acc);}), (function(){return ((($receiver = smalltalk.send(acc, "_includes_", [smalltalk.send(each, "_superclass", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return (function($rec){smalltalk.send($rec, "_add_", [each]);return smalltalk.send($rec, "_yourself", []);})(acc);})() : (function(){return smalltalk.send([each], "__comma", [acc]);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return (function($rec){smalltalk.send($rec, "_add_", [each]);return smalltalk.send($rec, "_yourself", []);})(acc);}), (function(){return smalltalk.send([each], "__comma", [acc]);})]));})]));})]);
+return self;},
+args: [],
+source: unescape('sortedClasses%0A%09%22Answer%20all%20classes%20in%20the%20receiver%2C%20sorted%20by%20superclass/subclasses%22%0A%09%0A%09%5Eself%20classes%20inject%3A%20%23%28%29%20into%3A%20%5B%3Aacc%20%3Aeach%20%7C%20%0A%09%09acc%20isEmpty%20%0A%09%09%09ifTrue%3A%20%5Bacc%20add%3A%20each%3B%20yourself%5D%0A%09%09%09ifFalse%3A%20%5B%28acc%20includes%3A%20each%20superclass%29%0A%09%09%09%09ifTrue%3A%20%5Bacc%20add%3A%20each%3B%20yourself%5D%0A%09%09%09%09ifFalse%3A%20%5B%7Beach%7D%2C%20acc%5D%5D%5D'),
+messageSends: ["inject:into:", "classes", "ifTrue:ifFalse:", "isEmpty", "add:", "yourself", "includes:", "superclass", unescape("%2C")],
+referencedClasses: []
+}),
+smalltalk.Package);
+
 
 smalltalk.Package.klass.iVarNames = ['defaultCommitPathJs','defaultCommitPathSt'];
 smalltalk.addMethod(
@@ -2159,22 +2175,6 @@ referencedClasses: []
 }),
 smalltalk.Number);
 
-smalltalk.addMethod(
-unescape('_%5C'),
-smalltalk.method({
-selector: unescape('%5C'),
-category: '',
-fn: function (aNumber){
-var self=this;
-return self % aNumber;
-return self;},
-args: ["aNumber"],
-source: unescape(''),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Number);
-
 smalltalk.addMethod(
 unescape('_to_by_'),
 smalltalk.method({
@@ -3472,40 +3472,156 @@ referencedClasses: []
 smalltalk.UndefinedObject.klass);
 
 
-smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel-Objects');
-smalltalk.Random.comment=unescape('%60Random%60%20is%20a%20random%20number%20generator%20and%20is%20implemented%20as%20a%20trivial%20wrapper%20around%20javascript%20%60Math.random%28%29%60%20and%20is%20used%20like%20this%3A%0A%0A%09Random%20new%20next%0A%0AThis%20will%20return%20a%20float%20x%20where%20x%20%3C%201%20and%20x%20%3E%200.%20If%20you%20want%20a%20random%20integer%20from%201%20to%2010%20you%20can%20use%20%60%23atRandom%60%0A%0A%0910%20atRandom%0A%0A...and%20if%20you%20want%20a%20random%20number%20in%20a%20specific%20interval%20this%20also%20works%3A%0A%0A%09%283%20to%3A%207%29%20atRandom%0A%0A...but%20be%20aware%20that%20%60%23to%3A%60%20does%20not%20create%20an%20Interval%20as%20in%20other%20Smalltalk%20implementations%20but%20in%20fact%20an%20%60Array%60%20of%20numbers%2C%20so%20it%27s%20better%20to%20use%3A%0A%0A%095%20atRandom%20+%202%0A%0ASince%20%60%23atRandom%60%20is%20implemented%20in%20%60SequencableCollection%60%20you%20can%20easy%20pick%20an%20element%20at%20random%3A%0A%0A%09%23%28%27a%27%20%27b%27%20%27c%27%29%20atRandom%0A%0A...or%20perhaps%20a%20letter%20from%20a%20%60String%60%3A%0A%0A%09%27abc%27%20atRandom%0A%0ASince%20Amber%20does%20not%20have%20Characters%20this%20will%20return%20a%20%60String%60%20of%20length%201%20like%20for%20example%20%60%27b%27%60.')
+smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel-Objects');
+smalltalk.JSObjectProxy.comment=unescape('JSObjectProxy%20handles%20sending%20messages%20to%20JavaScript%20object%2C%20therefore%20accessing%20JavaScript%20objects%20from%20Amber%20is%20transparent.%0AJSOjbectProxy%20makes%20intensive%20use%20of%20%60%23doesNotUnderstand%3A%60.%0A%0A%23%23%20Examples%0A%0AJSObjectProxy%20objects%20are%20instanciated%20by%20Amber%20when%20a%20Smalltalk%20message%20is%20sent%20to%20a%20JavaScript%20object.%0A%0A%20%20%20%20window%20alert%3A%20%27hello%20world%27.%0A%20%20%20%20window%20inspect.%0A%20%20%20%20%28window%20jQuery%3A%20%27body%27%29%20append%3A%20%27hello%20world%27%0A%0ASmalltalk%20messages%20sends%20are%20converted%20to%20JavaScript%20function%20calls%20or%20object%20property%20access%20_%28in%20this%20order%29_.%20If%20n%20one%20of%20them%20match%2C%20a%20%60MessageNotUnderstood%60%20error%20will%20be%20thrown.%20%0A%0A%23%23%20Message%20conversion%20rules%0A%0A-%20%60someUser%20name%60%20becomes%20%20%60someUser.name%60%0A-%20%60someUser%20name%3A%20%27John%27%60%20becomes%20%60someUser%20name%20%3D%20%22John%22%60%0A-%20%60console%20log%3A%20%27hello%20world%27%60%20becomes%20%60console.log%28%27hello%20world%27%29%60%0A-%20%60%28window%20jQuery%3A%20%27foo%27%29%20css%3A%20%27background%27%20color%3A%20%27red%27%60%20becomes%20%60window.jQuery%28%27foo%27%29.css%28%27background%27%2C%20%27red%27%29%60%0A%0A__Note%3A__%20For%20keyword-based%20messages%2C%20only%20the%20first%20keyword%20is%20kept%3A%20%60window%20foo%3A%201%20bar%3A%202%60%20is%20equivalent%20to%20%60window%20foo%3A%201%20baz%3A%202%60.')
 smalltalk.addMethod(
-unescape('_next'),
+unescape('_jsObject_'),
 smalltalk.method({
-selector: unescape('next'),
+selector: unescape('jsObject%3A'),
+category: 'accessing',
+fn: function (aJSObject){
+var self=this;
+(self['@jsObject']=aJSObject);
+return self;},
+args: ["aJSObject"],
+source: unescape('jsObject%3A%20aJSObject%0A%09jsObject%20%3A%3D%20aJSObject'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxy);
+
+smalltalk.addMethod(
+unescape('_jsObject'),
+smalltalk.method({
+selector: unescape('jsObject'),
 category: 'accessing',
 fn: function (){
 var self=this;
-return Math.random();
+return self['@jsObject'];
 return self;},
 args: [],
-source: unescape('next%0A%09%3Creturn%20Math.random%28%29%3E'),
+source: unescape('jsObject%0A%09%5EjsObject'),
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Random);
+smalltalk.JSObjectProxy);
 
 smalltalk.addMethod(
-unescape('_next_'),
+unescape('_printString'),
 smalltalk.method({
-selector: unescape('next%3A'),
+selector: unescape('printString'),
+category: 'proxy',
+fn: function (){
+var self=this;
+return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_toString", []);
+return self;},
+args: [],
+source: unescape('printString%0A%09%5Eself%20jsObject%20toString'),
+messageSends: ["toString", "jsObject"],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxy);
+
+smalltalk.addMethod(
+unescape('_inspectOn_'),
+smalltalk.method({
+selector: unescape('inspectOn%3A'),
+category: 'proxy',
+fn: function (anInspector){
+var self=this;
+var variables=nil;
+(variables=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
+smalltalk.send(variables, "_at_put_", [unescape("%23self"), smalltalk.send(self, "_jsObject", [])]);
+smalltalk.send(anInspector, "_setLabel_", [smalltalk.send(self, "_printString", [])]);
+for(var i in self['@jsObject']) {
+		variables._at_put_(i, self['@jsObject'][i]);
+	};
+smalltalk.send(anInspector, "_setVariables_", [variables]);
+return self;},
+args: ["anInspector"],
+source: unescape('inspectOn%3A%20anInspector%0A%09%7C%20variables%20%7C%0A%09variables%20%3A%3D%20Dictionary%20new.%0A%09variables%20at%3A%20%27%23self%27%20put%3A%20self%20jsObject.%0A%09anInspector%20setLabel%3A%20self%20printString.%0A%09%3Cfor%28var%20i%20in%20self%5B%27@jsObject%27%5D%29%20%7B%0A%09%09variables._at_put_%28i%2C%20self%5B%27@jsObject%27%5D%5Bi%5D%29%3B%0A%09%7D%3E.%0A%09anInspector%20setVariables%3A%20variables'),
+messageSends: ["new", "at:put:", "jsObject", "setLabel:", "printString", "setVariables:"],
+referencedClasses: ["Dictionary"]
+}),
+smalltalk.JSObjectProxy);
+
+smalltalk.addMethod(
+unescape('_doesNotUnderstand_'),
+smalltalk.method({
+selector: unescape('doesNotUnderstand%3A'),
+category: 'proxy',
+fn: function (aMessage){
+var self=this;
+var obj=nil;
+var selector=nil;
+var jsSelector=nil;
+var arguments=nil;
+(obj=smalltalk.send(self, "_jsObject", []));
+(selector=smalltalk.send(aMessage, "_selector", []));
+(jsSelector=smalltalk.send(selector, "_asJavaScriptSelector", []));
+(arguments=smalltalk.send(aMessage, "_arguments", []));
+if(obj[jsSelector] != undefined) {return smalltalk.send(obj, jsSelector, arguments)};
+smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
+return self;},
+args: ["aMessage"],
+source: unescape('doesNotUnderstand%3A%20aMessage%0A%09%7C%20obj%20selector%20jsSelector%20arguments%20%7C%0A%09obj%20%3A%3D%20self%20jsObject.%0A%09selector%20%3A%3D%20aMessage%20selector.%0A%09jsSelector%20%3A%3D%20selector%20asJavaScriptSelector.%0A%09arguments%20%3A%3D%20aMessage%20arguments.%0A%09%3Cif%28obj%5BjsSelector%5D%20%21%3D%20undefined%29%20%7Breturn%20smalltalk.send%28obj%2C%20jsSelector%2C%20arguments%29%7D%3E.%0A%09super%20doesNotUnderstand%3A%20aMessage'),
+messageSends: ["jsObject", "selector", "asJavaScriptSelector", "arguments", "doesNotUnderstand:"],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxy);
+
+smalltalk.addMethod(
+unescape('_at_'),
+smalltalk.method({
+selector: unescape('at%3A'),
 category: 'accessing',
-fn: function (anInteger){
+fn: function (aSymbol){
 var self=this;
-return smalltalk.send(smalltalk.send((1), "_to_", [anInteger]), "_collect_", [(function(each){return smalltalk.send(self, "_next", []);})]);
+var attr=nil;
+(attr=smalltalk.send(aSymbol, "_asString", []));
+return self['@jsObject'][attr];
 return self;},
-args: ["anInteger"],
-source: unescape('next%3A%20anInteger%0A%20%20%20%20%5E%281%20to%3A%20anInteger%29%20collect%3A%20%5B%3Aeach%20%7C%20self%20next%5D'),
-messageSends: ["collect:", "to:", "next"],
+args: ["aSymbol"],
+source: unescape('at%3A%20aSymbol%0A%09%7C%20attr%20%7C%0A%09attr%20%3A%3D%20aSymbol%20asString.%0A%09%3Creturn%20self%5B%27@jsObject%27%5D%5Battr%5D%3E'),
+messageSends: ["asString"],
 referencedClasses: []
 }),
-smalltalk.Random);
+smalltalk.JSObjectProxy);
 
+smalltalk.addMethod(
+unescape('_at_put_'),
+smalltalk.method({
+selector: unescape('at%3Aput%3A'),
+category: 'accessing',
+fn: function (aSymbol, anObject){
+var self=this;
+var attr=nil;
+(attr=smalltalk.send(aSymbol, "_asString", []));
+self['@jsObject'][attr] = anObject;
+return self;},
+args: ["aSymbol", "anObject"],
+source: unescape('at%3A%20aSymbol%20put%3A%20anObject%0A%09%7C%20attr%20%7C%0A%09attr%20%3A%3D%20aSymbol%20asString.%0A%09%3Cself%5B%27@jsObject%27%5D%5Battr%5D%20%3D%20anObject%3E'),
+messageSends: ["asString"],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxy);
+
+
+smalltalk.addMethod(
+unescape('_on_'),
+smalltalk.method({
+selector: unescape('on%3A'),
+category: 'instance creation',
+fn: function (aJSObject){
+var self=this;
+return (function($rec){smalltalk.send($rec, "_jsObject_", [aJSObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
+return self;},
+args: ["aJSObject"],
+source: unescape('on%3A%20aJSObject%0A%09%5Eself%20new%0A%09%09jsObject%3A%20aJSObject%3B%0A%09%09yourself'),
+messageSends: ["jsObject:", "yourself", "new"],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxy.klass);
 
 
 smalltalk.addClass('Point', smalltalk.Object, ['x', 'y'], 'Kernel-Objects');
@@ -3704,155 +3820,39 @@ referencedClasses: []
 smalltalk.Point.klass);
 
 
-smalltalk.addClass('JSObjectProxy', smalltalk.Object, ['jsObject'], 'Kernel-Objects');
-smalltalk.JSObjectProxy.comment=unescape('JSObjectProxy%20handles%20sending%20messages%20to%20JavaScript%20object%2C%20therefore%20accessing%20JavaScript%20objects%20from%20Amber%20is%20transparent.%0AJSOjbectProxy%20makes%20intensive%20use%20of%20%60%23doesNotUnderstand%3A%60.%0A%0A%23%23%20Examples%0A%0AJSObjectProxy%20objects%20are%20instanciated%20by%20Amber%20when%20a%20Smalltalk%20message%20is%20sent%20to%20a%20JavaScript%20object.%0A%0A%20%20%20%20window%20alert%3A%20%27hello%20world%27.%0A%20%20%20%20window%20inspect.%0A%20%20%20%20%28window%20jQuery%3A%20%27body%27%29%20append%3A%20%27hello%20world%27%0A%0ASmalltalk%20messages%20sends%20are%20converted%20to%20JavaScript%20function%20calls%20or%20object%20property%20access%20_%28in%20this%20order%29_.%20If%20n%20one%20of%20them%20match%2C%20a%20%60MessageNotUnderstood%60%20error%20will%20be%20thrown.%20%0A%0A%23%23%20Message%20conversion%20rules%0A%0A-%20%60someUser%20name%60%20becomes%20%20%60someUser.name%60%0A-%20%60someUser%20name%3A%20%27John%27%60%20becomes%20%60someUser%20name%20%3D%20%22John%22%60%0A-%20%60console%20log%3A%20%27hello%20world%27%60%20becomes%20%60console.log%28%27hello%20world%27%29%60%0A-%20%60%28window%20jQuery%3A%20%27foo%27%29%20css%3A%20%27background%27%20color%3A%20%27red%27%60%20becomes%20%60window.jQuery%28%27foo%27%29.css%28%27background%27%2C%20%27red%27%29%60%0A%0A__Note%3A__%20For%20keyword-based%20messages%2C%20only%20the%20first%20keyword%20is%20kept%3A%20%60window%20foo%3A%201%20bar%3A%202%60%20is%20equivalent%20to%20%60window%20foo%3A%201%20baz%3A%202%60.')
-smalltalk.addMethod(
-unescape('_jsObject_'),
-smalltalk.method({
-selector: unescape('jsObject%3A'),
-category: 'accessing',
-fn: function (aJSObject){
-var self=this;
-(self['@jsObject']=aJSObject);
-return self;},
-args: ["aJSObject"],
-source: unescape('jsObject%3A%20aJSObject%0A%09jsObject%20%3A%3D%20aJSObject'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JSObjectProxy);
-
+smalltalk.addClass('Random', smalltalk.Object, [], 'Kernel-Objects');
+smalltalk.Random.comment=unescape('%60Random%60%20is%20a%20random%20number%20generator%20and%20is%20implemented%20as%20a%20trivial%20wrapper%20around%20javascript%20%60Math.random%28%29%60%20and%20is%20used%20like%20this%3A%0A%0A%09Random%20new%20next%0A%0AThis%20will%20return%20a%20float%20x%20where%20x%20%3C%201%20and%20x%20%3E%200.%20If%20you%20want%20a%20random%20integer%20from%201%20to%2010%20you%20can%20use%20%60%23atRandom%60%0A%0A%0910%20atRandom%0A%0A...and%20if%20you%20want%20a%20random%20number%20in%20a%20specific%20interval%20this%20also%20works%3A%0A%0A%09%283%20to%3A%207%29%20atRandom%0A%0A...but%20be%20aware%20that%20%60%23to%3A%60%20does%20not%20create%20an%20Interval%20as%20in%20other%20Smalltalk%20implementations%20but%20in%20fact%20an%20%60Array%60%20of%20numbers%2C%20so%20it%27s%20better%20to%20use%3A%0A%0A%095%20atRandom%20+%202%0A%0ASince%20%60%23atRandom%60%20is%20implemented%20in%20%60SequencableCollection%60%20you%20can%20easy%20pick%20an%20element%20at%20random%3A%0A%0A%09%23%28%27a%27%20%27b%27%20%27c%27%29%20atRandom%0A%0A...or%20perhaps%20a%20letter%20from%20a%20%60String%60%3A%0A%0A%09%27abc%27%20atRandom%0A%0ASince%20Amber%20does%20not%20have%20Characters%20this%20will%20return%20a%20%60String%60%20of%20length%201%20like%20for%20example%20%60%27b%27%60.')
 smalltalk.addMethod(
-unescape('_jsObject'),
+unescape('_next'),
 smalltalk.method({
-selector: unescape('jsObject'),
+selector: unescape('next'),
 category: 'accessing',
 fn: function (){
 var self=this;
-return self['@jsObject'];
+return Math.random();
 return self;},
 args: [],
-source: unescape('jsObject%0A%09%5EjsObject'),
+source: unescape('next%0A%09%3Creturn%20Math.random%28%29%3E'),
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.JSObjectProxy);
-
-smalltalk.addMethod(
-unescape('_printString'),
-smalltalk.method({
-selector: unescape('printString'),
-category: 'proxy',
-fn: function (){
-var self=this;
-return smalltalk.send(smalltalk.send(self, "_jsObject", []), "_toString", []);
-return self;},
-args: [],
-source: unescape('printString%0A%09%5Eself%20jsObject%20toString'),
-messageSends: ["toString", "jsObject"],
-referencedClasses: []
-}),
-smalltalk.JSObjectProxy);
-
-smalltalk.addMethod(
-unescape('_inspectOn_'),
-smalltalk.method({
-selector: unescape('inspectOn%3A'),
-category: 'proxy',
-fn: function (anInspector){
-var self=this;
-var variables=nil;
-(variables=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []));
-smalltalk.send(variables, "_at_put_", [unescape("%23self"), smalltalk.send(self, "_jsObject", [])]);
-smalltalk.send(anInspector, "_setLabel_", [smalltalk.send(self, "_printString", [])]);
-for(var i in self['@jsObject']) {
-		variables._at_put_(i, self['@jsObject'][i]);
-	};
-smalltalk.send(anInspector, "_setVariables_", [variables]);
-return self;},
-args: ["anInspector"],
-source: unescape('inspectOn%3A%20anInspector%0A%09%7C%20variables%20%7C%0A%09variables%20%3A%3D%20Dictionary%20new.%0A%09variables%20at%3A%20%27%23self%27%20put%3A%20self%20jsObject.%0A%09anInspector%20setLabel%3A%20self%20printString.%0A%09%3Cfor%28var%20i%20in%20self%5B%27@jsObject%27%5D%29%20%7B%0A%09%09variables._at_put_%28i%2C%20self%5B%27@jsObject%27%5D%5Bi%5D%29%3B%0A%09%7D%3E.%0A%09anInspector%20setVariables%3A%20variables'),
-messageSends: ["new", "at:put:", "jsObject", "setLabel:", "printString", "setVariables:"],
-referencedClasses: ["Dictionary"]
-}),
-smalltalk.JSObjectProxy);
-
-smalltalk.addMethod(
-unescape('_doesNotUnderstand_'),
-smalltalk.method({
-selector: unescape('doesNotUnderstand%3A'),
-category: 'proxy',
-fn: function (aMessage){
-var self=this;
-var obj=nil;
-var selector=nil;
-var jsSelector=nil;
-var arguments=nil;
-(obj=smalltalk.send(self, "_jsObject", []));
-(selector=smalltalk.send(aMessage, "_selector", []));
-(jsSelector=smalltalk.send(selector, "_asJavaScriptSelector", []));
-(arguments=smalltalk.send(aMessage, "_arguments", []));
-if(obj[jsSelector] != undefined) {return smalltalk.send(obj, jsSelector, arguments)};
-smalltalk.send(self, "_doesNotUnderstand_", [aMessage], smalltalk.Object);
-return self;},
-args: ["aMessage"],
-source: unescape('doesNotUnderstand%3A%20aMessage%0A%09%7C%20obj%20selector%20jsSelector%20arguments%20%7C%0A%09obj%20%3A%3D%20self%20jsObject.%0A%09selector%20%3A%3D%20aMessage%20selector.%0A%09jsSelector%20%3A%3D%20selector%20asJavaScriptSelector.%0A%09arguments%20%3A%3D%20aMessage%20arguments.%0A%09%3Cif%28obj%5BjsSelector%5D%20%21%3D%20undefined%29%20%7Breturn%20smalltalk.send%28obj%2C%20jsSelector%2C%20arguments%29%7D%3E.%0A%09super%20doesNotUnderstand%3A%20aMessage'),
-messageSends: ["jsObject", "selector", "asJavaScriptSelector", "arguments", "doesNotUnderstand:"],
-referencedClasses: []
-}),
-smalltalk.JSObjectProxy);
-
-smalltalk.addMethod(
-unescape('_at_'),
-smalltalk.method({
-selector: unescape('at%3A'),
-category: 'accessing',
-fn: function (aSymbol){
-var self=this;
-var attr=nil;
-(attr=smalltalk.send(aSymbol, "_asString", []));
-return self['@jsObject'][attr];
-return self;},
-args: ["aSymbol"],
-source: unescape('at%3A%20aSymbol%0A%09%7C%20attr%20%7C%0A%09attr%20%3A%3D%20aSymbol%20asString.%0A%09%3Creturn%20self%5B%27@jsObject%27%5D%5Battr%5D%3E'),
-messageSends: ["asString"],
-referencedClasses: []
-}),
-smalltalk.JSObjectProxy);
+smalltalk.Random);
 
 smalltalk.addMethod(
-unescape('_at_put_'),
+unescape('_next_'),
 smalltalk.method({
-selector: unescape('at%3Aput%3A'),
+selector: unescape('next%3A'),
 category: 'accessing',
-fn: function (aSymbol, anObject){
+fn: function (anInteger){
 var self=this;
-var attr=nil;
-(attr=smalltalk.send(aSymbol, "_asString", []));
-self['@jsObject'][attr] = anObject;
+return smalltalk.send(smalltalk.send((1), "_to_", [anInteger]), "_collect_", [(function(each){return smalltalk.send(self, "_next", []);})]);
 return self;},
-args: ["aSymbol", "anObject"],
-source: unescape('at%3A%20aSymbol%20put%3A%20anObject%0A%09%7C%20attr%20%7C%0A%09attr%20%3A%3D%20aSymbol%20asString.%0A%09%3Cself%5B%27@jsObject%27%5D%5Battr%5D%20%3D%20anObject%3E'),
-messageSends: ["asString"],
+args: ["anInteger"],
+source: unescape('next%3A%20anInteger%0A%20%20%20%20%5E%281%20to%3A%20anInteger%29%20collect%3A%20%5B%3Aeach%20%7C%20self%20next%5D'),
+messageSends: ["collect:", "to:", "next"],
 referencedClasses: []
 }),
-smalltalk.JSObjectProxy);
-
+smalltalk.Random);
 
-smalltalk.addMethod(
-unescape('_on_'),
-smalltalk.method({
-selector: unescape('on%3A'),
-category: 'instance creation',
-fn: function (aJSObject){
-var self=this;
-return (function($rec){smalltalk.send($rec, "_jsObject_", [aJSObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
-return self;},
-args: ["aJSObject"],
-source: unescape('on%3A%20aJSObject%0A%09%5Eself%20new%0A%09%09jsObject%3A%20aJSObject%3B%0A%09%09yourself'),
-messageSends: ["jsObject:", "yourself", "new"],
-referencedClasses: []
-}),
-smalltalk.JSObjectProxy.klass);
 
 

+ 3 - 2
js/boot.js

@@ -48,9 +48,9 @@ if (typeof console === "undefined") {
 
 /* Smalltalk constructors definition */
 
-function SmalltalkObject(){};
+function SmalltalkObject(){}
 function SmalltalkBehavior(){};
-function SmalltalkClass(){};
+function SmalltalkClass(){}
 function SmalltalkPackage(){};
 function SmalltalkMetaclass(){
 	this.meta = true;
@@ -133,6 +133,7 @@ function Smalltalk(){
 		that.fn = spec.fn || function(){};
 		that.superclass = spec.superclass;
 		that.iVarNames = spec.iVarNames || [];
+        that.toString = function() {return 'Smalltalk ' + that.className};
 		if(that.superclass) {
 			that.klass.superclass = that.superclass.klass;
 		}

+ 223 - 223
st/Compiler.st

@@ -1,158 +1,101 @@
 Smalltalk current createPackage: 'Compiler' properties: #{}!
-Object subclass: #Node
-	instanceVariableNames: 'nodes'
+Object subclass: #NodeVisitor
+	instanceVariableNames: ''
 	category: 'Compiler'!
 
-!Node methodsFor: 'accessing'!
+!NodeVisitor methodsFor: 'visiting'!
 
-nodes
-	^nodes ifNil: [nodes := Array new]
+visit: aNode
+	aNode accept: self
 !
 
-addNode: aNode
-	self nodes add: aNode
-! !
-
-!Node methodsFor: 'building'!
-
-nodes: aCollection
-	nodes := aCollection
-! !
+visitNode: aNode
+!
 
-!Node methodsFor: 'testing'!
+visitMethodNode: aNode
+	self visitNode: aNode
+!
 
-isValueNode
-	^false
+visitSequenceNode: aNode
+	self visitNode: aNode
 !
 
-isBlockNode
-	^false
+visitBlockSequenceNode: aNode
+	self visitSequenceNode: aNode
 !
 
-isBlockSequenceNode
-	^false
-! !
+visitBlockNode: aNode
+	self visitNode: aNode
+!
 
-!Node methodsFor: 'visiting'!
+visitReturnNode: aNode
+	self visitNode: aNode
+!
 
-accept: aVisitor
-	aVisitor visitNode: self
-! !
+visitSendNode: aNode
+	self visitNode: aNode
+!
 
-Node subclass: #SequenceNode
-	instanceVariableNames: 'temps'
-	category: 'Compiler'!
+visitCascadeNode: aNode
+	self visitNode: aNode
+!
 
-!SequenceNode methodsFor: 'accessing'!
+visitValueNode: aNode
+	self visitNode: aNode
+!
 
-temps
-	^temps ifNil: [#()]
+visitVariableNode: aNode
 !
 
-temps: aCollection
-	temps := aCollection
-! !
+visitAssignmentNode: aNode
+	self visitNode: aNode
+!
 
-!SequenceNode methodsFor: 'testing'!
+visitClassReferenceNode: aNode
+	self 
+	    nextPutAll: 'smalltalk.';
+	    nextPutAll: aNode value
+!
 
-asBlockSequenceNode
-	^BlockSequenceNode new
-	    nodes: self nodes;
-	    temps: self temps;
-	    yourself
-! !
+visitJSStatementNode: aNode
+	self 
+	    nextPutAll: 'function(){';
+	    nextPutAll: aNode source;
+	    nextPutAll: '})()'
+!
 
-!SequenceNode methodsFor: 'visiting'!
+visitDynamicArrayNode: aNode
+	self visitNode: aNode
+!
 
-accept: aVisitor
-	aVisitor visitSequenceNode: self
+visitDynamicDictionaryNode: aNode
+	self visitNode: aNode
 ! !
 
-Node subclass: #DynamicDictionaryNode
+Object subclass: #DoIt
 	instanceVariableNames: ''
 	category: 'Compiler'!
 
-!DynamicDictionaryNode methodsFor: 'visiting'!
-
-accept: aVisitor
-	aVisitor visitDynamicDictionaryNode: self
-! !
-
-Node subclass: #ReturnNode
+Object subclass: #Importer
 	instanceVariableNames: ''
 	category: 'Compiler'!
 
-!ReturnNode methodsFor: 'visiting'!
-
-accept: aVisitor
-	aVisitor visitReturnNode: self
-! !
-
-Object subclass: #ChunkParser
-	instanceVariableNames: 'stream'
-	category: 'Compiler'!
-
-!ChunkParser methodsFor: 'accessing'!
-
-stream: aStream
-	stream := aStream
-! !
-
-!ChunkParser methodsFor: 'reading'!
-
-nextChunk
-	"The chunk format (Smalltalk Interchange Format or Fileout format)
-	is a trivial format but can be a bit tricky to understand:
-		- Uses the exclamation mark as delimiter of chunks.
-		- Inside a chunk a normal exclamation mark must be doubled.
-		- A non empty chunk must be a valid Smalltalk expression.
-		- A chunk on top level with a preceding empty chunk is an instruction chunk:
-			- The object created by the expression then takes over reading chunks.
-
-	This metod returns next chunk as a String (trimmed), empty String (all whitespace) or nil."
-
-	| char result chunk |
-	result := '' writeStream.
-        [char := stream next.
-        char notNil] whileTrue: [
-                 char = '!!' ifTrue: [
-                         stream peek = '!!'
-                                ifTrue: [stream next "skipping the escape double"]
-                                ifFalse: [^result contents trimBoth  "chunk end marker found"]].
-                 result nextPut: char].
-	^nil "a chunk needs to end with !!"
-! !
-
-!ChunkParser class methodsFor: 'not yet classified'!
-
-on: aStream
-	^self new stream: aStream
-! !
-
-Node subclass: #ValueNode
-	instanceVariableNames: 'value'
-	category: 'Compiler'!
-
-!ValueNode methodsFor: 'accessing'!
-
-value
-	^value
-!
-
-value: anObject
-	value := anObject
-! !
-
-!ValueNode methodsFor: 'testing'!
-
-isValueNode
-	^true
-! !
-
-!ValueNode methodsFor: 'visiting'!
+!Importer methodsFor: 'fileIn'!
 
-accept: aVisitor
-	aVisitor visitValueNode: self
+import: aStream
+    | chunk result parser lastEmpty |
+    parser := ChunkParser on: aStream.
+    lastEmpty := false.
+    [chunk := parser nextChunk.
+     chunk isNil] whileFalse: [
+        chunk isEmpty
+       		ifTrue: [lastEmpty := true]
+       		ifFalse: [
+        		result := Compiler new loadExpression: chunk.
+        		lastEmpty 
+            			ifTrue: [
+                                  	lastEmpty := false.
+                                  	result scanFrom: parser]]]
 ! !
 
 Object subclass: #Exporter
@@ -169,7 +112,7 @@ exportPackage: packageName
                 package := Smalltalk current packageAt: packageName.
                 self exportPackageDefinitionOf: package on: stream.
 		"Export classes in dependency order"
-	    	(package classes sorted: [:a :b | a subclasses includes: b]) do: [:each |
+	    	package sortedClasses do: [:each |
                         stream nextPutAll: (self exportClass: each)].
 		self exportPackageExtensionsOf: package on: stream]
 !
@@ -279,6 +222,162 @@ exportPackageDefinitionOf: package on: aStream
 	aStream lf
 ! !
 
+Object subclass: #ChunkParser
+	instanceVariableNames: 'stream'
+	category: 'Compiler'!
+
+!ChunkParser methodsFor: 'accessing'!
+
+stream: aStream
+	stream := aStream
+! !
+
+!ChunkParser methodsFor: 'reading'!
+
+nextChunk
+	"The chunk format (Smalltalk Interchange Format or Fileout format)
+	is a trivial format but can be a bit tricky to understand:
+		- Uses the exclamation mark as delimiter of chunks.
+		- Inside a chunk a normal exclamation mark must be doubled.
+		- A non empty chunk must be a valid Smalltalk expression.
+		- A chunk on top level with a preceding empty chunk is an instruction chunk:
+			- The object created by the expression then takes over reading chunks.
+
+	This metod returns next chunk as a String (trimmed), empty String (all whitespace) or nil."
+
+	| char result chunk |
+	result := '' writeStream.
+        [char := stream next.
+        char notNil] whileTrue: [
+                 char = '!!' ifTrue: [
+                         stream peek = '!!'
+                                ifTrue: [stream next "skipping the escape double"]
+                                ifFalse: [^result contents trimBoth  "chunk end marker found"]].
+                 result nextPut: char].
+	^nil "a chunk needs to end with !!"
+! !
+
+!ChunkParser class methodsFor: 'not yet classified'!
+
+on: aStream
+	^self new stream: aStream
+! !
+
+Object subclass: #Node
+	instanceVariableNames: 'nodes'
+	category: 'Compiler'!
+
+!Node methodsFor: 'accessing'!
+
+nodes
+	^nodes ifNil: [nodes := Array new]
+!
+
+addNode: aNode
+	self nodes add: aNode
+! !
+
+!Node methodsFor: 'building'!
+
+nodes: aCollection
+	nodes := aCollection
+! !
+
+!Node methodsFor: 'testing'!
+
+isValueNode
+	^false
+!
+
+isBlockNode
+	^false
+!
+
+isBlockSequenceNode
+	^false
+! !
+
+!Node methodsFor: 'visiting'!
+
+accept: aVisitor
+	aVisitor visitNode: self
+! !
+
+Node subclass: #SequenceNode
+	instanceVariableNames: 'temps'
+	category: 'Compiler'!
+
+!SequenceNode methodsFor: 'accessing'!
+
+temps
+	^temps ifNil: [#()]
+!
+
+temps: aCollection
+	temps := aCollection
+! !
+
+!SequenceNode methodsFor: 'testing'!
+
+asBlockSequenceNode
+	^BlockSequenceNode new
+	    nodes: self nodes;
+	    temps: self temps;
+	    yourself
+! !
+
+!SequenceNode methodsFor: 'visiting'!
+
+accept: aVisitor
+	aVisitor visitSequenceNode: self
+! !
+
+Node subclass: #DynamicDictionaryNode
+	instanceVariableNames: ''
+	category: 'Compiler'!
+
+!DynamicDictionaryNode methodsFor: 'visiting'!
+
+accept: aVisitor
+	aVisitor visitDynamicDictionaryNode: self
+! !
+
+Node subclass: #ReturnNode
+	instanceVariableNames: ''
+	category: 'Compiler'!
+
+!ReturnNode methodsFor: 'visiting'!
+
+accept: aVisitor
+	aVisitor visitReturnNode: self
+! !
+
+Node subclass: #ValueNode
+	instanceVariableNames: 'value'
+	category: 'Compiler'!
+
+!ValueNode methodsFor: 'accessing'!
+
+value
+	^value
+!
+
+value: anObject
+	value := anObject
+! !
+
+!ValueNode methodsFor: 'testing'!
+
+isValueNode
+	^true
+! !
+
+!ValueNode methodsFor: 'visiting'!
+
+accept: aVisitor
+	aVisitor visitValueNode: self
+! !
+
 ValueNode subclass: #VariableNode
 	instanceVariableNames: 'assigned'
 	category: 'Compiler'!
@@ -518,28 +617,6 @@ accept: aVisitor
 	aVisitor visitAssignmentNode: self
 ! !
 
-Object subclass: #Importer
-	instanceVariableNames: ''
-	category: 'Compiler'!
-
-!Importer methodsFor: 'fileIn'!
-
-import: aStream
-    | chunk result parser lastEmpty |
-    parser := ChunkParser on: aStream.
-    lastEmpty := false.
-    [chunk := parser nextChunk.
-     chunk isNil] whileFalse: [
-        chunk isEmpty
-       		ifTrue: [lastEmpty := true]
-       		ifFalse: [
-        		result := Compiler new loadExpression: chunk.
-        		lastEmpty 
-            			ifTrue: [
-                                  	lastEmpty := false.
-                                  	result scanFrom: parser]]]
-! !
-
 Node subclass: #DynamicArrayNode
 	instanceVariableNames: ''
 	category: 'Compiler'!
@@ -550,83 +627,6 @@ accept: aVisitor
 	aVisitor visitDynamicArrayNode: self
 ! !
 
-Object subclass: #DoIt
-	instanceVariableNames: ''
-	category: 'Compiler'!
-
-Object subclass: #NodeVisitor
-	instanceVariableNames: ''
-	category: 'Compiler'!
-
-!NodeVisitor methodsFor: 'visiting'!
-
-visit: aNode
-	aNode accept: self
-!
-
-visitNode: aNode
-!
-
-visitMethodNode: aNode
-	self visitNode: aNode
-!
-
-visitSequenceNode: aNode
-	self visitNode: aNode
-!
-
-visitBlockSequenceNode: aNode
-	self visitSequenceNode: aNode
-!
-
-visitBlockNode: aNode
-	self visitNode: aNode
-!
-
-visitReturnNode: aNode
-	self visitNode: aNode
-!
-
-visitSendNode: aNode
-	self visitNode: aNode
-!
-
-visitCascadeNode: aNode
-	self visitNode: aNode
-!
-
-visitValueNode: aNode
-	self visitNode: aNode
-!
-
-visitVariableNode: aNode
-!
-
-visitAssignmentNode: aNode
-	self visitNode: aNode
-!
-
-visitClassReferenceNode: aNode
-	self 
-	    nextPutAll: 'smalltalk.';
-	    nextPutAll: aNode value
-!
-
-visitJSStatementNode: aNode
-	self 
-	    nextPutAll: 'function(){';
-	    nextPutAll: aNode source;
-	    nextPutAll: '})()'
-!
-
-visitDynamicArrayNode: aNode
-	self visitNode: aNode
-!
-
-visitDynamicDictionaryNode: aNode
-	self visitNode: aNode
-! !
-
 NodeVisitor subclass: #Compiler
 	instanceVariableNames: 'stream nestedBlocks earlyReturn currentClass currentSelector unknownVariables tempVariables messageSends referencedClasses classReferenced source argVariables'
 	category: 'Compiler'!

+ 27 - 27
st/Kernel-Announcements.st

@@ -1,31 +1,4 @@
 Smalltalk current createPackage: 'Kernel-Announcements' properties: #{}!
-Object subclass: #Announcer
-	instanceVariableNames: 'registry subscriptions'
-	category: 'Kernel-Announcements'!
-
-!Announcer methodsFor: 'announcing'!
-
-announce: anAnnouncement
-	subscriptions do: [:each |
-		each deliver: anAnnouncement]
-! !
-
-!Announcer methodsFor: 'initialization'!
-
-initialize
-	super initialize.
-	subscriptions := OrderedCollection new
-! !
-
-!Announcer methodsFor: 'subscribing'!
-
-on: aClass do: aBlock
-	subscriptions add: (AnnouncementSubscription new
-		block: aBlock;
-		announcementClass: aClass;
-		yourself)
-! !
-
 Object subclass: #AnnouncementSubscription
 	instanceVariableNames: 'block announcementClass'
 	category: 'Kernel-Announcements'!
@@ -59,3 +32,30 @@ handlesAnnouncement: anAnnouncement
 	^anAnnouncement isKindOf: self announcementClass
 ! !
 
+Object subclass: #Announcer
+	instanceVariableNames: 'registry subscriptions'
+	category: 'Kernel-Announcements'!
+
+!Announcer methodsFor: 'announcing'!
+
+announce: anAnnouncement
+	subscriptions do: [:each |
+		each deliver: anAnnouncement]
+! !
+
+!Announcer methodsFor: 'initialization'!
+
+initialize
+	super initialize.
+	subscriptions := Array new
+! !
+
+!Announcer methodsFor: 'subscribing'!
+
+on: aClass do: aBlock
+	subscriptions add: (AnnouncementSubscription new
+		block: aBlock;
+		announcementClass: aClass;
+		yourself)
+! !
+

+ 96 - 90
st/Kernel-Objects.st

@@ -545,6 +545,17 @@ commitPathSt: aString
 classes
 	"We need to do a reverse scan."
 	^Smalltalk current classes select: [:c | c package == self]
+!
+
+sortedClasses
+	"Answer all classes in the receiver, sorted by superclass/subclasses"
+	
+	^self classes inject: #() into: [:acc :each | 
+		acc isEmpty 
+			ifTrue: [acc add: each; yourself]
+			ifFalse: [(acc includes: each superclass)
+				ifTrue: [acc add: each; yourself]
+				ifFalse: [{each}, acc]]]
 ! !
 
 !Package methodsFor: 'printing'!
@@ -662,11 +673,6 @@ A Number can be used to evaluate a Block a fixed number of times:
 	
 	1 to: 10 by: 2 do: [:aNumber| Transcript show: aNumber asString; cr].!
 
-!Number methodsFor: ''!
-
-
-! !
-
 !Number methodsFor: 'accessing'!
 
 identityHash
@@ -1271,44 +1277,87 @@ new
 	    self error: 'You cannot create new instances of UndefinedObject. Use nil'
 ! !
 
-Object subclass: #Random
-	instanceVariableNames: ''
+Object subclass: #JSObjectProxy
+	instanceVariableNames: 'jsObject'
 	category: 'Kernel-Objects'!
-!Random commentStamp!
-`Random` is a random number generator and is implemented as a trivial wrapper around javascript `Math.random()` and is used like this:
+!JSObjectProxy commentStamp!
+JSObjectProxy handles sending messages to JavaScript object, therefore accessing JavaScript objects from Amber is transparent.
+JSOjbectProxy makes intensive use of `#doesNotUnderstand:`.
 
-	Random new next
+## Examples
 
-This will return a float x where x < 1 and x > 0. If you want a random integer from 1 to 10 you can use `#atRandom`
+JSObjectProxy objects are instanciated by Amber when a Smalltalk message is sent to a JavaScript object.
 
-	10 atRandom
+    window alert: 'hello world'.
+    window inspect.
+    (window jQuery: 'body') append: 'hello world'
 
-...and if you want a random number in a specific interval this also works:
+Smalltalk messages sends are converted to JavaScript function calls or object property access _(in this order)_. If n one of them match, a `MessageNotUnderstood` error will be thrown. 
 
-	(3 to: 7) atRandom
+## Message conversion rules
 
-...but be aware that `#to:` does not create an Interval as in other Smalltalk implementations but in fact an `Array` of numbers, so it's better to use:
+- `someUser name` becomes  `someUser.name`
+- `someUser name: 'John'` becomes `someUser name = "John"`
+- `console log: 'hello world'` becomes `console.log('hello world')`
+- `(window jQuery: 'foo') css: 'background' color: 'red'` becomes `window.jQuery('foo').css('background', 'red')`
 
-	5 atRandom + 2
+__Note:__ For keyword-based messages, only the first keyword is kept: `window foo: 1 bar: 2` is equivalent to `window foo: 1 baz: 2`.!
 
-Since `#atRandom` is implemented in `SequencableCollection` you can easy pick an element at random:
+!JSObjectProxy methodsFor: 'accessing'!
 
-	#('a' 'b' 'c') atRandom
+jsObject: aJSObject
+	jsObject := aJSObject
+!
 
-...or perhaps a letter from a `String`:
+jsObject
+	^jsObject
+!
 
-	'abc' atRandom
+at: aSymbol
+	| attr |
+	attr := aSymbol asString.
+	<return self['@jsObject'][attr]>
+!
 
-Since Amber does not have Characters this will return a `String` of length 1 like for example `'b'`.!
+at: aSymbol put: anObject
+	| attr |
+	attr := aSymbol asString.
+	<self['@jsObject'][attr] = anObject>
+! !
 
-!Random methodsFor: 'accessing'!
+!JSObjectProxy methodsFor: 'proxy'!
 
-next
-	<return Math.random()>
+printString
+	^self jsObject toString
 !
 
-next: anInteger
-    ^(1 to: anInteger) collect: [:each | self next]
+inspectOn: anInspector
+	| variables |
+	variables := Dictionary new.
+	variables at: '#self' put: self jsObject.
+	anInspector setLabel: self printString.
+	<for(var i in self['@jsObject']) {
+		variables._at_put_(i, self['@jsObject'][i]);
+	}>.
+	anInspector setVariables: variables
+!
+
+doesNotUnderstand: aMessage
+	| obj selector jsSelector arguments |
+	obj := self jsObject.
+	selector := aMessage selector.
+	jsSelector := selector asJavaScriptSelector.
+	arguments := aMessage arguments.
+	<if(obj[jsSelector] !!= undefined) {return smalltalk.send(obj, jsSelector, arguments)}>.
+	super doesNotUnderstand: aMessage
+! !
+
+!JSObjectProxy class methodsFor: 'instance creation'!
+
+on: aJSObject
+	^self new
+		jsObject: aJSObject;
+		yourself
 ! !
 
 Object subclass: #Point
@@ -1404,86 +1453,43 @@ x: aNumber y: anotherNumber
 		yourself
 ! !
 
-Object subclass: #JSObjectProxy
-	instanceVariableNames: 'jsObject'
+Object subclass: #Random
+	instanceVariableNames: ''
 	category: 'Kernel-Objects'!
-!JSObjectProxy commentStamp!
-JSObjectProxy handles sending messages to JavaScript object, therefore accessing JavaScript objects from Amber is transparent.
-JSOjbectProxy makes intensive use of `#doesNotUnderstand:`.
-
-## Examples
+!Random commentStamp!
+`Random` is a random number generator and is implemented as a trivial wrapper around javascript `Math.random()` and is used like this:
 
-JSObjectProxy objects are instanciated by Amber when a Smalltalk message is sent to a JavaScript object.
+	Random new next
 
-    window alert: 'hello world'.
-    window inspect.
-    (window jQuery: 'body') append: 'hello world'
+This will return a float x where x < 1 and x > 0. If you want a random integer from 1 to 10 you can use `#atRandom`
 
-Smalltalk messages sends are converted to JavaScript function calls or object property access _(in this order)_. If n one of them match, a `MessageNotUnderstood` error will be thrown. 
+	10 atRandom
 
-## Message conversion rules
+...and if you want a random number in a specific interval this also works:
 
-- `someUser name` becomes  `someUser.name`
-- `someUser name: 'John'` becomes `someUser name = "John"`
-- `console log: 'hello world'` becomes `console.log('hello world')`
-- `(window jQuery: 'foo') css: 'background' color: 'red'` becomes `window.jQuery('foo').css('background', 'red')`
+	(3 to: 7) atRandom
 
-__Note:__ For keyword-based messages, only the first keyword is kept: `window foo: 1 bar: 2` is equivalent to `window foo: 1 baz: 2`.!
+...but be aware that `#to:` does not create an Interval as in other Smalltalk implementations but in fact an `Array` of numbers, so it's better to use:
 
-!JSObjectProxy methodsFor: 'accessing'!
+	5 atRandom + 2
 
-jsObject: aJSObject
-	jsObject := aJSObject
-!
+Since `#atRandom` is implemented in `SequencableCollection` you can easy pick an element at random:
 
-jsObject
-	^jsObject
-!
+	#('a' 'b' 'c') atRandom
 
-at: aSymbol
-	| attr |
-	attr := aSymbol asString.
-	<return self['@jsObject'][attr]>
-!
+...or perhaps a letter from a `String`:
 
-at: aSymbol put: anObject
-	| attr |
-	attr := aSymbol asString.
-	<self['@jsObject'][attr] = anObject>
-! !
+	'abc' atRandom
 
-!JSObjectProxy methodsFor: 'proxy'!
+Since Amber does not have Characters this will return a `String` of length 1 like for example `'b'`.!
 
-printString
-	^self jsObject toString
-!
+!Random methodsFor: 'accessing'!
 
-inspectOn: anInspector
-	| variables |
-	variables := Dictionary new.
-	variables at: '#self' put: self jsObject.
-	anInspector setLabel: self printString.
-	<for(var i in self['@jsObject']) {
-		variables._at_put_(i, self['@jsObject'][i]);
-	}>.
-	anInspector setVariables: variables
+next
+	<return Math.random()>
 !
 
-doesNotUnderstand: aMessage
-	| obj selector jsSelector arguments |
-	obj := self jsObject.
-	selector := aMessage selector.
-	jsSelector := selector asJavaScriptSelector.
-	arguments := aMessage arguments.
-	<if(obj[jsSelector] !!= undefined) {return smalltalk.send(obj, jsSelector, arguments)}>.
-	super doesNotUnderstand: aMessage
-! !
-
-!JSObjectProxy class methodsFor: 'instance creation'!
-
-on: aJSObject
-	^self new
-		jsObject: aJSObject;
-		yourself
+next: anInteger
+    ^(1 to: anInteger) collect: [:each | self next]
 ! !
 

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů