Browse Source

Fixed Object >> ~=

Nicolas Petton 13 years ago
parent
commit
c8e4bc9d17
3 changed files with 167 additions and 204 deletions
  1. 37 60
      js/Kernel.deploy.js
  2. 83 110
      js/Kernel.js
  3. 47 34
      st/Kernel.st

+ 37 - 60
js/Kernel.deploy.js

@@ -16,7 +16,7 @@ smalltalk.method({
 selector: '~=',
 fn: function (anObject){
 var self=this;
-return smalltalk.send(smalltalk.send(self, "__eq", [anObject]), "__eq_eq", [false]);
+return (($receiver = (($receiver = self).klass === smalltalk.Number) ? $receiver ==anObject : smalltalk.send($receiver, "__eq", [anObject])).klass === smalltalk.Number) ? $receiver ==false : smalltalk.send($receiver, "__eq", [false]);
 return self;}
 }),
 smalltalk.Object);
@@ -858,7 +858,7 @@ smalltalk.method({
 selector: 'commentStamp:prior:',
 fn: function (aStamp, prior){
 var self=this;
-return smalltalk.send(self, "_commentStamp", []);
+
 return self;}
 }),
 smalltalk.Behavior);
@@ -1611,6 +1611,39 @@ return self;}
 }),
 smalltalk.BlockClosure);
 
+smalltalk.addMethod(
+'_whileFalse',
+smalltalk.method({
+selector: 'whileFalse',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_whileFalse_", [(function(){return nil;})]);
+return self;}
+}),
+smalltalk.BlockClosure);
+
+smalltalk.addMethod(
+'_whileTrue',
+smalltalk.method({
+selector: 'whileTrue',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_whileTrue_", [(function(){return nil;})]);
+return self;}
+}),
+smalltalk.BlockClosure);
+
+smalltalk.addMethod(
+'_new',
+smalltalk.method({
+selector: 'new',
+fn: function (){
+var self=this;
+return new self();
+return self;}
+}),
+smalltalk.BlockClosure);
+
 
 
 smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel');
@@ -1752,40 +1785,6 @@ return self;}
 }),
 smalltalk.Boolean);
 
-smalltalk.addMethod(
-'_&',
-smalltalk.method({
-selector: '&',
-fn: function (aBoolean){
-var self=this;
-
-	    if(self == true) {
-		return aBoolean;
-	    } else {
-		return false;
-	    }
-	;
-return self;}
-}),
-smalltalk.Boolean);
-
-smalltalk.addMethod(
-'_|',
-smalltalk.method({
-selector: '|',
-fn: function (aBoolean){
-var self=this;
-
-	    if(self == true) {
-		return true;
-	    } else {
-		return aBoolean;
-	    }
-	;
-return self;}
-}),
-smalltalk.Boolean);
-
 
 
 smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel');
@@ -3405,17 +3404,6 @@ return self;}
 }),
 smalltalk.String);
 
-smalltalk.addMethod(
-'_asciiValue',
-smalltalk.method({
-selector: 'asciiValue',
-fn: function (){
-var self=this;
-return self.charCodeAt(0);;
-return self;}
-}),
-smalltalk.String);
-
 
 smalltalk.addMethod(
 '_streamClass',
@@ -3508,17 +3496,6 @@ return self;}
 }),
 smalltalk.String.klass);
 
-smalltalk.addMethod(
-'_value_',
-smalltalk.method({
-selector: 'value:',
-fn: function (aUTFCharCode){
-var self=this;
-return String.fromCharCode(aUTFCharCode);;
-return self;}
-}),
-smalltalk.String.klass);
-
 
 smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel');
 smalltalk.addMethod(
@@ -3655,7 +3632,7 @@ fn: function (aBlock){
 var self=this;
 
 		return self.sort(function(a, b) {
-			if(aBlock(a,b)) {return 1} else {return -1}
+			if(aBlock(a,b)) {return -1} else {return 1}
 		})
 	;
 return self;}
@@ -3697,7 +3674,7 @@ smalltalk.method({
 selector: 'sorted:',
 fn: function (aBlock){
 var self=this;
-return smalltalk.send(smalltalk.send(self, "_copy", []), "_sorted_", [aBlock]);
+return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
 return self;}
 }),
 smalltalk.Array);

+ 83 - 110
js/Kernel.js

@@ -21,10 +21,10 @@ selector: '~=',
 category: 'comparing',
 fn: function (anObject){
 var self=this;
-return smalltalk.send(smalltalk.send(self, "__eq", [anObject]), "__eq_eq", [false]);
+return (($receiver = (($receiver = self).klass === smalltalk.Number) ? $receiver ==anObject : smalltalk.send($receiver, "__eq", [anObject])).klass === smalltalk.Number) ? $receiver ==false : smalltalk.send($receiver, "__eq", [false]);
 return self;},
-source: unescape('%7E%3D%20anObject%0A%09%5E%28self%20%3D%20anObject%29%20%3D%3D%20false'),
-messageSends: [unescape("%3D%3D"), unescape("%3D")],
+source: unescape('%7E%3D%20anObject%0A%09%5E%28self%20%3D%20anObject%29%20%3D%20false'),
+messageSends: [unescape("%3D")],
 referencedClasses: []
 }),
 smalltalk.Object);
@@ -429,7 +429,7 @@ fn: function (aBlock){
 var self=this;
 return self;
 return self;},
-source: unescape('ifNil%3A%20aBlock%0A%09%5Eself'),
+source: unescape('ifNil%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -444,7 +444,7 @@ fn: function (aBlock, anotherBlock){
 var self=this;
 return smalltalk.send(anotherBlock, "_value", []);
 return self;},
-source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%5EanotherBlock%20value'),
+source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EanotherBlock%20value'),
 messageSends: ["value"],
 referencedClasses: []
 }),
@@ -459,7 +459,7 @@ fn: function (aBlock){
 var self=this;
 return smalltalk.send(aBlock, "_value", []);
 return self;},
-source: unescape('ifNotNil%3A%20aBlock%0A%09%5EaBlock%20value'),
+source: unescape('ifNotNil%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EaBlock%20value'),
 messageSends: ["value"],
 referencedClasses: []
 }),
@@ -474,7 +474,7 @@ fn: function (aBlock, anotherBlock){
 var self=this;
 return smalltalk.send(aBlock, "_value", []);
 return self;},
-source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%5EaBlock%20value'),
+source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EaBlock%20value'),
 messageSends: ["value"],
 referencedClasses: []
 }),
@@ -1151,10 +1151,10 @@ selector: 'commentStamp:prior:',
 category: 'accessing',
 fn: function (aStamp, prior){
 var self=this;
-return smalltalk.send(self, "_commentStamp", []);
+
 return self;},
-source: unescape('commentStamp%3A%20aStamp%20prior%3A%20prior%0A%20%20%20%20%20%20%20%20%20%22Stamp%20and%20prior%20ignored%20right%20now.%22%0A%09%5Eself%20commentStamp'),
-messageSends: ["commentStamp"],
+source: unescape('commentStamp%3A%20aStamp%20prior%3A%20prior%0A%20%20%20%20%20%20%20%20%20%22Ignored%20right%20now.%22'),
+messageSends: [],
 referencedClasses: []
 }),
 smalltalk.Behavior);
@@ -1529,7 +1529,7 @@ fn: function (aNumber){
 var self=this;
 return Number(self) == aNumber;
 return self;},
-source: unescape('%3D%20aNumber%0A%09%3Creturn%20Number%28self%29%20%3D%3D%20aNumber%3E'),
+source: unescape('%3D%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20Number%28self%29%20%3D%3D%20aNumber%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -1544,7 +1544,7 @@ fn: function (aNumber){
 var self=this;
 return self > aNumber;
 return self;},
-source: unescape('%3E%20aNumber%0A%09%3Creturn%20self%20%3E%3E%20aNumber%3E'),
+source: unescape('%3E%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20%3E%3E%20aNumber%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -1559,7 +1559,7 @@ fn: function (aNumber){
 var self=this;
 return self < aNumber;
 return self;},
-source: unescape('%3C%20aNumber%0A%09%3Creturn%20self%20%3C%20aNumber%3E'),
+source: unescape('%3C%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20%3C%20aNumber%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -1574,7 +1574,7 @@ fn: function (aNumber){
 var self=this;
 return self >= aNumber;
 return self;},
-source: unescape('%3E%3D%20aNumber%0A%09%3Creturn%20self%20%3E%3E%3D%20aNumber%3E'),
+source: unescape('%3E%3D%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20%3E%3E%3D%20aNumber%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -1589,7 +1589,7 @@ fn: function (aNumber){
 var self=this;
 return self <= aNumber;
 return self;},
-source: unescape('%3C%3D%20aNumber%0A%09%3Creturn%20self%20%3C%3D%20aNumber%3E'),
+source: unescape('%3C%3D%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20%3C%3D%20aNumber%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -1604,7 +1604,7 @@ fn: function (aNumber){
 var self=this;
 return self + aNumber;
 return self;},
-source: unescape('+%20aNumber%0A%09%3Creturn%20self%20+%20aNumber%3E'),
+source: unescape('+%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20+%20aNumber%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -1619,7 +1619,7 @@ fn: function (aNumber){
 var self=this;
 return self - aNumber;
 return self;},
-source: unescape('-%20aNumber%0A%09%3Creturn%20self%20-%20aNumber%3E'),
+source: unescape('-%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20-%20aNumber%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -1634,7 +1634,7 @@ fn: function (aNumber){
 var self=this;
 return self * aNumber;
 return self;},
-source: unescape('*%20aNumber%0A%09%3Creturn%20self%20*%20aNumber%3E'),
+source: unescape('*%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20*%20aNumber%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -1649,7 +1649,7 @@ fn: function (aNumber){
 var self=this;
 return self / aNumber;
 return self;},
-source: unescape('/%20aNumber%0A%09%3Creturn%20self%20/%20aNumber%3E'),
+source: unescape('/%20aNumber%0A%09%22Inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%20/%20aNumber%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -2011,7 +2011,7 @@ fn: function (aBlock){
 var self=this;
 while(self()) {aBlock()};
 return self;},
-source: unescape('whileTrue%3A%20aBlock%0A%09%3Cwhile%28self%28%29%29%20%7BaBlock%28%29%7D%3E'),
+source: unescape('whileTrue%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Cwhile%28self%28%29%29%20%7BaBlock%28%29%7D%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -2026,7 +2026,7 @@ fn: function (aBlock){
 var self=this;
 while(!self()) {aBlock()};
 return self;},
-source: unescape('whileFalse%3A%20aBlock%0A%09%3Cwhile%28%21self%28%29%29%20%7BaBlock%28%29%7D%3E'),
+source: unescape('whileFalse%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Cwhile%28%21self%28%29%29%20%7BaBlock%28%29%7D%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -2041,7 +2041,7 @@ fn: function (){
 var self=this;
 return self();;
 return self;},
-source: unescape('value%0A%09%3Creturn%20self%28%29%3B%3E'),
+source: unescape('value%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%28%29%3B%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -2056,7 +2056,7 @@ fn: function (anArg){
 var self=this;
 return self(anArg);;
 return self;},
-source: unescape('value%3A%20anArg%0A%09%3Creturn%20self%28anArg%29%3B%3E'),
+source: unescape('value%3A%20anArg%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%28anArg%29%3B%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -2071,7 +2071,7 @@ fn: function (firstArg, secondArg){
 var self=this;
 return self(firstArg, secondArg);;
 return self;},
-source: unescape('value%3A%20firstArg%20value%3A%20secondArg%0A%09%3Creturn%20self%28firstArg%2C%20secondArg%29%3B%3E'),
+source: unescape('value%3A%20firstArg%20value%3A%20secondArg%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%28firstArg%2C%20secondArg%29%3B%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -2086,7 +2086,7 @@ fn: function (firstArg, secondArg, thirdArg){
 var self=this;
 return self(firstArg, secondArg, thirdArg);;
 return self;},
-source: unescape('value%3A%20firstArg%20value%3A%20secondArg%20value%3A%20thirdArg%0A%09%3Creturn%20self%28firstArg%2C%20secondArg%2C%20thirdArg%29%3B%3E'),
+source: unescape('value%3A%20firstArg%20value%3A%20secondArg%20value%3A%20thirdArg%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3Creturn%20self%28firstArg%2C%20secondArg%2C%20thirdArg%29%3B%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -2167,6 +2167,51 @@ referencedClasses: [smalltalk.String]
 }),
 smalltalk.BlockClosure);
 
+smalltalk.addMethod(
+'_whileFalse',
+smalltalk.method({
+selector: 'whileFalse',
+category: 'controlling',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_whileFalse_", [(function(){return nil;})]);
+return self;},
+source: unescape('whileFalse%0A%09%22inlined%20in%20the%20Compiler%22%0A%09self%20whileFalse%3A%20%5B%5D'),
+messageSends: ["whileFalse:"],
+referencedClasses: []
+}),
+smalltalk.BlockClosure);
+
+smalltalk.addMethod(
+'_whileTrue',
+smalltalk.method({
+selector: 'whileTrue',
+category: 'controlling',
+fn: function (){
+var self=this;
+smalltalk.send(self, "_whileTrue_", [(function(){return nil;})]);
+return self;},
+source: unescape('whileTrue%0A%09%22inlined%20in%20the%20Compiler%22%0A%09self%20whileTrue%3A%20%5B%5D'),
+messageSends: ["whileTrue:"],
+referencedClasses: []
+}),
+smalltalk.BlockClosure);
+
+smalltalk.addMethod(
+'_new',
+smalltalk.method({
+selector: 'new',
+category: 'evaluating',
+fn: function (){
+var self=this;
+return new self();
+return self;},
+source: unescape('new%0A%09%22Use%20the%20receiver%20as%20a%20JS%20constructor.%20%0A%09*Do%20not*%20use%20this%20method%20to%20instanciate%20Smalltalk%20objects%21%22%0A%09%3Creturn%20new%20self%28%29%3E'),
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.BlockClosure);
+
 
 
 smalltalk.addClass('Boolean', smalltalk.Object, [], 'Kernel');
@@ -2224,7 +2269,7 @@ fn: function (aBlock){
 var self=this;
 return smalltalk.send(self, "_ifTrue_ifFalse_", [aBlock, (function(){return nil;})]);
 return self;},
-source: unescape('ifTrue%3A%20aBlock%0A%09%5Eself%20ifTrue%3A%20aBlock%20ifFalse%3A%20%5B%5D'),
+source: unescape('ifTrue%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself%20ifTrue%3A%20aBlock%20ifFalse%3A%20%5B%5D'),
 messageSends: ["ifTrue:ifFalse:"],
 referencedClasses: []
 }),
@@ -2239,7 +2284,7 @@ fn: function (aBlock){
 var self=this;
 return smalltalk.send(self, "_ifTrue_ifFalse_", [(function(){return nil;}), aBlock]);
 return self;},
-source: unescape('ifFalse%3A%20aBlock%0A%09%5Eself%20ifTrue%3A%20%5B%5D%20ifFalse%3A%20aBlock'),
+source: unescape('ifFalse%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself%20ifTrue%3A%20%5B%5D%20ifFalse%3A%20aBlock'),
 messageSends: ["ifTrue:ifFalse:"],
 referencedClasses: []
 }),
@@ -2254,7 +2299,7 @@ fn: function (aBlock, anotherBlock){
 var self=this;
 return smalltalk.send(self, "_ifTrue_ifFalse_", [anotherBlock, aBlock]);
 return self;},
-source: unescape('ifFalse%3A%20aBlock%20ifTrue%3A%20anotherBlock%0A%09%5Eself%20ifTrue%3A%20anotherBlock%20ifFalse%3A%20aBlock'),
+source: unescape('ifFalse%3A%20aBlock%20ifTrue%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself%20ifTrue%3A%20anotherBlock%20ifFalse%3A%20aBlock'),
 messageSends: ["ifTrue:ifFalse:"],
 referencedClasses: []
 }),
@@ -2275,7 +2320,7 @@ var self=this;
 	    }
 	;
 return self;},
-source: unescape('ifTrue%3A%20aBlock%20ifFalse%3A%20anotherBlock%0A%09%3C%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20aBlock%28%29%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20anotherBlock%28%29%3B%0A%09%20%20%20%20%7D%0A%09%3E'),
+source: unescape('ifTrue%3A%20aBlock%20ifFalse%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%3C%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20aBlock%28%29%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20anotherBlock%28%29%3B%0A%09%20%20%20%20%7D%0A%09%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -2356,48 +2401,6 @@ referencedClasses: []
 }),
 smalltalk.Boolean);
 
-smalltalk.addMethod(
-'_&',
-smalltalk.method({
-selector: '&',
-category: 'controlling',
-fn: function (aBoolean){
-var self=this;
-
-	    if(self == true) {
-		return aBoolean;
-	    } else {
-		return false;
-	    }
-	;
-return self;},
-source: unescape('%26%20aBoolean%0A%09%3C%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20aBoolean%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20false%3B%0A%09%20%20%20%20%7D%0A%09%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Boolean);
-
-smalltalk.addMethod(
-'_|',
-smalltalk.method({
-selector: '|',
-category: 'controlling',
-fn: function (aBoolean){
-var self=this;
-
-	    if(self == true) {
-		return true;
-	    } else {
-		return aBoolean;
-	    }
-	;
-return self;},
-source: unescape('%7C%20aBoolean%0A%09%3C%0A%09%20%20%20%20if%28self%20%3D%3D%20true%29%20%7B%0A%09%09return%20true%3B%0A%09%20%20%20%20%7D%20else%20%7B%0A%09%09return%20aBoolean%3B%0A%09%20%20%20%20%7D%0A%09%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Boolean);
-
 
 
 smalltalk.addClass('Date', smalltalk.Object, [], 'Kernel');
@@ -3092,7 +3095,7 @@ fn: function (aBlock){
 var self=this;
 return smalltalk.send(self, "_ifNil_ifNotNil_", [aBlock, (function(){return nil;})]);
 return self;},
-source: unescape('ifNil%3A%20aBlock%0A%09%5Eself%20ifNil%3A%20aBlock%20ifNotNil%3A%20%5B%5D'),
+source: unescape('ifNil%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself%20ifNil%3A%20aBlock%20ifNotNil%3A%20%5B%5D'),
 messageSends: ["ifNil:ifNotNil:"],
 referencedClasses: []
 }),
@@ -3107,7 +3110,7 @@ fn: function (aBlock){
 var self=this;
 return self;
 return self;},
-source: unescape('ifNotNil%3A%20aBlock%0A%09%5Eself'),
+source: unescape('ifNotNil%3A%20aBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5Eself'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -3122,7 +3125,7 @@ fn: function (aBlock, anotherBlock){
 var self=this;
 return smalltalk.send(aBlock, "_value", []);
 return self;},
-source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%5EaBlock%20value'),
+source: unescape('ifNil%3A%20aBlock%20ifNotNil%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EaBlock%20value'),
 messageSends: ["value"],
 referencedClasses: []
 }),
@@ -3137,7 +3140,7 @@ fn: function (aBlock, anotherBlock){
 var self=this;
 return smalltalk.send(anotherBlock, "_value", []);
 return self;},
-source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%5EanotherBlock%20value'),
+source: unescape('ifNotNil%3A%20aBlock%20ifNil%3A%20anotherBlock%0A%09%22inlined%20in%20the%20Compiler%22%0A%09%5EanotherBlock%20value'),
 messageSends: ["value"],
 referencedClasses: []
 }),
@@ -4582,21 +4585,6 @@ referencedClasses: []
 }),
 smalltalk.String);
 
-smalltalk.addMethod(
-'_asciiValue',
-smalltalk.method({
-selector: 'asciiValue',
-category: 'accessing',
-fn: function (){
-var self=this;
-return self.charCodeAt(0);;
-return self;},
-source: unescape('asciiValue%0A%09%3Creturn%20self.charCodeAt%280%29%3B%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.String);
-
 
 smalltalk.addMethod(
 '_streamClass',
@@ -4721,21 +4709,6 @@ referencedClasses: [smalltalk.String]
 }),
 smalltalk.String.klass);
 
-smalltalk.addMethod(
-'_value_',
-smalltalk.method({
-selector: 'value:',
-category: 'instance creation',
-fn: function (aUTFCharCode){
-var self=this;
-return String.fromCharCode(aUTFCharCode);;
-return self;},
-source: unescape('value%3A%20aUTFCharCode%0A%0A%09%3Creturn%20String.fromCharCode%28aUTFCharCode%29%3B%3E'),
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.String.klass);
-
 
 smalltalk.addClass('Array', smalltalk.SequenceableCollection, [], 'Kernel');
 smalltalk.addMethod(
@@ -4913,11 +4886,11 @@ fn: function (aBlock){
 var self=this;
 
 		return self.sort(function(a, b) {
-			if(aBlock(a,b)) {return 1} else {return -1}
+			if(aBlock(a,b)) {return -1} else {return 1}
 		})
 	;
 return self;},
-source: unescape('sort%3A%20aBlock%0A%09%3C%0A%09%09return%20self.sort%28function%28a%2C%20b%29%20%7B%0A%09%09%09if%28aBlock%28a%2Cb%29%29%20%7Breturn%201%7D%20else%20%7Breturn%20-1%7D%0A%09%09%7D%29%0A%09%3E'),
+source: unescape('sort%3A%20aBlock%0A%09%3C%0A%09%09return%20self.sort%28function%28a%2C%20b%29%20%7B%0A%09%09%09if%28aBlock%28a%2Cb%29%29%20%7Breturn%20-1%7D%20else%20%7Breturn%201%7D%0A%09%09%7D%29%0A%09%3E'),
 messageSends: [],
 referencedClasses: []
 }),
@@ -4967,10 +4940,10 @@ selector: 'sorted:',
 category: 'enumerating',
 fn: function (aBlock){
 var self=this;
-return smalltalk.send(smalltalk.send(self, "_copy", []), "_sorted_", [aBlock]);
+return smalltalk.send(smalltalk.send(self, "_copy", []), "_sort_", [aBlock]);
 return self;},
-source: unescape('sorted%3A%20aBlock%0A%09%5Eself%20copy%20sorted%3A%20aBlock'),
-messageSends: ["sorted:", "copy"],
+source: unescape('sorted%3A%20aBlock%0A%09%5Eself%20copy%20sort%3A%20aBlock'),
+messageSends: ["sort:", "copy"],
 referencedClasses: []
 }),
 smalltalk.Array);

+ 47 - 34
st/Kernel.st

@@ -43,7 +43,7 @@ basicDelete: aString
 !
 
 ~= anObject
-	^(self = anObject) == false
+	^(self = anObject) = false
 ! !
 
 !Object methodsFor: 'converting'!
@@ -180,18 +180,22 @@ isMemberOf: aClass
 !
 
 ifNil: aBlock
+	"inlined in the Compiler"
 	^self
 !
 
 ifNil: aBlock ifNotNil: anotherBlock
+	"inlined in the Compiler"
 	^anotherBlock value
 !
 
 ifNotNil: aBlock
+	"inlined in the Compiler"
 	^aBlock value
 !
 
 ifNotNil: aBlock ifNil: anotherBlock
+	"inlined in the Compiler"
 	^aBlock value
 !
 
@@ -383,8 +387,7 @@ methodsFor: aString stamp: aStamp
 !
 
 commentStamp: aStamp prior: prior
-         "Stamp and prior ignored right now."
-	^self commentStamp
+         "Ignored right now."
 ! !
 
 !Behavior methodsFor: 'instance creation'!
@@ -535,18 +538,22 @@ Object subclass: #Number
 !Number methodsFor: 'arithmetic'!
 
 + aNumber
+	"Inlined in the Compiler"
 	<return self + aNumber>
 !
 
 - aNumber
+	"Inlined in the Compiler"
 	<return self - aNumber>
 !
 
 * aNumber
+	"Inlined in the Compiler"
 	<return self * aNumber>
 !
 
 / aNumber
+	"Inlined in the Compiler"
 	<return self / aNumber>
 !
 
@@ -565,22 +572,27 @@ modulo: aNumber
 !Number methodsFor: 'comparing'!
 
 = aNumber
+	"Inlined in the Compiler"
 	<return Number(self) == aNumber>
 !
 
 > aNumber
+	"Inlined in the Compiler"
 	<return self >> aNumber>
 !
 
 < aNumber
+	"Inlined in the Compiler"
 	<return self < aNumber>
 !
 
 >= aNumber
+	"Inlined in the Compiler"
 	<return self >>= aNumber>
 !
 
 <= aNumber
+	"Inlined in the Compiler"
 	<return self <= aNumber>
 ! !
 
@@ -696,11 +708,23 @@ compiledSource
 !BlockClosure methodsFor: 'controlling'!
 
 whileTrue: aBlock
+	"inlined in the Compiler"
 	<while(self()) {aBlock()}>
 !
 
 whileFalse: aBlock
+	"inlined in the Compiler"
 	<while(!!self()) {aBlock()}>
+!
+
+whileFalse
+	"inlined in the Compiler"
+	self whileFalse: []
+!
+
+whileTrue
+	"inlined in the Compiler"
+	self whileTrue: []
 ! !
 
 !BlockClosure methodsFor: 'error handling'!
@@ -715,23 +739,33 @@ on: anErrorClass do: aBlock
 !BlockClosure methodsFor: 'evaluating'!
 
 value
+	"inlined in the Compiler"
 	<return self();>
 !
 
 value: anArg
+	"inlined in the Compiler"
 	<return self(anArg);>
 !
 
 value: firstArg value: secondArg
+	"inlined in the Compiler"
 	<return self(firstArg, secondArg);>
 !
 
 value: firstArg value: secondArg value: thirdArg
+	"inlined in the Compiler"
 	<return self(firstArg, secondArg, thirdArg);>
 !
 
 valueWithPossibleArguments: aCollection
 	<return self.apply(null, aCollection);>
+!
+
+new
+	"Use the receiver as a JS constructor. 
+	*Do not* use this method to instanciate Smalltalk objects!!"
+	<return new self()>
 ! !
 
 !BlockClosure methodsFor: 'printing'!
@@ -774,18 +808,22 @@ asJSONObject
 !Boolean methodsFor: 'controlling'!
 
 ifTrue: aBlock
+	"inlined in the Compiler"
 	^self ifTrue: aBlock ifFalse: []
 !
 
 ifFalse: aBlock
+	"inlined in the Compiler"
 	^self ifTrue: [] ifFalse: aBlock
 !
 
 ifFalse: aBlock ifTrue: anotherBlock
+	"inlined in the Compiler"
 	^self ifTrue: anotherBlock ifFalse: aBlock
 !
 
 ifTrue: aBlock ifFalse: anotherBlock
+	"inlined in the Compiler"
 	<
 	    if(self == true) {
 		return aBlock();
@@ -809,26 +847,6 @@ or: aBlock
 
 not
 	^self = false
-!
-
-& aBoolean
-	<
-	    if(self == true) {
-		return aBoolean;
-	    } else {
-		return false;
-	    }
-	>
-!
-
-| aBoolean
-	<
-	    if(self == true) {
-		return true;
-	    } else {
-		return aBoolean;
-	    }
-	>
 ! !
 
 !Boolean methodsFor: 'copying'!
@@ -1067,18 +1085,22 @@ printString
 !UndefinedObject methodsFor: 'testing'!
 
 ifNil: aBlock
+	"inlined in the Compiler"
 	^self ifNil: aBlock ifNotNil: []
 !
 
 ifNotNil: aBlock
+	"inlined in the Compiler"
 	^self
 !
 
 ifNil: aBlock ifNotNil: anotherBlock
+	"inlined in the Compiler"
 	^aBlock value
 !
 
 ifNotNil: aBlock ifNil: anotherBlock
+	"inlined in the Compiler"
 	^anotherBlock value
 !
 
@@ -1395,10 +1417,6 @@ escaped
 
 unescaped
 	<return unescape(self)>
-!
-
-asciiValue
-	<return self.charCodeAt(0);>
 ! !
 
 !String methodsFor: 'adding'!
@@ -1629,11 +1647,6 @@ streamContents: blockWithArg
 	stream := (self streamClass on: String new).
 	blockWithArg value: stream.
 	^ stream contents
-!
-
-value: aUTFCharCode
-
-	<return String.fromCharCode(aUTFCharCode);>
 ! !
 
 SequenceableCollection subclass: #Array
@@ -1729,7 +1742,7 @@ sort
 sort: aBlock
 	<
 		return self.sort(function(a, b) {
-			if(aBlock(a,b)) {return 1} else {return -1}
+			if(aBlock(a,b)) {return -1} else {return 1}
 		})
 	>
 !
@@ -1739,7 +1752,7 @@ sorted
 !
 
 sorted: aBlock
-	^self copy sorted: aBlock
+	^self copy sort: aBlock
 !
 
 printString