Browse Source

Compile both self and $self into method.

'self' meant to be used for the value.
'$self' meant to be used as a receiver.
ATM, both are defined as 'this'.
Herbert Vojčík 1 year ago
parent
commit
e23f53c0e0

+ 3 - 0
API-CHANGES.txt

@@ -12,6 +12,9 @@
 + PseudoVar >>
   + isSelf
   + isSuper
++UndefinedObject >>
+  + identityHash
+  + value
 
 - IRSend >>
   - isSuperSend

+ 2 - 0
CHANGELOG

@@ -4,6 +4,8 @@
 * Removed `.allowJavaScriptCalls` flag.
 * Internal `.isNil` deprecated in favour of `.a$nil`.
 * Internal `.klass` deprecated in favour of `.a$cls`.
+* Both 'self' and '$self' compiled in method code.
+  * '$self' used as receiver, 'self' used to pass a value.
 
 Breaks fw compat, uses `a$nil` and `a$cls` when compiling / saving code.
 

File diff suppressed because it is too large
+ 243 - 243
external/amber-cli/src/AmberCli.js


+ 5 - 5
external/amber-dev/lib/NodeTestRunner.js

@@ -13,11 +13,11 @@ $core.method({
 selector: "main",
 protocol: "not yet classified",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._runTestSuite();
+$self._runTestSuite();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"main",{},$globals.NodeTestRunner.a$cls)});
@@ -37,7 +37,7 @@ $core.method({
 selector: "runTestSuite",
 protocol: "not yet classified",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var suite,worker;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
@@ -176,7 +176,7 @@ $20=$recv($21).__comma(" is failing!");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx[","]=6;
 //>>excludeEnd("ctx");
-self._throw_($20);
+$self._throw_($20);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["throw:"]=1;
 //>>excludeEnd("ctx");
@@ -215,7 +215,7 @@ $33=$recv($34).__comma(" has errors!");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx[","]=9;
 //>>excludeEnd("ctx");
-return self._throw_($33);
+return $self._throw_($33);
 }
 }
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);

+ 1 - 1
internal/index.html

@@ -30,7 +30,7 @@
     startHelios.parentNode.removeChild(startHelios);
     var loadHelpers = new Promise(function (resolve, reject) {
         setTimeout(function () {
-            require(["amber/legacy/IDE", "amber/web/Web", "amber/legacy/Benchfib", "helios/all", "amber_cli/AmberCli"], resolve, reject);
+            require(["amber/legacy/IDE", "amber/web/Web", "amber/web/Web-Snippets", "my/silk/devel", "helios/all", "amber_cli/AmberCli"], resolve, reject);
         }, 250);
     });
     require(["amber/devel"], function (amber) {

File diff suppressed because it is too large
+ 243 - 243
src/Compiler-AST.js


+ 93 - 93
src/Compiler-Core.js

@@ -15,11 +15,11 @@ $core.method({
 selector: "compileNode:",
 protocol: "compiling",
 fn: function (aNode){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return $recv(self._transformers())._inject_into_(aNode,(function(input,transformer){
+return $recv($self._transformers())._inject_into_(aNode,(function(input,transformer){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -46,8 +46,8 @@ $core.method({
 selector: "currentClass",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@currentClass"];
+var self=this,$self=this;
+return $self["@currentClass"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -64,8 +64,8 @@ $core.method({
 selector: "currentClass:",
 protocol: "accessing",
 fn: function (aClass){
-var self=this;
-self["@currentClass"]=aClass;
+var self=this,$self=this;
+$self["@currentClass"]=aClass;
 return self;
 
 },
@@ -83,8 +83,8 @@ $core.method({
 selector: "currentPackage",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@currentPackage"];
+var self=this,$self=this;
+return $self["@currentPackage"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -101,8 +101,8 @@ $core.method({
 selector: "currentPackage:",
 protocol: "accessing",
 fn: function (anObject){
-var self=this;
-self["@currentPackage"]=anObject;
+var self=this,$self=this;
+$self["@currentPackage"]=anObject;
 return self;
 
 },
@@ -120,7 +120,7 @@ $core.method({
 selector: "pseudoVariables",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -143,12 +143,12 @@ $core.method({
 selector: "source",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1,$receiver;
-$1=self["@source"];
+$1=$self["@source"];
 if(($receiver = $1) == null || $receiver.a$nil){
 return "";
 } else {
@@ -172,8 +172,8 @@ $core.method({
 selector: "source:",
 protocol: "accessing",
 fn: function (aString){
-var self=this;
-self["@source"]=aString;
+var self=this,$self=this;
+$self["@source"]=aString;
 return self;
 
 },
@@ -191,12 +191,12 @@ $core.method({
 selector: "transformers",
 protocol: "compiling",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var dict;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-dict=self._transformersDictionary();
+dict=$self._transformersDictionary();
 return $recv($recv($recv($recv(dict)._keys())._asArray())._sort())._collect_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
@@ -224,11 +224,11 @@ $core.method({
 selector: "transformersDictionary",
 protocol: "compiling",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._subclassResponsibility();
+$self._subclassResponsibility();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"transformersDictionary",{},$globals.AbstractCodeGenerator)});
@@ -254,13 +254,13 @@ $core.method({
 selector: "irTranslator",
 protocol: "compiling",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
-$1=$recv(self._irTranslatorClass())._new();
-$recv($1)._currentClass_(self._currentClass());
+$1=$recv($self._irTranslatorClass())._new();
+$recv($1)._currentClass_($self._currentClass());
 return $recv($1)._yourself();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"irTranslator",{},$globals.CodeGenerator)});
@@ -280,7 +280,7 @@ $core.method({
 selector: "irTranslatorClass",
 protocol: "compiling",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 return $globals.IRJSTranslator;
 
 },
@@ -298,13 +298,13 @@ $core.method({
 selector: "semanticAnalyzer",
 protocol: "compiling",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
-$1=$recv($globals.SemanticAnalyzer)._on_(self._currentClass());
-$recv($1)._thePackage_(self._currentPackage());
+$1=$recv($globals.SemanticAnalyzer)._on_($self._currentClass());
+$recv($1)._thePackage_($self._currentPackage());
 return $recv($1)._yourself();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"semanticAnalyzer",{},$globals.CodeGenerator)});
@@ -324,25 +324,25 @@ $core.method({
 selector: "transformersDictionary",
 protocol: "compiling",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1,$2,$receiver;
-$1=self["@transformersDictionary"];
+$1=$self["@transformersDictionary"];
 if(($receiver = $1) == null || $receiver.a$nil){
 $2=$recv($globals.Dictionary)._new();
-$recv($2)._at_put_("2000-semantic",self._semanticAnalyzer());
+$recv($2)._at_put_("2000-semantic",$self._semanticAnalyzer());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["at:put:"]=1;
 //>>excludeEnd("ctx");
-$recv($2)._at_put_("5000-astToIr",self._translator());
+$recv($2)._at_put_("5000-astToIr",$self._translator());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["at:put:"]=2;
 //>>excludeEnd("ctx");
-$recv($2)._at_put_("8000-irToJs",self._irTranslator());
-self["@transformersDictionary"]=$recv($2)._yourself();
-return self["@transformersDictionary"];
+$recv($2)._at_put_("8000-irToJs",$self._irTranslator());
+$self["@transformersDictionary"]=$recv($2)._yourself();
+return $self["@transformersDictionary"];
 } else {
 return $1;
 }
@@ -364,14 +364,14 @@ $core.method({
 selector: "translator",
 protocol: "compiling",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 $1=$recv($globals.IRASTTranslator)._new();
-$recv($1)._source_(self._source());
-$recv($1)._theClass_(self._currentClass());
+$recv($1)._source_($self._source());
+$recv($1)._theClass_($self._currentClass());
 return $recv($1)._yourself();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"translator",{},$globals.CodeGenerator)});
@@ -397,12 +397,12 @@ $core.method({
 selector: "codeGeneratorClass",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1,$receiver;
-$1=self["@codeGeneratorClass"];
+$1=$self["@codeGeneratorClass"];
 if(($receiver = $1) == null || $receiver.a$nil){
 return $globals.InliningCodeGenerator;
 } else {
@@ -426,8 +426,8 @@ $core.method({
 selector: "codeGeneratorClass:",
 protocol: "accessing",
 fn: function (aClass){
-var self=this;
-self["@codeGeneratorClass"]=aClass;
+var self=this,$self=this;
+$self["@codeGeneratorClass"]=aClass;
 return self;
 
 },
@@ -445,12 +445,12 @@ $core.method({
 selector: "compile:forClass:protocol:",
 protocol: "compiling",
 fn: function (aString,aClass,anotherString){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._source_(aString);
-return self._compileNode_forClass_package_(self._parse_(aString),aClass,$recv(aClass)._packageOfProtocol_(anotherString));
+$self._source_(aString);
+return $self._compileNode_forClass_package_($self._parse_(aString),aClass,$recv(aClass)._packageOfProtocol_(anotherString));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"compile:forClass:protocol:",{aString:aString,aClass:aClass,anotherString:anotherString},$globals.Compiler)});
 //>>excludeEnd("ctx");
@@ -469,7 +469,7 @@ $core.method({
 selector: "compileExpression:on:",
 protocol: "compiling",
 fn: function (aString,anObject){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -478,7 +478,7 @@ $1=$recv("xxxDoIt ^ [ ".__comma(aString)).__comma(" ] value");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx[","]=1;
 //>>excludeEnd("ctx");
-return self._compile_forClass_protocol_($1,$recv(anObject)._class(),"**xxxDoIt");
+return $self._compile_forClass_protocol_($1,$recv(anObject)._class(),"**xxxDoIt");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"compileExpression:on:",{aString:aString,anObject:anObject},$globals.Compiler)});
 //>>excludeEnd("ctx");
@@ -497,17 +497,17 @@ $core.method({
 selector: "compileNode:",
 protocol: "compiling",
 fn: function (aNode){
-var self=this;
+var self=this,$self=this;
 var generator,result;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
-generator=$recv(self._codeGeneratorClass())._new();
+generator=$recv($self._codeGeneratorClass())._new();
 $1=generator;
-$recv($1)._source_(self._source());
-$recv($1)._currentClass_(self._currentClass());
-$recv($1)._currentPackage_(self._currentPackage());
+$recv($1)._source_($self._source());
+$recv($1)._currentClass_($self._currentClass());
+$recv($1)._currentPackage_($self._currentPackage());
 result=$recv(generator)._compileNode_(aNode);
 return result;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -528,13 +528,13 @@ $core.method({
 selector: "compileNode:forClass:package:",
 protocol: "compiling",
 fn: function (aNode,aClass,aPackage){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._currentClass_(aClass);
-self._currentPackage_(aPackage);
-return self._compileNode_(aNode);
+$self._currentClass_(aClass);
+$self._currentPackage_(aPackage);
+return $self._compileNode_(aNode);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"compileNode:forClass:package:",{aNode:aNode,aClass:aClass,aPackage:aPackage},$globals.Compiler)});
 //>>excludeEnd("ctx");
@@ -553,8 +553,8 @@ $core.method({
 selector: "currentClass",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@currentClass"];
+var self=this,$self=this;
+return $self["@currentClass"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -571,8 +571,8 @@ $core.method({
 selector: "currentClass:",
 protocol: "accessing",
 fn: function (aClass){
-var self=this;
-self["@currentClass"]=aClass;
+var self=this,$self=this;
+$self["@currentClass"]=aClass;
 return self;
 
 },
@@ -590,8 +590,8 @@ $core.method({
 selector: "currentPackage",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@currentPackage"];
+var self=this,$self=this;
+return $self["@currentPackage"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -608,8 +608,8 @@ $core.method({
 selector: "currentPackage:",
 protocol: "accessing",
 fn: function (anObject){
-var self=this;
-self["@currentPackage"]=anObject;
+var self=this,$self=this;
+$self["@currentPackage"]=anObject;
 return self;
 
 },
@@ -627,7 +627,7 @@ $core.method({
 selector: "eval:",
 protocol: "compiling",
 fn: function (aString){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -651,7 +651,7 @@ $core.method({
 selector: "eval:forPackage:",
 protocol: "compiling",
 fn: function (aString,aPackage){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -677,11 +677,11 @@ $core.method({
 selector: "evaluateExpression:",
 protocol: "compiling",
 fn: function (aString){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return self._evaluateExpression_on_(aString,$recv($globals.DoIt)._new());
+return $self._evaluateExpression_on_(aString,$recv($globals.DoIt)._new());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"evaluateExpression:",{aString:aString},$globals.Compiler)});
 //>>excludeEnd("ctx");
@@ -700,13 +700,13 @@ $core.method({
 selector: "evaluateExpression:on:",
 protocol: "compiling",
 fn: function (aString,anObject){
-var self=this;
+var self=this,$self=this;
 var result,method;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
-method=self._eval_(self._compileExpression_on_(aString,anObject));
+method=$self._eval_($self._compileExpression_on_(aString,anObject));
 $recv(method)._protocol_("**xxxDoIt");
 $1=$recv(anObject)._class();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -734,12 +734,12 @@ $core.method({
 selector: "install:forClass:protocol:",
 protocol: "compiling",
 fn: function (aString,aBehavior,anotherString){
-var self=this;
+var self=this,$self=this;
 var compiledMethod;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-compiledMethod=self._eval_forPackage_(self._compile_forClass_protocol_(aString,aBehavior,anotherString),$recv(aBehavior)._packageOfProtocol_(anotherString));
+compiledMethod=$self._eval_forPackage_($self._compile_forClass_protocol_(aString,aBehavior,anotherString),$recv(aBehavior)._packageOfProtocol_(anotherString));
 return $recv($recv($globals.ClassBuilder)._new())._installMethod_forClass_protocol_(compiledMethod,aBehavior,anotherString);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"install:forClass:protocol:",{aString:aString,aBehavior:aBehavior,anotherString:anotherString,compiledMethod:compiledMethod},$globals.Compiler)});
@@ -759,7 +759,7 @@ $core.method({
 selector: "parse:",
 protocol: "compiling",
 fn: function (aString){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -782,7 +782,7 @@ $core.method({
 selector: "parseExpression:",
 protocol: "compiling",
 fn: function (aString){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -791,7 +791,7 @@ $1=$recv("doIt ^ [ ".__comma(aString)).__comma(" ] value");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx[","]=1;
 //>>excludeEnd("ctx");
-return self._parse_($1);
+return $self._parse_($1);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"parseExpression:",{aString:aString},$globals.Compiler)});
 //>>excludeEnd("ctx");
@@ -810,7 +810,7 @@ $core.method({
 selector: "recompile:",
 protocol: "compiling",
 fn: function (aClass){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -824,7 +824,7 @@ $1=$recv($recv(each)._methodClass()).__eq(aClass);
 $ctx2.sendIdx["="]=1;
 //>>excludeEnd("ctx");
 if($core.assert($1)){
-return self._install_forClass_protocol_($recv(each)._source(),aClass,$recv(each)._protocol());
+return $self._install_forClass_protocol_($recv(each)._source(),aClass,$recv(each)._protocol());
 }
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
@@ -838,7 +838,7 @@ var meta;
 meta=$receiver;
 $3=$recv(meta).__eq(aClass);
 if(!$core.assert($3)){
-self._recompile_(meta);
+$self._recompile_(meta);
 }
 }
 return self;
@@ -860,7 +860,7 @@ $core.method({
 selector: "recompileAll",
 protocol: "compiling",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -868,7 +868,7 @@ $recv($recv($globals.Smalltalk)._classes())._do_displayingProgress_((function(ea
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._recompile_(each);
+return $self._recompile_(each);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
 //>>excludeEnd("ctx");
@@ -892,12 +892,12 @@ $core.method({
 selector: "source",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1,$receiver;
-$1=self["@source"];
+$1=$self["@source"];
 if(($receiver = $1) == null || $receiver.a$nil){
 return "";
 } else {
@@ -921,8 +921,8 @@ $core.method({
 selector: "source:",
 protocol: "accessing",
 fn: function (aString){
-var self=this;
-self["@source"]=aString;
+var self=this,$self=this;
+$self["@source"]=aString;
 return self;
 
 },
@@ -941,11 +941,11 @@ $core.method({
 selector: "recompile:",
 protocol: "compiling",
 fn: function (aClass){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv(self._new())._recompile_(aClass);
+$recv($self._new())._recompile_(aClass);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass},$globals.Compiler.a$cls)});
@@ -965,7 +965,7 @@ $core.method({
 selector: "recompileAll",
 protocol: "compiling",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -973,7 +973,7 @@ $recv($recv($globals.Smalltalk)._classes())._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._recompile_(each);
+return $self._recompile_(each);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
 //>>excludeEnd("ctx");
@@ -1014,7 +1014,7 @@ $core.method({
 selector: "evaluate:context:",
 protocol: "evaluating",
 fn: function (aString,aContext){
-var self=this;
+var self=this,$self=this;
 var compiler,ast;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
@@ -1065,7 +1065,7 @@ $core.method({
 selector: "evaluate:for:",
 protocol: "evaluating",
 fn: function (aString,anObject){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -1088,7 +1088,7 @@ $core.method({
 selector: "evaluate:receiver:",
 protocol: "evaluating",
 fn: function (aString,anObject){
-var self=this;
+var self=this,$self=this;
 var compiler;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
@@ -1135,11 +1135,11 @@ $core.method({
 selector: "evaluate:for:",
 protocol: "instance creation",
 fn: function (aString,anObject){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return $recv(self._new())._evaluate_for_(aString,anObject);
+return $recv($self._new())._evaluate_for_(aString,anObject);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"evaluate:for:",{aString:aString,anObject:anObject},$globals.Evaluator.a$cls)});
 //>>excludeEnd("ctx");
@@ -1158,14 +1158,14 @@ $core.method({
 selector: "asVariableName",
 protocol: "*Compiler-Core",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 $1=$recv($recv($globals.Smalltalk)._reservedWords())._includes_(self);
 if($core.assert($1)){
-return self.__comma("_");
+return $self.__comma("_");
 } else {
 return self;
 }

File diff suppressed because it is too large
+ 497 - 490
src/Compiler-IR.js


+ 5 - 2
src/Compiler-IR.st

@@ -1006,6 +1006,9 @@ visitInstructionList: anArray enclosedBetween: aString and: anotherString
 !
 
 visitReceiver: anIRInstruction
+	"Ugly hack, mutation"
+	anIRInstruction isSelf ifTrue: [ anIRInstruction variable: (anIRInstruction variable copy name: '$self'; yourself) ].
+	
 	anIRInstruction needsBoxingAsReceiver ifFalse: [ ^ self visit: anIRInstruction ].
 	
 	self stream nextPutAll: '$recv('.
@@ -1030,7 +1033,7 @@ visitSuperSend: anIRSend
 		nextPutAll: '(', self currentClass asJavaScriptSource;
 		nextPutAll: '.superclass||$boot.nilAsClass).fn.prototype.';
 		nextPutAll: anIRSend selector asJavaScriptMethodName, '.apply(';
-		nextPutAll: '$recv(self), '.
+		nextPutAll: '$self, '.
 	self
 		visitInstructionList: anIRSend arguments
 		enclosedBetween: '[' and: ']'.
@@ -1170,7 +1173,7 @@ nextPutFunctionWith: aBlock arguments: anArray
 		do: [ :each | stream nextPutAll: each asVariableName ]
 		separatedBy: [ stream nextPut: ',' ].
 	stream nextPutAll: '){'; lf.
-	stream nextPutAll: 'var self=this;'; lf.
+	stream nextPutAll: 'var self=this,$self=this;'; lf.
 	aBlock value.
 	stream lf; nextPutAll: '}'
 !

File diff suppressed because it is too large
+ 155 - 155
src/Compiler-Inlining.js


File diff suppressed because it is too large
+ 360 - 360
src/Compiler-Interpreter.js


File diff suppressed because it is too large
+ 260 - 260
src/Compiler-Semantic.js


+ 1 - 1
src/Compiler-Semantic.st

@@ -362,7 +362,7 @@ I am an instance variable of a method or block.!
 !InstanceVar methodsFor: 'testing'!
 
 alias
-	^ 'self["@', self name, '"]'
+	^ '$self["@', self name, '"]'
 !
 
 isInstanceVar

File diff suppressed because it is too large
+ 278 - 278
src/Compiler-Tests.js


+ 90 - 90
src/Kernel-Announcements.js

@@ -15,8 +15,8 @@ $core.method({
 selector: "announcementClass",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@announcementClass"];
+var self=this,$self=this;
+return $self["@announcementClass"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -33,8 +33,8 @@ $core.method({
 selector: "announcementClass:",
 protocol: "accessing",
 fn: function (aClass){
-var self=this;
-self["@announcementClass"]=aClass;
+var self=this,$self=this;
+$self["@announcementClass"]=aClass;
 return self;
 
 },
@@ -52,14 +52,14 @@ $core.method({
 selector: "deliver:",
 protocol: "announcing",
 fn: function (anAnnouncement){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
-$1=self._handlesAnnouncement_(anAnnouncement);
+$1=$self._handlesAnnouncement_(anAnnouncement);
 if($core.assert($1)){
-$recv(self._valuable())._value_(anAnnouncement);
+$recv($self._valuable())._value_(anAnnouncement);
 }
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -80,7 +80,7 @@ $core.method({
 selector: "handlesAnnouncement:",
 protocol: "announcing",
 fn: function (anAnnouncement){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -89,7 +89,7 @@ $2=$recv($globals.Smalltalk)._globals();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["globals"]=1;
 //>>excludeEnd("ctx");
-$3=$recv(self._announcementClass())._name();
+$3=$recv($self._announcementClass())._name();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["name"]=1;
 //>>excludeEnd("ctx");
@@ -122,11 +122,11 @@ $core.method({
 selector: "receiver",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return $recv(self._valuable())._receiver();
+return $recv($self._valuable())._receiver();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"receiver",{},$globals.AnnouncementSubscription)});
 //>>excludeEnd("ctx");
@@ -145,8 +145,8 @@ $core.method({
 selector: "valuable",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@valuable"];
+var self=this,$self=this;
+return $self["@valuable"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -163,8 +163,8 @@ $core.method({
 selector: "valuable:",
 protocol: "accessing",
 fn: function (aValuable){
-var self=this;
-self["@valuable"]=aValuable;
+var self=this,$self=this;
+$self["@valuable"]=aValuable;
 return self;
 
 },
@@ -188,8 +188,8 @@ $core.method({
 selector: "receiver",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@receiver"];
+var self=this,$self=this;
+return $self["@receiver"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -206,8 +206,8 @@ $core.method({
 selector: "receiver:",
 protocol: "accessing",
 fn: function (anObject){
-var self=this;
-self["@receiver"]=anObject;
+var self=this,$self=this;
+$self["@receiver"]=anObject;
 return self;
 
 },
@@ -225,8 +225,8 @@ $core.method({
 selector: "valuable",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@valuable"];
+var self=this,$self=this;
+return $self["@valuable"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -243,8 +243,8 @@ $core.method({
 selector: "valuable:",
 protocol: "accessing",
 fn: function (anObject){
-var self=this;
-self["@valuable"]=anObject;
+var self=this,$self=this;
+$self["@valuable"]=anObject;
 return self;
 
 },
@@ -262,11 +262,11 @@ $core.method({
 selector: "value",
 protocol: "evaluating",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return $recv(self._valuable())._value();
+return $recv($self._valuable())._value();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"value",{},$globals.AnnouncementValuable)});
 //>>excludeEnd("ctx");
@@ -285,11 +285,11 @@ $core.method({
 selector: "value:",
 protocol: "evaluating",
 fn: function (anObject){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return $recv(self._valuable())._value_(anObject);
+return $recv($self._valuable())._value_(anObject);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"value:",{anObject:anObject},$globals.AnnouncementValuable)});
 //>>excludeEnd("ctx");
@@ -314,11 +314,11 @@ $core.method({
 selector: "announce:",
 protocol: "announcing",
 fn: function (anAnnouncement){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv(self["@subscriptions"])._do_((function(each){
+$recv($self["@subscriptions"])._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -346,7 +346,7 @@ $core.method({
 selector: "initialize",
 protocol: "initialization",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -354,11 +354,11 @@ return $core.withContext(function($ctx1) {
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = true,
 //>>excludeEnd("ctx");
-($globals.Announcer.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($recv(self), []));
+($globals.Announcer.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
-self["@subscriptions"]=$recv($globals.OrderedCollection)._new();
+$self["@subscriptions"]=$recv($globals.OrderedCollection)._new();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.Announcer)});
@@ -378,11 +378,11 @@ $core.method({
 selector: "on:do:",
 protocol: "subscribing",
 fn: function (aClass,aBlock){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._on_do_for_(aClass,aBlock,nil);
+$self._on_do_for_(aClass,aBlock,nil);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"on:do:",{aClass:aClass,aBlock:aBlock},$globals.Announcer)});
@@ -402,12 +402,12 @@ $core.method({
 selector: "on:do:for:",
 protocol: "subscribing",
 fn: function (aClass,aBlock,aReceiver){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1,$3,$5,$6,$4,$2;
-$1=self["@subscriptions"];
+$1=$self["@subscriptions"];
 $3=$recv($globals.AnnouncementSubscription)._new();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["new"]=1;
@@ -446,7 +446,7 @@ $core.method({
 selector: "on:doOnce:",
 protocol: "subscribing",
 fn: function (aClass,aBlock){
-var self=this;
+var self=this,$self=this;
 var subscription;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
@@ -459,13 +459,13 @@ $recv(subscription)._valuable_((function(ann){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-$recv(self["@subscriptions"])._remove_(subscription);
+$recv($self["@subscriptions"])._remove_(subscription);
 return $recv(aBlock)._value_(ann);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
-$recv(self["@subscriptions"])._add_(subscription);
+$recv($self["@subscriptions"])._add_(subscription);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"on:doOnce:",{aClass:aClass,aBlock:aBlock,subscription:subscription},$globals.Announcer)});
@@ -485,12 +485,12 @@ $core.method({
 selector: "on:send:to:",
 protocol: "subscribing",
 fn: function (aClass,aSelector,anObject){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1,$3,$5,$6,$4,$2;
-$1=self["@subscriptions"];
+$1=$self["@subscriptions"];
 $3=$recv($globals.AnnouncementSubscription)._new();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["new"]=1;
@@ -526,11 +526,11 @@ $core.method({
 selector: "unsubscribe:",
 protocol: "subscribing",
 fn: function (anObject){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self["@subscriptions"]=$recv(self["@subscriptions"])._reject_((function(each){
+$self["@subscriptions"]=$recv($self["@subscriptions"])._reject_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -566,22 +566,22 @@ $core.method({
 selector: "current",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1,$receiver;
-$1=self["@current"];
+$1=$self["@current"];
 if(($receiver = $1) == null || $receiver.a$nil){
-self["@current"]=(
+$self["@current"]=(
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = true,
 //>>excludeEnd("ctx");
-($globals.SystemAnnouncer.a$cls.superclass||$boot.nilAsClass).fn.prototype._new.apply($recv(self), []));
+($globals.SystemAnnouncer.a$cls.superclass||$boot.nilAsClass).fn.prototype._new.apply($self, []));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
-return self["@current"];
+return $self["@current"];
 } else {
 return $1;
 }
@@ -603,11 +603,11 @@ $core.method({
 selector: "new",
 protocol: "instance creation",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._shouldNotImplement();
+$self._shouldNotImplement();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"new",{},$globals.SystemAnnouncer.a$cls)});
@@ -633,7 +633,7 @@ $core.method({
 selector: "classTag",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 return "announcement";
 
 },
@@ -656,8 +656,8 @@ $core.method({
 selector: "theClass",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@theClass"];
+var self=this,$self=this;
+return $self["@theClass"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -674,8 +674,8 @@ $core.method({
 selector: "theClass:",
 protocol: "accessing",
 fn: function (aClass){
-var self=this;
-self["@theClass"]=aClass;
+var self=this,$self=this;
+$self["@theClass"]=aClass;
 return self;
 
 },
@@ -717,8 +717,8 @@ $core.method({
 selector: "oldClass",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@oldClass"];
+var self=this,$self=this;
+return $self["@oldClass"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -735,8 +735,8 @@ $core.method({
 selector: "oldClass:",
 protocol: "accessing",
 fn: function (aClass){
-var self=this;
-self["@oldClass"]=aClass;
+var self=this,$self=this;
+$self["@oldClass"]=aClass;
 return self;
 
 },
@@ -760,8 +760,8 @@ $core.method({
 selector: "oldPackage",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@oldPackage"];
+var self=this,$self=this;
+return $self["@oldPackage"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -778,8 +778,8 @@ $core.method({
 selector: "oldPackage:",
 protocol: "accessing",
 fn: function (aPackage){
-var self=this;
-self["@oldPackage"]=aPackage;
+var self=this,$self=this;
+$self["@oldPackage"]=aPackage;
 return self;
 
 },
@@ -815,8 +815,8 @@ $core.method({
 selector: "method",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@method"];
+var self=this,$self=this;
+return $self["@method"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -833,8 +833,8 @@ $core.method({
 selector: "method:",
 protocol: "accessing",
 fn: function (aCompiledMethod){
-var self=this;
-self["@method"]=aCompiledMethod;
+var self=this,$self=this;
+$self["@method"]=aCompiledMethod;
 return self;
 
 },
@@ -864,8 +864,8 @@ $core.method({
 selector: "oldMethod",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@oldMethod"];
+var self=this,$self=this;
+return $self["@oldMethod"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -882,8 +882,8 @@ $core.method({
 selector: "oldMethod:",
 protocol: "accessing",
 fn: function (aMethod){
-var self=this;
-self["@oldMethod"]=aMethod;
+var self=this,$self=this;
+$self["@oldMethod"]=aMethod;
 return self;
 
 },
@@ -907,8 +907,8 @@ $core.method({
 selector: "oldProtocol",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@oldProtocol"];
+var self=this,$self=this;
+return $self["@oldProtocol"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -925,8 +925,8 @@ $core.method({
 selector: "oldProtocol:",
 protocol: "accessing",
 fn: function (aString){
-var self=this;
-self["@oldProtocol"]=aString;
+var self=this,$self=this;
+$self["@oldProtocol"]=aString;
 return self;
 
 },
@@ -956,8 +956,8 @@ $core.method({
 selector: "package",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@package"];
+var self=this,$self=this;
+return $self["@package"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -974,8 +974,8 @@ $core.method({
 selector: "package:",
 protocol: "accessing",
 fn: function (aPackage){
-var self=this;
-self["@package"]=aPackage;
+var self=this,$self=this;
+$self["@package"]=aPackage;
 return self;
 
 },
@@ -1023,18 +1023,18 @@ $core.method({
 selector: "package",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1,$receiver;
-$1=self._theClass();
+$1=$self._theClass();
 if(($receiver = $1) == null || $receiver.a$nil){
 return $1;
 } else {
 var class_;
 class_=$receiver;
-return $recv(class_)._packageOfProtocol_(self._protocol());
+return $recv(class_)._packageOfProtocol_($self._protocol());
 }
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"package",{},$globals.ProtocolAnnouncement)});
@@ -1054,8 +1054,8 @@ $core.method({
 selector: "protocol",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@protocol"];
+var self=this,$self=this;
+return $self["@protocol"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -1072,8 +1072,8 @@ $core.method({
 selector: "protocol:",
 protocol: "accessing",
 fn: function (aString){
-var self=this;
-self["@protocol"]=aString;
+var self=this,$self=this;
+$self["@protocol"]=aString;
 return self;
 
 },
@@ -1091,8 +1091,8 @@ $core.method({
 selector: "theClass",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@theClass"];
+var self=this,$self=this;
+return $self["@theClass"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -1109,8 +1109,8 @@ $core.method({
 selector: "theClass:",
 protocol: "accessing",
 fn: function (aClass){
-var self=this;
-self["@theClass"]=aClass;
+var self=this,$self=this;
+$self["@theClass"]=aClass;
 return self;
 
 },

File diff suppressed because it is too large
+ 331 - 331
src/Kernel-Classes.js


File diff suppressed because it is too large
+ 814 - 814
src/Kernel-Collections.js


+ 51 - 51
src/Kernel-Collections.st

@@ -76,11 +76,11 @@ Types of buckets are the responsibility of subclasses via `#newBucket`.!
 
 bucketOfElement: anObject
 	<inlineJS: '
-		var hash = self[''@hashBlock''](anObject);
+		var hash = $self[''@hashBlock''](anObject);
 		if (!!hash) return null;
-		var buckets = self[''@buckets''],
+		var buckets = $self[''@buckets''],
 			bucket = buckets[hash];
-		if (!!bucket) { bucket = buckets[hash] = self._newBucket(); }
+		if (!!bucket) { bucket = buckets[hash] = $self._newBucket(); }
 		return bucket;
 	'>
 !
@@ -92,14 +92,14 @@ hashBlock: aBlock
 !BucketStore methodsFor: 'adding/removing'!
 
 removeAll
-	<inlineJS: 'self[''@buckets''] = Object.create(null);'>
+	<inlineJS: '$self[''@buckets''] = Object.create(null);'>
 ! !
 
 !BucketStore methodsFor: 'enumerating'!
 
 do: aBlock
 	<inlineJS: '
-		var buckets = self[''@buckets''];
+		var buckets = $self[''@buckets''];
 		var keys = Object.keys(buckets);
 		for (var i = 0; i < keys.length; ++i) { buckets[keys[i]]._do_(aBlock); }
 	'>
@@ -789,21 +789,21 @@ The external name is referred to as the key.!
 
 at: aKey ifAbsent: aBlock
 	<inlineJS: '
-		var index = self._positionOfKey_(aKey);
-		return index >=0 ? self[''@values''][index] : aBlock._value();
+		var index = $self._positionOfKey_(aKey);
+		return index >=0 ? $self[''@values''][index] : aBlock._value();
 	'>
 !
 
 at: aKey put: aValue
 	<inlineJS: '
-		var index = self._positionOfKey_(aKey);
+		var index = $self._positionOfKey_(aKey);
 		if(index === -1) {
-			var keys = self[''@keys''];
+			var keys = $self[''@keys''];
 			index = keys.length;
 			keys.push(aKey);
 		}
 
-		return self[''@values''][index] = aValue;
+		return $self[''@values''][index] = aValue;
 	'>
 !
 
@@ -834,11 +834,11 @@ removeAll
 
 removeKey: aKey ifAbsent: aBlock
 	<inlineJS: '
-		var index = self._positionOfKey_(aKey);
+		var index = $self._positionOfKey_(aKey);
 		if(index === -1) {
 			return aBlock._value()
 		} else {
-			var keys = self[''@keys''], values = self[''@values''];
+			var keys = $self[''@keys''], values = $self[''@values''];
 			var value = values[index], l = keys.length;
 			keys[index] = keys[l-1];
 			keys.pop();
@@ -875,7 +875,7 @@ initialize
 
 positionOfKey: anObject
 	<inlineJS: '
-		var keys = self[''@keys''];
+		var keys = $self[''@keys''];
 		for(var i=0;i<keys.length;i++){
 			if(keys[i].__eq(anObject)) { return i;}
 		}
@@ -886,7 +886,7 @@ positionOfKey: anObject
 !Dictionary methodsFor: 'testing'!
 
 includesKey: aKey
-	<inlineJS: 'return self._positionOfKey_(aKey) >= 0;'>
+	<inlineJS: 'return $self._positionOfKey_(aKey) >= 0;'>
 ! !
 
 AssociativeCollection subclass: #HashedCollection
@@ -915,8 +915,8 @@ keys
 
 values
 	<inlineJS: '
-		return self._keys().map(function(key){
-			return self._at_(key);
+		return $self._keys().map(function(key){
+			return $self._at_(key);
 		});
 	'>
 ! !
@@ -990,9 +990,9 @@ fourth
 
 indexOf: anObject ifAbsent: aBlock
 	<inlineJS: '
-		self = self._numericallyIndexable();
-		for(var i=0; i < self.length; i++) {
-			if($recv(self[i]).__eq(anObject)) {return i+1}
+		var nself = $self._numericallyIndexable();
+		for(var i=0; i < nself.length; i++) {
+			if($recv(nself[i]).__eq(anObject)) {return i+1}
 		};
 		return aBlock._value();
 	'>
@@ -1007,9 +1007,9 @@ indexOf: anObject startingAt: start
 
 indexOf: anObject startingAt: start ifAbsent: aBlock
 	<inlineJS: '
-		self = self._numericallyIndexable();
-		for(var i=start - 1; i < self.length; i++){
-			if($recv(self[i]).__eq(anObject)) {return i+1}
+		var nself = $self._numericallyIndexable();
+		for(var i=start - 1; i < nself.length; i++){
+			if($recv(nself[i]).__eq(anObject)) {return i+1}
 		}
 		return aBlock._value();
 	'>
@@ -1036,7 +1036,7 @@ single
 <inlineJS: '
 	if (self.length == 0) throw new Error("Collection is empty");
 	if (self.length > 1) throw new Error("Collection holds more than one element.");
-	return self[0];
+	return $self._numericallyIndexable()[0];
 '>
 !
 
@@ -1080,19 +1080,19 @@ copyFrom: anIndex to: anotherIndex
 
 detect: aBlock ifNone: anotherBlock
 	<inlineJS: '
-		self = self._numericallyIndexable();
-		for(var i = 0; i < self.length; i++)
-			if(aBlock._value_(self[i]))
-				return self[i];
+		var nself = $self._numericallyIndexable();
+		for(var i = 0; i < nself.length; i++)
+			if(aBlock._value_(nself[i]))
+				return nself[i];
 		return anotherBlock._value();
 	'>
 !
 
 do: aBlock
 	<inlineJS: '
-		self = self._numericallyIndexable();
-		for(var i=0; i < self.length; i++) {
-			aBlock._value_(self[i]);
+		var nself = $self._numericallyIndexable();
+		for(var i=0; i < nself.length; i++) {
+			aBlock._value_(nself[i]);
 		}
 	'>
 !
@@ -1103,19 +1103,19 @@ reverseDo: aBlock
 
 with: anotherCollection do: aBlock
 	<inlineJS: '
-		self = self._numericallyIndexable();
+		var nself = $self._numericallyIndexable();
 		anotherCollection = anotherCollection._numericallyIndexable();
-		for(var i=0; i<self.length; i++) {
-			aBlock._value_value_(self[i], anotherCollection[i]);
+		for(var i=0; i<nself.length; i++) {
+			aBlock._value_value_(nself[i], anotherCollection[i]);
 		}
 	'>
 !
 
 withIndexDo: aBlock
 	<inlineJS: '
-		self = self._numericallyIndexable();
-		for(var i=0; i < self.length; i++) {
-			aBlock._value_value_(self[i], i+1);
+		var nself = $self._numericallyIndexable();
+		for(var i=0; i < nself.length; i++) {
+			aBlock._value_value_(nself[i], i+1);
 		}
 	'>
 ! !
@@ -1236,7 +1236,7 @@ add: anObject
 addAll: aCollection
 <inlineJS: '
 	if (Array.isArray(aCollection) && aCollection.length < 65000) self.push.apply(self, aCollection);
-	else $globals.Array.superclass.fn.prototype._addAll_.call(self, aCollection);
+	else $globals.Array.superclass.fn.prototype._addAll_.call($self, aCollection);
 	return aCollection;
 '>
 !
@@ -1938,14 +1938,14 @@ remove: anObject ifAbsent: aBlock
 
 removeAll
 	<inlineJS: '
-		self[''@fastBuckets''] = {
+		$self[''@fastBuckets''] = {
 			"boolean": { store: Object.create(null), fn: function (x) { return {"true": true, "false": false, "null": null}[x]; } },
 			"number": { store: Object.create(null), fn: Number },
 			"string": { store: Object.create(null) }
 		};
-		self[''@slowBucketStores''].forEach(function (x) { x._removeAll(); });
-		self[''@defaultBucket'']._removeAll();
-		self[''@size''] = 0;
+		$self[''@slowBucketStores''].forEach(function (x) { x._removeAll(); });
+		$self[''@defaultBucket'']._removeAll();
+		$self[''@size''] = 0;
 	'>
 ! !
 
@@ -1975,16 +1975,16 @@ detect: aBlock ifNone: anotherBlock
 do: aBlock
 	<inlineJS: '
 		var el, keys, i;
-		el = self[''@fastBuckets''];
+		el = $self[''@fastBuckets''];
 		keys = Object.keys(el);
 		for (i = 0; i < keys.length; ++i) {
 			var fastBucket = el[keys[i]], fn = fastBucket.fn, store = Object.keys(fastBucket.store);
 			if (fn) { for (var j = 0; j < store.length; ++j) { aBlock._value_(fn(store[j])); } }
 			else { store._do_(aBlock); }
 		}
-		el = self[''@slowBucketStores''];
+		el = $self[''@slowBucketStores''];
 		for (i = 0; i < el.length; ++i) { el[i]._do_(aBlock); }
-		self[''@defaultBucket'']._do_(aBlock);
+		$self[''@defaultBucket'']._do_(aBlock);
 	'>
 !
 
@@ -2041,7 +2041,7 @@ printOn: aStream
 add: anObject in: anotherObject
 	<inlineJS: '
 		if (anObject in anotherObject.store) { return false; }
-		self[''@size'']++;
+		$self[''@size'']++;
 		anotherObject.store[anObject] = true;
 		return anObject;
 	'>
@@ -2056,17 +2056,17 @@ bucketsOfElement: anObject
 	
 	<inlineJS: '
 		// include nil to well-known objects under "boolean" fastBucket
-		if (anObject == null || anObject.a$nil) return [ null, self[''@fastBuckets''].boolean ];
+		if (anObject == null || anObject.a$nil) return [ null, $self[''@fastBuckets''].boolean ];
 		
 		var prim = anObject.valueOf();
-		if (typeof prim === "object" || typeof prim === "function" || !!self[''@fastBuckets''][typeof prim]) {
+		if (typeof prim === "object" || typeof prim === "function" || !!$self[''@fastBuckets''][typeof prim]) {
 			var bucket = null;
-			self[''@slowBucketStores''].some(function (store) {
+			$self[''@slowBucketStores''].some(function (store) {
 				return bucket = store._bucketOfElement_(anObject);
 			});
-			return [ anObject, null, bucket || self[''@defaultBucket''] ];
+			return [ anObject, null, bucket || $self[''@defaultBucket''] ];
 		}
-		return [ prim, self[''@fastBuckets''][typeof prim] ];
+		return [ prim, $self[''@fastBuckets''][typeof prim] ];
 	'>
 !
 
@@ -2086,7 +2086,7 @@ jsConstructorNameOf: anObject
 !
 
 remove: anObject in: anotherObject
-	<inlineJS: 'if (delete anotherObject.store[anObject]) self[''@size'']--'>
+	<inlineJS: 'if (delete anotherObject.store[anObject]) $self[''@size'']--'>
 ! !
 
 !Set methodsFor: 'testing'!

+ 49 - 49
src/Kernel-Dag.js

@@ -15,11 +15,11 @@ $core.method({
 selector: "value:",
 protocol: "evaluating",
 fn: function (anObject){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return self._visit_(anObject);
+return $self._visit_(anObject);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"value:",{anObject:anObject},$globals.AbstractDagVisitor)});
 //>>excludeEnd("ctx");
@@ -38,7 +38,7 @@ $core.method({
 selector: "visit:",
 protocol: "visiting",
 fn: function (aNode){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -61,7 +61,7 @@ $core.method({
 selector: "visitAll:",
 protocol: "visiting",
 fn: function (aCollection){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -69,7 +69,7 @@ return $recv(aCollection)._collect_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._visit_(each);
+return $self._visit_(each);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
 //>>excludeEnd("ctx");
@@ -92,11 +92,11 @@ $core.method({
 selector: "visitAllChildren:",
 protocol: "visiting",
 fn: function (aDagNode){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return self._visitAll_($recv(aDagNode)._dagChildren());
+return $self._visitAll_($recv(aDagNode)._dagChildren());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"visitAllChildren:",{aDagNode:aDagNode},$globals.AbstractDagVisitor)});
 //>>excludeEnd("ctx");
@@ -115,11 +115,11 @@ $core.method({
 selector: "visitDagNode:",
 protocol: "visiting",
 fn: function (aNode){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._subclassResponsibility();
+$self._subclassResponsibility();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"visitDagNode:",{aNode:aNode},$globals.AbstractDagVisitor)});
@@ -139,7 +139,7 @@ $core.method({
 selector: "visitDagNodeVariantRedux:",
 protocol: "visiting",
 fn: function (aNode){
-var self=this;
+var self=this,$self=this;
 var newChildren,oldChildren;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
@@ -148,7 +148,7 @@ var $2,$3,$1,$4,$5;
 var $early={};
 try {
 oldChildren=$recv(aNode)._dagChildren();
-newChildren=self._visitAllChildren_(aNode);
+newChildren=$self._visitAllChildren_(aNode);
 $2=$recv(oldChildren)._size();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["size"]=1;
@@ -199,11 +199,11 @@ $core.method({
 selector: "visitDagNodeVariantSimple:",
 protocol: "visiting",
 fn: function (aNode){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._visitAllChildren_(aNode);
+$self._visitAllChildren_(aNode);
 return aNode;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"visitDagNodeVariantSimple:",{aNode:aNode},$globals.AbstractDagVisitor)});
@@ -229,7 +229,7 @@ $core.method({
 selector: "initialize",
 protocol: "initialization",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -237,11 +237,11 @@ return $core.withContext(function($ctx1) {
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = true,
 //>>excludeEnd("ctx");
-($globals.PathDagVisitor.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($recv(self), []));
+($globals.PathDagVisitor.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
-self["@path"]=[];
+$self["@path"]=[];
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.PathDagVisitor)});
@@ -261,8 +261,8 @@ $core.method({
 selector: "path",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@path"];
+var self=this,$self=this;
+return $self["@path"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -279,24 +279,24 @@ $core.method({
 selector: "visit:",
 protocol: "visiting",
 fn: function (aNode){
-var self=this;
+var self=this,$self=this;
 var oldPath,result;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 result=aNode;
-oldPath=self["@path"];
+oldPath=$self["@path"];
 $recv((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-self["@path"]=$recv(self["@path"]).__comma([aNode]);
-self["@path"];
+$self["@path"]=$recv($self["@path"]).__comma([aNode]);
+$self["@path"];
 result=(
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.supercall = true,
 //>>excludeEnd("ctx");
-($globals.PathDagVisitor.superclass||$boot.nilAsClass).fn.prototype._visit_.apply($recv(self), [aNode]));
+($globals.PathDagVisitor.superclass||$boot.nilAsClass).fn.prototype._visit_.apply($self, [aNode]));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.supercall = false;
 //>>excludeEnd("ctx");;
@@ -305,8 +305,8 @@ return result;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
 //>>excludeEnd("ctx");
 }))._ensure_((function(){
-self["@path"]=oldPath;
-return self["@path"];
+$self["@path"]=oldPath;
+return $self["@path"];
 
 }));
 return result;
@@ -328,7 +328,7 @@ $core.method({
 selector: "visitDagNodeVariantRedux:",
 protocol: "visiting",
 fn: function (aNode){
-var self=this;
+var self=this,$self=this;
 var newNode;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
@@ -338,13 +338,13 @@ newNode=(
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = true,
 //>>excludeEnd("ctx");
-($globals.PathDagVisitor.superclass||$boot.nilAsClass).fn.prototype._visitDagNodeVariantRedux_.apply($recv(self), [aNode]));
+($globals.PathDagVisitor.superclass||$boot.nilAsClass).fn.prototype._visitDagNodeVariantRedux_.apply($self, [aNode]));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
 $1=$recv(aNode).__eq_eq(newNode);
 if(!$core.assert($1)){
-$recv(self["@path"])._at_put_($recv(self["@path"])._size(),newNode);
+$recv($self["@path"])._at_put_($recv($self["@path"])._size(),newNode);
 }
 return newNode;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -371,7 +371,7 @@ $core.method({
 selector: "acceptDagVisitor:",
 protocol: "visiting",
 fn: function (aVisitor){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -394,18 +394,18 @@ $core.method({
 selector: "allDagChildren",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var allNodes;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
-$1=self._dagChildren();
+$1=$self._dagChildren();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["dagChildren"]=1;
 //>>excludeEnd("ctx");
 allNodes=$recv($1)._asSet();
-$recv(self._dagChildren())._do_((function(each){
+$recv($self._dagChildren())._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -433,11 +433,11 @@ $core.method({
 selector: "dagChildren",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._subclassResponsibility();
+$self._subclassResponsibility();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"dagChildren",{},$globals.DagNode)});
@@ -457,11 +457,11 @@ $core.method({
 selector: "dagChildren:",
 protocol: "accessing",
 fn: function (aCollection){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._subclassResponsibility();
+$self._subclassResponsibility();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"dagChildren:",{aCollection:aCollection},$globals.DagNode)});
@@ -481,7 +481,7 @@ $core.method({
 selector: "isDagNode",
 protocol: "testing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 return true;
 
 },
@@ -505,11 +505,11 @@ $core.method({
 selector: "addDagChild:",
 protocol: "accessing",
 fn: function (aDagNode){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv(self._dagChildren())._add_(aDagNode);
+$recv($self._dagChildren())._add_(aDagNode);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"addDagChild:",{aDagNode:aDagNode},$globals.DagParentNode)});
@@ -529,15 +529,15 @@ $core.method({
 selector: "dagChildren",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1,$receiver;
-$1=self["@nodes"];
+$1=$self["@nodes"];
 if(($receiver = $1) == null || $receiver.a$nil){
-self["@nodes"]=$recv($globals.Array)._new();
-return self["@nodes"];
+$self["@nodes"]=$recv($globals.Array)._new();
+return $self["@nodes"];
 } else {
 return $1;
 }
@@ -559,8 +559,8 @@ $core.method({
 selector: "dagChildren:",
 protocol: "accessing",
 fn: function (aCollection){
-var self=this;
-self["@nodes"]=aCollection;
+var self=this,$self=this;
+$self["@nodes"]=aCollection;
 return self;
 
 },
@@ -584,7 +584,7 @@ $core.method({
 selector: "dagChildren",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 return [];
 
 },
@@ -602,7 +602,7 @@ $core.method({
 selector: "dagChildren:",
 protocol: "accessing",
 fn: function (aCollection){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -610,7 +610,7 @@ $recv(aCollection)._ifNotEmpty_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._error_("A DagSink cannot have children.");
+return $self._error_("A DagSink cannot have children.");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
 //>>excludeEnd("ctx");
@@ -635,7 +635,7 @@ $core.method({
 selector: "isDagNode",
 protocol: "*Kernel-Dag",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 return false;
 
 },

+ 55 - 55
src/Kernel-Exceptions.js

@@ -15,7 +15,7 @@ $core.method({
 selector: "beHandled",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -39,7 +39,7 @@ $core.method({
 selector: "beUnhandled",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -63,7 +63,7 @@ $core.method({
 selector: "context",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -87,11 +87,11 @@ $core.method({
 selector: "initialize",
 protocol: "initialization",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._messageText_("Errorclass: ".__comma($recv(self._class())._name()));
+$self._messageText_("Errorclass: ".__comma($recv($self._class())._name()));
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.Error)});
@@ -111,7 +111,7 @@ $core.method({
 selector: "isSmalltalkError",
 protocol: "testing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -135,7 +135,7 @@ $core.method({
 selector: "jsStack",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -159,8 +159,8 @@ $core.method({
 selector: "messageText",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@messageText"];
+var self=this,$self=this;
+return $self["@messageText"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -177,8 +177,8 @@ $core.method({
 selector: "messageText:",
 protocol: "accessing",
 fn: function (aString){
-var self=this;
-self["@messageText"]=aString;
+var self=this,$self=this;
+$self["@messageText"]=aString;
 return self;
 
 },
@@ -196,7 +196,7 @@ $core.method({
 selector: "resignal",
 protocol: "signaling",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -223,7 +223,7 @@ $core.method({
 selector: "signal",
 protocol: "signaling",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -252,12 +252,12 @@ $core.method({
 selector: "signal:",
 protocol: "signaling",
 fn: function (aString){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._messageText_(aString);
-self._signal();
+$self._messageText_(aString);
+$self._signal();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},$globals.Error)});
@@ -277,11 +277,11 @@ $core.method({
 selector: "signalerContext",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return self._signalerContextFrom_(self._context());
+return $self._signalerContextFrom_($self._context());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"signalerContext",{},$globals.Error)});
 //>>excludeEnd("ctx");
@@ -300,7 +300,7 @@ $core.method({
 selector: "signalerContextFrom:",
 protocol: "accessing",
 fn: function (aContext){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -321,7 +321,7 @@ $1=$recv($2)._or_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
-return $recv($recv(context)._receiver()).__eq_eq(self._class());
+return $recv($recv(context)._receiver()).__eq_eq($self._class());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
 //>>excludeEnd("ctx");
@@ -349,7 +349,7 @@ $core.method({
 selector: "wasHandled",
 protocol: "testing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -374,7 +374,7 @@ $core.method({
 selector: "classTag",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 return "exception";
 
 },
@@ -392,11 +392,11 @@ $core.method({
 selector: "signal",
 protocol: "instance creation",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return $recv(self._new())._signal();
+return $recv($self._new())._signal();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"signal",{},$globals.Error.a$cls)});
 //>>excludeEnd("ctx");
@@ -415,11 +415,11 @@ $core.method({
 selector: "signal:",
 protocol: "instance creation",
 fn: function (aString){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return $recv(self._new())._signal_(aString);
+return $recv($self._new())._signal_(aString);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},$globals.Error.a$cls)});
 //>>excludeEnd("ctx");
@@ -443,7 +443,7 @@ $core.method({
 selector: "messageText",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 return "Halt encountered";
 
 },
@@ -461,7 +461,7 @@ $core.method({
 selector: "signalerContextFrom:",
 protocol: "accessing",
 fn: function (aContext){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -482,7 +482,7 @@ $1=$recv($2)._or_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
-return $recv($recv($recv(context)._receiver()).__eq_eq(self._class()))._or_((function(){
+return $recv($recv($recv(context)._receiver()).__eq_eq($self._class()))._or_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx4) {
 //>>excludeEnd("ctx");
@@ -527,7 +527,7 @@ $core.method({
 selector: "context:",
 protocol: "accessing",
 fn: function (aMethodContext){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -551,8 +551,8 @@ $core.method({
 selector: "exception",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@exception"];
+var self=this,$self=this;
+return $self["@exception"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -569,8 +569,8 @@ $core.method({
 selector: "exception:",
 protocol: "accessing",
 fn: function (anException){
-var self=this;
-self["@exception"]=anException;
+var self=this,$self=this;
+$self["@exception"]=anException;
 return self;
 
 },
@@ -588,11 +588,11 @@ $core.method({
 selector: "messageText",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return "JavaScript exception: " + self["@exception"].toString();
+return "JavaScript exception: " + $self["@exception"].toString();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"messageText",{},$globals.JavaScriptException)});
@@ -600,7 +600,7 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "messageText\x0a\x09<inlineJS: 'return \x22JavaScript exception: \x22 + self[\x22@exception\x22].toString()'>",
+source: "messageText\x0a\x09<inlineJS: 'return \x22JavaScript exception: \x22 + $self[\x22@exception\x22].toString()'>",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
@@ -613,12 +613,12 @@ $core.method({
 selector: "on:",
 protocol: "instance creation",
 fn: function (anException){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
-$1=self._new();
+$1=$self._new();
 $recv($1)._exception_(anException);
 return $recv($1)._yourself();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -639,12 +639,12 @@ $core.method({
 selector: "on:context:",
 protocol: "instance creation",
 fn: function (anException,aMethodContext){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
-$1=self._new();
+$1=$self._new();
 $recv($1)._exception_(anException);
 $recv($1)._context_(aMethodContext);
 return $recv($1)._yourself();
@@ -671,8 +671,8 @@ $core.method({
 selector: "message",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@message"];
+var self=this,$self=this;
+return $self["@message"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -689,8 +689,8 @@ $core.method({
 selector: "message:",
 protocol: "accessing",
 fn: function (aMessage){
-var self=this;
-self["@message"]=aMessage;
+var self=this,$self=this;
+$self["@message"]=aMessage;
 return self;
 
 },
@@ -708,12 +708,12 @@ $core.method({
 selector: "messageText",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
-$1=$recv($recv($recv(self._receiver())._asString()).__comma(" does not understand #")).__comma($recv(self._message())._selector());
+$1=$recv($recv($recv($self._receiver())._asString()).__comma(" does not understand #")).__comma($recv($self._message())._selector());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx[","]=1;
 //>>excludeEnd("ctx");
@@ -736,8 +736,8 @@ $core.method({
 selector: "receiver",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@receiver"];
+var self=this,$self=this;
+return $self["@receiver"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -754,8 +754,8 @@ $core.method({
 selector: "receiver:",
 protocol: "accessing",
 fn: function (anObject){
-var self=this;
-self["@receiver"]=anObject;
+var self=this,$self=this;
+$self["@receiver"]=anObject;
 return self;
 
 },
@@ -779,8 +779,8 @@ $core.method({
 selector: "object",
 protocol: "accessing",
 fn: function (){
-var self=this;
-return self["@object"];
+var self=this,$self=this;
+return $self["@object"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -797,8 +797,8 @@ $core.method({
 selector: "object:",
 protocol: "accessing",
 fn: function (anObject){
-var self=this;
-self["@object"]=anObject;
+var self=this,$self=this;
+$self["@object"]=anObject;
 return self;
 
 },

+ 1 - 1
src/Kernel-Exceptions.st

@@ -161,7 +161,7 @@ exception: anException
 !
 
 messageText
-	<inlineJS: 'return "JavaScript exception: " + self["@exception"].toString()'>
+	<inlineJS: 'return "JavaScript exception: " + $self["@exception"].toString()'>
 ! !
 
 !JavaScriptException class methodsFor: 'instance creation'!

File diff suppressed because it is too large
+ 235 - 235
src/Kernel-Infrastructure.js


+ 7 - 7
src/Kernel-Infrastructure.st

@@ -30,13 +30,13 @@ __Note:__ For keyword-based messages, only the first keyword is kept: `window fo
 !JSObjectProxy methodsFor: 'accessing'!
 
 at: aString
-	<inlineJS: 'return self[''@jsObject''][aString]'>
+	<inlineJS: 'return $self[''@jsObject''][aString]'>
 !
 
 at: aString ifAbsent: aBlock
 	"return the aString property or evaluate aBlock if the property is not defined on the object"
 	<inlineJS: '
-		var obj = self[''@jsObject''];
+		var obj = $self[''@jsObject''];
 		return aString in obj ? obj[aString] : aBlock._value();
 	'>
 !
@@ -44,7 +44,7 @@ at: aString ifAbsent: aBlock
 at: aString ifPresent: aBlock
 	"return the evaluation of aBlock with the value if the property is defined or return nil"
 	<inlineJS: '
-		var obj = self[''@jsObject''];
+		var obj = $self[''@jsObject''];
 		return aString in obj ? aBlock._value_(obj[aString]) : nil;
 	'>
 !
@@ -53,13 +53,13 @@ at: aString ifPresent: aBlock ifAbsent: anotherBlock
 	"return the evaluation of aBlock with the value if the property is defined
 	or return value of anotherBlock"
 	<inlineJS: '
-		var obj = self[''@jsObject''];
+		var obj = $self[''@jsObject''];
 		return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();
 	'>
 !
 
 at: aString put: anObject
-	<inlineJS: 'return self[''@jsObject''][aString] = anObject'>
+	<inlineJS: 'return $self[''@jsObject''][aString] = anObject'>
 !
 
 in: aValuable
@@ -89,7 +89,7 @@ asJavaScriptObject
 
 keysAndValuesDo: aBlock
 	<inlineJS: '
-		var o = self[''@jsObject''];
+		var o = $self[''@jsObject''];
 		for(var i in o) {
 			aBlock._value_value_(i, o[i]);
 		}
@@ -104,7 +104,7 @@ printOn: aStream
 
 printString
 	<inlineJS: '
-		var js = self[''@jsObject''];
+		var js = $self[''@jsObject''];
 		return js.toString
 			? js.toString()
 			: Object.prototype.toString.call(js)

File diff suppressed because it is too large
+ 235 - 235
src/Kernel-Methods.js


+ 6 - 6
src/Kernel-Methods.st

@@ -47,7 +47,7 @@ whileFalse
 !
 
 whileFalse: aBlock
-	<inlineJS: 'while(!!$core.assert(self._value())) {aBlock._value()}'>
+	<inlineJS: 'while(!!$core.assert($self._value())) {aBlock._value()}'>
 !
 
 whileTrue
@@ -55,7 +55,7 @@ whileTrue
 !
 
 whileTrue: aBlock
-	<inlineJS: 'while($core.assert(self._value())) {aBlock._value()}'>
+	<inlineJS: 'while($core.assert($self._value())) {aBlock._value()}'>
 ! !
 
 !BlockClosure methodsFor: 'converting'!
@@ -95,7 +95,7 @@ on: anErrorClass do: aBlock
 tryCatch: aBlock
 	<inlineJS: '
 		try {
-			return self._value();
+			return $self._value();
 		} catch(error) {
 			// pass non-local returns undetected
 			if (Array.isArray(error) && error.length === 1) throw error;
@@ -111,7 +111,7 @@ applyTo: anObject arguments: aCollection
 !
 
 ensure: aBlock
-	<inlineJS: 'try{return self._value()}finally{aBlock._value()}'>
+	<inlineJS: 'try{return $self._value()}finally{aBlock._value()}'>
 !
 
 new
@@ -876,14 +876,14 @@ rawTimeout: anObject
 
 clearInterval
 	<inlineJS: '
-		var interval = self["@rawTimeout"];
+		var interval = $self["@rawTimeout"];
 		clearInterval(interval);
 	'>
 !
 
 clearTimeout
 	<inlineJS: '
-		var timeout = self["@rawTimeout"];
+		var timeout = $self["@rawTimeout"];
 		clearTimeout(timeout);
 	'>
 ! !

File diff suppressed because it is too large
+ 374 - 332
src/Kernel-Objects.js


+ 17 - 5
src/Kernel-Objects.st

@@ -10,7 +10,7 @@ In most cases, subclassing `ProtoObject` is wrong and `Object` should be used in
 !ProtoObject methodsFor: 'accessing'!
 
 class
-	<inlineJS: 'return self.a$cls'>
+	<inlineJS: 'return $self.a$cls'>
 !
 
 identityHash
@@ -24,11 +24,11 @@ identityHash
 !
 
 instVarAt: aString
-	<inlineJS: 'return self[''@''+aString]'>
+	<inlineJS: 'return $self[''@''+aString]'>
 !
 
 instVarAt: aString put: anObject
-	<inlineJS: 'self[''@'' + aString] = anObject'>
+	<inlineJS: '$self[''@'' + aString] = anObject'>
 !
 
 yourself
@@ -43,7 +43,7 @@ yourself
 
 == anObject
 <inlineJS:
-	'return self._class() === $recv(anObject)._class() && self._isSameInstanceAs_(anObject)'>
+	'return $self._class() === $recv(anObject)._class() && $self._isSameInstanceAs_(anObject)'>
 !
 
 isSameInstanceAs: anObject
@@ -265,7 +265,7 @@ deepCopy
 		var copy = self.a$cls._new();
 		Object.keys(self).forEach(function (i) {
 		if(/^@.+/.test(i)) {
-			copy[i] = self[i]._deepCopy();
+			copy[i] = $recv(self[i])._deepCopy();
 		}
 		});
 		return copy;
@@ -1310,6 +1310,12 @@ I describe the behavior of my sole instance, `nil`. `nil` represents a prior val
 
 __note:__ When sending messages to the `undefined` JavaScript object, it will be replaced by `nil`.!
 
+!UndefinedObject methodsFor: 'accessing'!
+
+identityHash
+	^ 'NIL'
+! !
+
 !UndefinedObject methodsFor: 'converting'!
 
 asJavaScriptObject
@@ -1326,6 +1332,12 @@ shallowCopy
 	^ self
 ! !
 
+!UndefinedObject methodsFor: 'evaluating'!
+
+value
+	<inlineJS: 'return null'>
+! !
+
 !UndefinedObject methodsFor: 'printing'!
 
 printOn: aStream

File diff suppressed because it is too large
+ 39 - 39
src/Kernel-Promises.js


+ 7 - 7
src/Kernel-Promises.st

@@ -125,7 +125,7 @@ value: anObject
 !JSObjectProxy methodsFor: '*Kernel-Promises'!
 
 catch: aBlock
-<inlineJS: 'var js = self["@jsObject"];
+<inlineJS: 'var js = $self["@jsObject"];
 if (typeof js.then === "function")
     return $globals.Thenable.fn.prototype._catch_.call(js, aBlock);
 else
@@ -137,7 +137,7 @@ else
 !
 
 on: aClass do: aBlock
-<inlineJS: 'var js = self["@jsObject"];
+<inlineJS: 'var js = $self["@jsObject"];
 if (typeof js.then === "function")
     return $globals.Thenable.fn.prototype._on_do_.call(js, aClass, aBlock);
 else
@@ -149,7 +149,7 @@ else
 !
 
 on: aClass do: aBlock catch: anotherBlock
-<inlineJS: 'var js = self["@jsObject"];
+<inlineJS: 'var js = $self["@jsObject"];
 if (typeof js.then === "function")
     return $globals.Thenable.fn.prototype._on_do_catch_.call(js, aClass, aBlock, anotherBlock);
 else
@@ -161,7 +161,7 @@ else
 !
 
 then: aBlockOrArray
-<inlineJS: 'var js = self["@jsObject"];
+<inlineJS: 'var js = $self["@jsObject"];
 if (typeof js.then === "function")
     return $globals.Thenable.fn.prototype._then_.call(js, aBlockOrArray);
 else
@@ -173,7 +173,7 @@ else
 !
 
 then: aBlockOrArray catch: anotherBlock
-<inlineJS: 'var js = self["@jsObject"];
+<inlineJS: 'var js = $self["@jsObject"];
 if (typeof js.then === "function")
     return $globals.Thenable.fn.prototype._then_catch_.call(js, aBlockOrArray, anotherBlock);
 else
@@ -185,7 +185,7 @@ else
 !
 
 then: aBlockOrArray on: aClass do: aBlock
-<inlineJS: 'var js = self["@jsObject"];
+<inlineJS: 'var js = $self["@jsObject"];
 if (typeof js.then === "function")
     return $globals.Thenable.fn.prototype._then_on_do_.call(js, aBlockOrArray, aClass, aBlock);
 else
@@ -197,7 +197,7 @@ else
 !
 
 then: aBlockOrArray on: aClass do: aBlock catch: anotherBlock
-<inlineJS: 'var js = self["@jsObject"];
+<inlineJS: 'var js = $self["@jsObject"];
 if (typeof js.then === "function")
     return $globals.Thenable.fn.prototype._then_on_do_catch_.call(js, aBlockOrArray, aClass, aBlock, anotherBlock);
 else

File diff suppressed because it is too large
+ 1473 - 1473
src/Kernel-Tests.js


+ 3 - 3
src/Kernel-Tests.st

@@ -163,11 +163,11 @@ testNewWithValues
 
 	var wrappedConstructor = $recv(TestConstructor);
 	var result = wrappedConstructor._newWithValues_([1, 2, 3]);
-	self._assert_(result instanceof TestConstructor);
-	self._assert_equals_(result.name, "theTestPrototype");
+	$self._assert_(result instanceof TestConstructor);
+	$self._assert_equals_(result.name, "theTestPrototype");
 
 	/* newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made. */
-	self._should_raise_(function () {wrappedConstructor._newWithValues_("single argument");}, $globals.Error);
+	$self._should_raise_(function () {wrappedConstructor._newWithValues_("single argument");}, $globals.Error);
 '>
 !
 

+ 18 - 18
src/Platform-Browser.js

@@ -15,7 +15,7 @@ $core.method({
 selector: "globals",
 protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 return window;