Browse Source

Merge pull request #1089 from amber-smalltalk/gh-831

New names of internal variables.
Herbert Vojčík 10 years ago
parent
commit
0629e32d7b

+ 10 - 0
API-CHANGES.txt

@@ -5,6 +5,10 @@
 * smalltalk.selector is now smalltalk.st2js
 * smalltalk.convertSelector is now smalltalk.js2st
 * Collection >> ifEmpty:ifNotEmpty: family passes self to ifNotEmpty: block
+* Smalltalk vm is now Smalltalk core
+* boot.js's .vm is now .api
+* amber load sets' .vm is now .api
+* Internal variables smalltalk/globals/_st are now $core/$globals/$recv
 
 + smalltalk.
   + accessJavaScript
@@ -13,6 +17,12 @@
   + postMessageTo:origin:
 + Class >>
   + heliosClass
++ SmalltalkImage >>
+  + core
++ amber/boot exports
+  + api
++ amber/{devel,deploy,lang} exports
+  + api
 
 - ProtoObject class >>
   - heliosClass

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


File diff suppressed because it is too large
+ 216 - 215
external/amber-cli/support/amber-cli.js


+ 111 - 110
src/Benchfib.js

@@ -1,25 +1,26 @@
 define("amber_core/Benchfib", ["amber/boot", "amber_core/Kernel-Objects"], function($boot){
-var smalltalk=$boot.vm,nil=$boot.nil,_st=$boot.asReceiver,globals=$boot.globals;
-smalltalk.addPackage('Benchfib');
-smalltalk.packages["Benchfib"].transport = {"type":"amd","amdNamespace":"amber_core"};
+var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
+var smalltalk=$core,_st=$recv,globals=$globals;
+$core.addPackage('Benchfib');
+$core.packages["Benchfib"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('Benchfib', globals.Object, [], 'Benchfib');
+$core.addClass('Benchfib', $globals.Object, [], 'Benchfib');
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "main",
 protocol: 'not yet classified',
 fn: function (){
 var self=this;
 var result;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 result=(0)._tinyBenchmarks();
-_st(console)._log_("0 tinyBenchmarks => ".__comma(result));
+$recv(console)._log_("0 tinyBenchmarks => ".__comma(result));
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"main",{result:result},globals.Benchfib.klass)});
+}, function($ctx1) {$ctx1.fill(self,"main",{result:result},$globals.Benchfib.klass)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -29,39 +30,39 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["tinyBenchmarks", "log:", ","]
 }),
-globals.Benchfib.klass);
+$globals.Benchfib.klass);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "benchFib",
 protocol: '*Benchfib',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $2,$5,$4,$3,$1;
 $2=self.__lt((2));
-if(smalltalk.assert($2)){
+if($core.assert($2)){
 $1=(1);
 } else {
 $5=self.__minus((1));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["-"]=1;
 //>>excludeEnd("ctx");
-$4=_st($5)._benchFib();
+$4=$recv($5)._benchFib();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["benchFib"]=1;
 //>>excludeEnd("ctx");
-$3=_st($4).__plus(_st(self.__minus((2)))._benchFib());
-$1=_st($3).__plus((1));
+$3=$recv($4).__plus($recv(self.__minus((2)))._benchFib());
+$1=$recv($3).__plus((1));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["+"]=1;
 //>>excludeEnd("ctx");
 };
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"benchFib",{},globals.Number)});
+}, function($ctx1) {$ctx1.fill(self,"benchFib",{},$globals.Number)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -71,68 +72,68 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["ifTrue:ifFalse:", "<", "+", "benchFib", "-"]
 }),
-globals.Number);
+$globals.Number);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "benchmark",
 protocol: '*Benchfib',
 fn: function (){
 var self=this;
 var size,flags,prime,k,count;
-function $Array(){return globals.Array||(typeof Array=="undefined"?nil:Array)}
+function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1,$2;
 size=(8190);
 (1)._to_do_(self,(function(iter){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 count=(0);
 count;
-flags=_st($Array())._new();
+flags=$recv($Array())._new();
 flags;
-_st(size)._timesRepeat_((function(){
+$recv(size)._timesRepeat_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
-return _st(flags)._add_(true);
+return $recv(flags)._add_(true);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
 //>>excludeEnd("ctx");
 }));
 return (1)._to_do_(size,(function(i){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
-$1=_st(flags)._at_(i);
-if(smalltalk.assert($1)){
-prime=_st(i).__plus((1));
+$1=$recv(flags)._at_(i);
+if($core.assert($1)){
+prime=$recv(i).__plus((1));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx3.sendIdx["+"]=1;
 //>>excludeEnd("ctx");
 prime;
-k=_st(i).__plus(prime);
+k=$recv(i).__plus(prime);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx3.sendIdx["+"]=2;
 //>>excludeEnd("ctx");
 k;
-_st((function(){
+$recv((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx4) {
+return $core.withContext(function($ctx4) {
 //>>excludeEnd("ctx");
-return _st(k).__lt_eq(size);
+return $recv(k).__lt_eq(size);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx4) {$ctx4.fillBlock({},$ctx3,5)});
 //>>excludeEnd("ctx");
 }))._whileTrue_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx4) {
+return $core.withContext(function($ctx4) {
 //>>excludeEnd("ctx");
-_st(flags)._at_put_(k,false);
-k=_st(k).__plus(prime);
+$recv(flags)._at_put_(k,false);
+k=$recv(k).__plus(prime);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx4.sendIdx["+"]=3;
 //>>excludeEnd("ctx");
@@ -141,7 +142,7 @@ return k;
 }, function($ctx4) {$ctx4.fillBlock({},$ctx3,6)});
 //>>excludeEnd("ctx");
 }));
-count=_st(count).__plus((1));
+count=$recv(count).__plus((1));
 return count;
 };
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -158,7 +159,7 @@ $ctx1.sendIdx["to:do:"]=1;
 $2=count;
 return $2;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"benchmark",{size:size,flags:flags,prime:prime,k:k,count:count},globals.Number)});
+}, function($ctx1) {$ctx1.fill(self,"benchmark",{size:size,flags:flags,prime:prime,k:k,count:count},$globals.Number)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -168,16 +169,16 @@ referencedClasses: ["Array"],
 //>>excludeEnd("ide");
 messageSends: ["to:do:", "new", "timesRepeat:", "add:", "ifTrue:", "at:", "+", "whileTrue:", "<=", "at:put:"]
 }),
-globals.Number);
+$globals.Number);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "jsbenchFib",
 protocol: '*Benchfib',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 if (this < 2) {
 return 1;
@@ -185,7 +186,7 @@ return 1;
 return (this-1)._jsbenchFib() + (this-2)._jsbenchFib() + 1;};
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"jsbenchFib",{},globals.Number)});
+}, function($ctx1) {$ctx1.fill(self,"jsbenchFib",{},$globals.Number)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -195,16 +196,16 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.Number);
+$globals.Number);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "jsbenchmark",
 protocol: '*Benchfib',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 
 var size = 8190;
@@ -230,7 +231,7 @@ for (var z=0;z<this;z++) {
 return count;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"jsbenchmark",{},globals.Number)});
+}, function($ctx1) {$ctx1.fill(self,"jsbenchmark",{},$globals.Number)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -240,30 +241,30 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.Number);
+$globals.Number);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "jstinyBenchmarks",
 protocol: '*Benchfib',
 fn: function (){
 var self=this;
 var t1,t2,r,n1,n2;
-function $Date(){return globals.Date||(typeof Date=="undefined"?nil:Date)}
+function $Date(){return $globals.Date||(typeof Date=="undefined"?nil:Date)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $7,$6,$5,$4,$3,$2,$1;
 n1=(1);
-_st((function(){
+$recv((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-t1=_st($Date())._millisecondsToRun_((function(){
+t1=$recv($Date())._millisecondsToRun_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
-return _st(n1)._jsbenchmark();
+return $recv(n1)._jsbenchmark();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
 //>>excludeEnd("ctx");
@@ -272,7 +273,7 @@ return _st(n1)._jsbenchmark();
 $ctx2.sendIdx["millisecondsToRun:"]=1;
 //>>excludeEnd("ctx");
 t1;
-return _st(t1).__lt((1000));
+return $recv(t1).__lt((1000));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["<"]=1;
 //>>excludeEnd("ctx");
@@ -281,9 +282,9 @@ $ctx2.sendIdx["<"]=1;
 //>>excludeEnd("ctx");
 }))._whileTrue_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-n1=_st(n1).__star((2));
+n1=$recv(n1).__star((2));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["*"]=1;
 //>>excludeEnd("ctx");
@@ -296,63 +297,63 @@ return n1;
 $ctx1.sendIdx["whileTrue:"]=1;
 //>>excludeEnd("ctx");
 n2=(28);
-_st((function(){
+$recv((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-t2=_st($Date())._millisecondsToRun_((function(){
+t2=$recv($Date())._millisecondsToRun_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
-r=_st(n2)._jsbenchFib();
+r=$recv(n2)._jsbenchFib();
 return r;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,5)});
 //>>excludeEnd("ctx");
 }));
 t2;
-return _st(t2).__lt((1000));
+return $recv(t2).__lt((1000));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
 //>>excludeEnd("ctx");
 }))._whileTrue_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-n2=_st(n2).__plus((1));
+n2=$recv(n2).__plus((1));
 return n2;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)});
 //>>excludeEnd("ctx");
 }));
-$7=_st(n1).__star((500000));
+$7=$recv(n1).__star((500000));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["*"]=3;
 //>>excludeEnd("ctx");
-$6=_st($7).__star((1000));
+$6=$recv($7).__star((1000));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["*"]=2;
 //>>excludeEnd("ctx");
-$5=_st($6).__slash(t1);
+$5=$recv($6).__slash(t1);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["/"]=1;
 //>>excludeEnd("ctx");
-$4=_st($5)._printString();
+$4=$recv($5)._printString();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["printString"]=1;
 //>>excludeEnd("ctx");
-$3=_st($4).__comma(" bytecodes/sec; ");
-$2=_st($3).__comma(_st(_st(_st(r).__star((1000))).__slash(t2))._printString());
+$3=$recv($4).__comma(" bytecodes/sec; ");
+$2=$recv($3).__comma($recv($recv($recv(r).__star((1000))).__slash(t2))._printString());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx[","]=2;
 //>>excludeEnd("ctx");
-$1=_st($2).__comma(" sends/sec");
+$1=$recv($2).__comma(" sends/sec");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx[","]=1;
 //>>excludeEnd("ctx");
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"jstinyBenchmarks",{t1:t1,t2:t2,r:r,n1:n1,n2:n2},globals.Number)});
+}, function($ctx1) {$ctx1.fill(self,"jstinyBenchmarks",{t1:t1,t2:t2,r:r,n1:n1,n2:n2},$globals.Number)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -362,30 +363,30 @@ referencedClasses: ["Date"],
 //>>excludeEnd("ide");
 messageSends: ["whileTrue:", "millisecondsToRun:", "jsbenchmark", "<", "*", "jsbenchFib", "+", ",", "printString", "/"]
 }),
-globals.Number);
+$globals.Number);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "tinyBenchmarks",
 protocol: '*Benchfib',
 fn: function (){
 var self=this;
 var t1,t2,r,n1,n2;
-function $Date(){return globals.Date||(typeof Date=="undefined"?nil:Date)}
+function $Date(){return $globals.Date||(typeof Date=="undefined"?nil:Date)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $7,$6,$5,$4,$3,$2,$1;
 n1=(1);
-_st((function(){
+$recv((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-t1=_st($Date())._millisecondsToRun_((function(){
+t1=$recv($Date())._millisecondsToRun_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
-return _st(n1)._benchmark();
+return $recv(n1)._benchmark();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
 //>>excludeEnd("ctx");
@@ -394,7 +395,7 @@ return _st(n1)._benchmark();
 $ctx2.sendIdx["millisecondsToRun:"]=1;
 //>>excludeEnd("ctx");
 t1;
-return _st(t1).__lt((1000));
+return $recv(t1).__lt((1000));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["<"]=1;
 //>>excludeEnd("ctx");
@@ -403,9 +404,9 @@ $ctx2.sendIdx["<"]=1;
 //>>excludeEnd("ctx");
 }))._whileTrue_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-n1=_st(n1).__star((2));
+n1=$recv(n1).__star((2));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["*"]=1;
 //>>excludeEnd("ctx");
@@ -418,63 +419,63 @@ return n1;
 $ctx1.sendIdx["whileTrue:"]=1;
 //>>excludeEnd("ctx");
 n2=(16);
-_st((function(){
+$recv((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-t2=_st($Date())._millisecondsToRun_((function(){
+t2=$recv($Date())._millisecondsToRun_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
-r=_st(n2)._benchFib();
+r=$recv(n2)._benchFib();
 return r;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,5)});
 //>>excludeEnd("ctx");
 }));
 t2;
-return _st(t2).__lt((1000));
+return $recv(t2).__lt((1000));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)});
 //>>excludeEnd("ctx");
 }))._whileTrue_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-n2=_st(n2).__plus((1));
+n2=$recv(n2).__plus((1));
 return n2;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)});
 //>>excludeEnd("ctx");
 }));
-$7=_st(n1).__star((500000));
+$7=$recv(n1).__star((500000));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["*"]=3;
 //>>excludeEnd("ctx");
-$6=_st($7).__star((1000));
+$6=$recv($7).__star((1000));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["*"]=2;
 //>>excludeEnd("ctx");
-$5=_st($6).__slash(t1);
+$5=$recv($6).__slash(t1);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["/"]=1;
 //>>excludeEnd("ctx");
-$4=_st($5)._printString();
+$4=$recv($5)._printString();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["printString"]=1;
 //>>excludeEnd("ctx");
-$3=_st($4).__comma(" bytecodes/sec; ");
-$2=_st($3).__comma(_st(_st(_st(r).__star((1000))).__slash(t2))._printString());
+$3=$recv($4).__comma(" bytecodes/sec; ");
+$2=$recv($3).__comma($recv($recv($recv(r).__star((1000))).__slash(t2))._printString());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx[","]=2;
 //>>excludeEnd("ctx");
-$1=_st($2).__comma(" sends/sec");
+$1=$recv($2).__comma(" sends/sec");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx[","]=1;
 //>>excludeEnd("ctx");
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"tinyBenchmarks",{t1:t1,t2:t2,r:r,n1:n1,n2:n2},globals.Number)});
+}, function($ctx1) {$ctx1.fill(self,"tinyBenchmarks",{t1:t1,t2:t2,r:r,n1:n1,n2:n2},$globals.Number)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -484,6 +485,6 @@ referencedClasses: ["Date"],
 //>>excludeEnd("ide");
 messageSends: ["whileTrue:", "millisecondsToRun:", "benchmark", "<", "*", "benchFib", "+", ",", "printString", "/"]
 }),
-globals.Number);
+$globals.Number);
 
 });

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


File diff suppressed because it is too large
+ 218 - 217
src/Compiler-Core.js


+ 65 - 64
src/Compiler-Exceptions.js

@@ -1,50 +1,51 @@
 define("amber_core/Compiler-Exceptions", ["amber/boot", "amber_core/Kernel-Exceptions", "amber_core/Kernel-Objects"], function($boot){
-var smalltalk=$boot.vm,nil=$boot.nil,_st=$boot.asReceiver,globals=$boot.globals;
-smalltalk.addPackage('Compiler-Exceptions');
-smalltalk.packages["Compiler-Exceptions"].transport = {"type":"amd","amdNamespace":"amber_core"};
+var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
+var smalltalk=$core,_st=$recv,globals=$globals;
+$core.addPackage('Compiler-Exceptions');
+$core.packages["Compiler-Exceptions"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('CompilerError', globals.Error, [], 'Compiler-Exceptions');
+$core.addClass('CompilerError', $globals.Error, [], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
-globals.CompilerError.comment="I am the common superclass of all compiling errors.";
+$globals.CompilerError.comment="I am the common superclass of all compiling errors.";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('ParseError', globals.CompilerError, [], 'Compiler-Exceptions');
+$core.addClass('ParseError', $globals.CompilerError, [], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
-globals.ParseError.comment="Instance of ParseError are signaled on any parsing error.\x0aSee `Smalltalk >> #parse:`";
+$globals.ParseError.comment="Instance of ParseError are signaled on any parsing error.\x0aSee `Smalltalk >> #parse:`";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('SemanticError', globals.CompilerError, [], 'Compiler-Exceptions');
+$core.addClass('SemanticError', $globals.CompilerError, [], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
-globals.SemanticError.comment="I represent an abstract semantic error thrown by the SemanticAnalyzer.\x0aSemantic errors can be unknown variable errors, etc.\x0aSee my subclasses for concrete errors.\x0a\x0aThe IDE should catch instances of Semantic error to deal with them when compiling";
+$globals.SemanticError.comment="I represent an abstract semantic error thrown by the SemanticAnalyzer.\x0aSemantic errors can be unknown variable errors, etc.\x0aSee my subclasses for concrete errors.\x0a\x0aThe IDE should catch instances of Semantic error to deal with them when compiling";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('InliningError', globals.SemanticError, [], 'Compiler-Exceptions');
+$core.addClass('InliningError', $globals.SemanticError, [], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
-globals.InliningError.comment="Instances of InliningError are signaled when using an `InliningCodeGenerator`in a `Compiler`.";
+$globals.InliningError.comment="Instances of InliningError are signaled when using an `InliningCodeGenerator`in a `Compiler`.";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('InvalidAssignmentError', globals.SemanticError, ['variableName'], 'Compiler-Exceptions');
+$core.addClass('InvalidAssignmentError', $globals.SemanticError, ['variableName'], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
-globals.InvalidAssignmentError.comment="I get signaled when a pseudo variable gets assigned.";
+$globals.InvalidAssignmentError.comment="I get signaled when a pseudo variable gets assigned.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "messageText",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
 $1=" Invalid assignment to variable: ".__comma(self._variableName());
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"messageText",{},globals.InvalidAssignmentError)});
+}, function($ctx1) {$ctx1.fill(self,"messageText",{},$globals.InvalidAssignmentError)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -54,10 +55,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: [",", "variableName"]
 }),
-globals.InvalidAssignmentError);
+$globals.InvalidAssignmentError);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "variableName",
 protocol: 'accessing',
 fn: function (){
@@ -74,10 +75,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.InvalidAssignmentError);
+$globals.InvalidAssignmentError);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "variableName:",
 protocol: 'accessing',
 fn: function (aString){
@@ -93,31 +94,31 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.InvalidAssignmentError);
+$globals.InvalidAssignmentError);
 
 
 
-smalltalk.addClass('ShadowingVariableError', globals.SemanticError, ['variableName'], 'Compiler-Exceptions');
+$core.addClass('ShadowingVariableError', $globals.SemanticError, ['variableName'], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
-globals.ShadowingVariableError.comment="I get signaled when a variable in a block or method scope shadows a variable of the same name in an outer scope.";
+$globals.ShadowingVariableError.comment="I get signaled when a variable in a block or method scope shadows a variable of the same name in an outer scope.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "messageText",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
-$1=_st("Variable shadowing error: ".__comma(self._variableName())).__comma(" is already defined");
+$1=$recv("Variable shadowing error: ".__comma(self._variableName())).__comma(" is already defined");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx[","]=1;
 //>>excludeEnd("ctx");
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"messageText",{},globals.ShadowingVariableError)});
+}, function($ctx1) {$ctx1.fill(self,"messageText",{},$globals.ShadowingVariableError)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -127,10 +128,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: [",", "variableName"]
 }),
-globals.ShadowingVariableError);
+$globals.ShadowingVariableError);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "variableName",
 protocol: 'accessing',
 fn: function (){
@@ -147,10 +148,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.ShadowingVariableError);
+$globals.ShadowingVariableError);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "variableName:",
 protocol: 'accessing',
 fn: function (aString){
@@ -166,31 +167,31 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.ShadowingVariableError);
+$globals.ShadowingVariableError);
 
 
 
-smalltalk.addClass('UnknownVariableError', globals.SemanticError, ['variableName'], 'Compiler-Exceptions');
+$core.addClass('UnknownVariableError', $globals.SemanticError, ['variableName'], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
-globals.UnknownVariableError.comment="I get signaled when a variable is not defined.\x0aThe default behavior is to allow it, as this is how Amber currently is able to seamlessly send messages to JavaScript objects.";
+$globals.UnknownVariableError.comment="I get signaled when a variable is not defined.\x0aThe default behavior is to allow it, as this is how Amber currently is able to seamlessly send messages to JavaScript objects.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "messageText",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
-$1=_st("Unknown Variable error: ".__comma(self._variableName())).__comma(" is not defined");
+$1=$recv("Unknown Variable error: ".__comma(self._variableName())).__comma(" is not defined");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx[","]=1;
 //>>excludeEnd("ctx");
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"messageText",{},globals.UnknownVariableError)});
+}, function($ctx1) {$ctx1.fill(self,"messageText",{},$globals.UnknownVariableError)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -200,10 +201,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: [",", "variableName"]
 }),
-globals.UnknownVariableError);
+$globals.UnknownVariableError);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "variableName",
 protocol: 'accessing',
 fn: function (){
@@ -220,10 +221,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.UnknownVariableError);
+$globals.UnknownVariableError);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "variableName:",
 protocol: 'accessing',
 fn: function (aString){
@@ -239,27 +240,27 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.UnknownVariableError);
+$globals.UnknownVariableError);
 
 
 
-smalltalk.addClass('RethrowErrorHandler', globals.Object, [], 'Compiler-Exceptions');
+$core.addClass('RethrowErrorHandler', $globals.Object, [], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
-globals.RethrowErrorHandler.comment="This class is used in the commandline version of the compiler.\x0aIt uses the handleError: message of ErrorHandler for printing the stacktrace and throws the error again as JS exception.\x0aAs a result Smalltalk errors are not swallowd by the Amber runtime and compilation can be aborted.";
+$globals.RethrowErrorHandler.comment="This class is used in the commandline version of the compiler.\x0aIt uses the handleError: message of ErrorHandler for printing the stacktrace and throws the error again as JS exception.\x0aAs a result Smalltalk errors are not swallowd by the Amber runtime and compilation can be aborted.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "basicSignal:",
 protocol: 'error handling',
 fn: function (anError){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 throw anError;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"basicSignal:",{anError:anError},globals.RethrowErrorHandler)});
+}, function($ctx1) {$ctx1.fill(self,"basicSignal:",{anError:anError},$globals.RethrowErrorHandler)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -269,21 +270,21 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.RethrowErrorHandler);
+$globals.RethrowErrorHandler);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "handleError:",
 protocol: 'error handling',
 fn: function (anError){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self._basicSignal_(anError);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},globals.RethrowErrorHandler)});
+}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},$globals.RethrowErrorHandler)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -293,7 +294,7 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["basicSignal:"]
 }),
-globals.RethrowErrorHandler);
+$globals.RethrowErrorHandler);
 
 
 });

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


+ 9 - 9
src/Compiler-IR.st

@@ -966,7 +966,7 @@ visitIRDynamicArray: anIRDynamicArray
 !
 
 visitIRDynamicDictionary: anIRDynamicDictionary
-	self stream nextPutAll: 'globals.HashedCollection._newFromPairs_(['.
+	self stream nextPutAll: '$globals.HashedCollection._newFromPairs_(['.
 		anIRDynamicDictionary instructions
 			do: [ :each | self visit: each ]
 			separatedBy: [ self stream nextPutAll: ',' ].
@@ -1034,7 +1034,7 @@ visitIRValue: anIRValue
 
 visitIRVariable: anIRVariable
 	anIRVariable variable name = 'thisContext'
-		ifTrue: [ self stream nextPutAll: 'smalltalk.getThisContext()' ]
+		ifTrue: [ self stream nextPutAll: '$core.getThisContext()' ]
 		ifFalse: [ self stream nextPutAll: anIRVariable variable alias ]
 !
 
@@ -1046,7 +1046,7 @@ visitIRVerbatim: anIRVerbatim
 visitReceiver: anIRInstruction
 	anIRInstruction needsBoxingAsReceiver ifFalse: [ ^ self visit: anIRInstruction ].
 	
-	self stream nextPutAll: '_st('.
+	self stream nextPutAll: '$recv('.
 	self visit: anIRInstruction.
 	self stream nextPutAll: ')'
 !
@@ -1069,7 +1069,7 @@ visitSuperSend: anIRSend
 		nextPutAll: self currentClass asJavascript;
 		nextPutAll: '.superclass.fn.prototype.';
 		nextPutAll: anIRSend selector asJavaScriptMethodName, '.apply(';
-		nextPutAll: '_st('.
+		nextPutAll: '$recv('.
 	self visit: anIRSend instructions first.
 	self stream nextPutAll: '), ['.
 	anIRSend instructions allButFirst
@@ -1122,7 +1122,7 @@ nextPutBlockContextFor: anIRClosure during: aBlock
 	self
 		nextPutAll: '//>>excludeStart("ctx", pragmas.excludeDebugContexts);';
 		lf;
-		nextPutAll: 'return smalltalk.withContext(function(', anIRClosure scope alias, ') {';
+		nextPutAll: 'return $core.withContext(function(', anIRClosure scope alias, ') {';
 		lf;
 		nextPutAll: '//>>excludeEnd("ctx");';
 		lf.
@@ -1157,7 +1157,7 @@ nextPutClassRefFunction: aString
 	stream
 		nextPutAll: 'function $';
 		nextPutAll: aString;
-		nextPutAll: '(){return globals.';
+		nextPutAll: '(){return $globals.';
 		nextPutAll: aString;
 		nextPutAll: '||(typeof ';
 		nextPutAll: aString;
@@ -1183,7 +1183,7 @@ nextPutContextFor: aMethod during: aBlock
 	self
 		nextPutAll: '//>>excludeStart("ctx", pragmas.excludeDebugContexts);';
 		lf;
-		nextPutAll: 'return smalltalk.withContext(function(', aMethod scope alias, ') { ';
+		nextPutAll: 'return $core.withContext(function(', aMethod scope alias, ') { ';
 		lf;
 		nextPutAll: '//>>excludeEnd("ctx");';
 		lf.
@@ -1243,7 +1243,7 @@ nextPutIfElse: aBlock with: ifBlock with: elseBlock
 
 nextPutMethodDeclaration: aMethod with: aBlock
 	stream
-		nextPutAll: 'smalltalk.method({'; lf;
+		nextPutAll: '$core.method({'; lf;
 		nextPutAll: 'selector: ', aMethod selector asJavascript, ','; lf;
 		nextPutAll: 'source: ', aMethod source asJavascript, ',';lf.
 	aBlock value.
@@ -1300,7 +1300,7 @@ nextPutSendIndexFor: anIRSend
 
 nextPutSequenceWith: aBlock
 	"stream
-		nextPutAll: 'switch(smalltalk.thisContext.pc){'; lf."
+		nextPutAll: 'switch($core.thisContext.pc){'; lf."
 	aBlock value.
 	"stream
 		nextPutAll: '};'; lf"

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


+ 4 - 4
src/Compiler-Inlining.st

@@ -270,7 +270,7 @@ visitIRInlinedClosure: anIRInlinedClosure
 
 visitIRInlinedIfFalse: anIRInlinedIfFalse
 	self stream nextPutIf: [
-		self stream nextPutAll: '!! smalltalk.assert('.
+		self stream nextPutAll: '!!$core.assert('.
 		self visit: anIRInlinedIfFalse instructions first.
 		self stream nextPutAll: ')' ]
 		with: [ self visit: anIRInlinedIfFalse instructions last ]
@@ -288,7 +288,7 @@ visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil
 
 visitIRInlinedIfTrue: anIRInlinedIfTrue
 	self stream nextPutIf: [
-		self stream nextPutAll: 'smalltalk.assert('.
+		self stream nextPutAll: '$core.assert('.
 		self visit: anIRInlinedIfTrue instructions first.
 		self stream nextPutAll: ')' ]
 		with: [ self visit: anIRInlinedIfTrue instructions last ]
@@ -297,7 +297,7 @@ visitIRInlinedIfTrue: anIRInlinedIfTrue
 visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse
 	self stream
 		nextPutIfElse: [
-			self stream nextPutAll: 'smalltalk.assert('.
+			self stream nextPutAll: '$core.assert('.
 			self visit: anIRInlinedIfTrueIfFalse instructions first.
 			self stream nextPutAll: ')' ]
 		with: [ self visit: anIRInlinedIfTrueIfFalse instructions second ]
@@ -523,7 +523,7 @@ I inline message sends together with assignments by moving them around into the
 
 Will produce:
 
-	if(smalltalk.assert(true) {
+	if($core.assert(true) {
 		a = 1;
 	};!
 

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


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


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


+ 52 - 51
src/Examples.js

@@ -1,34 +1,35 @@
 define("amber_core/Examples", ["amber/boot", "amber_core/Web"], function($boot){
-var smalltalk=$boot.vm,nil=$boot.nil,_st=$boot.asReceiver,globals=$boot.globals;
-smalltalk.addPackage('Examples');
-smalltalk.packages["Examples"].transport = {"type":"amd","amdNamespace":"amber_core"};
+var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
+var smalltalk=$core,_st=$recv,globals=$globals;
+$core.addPackage('Examples');
+$core.packages["Examples"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('Counter', globals.Widget, ['count', 'header'], 'Examples');
+$core.addClass('Counter', $globals.Widget, ['count', 'header'], 'Examples');
 //>>excludeStart("ide", pragmas.excludeIdeData);
-globals.Counter.comment="This is a trivial Widget example mimicking the classic Counter example in Seaside.\x0aIn order to play with it, just evaluate the doit below in a workspace.\x0aThen take a look in the HTML document above the IDE.\x0a\x0a\x09\x09Counter tryExample";
+$globals.Counter.comment="This is a trivial Widget example mimicking the classic Counter example in Seaside.\x0aIn order to play with it, just evaluate the doit below in a workspace.\x0aThen take a look in the HTML document above the IDE.\x0a\x0a\x09\x09Counter tryExample";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "decrease",
 protocol: 'actions',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
-self["@count"]=_st(self["@count"]).__minus((1));
-_st(self["@header"])._contents_((function(html){
+self["@count"]=$recv(self["@count"]).__minus((1));
+$recv(self["@header"])._contents_((function(html){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return _st(html)._with_(_st(self["@count"])._asString());
+return $recv(html)._with_($recv(self["@count"])._asString());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"decrease",{},globals.Counter)});
+}, function($ctx1) {$ctx1.fill(self,"decrease",{},$globals.Counter)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -38,30 +39,30 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["-", "contents:", "with:", "asString"]
 }),
-globals.Counter);
+$globals.Counter);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "increase",
 protocol: 'actions',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
-self["@count"]=_st(self["@count"]).__plus((1));
-_st(self["@header"])._contents_((function(html){
+self["@count"]=$recv(self["@count"]).__plus((1));
+$recv(self["@header"])._contents_((function(html){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return _st(html)._with_(_st(self["@count"])._asString());
+return $recv(html)._with_($recv(self["@count"])._asString());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"increase",{},globals.Counter)});
+}, function($ctx1) {$ctx1.fill(self,"increase",{},$globals.Counter)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -71,29 +72,29 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["+", "contents:", "with:", "asString"]
 }),
-globals.Counter);
+$globals.Counter);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "initialize",
 protocol: 'initialization',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 (
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = true, 
 //>>excludeEnd("ctx");
-globals.Counter.superclass.fn.prototype._initialize.apply(_st(self), []));
+$globals.Counter.superclass.fn.prototype._initialize.apply($recv(self), []));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
 self["@count"]=(0);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.Counter)});
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.Counter)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -103,36 +104,36 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["initialize"]
 }),
-globals.Counter);
+$globals.Counter);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "renderOn:",
 protocol: 'rendering',
 fn: function (html){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1,$2,$3,$4,$5,$6;
-$1=_st(html)._h1();
-_st($1)._with_(_st(self["@count"])._asString());
+$1=$recv(html)._h1();
+$recv($1)._with_($recv(self["@count"])._asString());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["with:"]=1;
 //>>excludeEnd("ctx");
-$2=_st($1)._yourself();
+$2=$recv($1)._yourself();
 self["@header"]=$2;
-$3=_st(html)._button();
+$3=$recv(html)._button();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["button"]=1;
 //>>excludeEnd("ctx");
-_st($3)._with_("++");
+$recv($3)._with_("++");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["with:"]=2;
 //>>excludeEnd("ctx");
-$4=_st($3)._onClick_((function(){
+$4=$recv($3)._onClick_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 return self._increase();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -142,11 +143,11 @@ return self._increase();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["onClick:"]=1;
 //>>excludeEnd("ctx");
-$5=_st(html)._button();
-_st($5)._with_("--");
-$6=_st($5)._onClick_((function(){
+$5=$recv(html)._button();
+$recv($5)._with_("--");
+$6=$recv($5)._onClick_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 return self._decrease();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -155,7 +156,7 @@ return self._decrease();
 }));
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},globals.Counter)});
+}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},$globals.Counter)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -165,22 +166,22 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["with:", "h1", "asString", "yourself", "button", "onClick:", "increase", "decrease"]
 }),
-globals.Counter);
+$globals.Counter);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "tryExample",
 protocol: 'example',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
-_st(self._new())._appendToJQuery_("body"._asJQuery());
+$recv(self._new())._appendToJQuery_("body"._asJQuery());
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"tryExample",{},globals.Counter.klass)});
+}, function($ctx1) {$ctx1.fill(self,"tryExample",{},$globals.Counter.klass)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -190,6 +191,6 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["appendToJQuery:", "new", "asJQuery"]
 }),
-globals.Counter.klass);
+$globals.Counter.klass);
 
 });

File diff suppressed because it is too large
+ 223 - 222
src/IDE.js


File diff suppressed because it is too large
+ 224 - 223
src/Kernel-Announcements.js


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


+ 14 - 14
src/Kernel-Classes.st

@@ -93,9 +93,9 @@ javascriptConstructor
 
 javascriptConstructor: aJavaScriptFunction
 	"Set the JS constructor used to instantiate.
-	See the JS counter-part in boot.js `smalltalk.setClassConstructor'"
+	See the JS counter-part in boot.js `$core.setClassConstructor'"
 	
-	<smalltalk.setClassConstructor(self, aJavaScriptFunction);>
+	<$core.setClassConstructor(self, aJavaScriptFunction);>
 !
 
 lookupSelector: selector
@@ -119,7 +119,7 @@ methodAt: aString
 !
 
 methodDictionary
-	<var dict = globals.HashedCollection._new();
+	<var dict = $globals.HashedCollection._new();
 	var methods = self.methods;
 	Object.keys(methods).forEach(function(i) {
 		if(methods[i].selector) {
@@ -316,11 +316,11 @@ new
 !Behavior methodsFor: 'private'!
 
 basicAddCompiledMethod: aMethod
-	<smalltalk.addMethod(aMethod, self)>
+	<$core.addMethod(aMethod, self)>
 !
 
 basicRemoveCompiledMethod: aMethod
-	<smalltalk.removeMethod(aMethod,self)>
+	<$core.removeMethod(aMethod,self)>
 ! !
 
 !Behavior methodsFor: 'testing'!
@@ -451,7 +451,7 @@ subclass: aString instanceVariableNames: aString2 package: aString3
 !Class methodsFor: 'converting'!
 
 asJavascript
-	^ 'globals.', self name
+	^ '$globals.', self name
 ! !
 
 !Class methodsFor: 'printing'!
@@ -517,7 +517,7 @@ theNonMetaClass
 !Metaclass methodsFor: 'converting'!
 
 asJavascript
-	^ 'globals.', self instanceClass name, '.klass'
+	^ '$globals.', self instanceClass name, '.klass'
 ! !
 
 !Metaclass methodsFor: 'printing'!
@@ -712,8 +712,8 @@ installMethod: aCompiledMethod forClass: aBehavior protocol: aString
 
 basicAddSubclassOf: aClass named: aString instanceVariableNames: aCollection package: packageName
 	<
-		smalltalk.addClass(aString, aClass, aCollection, packageName);
-		return globals[aString]
+		$core.addClass(aString, aClass, aCollection, packageName);
+		return $globals[aString]
 	>
 !
 
@@ -728,13 +728,13 @@ basicClass: aClass instanceVariables: aCollection
 !
 
 basicRemoveClass: aClass
-	<smalltalk.removeClass(aClass)>
+	<$core.removeClass(aClass)>
 !
 
 basicRenameClass: aClass to: aString
 	<
-		globals[aString] = aClass;
-		delete globals[aClass.className];
+		$globals[aString] = aClass;
+		delete $globals[aClass.className];
 		aClass.className = aString;
 	>
 !
@@ -749,14 +749,14 @@ basicSwapClassNames: aClass with: anotherClass
 
 rawRenameClass: aClass to: aString
 	<
-		globals[aString] = aClass;
+		$globals[aString] = aClass;
 	>
 ! !
 
 !ClassBuilder methodsFor: 'public'!
 
 setupClass: aClass
-	<smalltalk.init(aClass);>
+	<$core.init(aClass);>
 ! !
 
 Object subclass: #ClassCategoryReader

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


+ 3 - 3
src/Kernel-Collections.st

@@ -958,7 +958,7 @@ indexOf: anObject ifAbsent: aBlock
 	<
 		self = self._numericallyIndexable();
 		for(var i=0; i < self.length; i++) {
-			if(_st(self[i]).__eq(anObject)) {return i+1}
+			if($recv(self[i]).__eq(anObject)) {return i+1}
 		};
 		return aBlock._value();
 	>
@@ -975,7 +975,7 @@ indexOf: anObject startingAt: start ifAbsent: aBlock
 	<
 		self = self._numericallyIndexable();
 		for(var i=start - 1; i < self.length; i++){
-			if(_st(self[i]).__eq(anObject)) {return i+1}
+			if($recv(self[i]).__eq(anObject)) {return i+1}
 		}
 		return aBlock._value();
 	>
@@ -1497,7 +1497,7 @@ asJSON
 !
 
 asJavaScriptMethodName
-	<return smalltalk.st2js(self)>
+	<return $core.st2js(self)>
 !
 
 asJavascript

+ 183 - 181
src/Kernel-Exceptions.js

@@ -1,25 +1,26 @@
 define("amber_core/Kernel-Exceptions", ["amber/boot", "amber_core/Kernel-Objects"], function($boot){
-var smalltalk=$boot.vm,nil=$boot.nil,_st=$boot.asReceiver,globals=$boot.globals;
-smalltalk.addPackage('Kernel-Exceptions');
-smalltalk.packages["Kernel-Exceptions"].transport = {"type":"amd","amdNamespace":"amber_core"};
+var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
+var smalltalk=$core,_st=$recv,globals=$globals;
+$core.addPackage('Kernel-Exceptions');
+$core.packages["Kernel-Exceptions"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('Error', globals.Object, ['messageText'], 'Kernel-Exceptions');
+$core.addClass('Error', $globals.Object, ['messageText'], 'Kernel-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
-globals.Error.comment="From the ANSI standard:\x0a\x0aThis protocol describes the behavior of instances of class `Error`.\x0aThese are used to represent error conditions that prevent the normal continuation of processing.\x0aActual error exceptions used by an application may be subclasses of this class.\x0aAs `Error` is explicitly specified to be subclassable, conforming implementations must implement its behavior in a non-fragile manner.";
+$globals.Error.comment="From the ANSI standard:\x0a\x0aThis protocol describes the behavior of instances of class `Error`.\x0aThese are used to represent error conditions that prevent the normal continuation of processing.\x0aActual error exceptions used by an application may be subclasses of this class.\x0aAs `Error` is explicitly specified to be subclassable, conforming implementations must implement its behavior in a non-fragile manner.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "beHandled",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self.amberHandled = true;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"beHandled",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"beHandled",{},$globals.Error)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -29,21 +30,21 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.Error);
+$globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "beUnhandled",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self.amberHandled = false;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"beUnhandled",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"beUnhandled",{},$globals.Error)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -53,21 +54,21 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.Error);
+$globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "context",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 return self.context;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"context",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"context",{},$globals.Error)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -77,21 +78,21 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.Error);
+$globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "initialize",
 protocol: 'initialization',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
-self._messageText_("Errorclass: ".__comma(_st(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)});
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.Error)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -101,21 +102,21 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["messageText:", ",", "name", "class"]
 }),
-globals.Error);
+$globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "isSmalltalkError",
 protocol: 'testing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 return self.smalltalkError === true;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"isSmalltalkError",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"isSmalltalkError",{},$globals.Error)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -125,21 +126,21 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.Error);
+$globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "jsStack",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 return self.stack;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"jsStack",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"jsStack",{},$globals.Error)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -149,10 +150,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.Error);
+$globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "messageText",
 protocol: 'accessing',
 fn: function (){
@@ -169,10 +170,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.Error);
+$globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "messageText:",
 protocol: 'accessing',
 fn: function (aString){
@@ -188,16 +189,16 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.Error);
+$globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "resignal",
 protocol: 'signaling',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 
 		self.amberHandled = false;
@@ -205,7 +206,7 @@ return smalltalk.withContext(function($ctx1) {
 	;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"resignal",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"resignal",{},$globals.Error)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -215,50 +216,51 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.Error);
+$globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "signal",
 protocol: 'signaling',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 
 		self.amberHandled = false;
-		self.context = smalltalk.getThisContext(); 
-		self.smalltalkError = true; throw(self)
+		self.context = $core.getThisContext(); 
+		self.smalltalkError = true;
+		throw self;
 	;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"signal",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"signal",{},$globals.Error)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "signal\x0a\x09<\x0a\x09\x09self.amberHandled = false;\x0a\x09\x09self.context = smalltalk.getThisContext(); \x0a\x09\x09self.smalltalkError = true; throw(self)\x0a\x09>",
+source: "signal\x0a\x09<\x0a\x09\x09self.amberHandled = false;\x0a\x09\x09self.context = $core.getThisContext(); \x0a\x09\x09self.smalltalkError = true;\x0a\x09\x09throw self;\x0a\x09>",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.Error);
+$globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "signal:",
 protocol: 'signaling',
 fn: function (aString){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self._messageText_(aString);
 self._signal();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},$globals.Error)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -268,22 +270,22 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["messageText:", "signal"]
 }),
-globals.Error);
+$globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "signalerContext",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
 $1=self._signalerContextFrom_(self._context());
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"signalerContext",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"signalerContext",{},$globals.Error)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -293,47 +295,47 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["signalerContextFrom:", "context"]
 }),
-globals.Error);
+$globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "signalerContextFrom:",
 protocol: 'accessing',
 fn: function (aContext){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $4,$3,$2,$1;
-$1=_st(aContext)._findContextSuchThat_((function(context){
+$1=$recv(aContext)._findContextSuchThat_((function(context){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-$4=_st(context)._receiver();
+$4=$recv(context)._receiver();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["receiver"]=1;
 //>>excludeEnd("ctx");
-$3=_st($4).__eq_eq(self);
+$3=$recv($4).__eq_eq(self);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["=="]=1;
 //>>excludeEnd("ctx");
-$2=_st($3)._or_((function(){
+$2=$recv($3)._or_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
-return _st(_st(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");
 }));
-return _st($2)._not();
+return $recv($2)._not();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({context:context},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"signalerContextFrom:",{aContext:aContext},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"signalerContextFrom:",{aContext:aContext},$globals.Error)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -343,21 +345,21 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["findContextSuchThat:", "not", "or:", "==", "receiver", "class"]
 }),
-globals.Error);
+$globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "wasHandled",
 protocol: 'testing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 return self.amberHandled || false;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"wasHandled",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"wasHandled",{},$globals.Error)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -367,11 +369,11 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.Error);
+$globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "heliosClass",
 protocol: 'helios',
 fn: function (){
@@ -386,22 +388,22 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.Error.klass);
+$globals.Error.klass);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "signal",
 protocol: 'instance creation',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
-$1=_st(self._new())._signal();
+$1=$recv(self._new())._signal();
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"signal",{},globals.Error.klass)});
+}, function($ctx1) {$ctx1.fill(self,"signal",{},$globals.Error.klass)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -411,22 +413,22 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["signal", "new"]
 }),
-globals.Error.klass);
+$globals.Error.klass);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "signal:",
 protocol: 'instance creation',
 fn: function (aString){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
-$1=_st(self._new())._signal_(aString);
+$1=$recv(self._new())._signal_(aString);
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},globals.Error.klass)});
+}, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},$globals.Error.klass)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -436,15 +438,15 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["signal:", "new"]
 }),
-globals.Error.klass);
+$globals.Error.klass);
 
 
-smalltalk.addClass('Halt', globals.Error, [], 'Kernel-Exceptions');
+$core.addClass('Halt', $globals.Error, [], 'Kernel-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
-globals.Halt.comment="I am provided to support `Object>>#halt`.";
+$globals.Halt.comment="I am provided to support `Object>>#halt`.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "messageText",
 protocol: 'accessing',
 fn: function (){
@@ -459,39 +461,39 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.Halt);
+$globals.Halt);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "signalerContextFrom:",
 protocol: 'accessing',
 fn: function (aContext){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $4,$3,$2,$1;
-$1=_st(aContext)._findContextSuchThat_((function(context){
+$1=$recv(aContext)._findContextSuchThat_((function(context){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-$4=_st(context)._receiver();
+$4=$recv(context)._receiver();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["receiver"]=1;
 //>>excludeEnd("ctx");
-$3=_st($4).__eq_eq(self);
+$3=$recv($4).__eq_eq(self);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["=="]=1;
 //>>excludeEnd("ctx");
-$2=_st($3)._or_((function(){
+$2=$recv($3)._or_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
-return _st(_st(_st(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 smalltalk.withContext(function($ctx4) {
+return $core.withContext(function($ctx4) {
 //>>excludeEnd("ctx");
-return _st(_st(_st(context)._method())._selector()).__eq("halt");
+return $recv($recv($recv(context)._method())._selector()).__eq("halt");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)});
 //>>excludeEnd("ctx");
@@ -503,14 +505,14 @@ return _st(_st(_st(context)._method())._selector()).__eq("halt");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["or:"]=1;
 //>>excludeEnd("ctx");
-return _st($2)._not();
+return $recv($2)._not();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({context:context},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"signalerContextFrom:",{aContext:aContext},globals.Halt)});
+}, function($ctx1) {$ctx1.fill(self,"signalerContextFrom:",{aContext:aContext},$globals.Halt)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -520,27 +522,27 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["findContextSuchThat:", "not", "or:", "==", "receiver", "class", "=", "selector", "method"]
 }),
-globals.Halt);
+$globals.Halt);
 
 
 
-smalltalk.addClass('JavaScriptException', globals.Error, ['exception'], 'Kernel-Exceptions');
+$core.addClass('JavaScriptException', $globals.Error, ['exception'], 'Kernel-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
-globals.JavaScriptException.comment="A JavaScriptException is thrown when a non-Smalltalk exception occurs while in the Smalltalk stack.\x0aSee `boot.js` `inContext()` and `BlockClosure >> on:do:`";
+$globals.JavaScriptException.comment="A JavaScriptException is thrown when a non-Smalltalk exception occurs while in the Smalltalk stack.\x0aSee `boot.js` `inContext()` and `BlockClosure >> on:do:`";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "context:",
 protocol: 'accessing',
 fn: function (aMethodContext){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self.context = aMethodContext;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"context:",{aMethodContext:aMethodContext},globals.JavaScriptException)});
+}, function($ctx1) {$ctx1.fill(self,"context:",{aMethodContext:aMethodContext},$globals.JavaScriptException)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -550,10 +552,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.JavaScriptException);
+$globals.JavaScriptException);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "exception",
 protocol: 'accessing',
 fn: function (){
@@ -570,10 +572,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.JavaScriptException);
+$globals.JavaScriptException);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "exception:",
 protocol: 'accessing',
 fn: function (anException){
@@ -589,21 +591,21 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.JavaScriptException);
+$globals.JavaScriptException);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "messageText",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 return 'JavaScript exception: ' + self["@exception"].toString();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"messageText",{},globals.JavaScriptException)});
+}, function($ctx1) {$ctx1.fill(self,"messageText",{},$globals.JavaScriptException)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -613,26 +615,26 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.JavaScriptException);
+$globals.JavaScriptException);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "on:",
 protocol: 'instance creation',
 fn: function (anException){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $2,$3,$1;
 $2=self._new();
-_st($2)._exception_(anException);
-$3=_st($2)._yourself();
+$recv($2)._exception_(anException);
+$3=$recv($2)._yourself();
 $1=$3;
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"on:",{anException:anException},globals.JavaScriptException.klass)});
+}, function($ctx1) {$ctx1.fill(self,"on:",{anException:anException},$globals.JavaScriptException.klass)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -642,26 +644,26 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["exception:", "new", "yourself"]
 }),
-globals.JavaScriptException.klass);
+$globals.JavaScriptException.klass);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "on:context:",
 protocol: 'instance creation',
 fn: function (anException,aMethodContext){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $2,$3,$1;
 $2=self._new();
-_st($2)._exception_(anException);
-_st($2)._context_(aMethodContext);
-$3=_st($2)._yourself();
+$recv($2)._exception_(anException);
+$recv($2)._context_(aMethodContext);
+$3=$recv($2)._yourself();
 $1=$3;
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"on:context:",{anException:anException,aMethodContext:aMethodContext},globals.JavaScriptException.klass)});
+}, function($ctx1) {$ctx1.fill(self,"on:context:",{anException:anException,aMethodContext:aMethodContext},$globals.JavaScriptException.klass)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -671,15 +673,15 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["exception:", "new", "context:", "yourself"]
 }),
-globals.JavaScriptException.klass);
+$globals.JavaScriptException.klass);
 
 
-smalltalk.addClass('MessageNotUnderstood', globals.Error, ['message', 'receiver'], 'Kernel-Exceptions');
+$core.addClass('MessageNotUnderstood', $globals.Error, ['message', 'receiver'], 'Kernel-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
-globals.MessageNotUnderstood.comment="This exception is provided to support `Object>>doesNotUnderstand:`.";
+$globals.MessageNotUnderstood.comment="This exception is provided to support `Object>>doesNotUnderstand:`.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "message",
 protocol: 'accessing',
 fn: function (){
@@ -696,10 +698,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.MessageNotUnderstood);
+$globals.MessageNotUnderstood);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "message:",
 protocol: 'accessing',
 fn: function (aMessage){
@@ -715,25 +717,25 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.MessageNotUnderstood);
+$globals.MessageNotUnderstood);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "messageText",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
-$1=_st(_st(_st(self._receiver())._asString()).__comma(" does not understand #")).__comma(_st(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");
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"messageText",{},globals.MessageNotUnderstood)});
+}, function($ctx1) {$ctx1.fill(self,"messageText",{},$globals.MessageNotUnderstood)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -743,10 +745,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: [",", "asString", "receiver", "selector", "message"]
 }),
-globals.MessageNotUnderstood);
+$globals.MessageNotUnderstood);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "receiver",
 protocol: 'accessing',
 fn: function (){
@@ -763,10 +765,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.MessageNotUnderstood);
+$globals.MessageNotUnderstood);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "receiver:",
 protocol: 'accessing',
 fn: function (anObject){
@@ -782,16 +784,16 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.MessageNotUnderstood);
+$globals.MessageNotUnderstood);
 
 
 
-smalltalk.addClass('NonBooleanReceiver', globals.Error, ['object'], 'Kernel-Exceptions');
+$core.addClass('NonBooleanReceiver', $globals.Error, ['object'], 'Kernel-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
-globals.NonBooleanReceiver.comment="NonBooleanReceiver exceptions may be thrown when executing inlined methods such as `#ifTrue:` with a non boolean receiver.";
+$globals.NonBooleanReceiver.comment="NonBooleanReceiver exceptions may be thrown when executing inlined methods such as `#ifTrue:` with a non boolean receiver.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "object",
 protocol: 'accessing',
 fn: function (){
@@ -808,10 +810,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.NonBooleanReceiver);
+$globals.NonBooleanReceiver);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "object:",
 protocol: 'accessing',
 fn: function (anObject){
@@ -827,13 +829,13 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.NonBooleanReceiver);
+$globals.NonBooleanReceiver);
 
 
 
-smalltalk.addClass('PackageCommitError', globals.Error, [], 'Kernel-Exceptions');
+$core.addClass('PackageCommitError', $globals.Error, [], 'Kernel-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
-globals.PackageCommitError.comment="I get signaled when an attempt to commit a package has failed.";
+$globals.PackageCommitError.comment="I get signaled when an attempt to commit a package has failed.";
 //>>excludeEnd("ide");
 
 });

+ 3 - 2
src/Kernel-Exceptions.st

@@ -71,8 +71,9 @@ resignal
 signal
 	<
 		self.amberHandled = false;
-		self.context = smalltalk.getThisContext(); 
-		self.smalltalkError = true; throw(self)
+		self.context = $core.getThisContext(); 
+		self.smalltalkError = true;
+		throw self;
 	>
 !
 

File diff suppressed because it is too large
+ 231 - 230
src/Kernel-ImportExport.js


+ 9 - 7
src/Kernel-ImportExport.st

@@ -253,7 +253,7 @@ jsClassNameFor: aClass
 		ifFalse: [
 			aClass
 				ifNil: [ 'null' ]
-				ifNotNil: [ 'globals.', aClass name ] ]
+				ifNotNil: [ '$globals.', aClass name ] ]
 ! !
 
 !Exporter methodsFor: 'output'!
@@ -261,7 +261,7 @@ jsClassNameFor: aClass
 exportDefinitionOf: aClass on: aStream
 	aStream
 		lf;
-		nextPutAll: 'smalltalk.addClass(';
+		nextPutAll: '$core.addClass(';
 		nextPutAll: '''', (self classNameFor: aClass), ''', ';
 		nextPutAll: (self jsClassNameFor: aClass superclass);
 		nextPutAll: ', ['.
@@ -300,8 +300,8 @@ exportMetaDefinitionOf: aClass on: aStream
 
 exportMethod: aMethod on: aStream
 	aStream
-		nextPutAll: 'smalltalk.addMethod(';lf;
-		nextPutAll: 'smalltalk.method({';lf;
+		nextPutAll: '$core.addMethod(';lf;
+		nextPutAll: '$core.method({';lf;
 		nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;
 		nextPutAll: 'protocol: ''', aMethod protocol, ''',';lf;
 		nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;
@@ -340,7 +340,7 @@ exportPackage: aPackage on: aStream
 
 exportPackageDefinitionOf: aPackage on: aStream
 	aStream
-		nextPutAll: 'smalltalk.addPackage(';
+		nextPutAll: '$core.addPackage(';
 		nextPutAll: '''', aPackage name, ''');';
 		lf
 !
@@ -359,7 +359,7 @@ exportPackagePrologueOf: aPackage on: aStream
 
 exportPackageTransportOf: aPackage on: aStream
 	aStream
-		nextPutAll: 'smalltalk.packages[';
+		nextPutAll: '$core.packages[';
 		nextPutAll: aPackage name asJavascript;
 		nextPutAll: '].transport = ';
 		nextPutAll: aPackage transport asJSONString;
@@ -391,7 +391,9 @@ exportPackagePrologueOf: aPackage on: aStream
 		nextPutAll: (#('amber/boot'), (self amdNamesOfPackages: aPackage loadDependencies)) asJavascript;
 		nextPutAll: ', function($boot){';
 		lf;
-		nextPutAll: 'var smalltalk=$boot.vm,nil=$boot.nil,_st=$boot.asReceiver,globals=$boot.globals;';
+		nextPutAll: 'var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;';
+		lf;
+		nextPutAll: 'var smalltalk=$core,_st=$recv,globals=$globals;';
 		lf
 ! !
 

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


+ 27 - 23
src/Kernel-Infrastructure.st

@@ -91,7 +91,7 @@ Typical use cases include IDEs, remote access and restricting browsing.!
 !Environment methodsFor: 'accessing'!
 
 allSelectors
-	^ Smalltalk vm allSelectors
+	^ Smalltalk core allSelectors
 !
 
 availableClassNames
@@ -424,7 +424,7 @@ doesNotUnderstand: aMessage
 
 forwardMessage: aString withArguments: anArray
 	<
-		return smalltalk.accessJavaScript(self._jsObject(), aString, anArray);
+		return $core.accessJavaScript(self._jsObject(), aString, anArray);
 	>
 !
 
@@ -1089,20 +1089,18 @@ Object subclass: #SmalltalkImage
 	package: 'Kernel-Infrastructure'!
 !SmalltalkImage commentStamp!
 I represent the Smalltalk system, wrapping
-operations of variable `smalltalk` declared in `support/boot.js`.
+operations of variable `$core` declared in `support/boot.js`.
 
 ## API
 
 I have only one instance, accessed with global variable `Smalltalk`.
 
-The `smalltalk` object holds all class and packages defined in the system.
-
 ## Classes
 
 Classes can be accessed using the following methods:
 
 - `#classes` answers the full list of Smalltalk classes in the system
-- `#at:` answers a specific class or `nil`
+- `#globals #at:` answers a specific global (usually, a class) or `nil`
 
 ## Packages
 
@@ -1133,6 +1131,10 @@ at: aString put: anObject
 	^ self globals at: aString put: anObject
 !
 
+core
+	<return $core>
+!
+
 current
 	"Backward compatibility for Smalltalk current ..."
 	self deprecatedAPI.
@@ -1141,11 +1143,11 @@ current
 
 globals
 	"Future compatibility to be able to use Smalltalk globals at: ..."
-	<return globals>
+	<return $globals>
 !
 
 includesKey: aKey
-	<return smalltalk.hasOwnProperty(aKey)>
+	<return $core.hasOwnProperty(aKey)>
 !
 
 parse: aString
@@ -1164,12 +1166,12 @@ pseudoVariableNames
 !
 
 readJSObject: anObject
-	<return smalltalk.readJSObject(anObject)>
+	<return $core.readJSObject(anObject)>
 !
 
 reservedWords
 	"JavaScript reserved words"
-	<return smalltalk.reservedWords>
+	<return $core.reservedWords>
 !
 
 settings
@@ -1183,14 +1185,14 @@ version
 !
 
 vm
-	"Future compatibility to be able to use Smalltalk vm ..."
-	<return smalltalk>
+	self deprecatedAPI: 'Use #core'.
+	^self core
 ! !
 
 !SmalltalkImage methodsFor: 'accessing amd'!
 
 amdRequire
-	^ self vm at: 'amdRequire'
+	^ self core at: 'amdRequire'
 !
 
 defaultAmdNamespace
@@ -1204,7 +1206,7 @@ defaultAmdNamespace: aString
 !SmalltalkImage methodsFor: 'classes'!
 
 classes
-	<return smalltalk.classes()>
+	<return $core.classes()>
 !
 
 removeClass: aClass
@@ -1245,7 +1247,7 @@ deleteGlobalJsVariable: aString
 
 globalJsVariables
 	"Array of global JavaScript variables"
-	<return smalltalk.globalJsVariables>
+	<return $core.globalJsVariables>
 ! !
 
 !SmalltalkImage methodsFor: 'packages'!
@@ -1265,7 +1267,7 @@ createPackage: packageName
 !
 
 packageAt: packageName
-	<return smalltalk.packages[packageName]>
+	<return $core.packages[packageName]>
 !
 
 packageAt: packageName ifAbsent: aBlock
@@ -1276,8 +1278,8 @@ packages
 	"Return all Package instances in the system."
 
 	<
-		return Object.keys(smalltalk.packages).map(function(k) {
-			return smalltalk.packages[k];
+		return Object.keys($core.packages).map(function(k) {
+			return $core.packages[k];
 		})
 	>
 !
@@ -1307,7 +1309,7 @@ renamePackage: packageName to: newName
 
 basicCreatePackage: packageName
 	"Create and bind a new bare package with given name and return it."
-	<return smalltalk.addPackage(packageName)>
+	<return $core.addPackage(packageName)>
 !
 
 basicParse: aString
@@ -1325,14 +1327,14 @@ createPackage: packageName properties: aDict
 deleteClass: aClass
 	"Deletes a class by deleting its binding only. Use #removeClass instead"
 	
-	<smalltalk.removeClass(aClass)>
+	<$core.removeClass(aClass)>
 !
 
 deletePackage: packageName
 	"Deletes a package by deleting its binding, but does not check if it contains classes etc.
 	To remove a package, use #removePackage instead."
 
-	<delete smalltalk.packages[packageName]>
+	<delete $core.packages[packageName]>
 ! !
 
 !SmalltalkImage methodsFor: 'testing'!
@@ -1349,7 +1351,9 @@ SmalltalkImage class instanceVariableNames: 'current'!
 !SmalltalkImage class methodsFor: 'initialization'!
 
 initialize
-	globals at: 'Smalltalk' put: self current
+	| st |
+	st := self current.
+	st globals at: 'Smalltalk' put: st
 ! !
 
 !SmalltalkImage class methodsFor: 'instance creation'!
@@ -1374,7 +1378,7 @@ do: aBlock displayingProgress: aString
 !String methodsFor: '*Kernel-Infrastructure'!
 
 asJavaScriptPropertyName
-<return smalltalk.st2prop(self)>
+<return $core.st2prop(self)>
 !
 
 asJavaScriptSelector

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


+ 6 - 6
src/Kernel-Methods.st

@@ -47,7 +47,7 @@ whileFalse
 !
 
 whileFalse: aBlock
-	<while(!!smalltalk.assert(self._value())) {aBlock._value()}>
+	<while(!!$core.assert(self._value())) {aBlock._value()}>
 !
 
 whileTrue
@@ -55,13 +55,13 @@ whileTrue
 !
 
 whileTrue: aBlock
-	<while(smalltalk.assert(self._value())) {aBlock._value()}>
+	<while($core.assert(self._value())) {aBlock._value()}>
 ! !
 
 !BlockClosure methodsFor: 'converting'!
 
 asCompiledMethod: aString
-	<return smalltalk.method({selector:aString, fn:self});>
+	<return $core.method({selector:aString, fn:self});>
 !
 
 currySelf
@@ -174,14 +174,14 @@ fork
 valueWithInterval: aNumber
 	<
 		var interval = setInterval(self, aNumber);
-		return globals.Timeout._on_(interval);
+		return $globals.Timeout._on_(interval);
 	>
 !
 
 valueWithTimeout: aNumber
 	<
 		var timeout = setTimeout(self, aNumber);
-		return globals.Timeout._on_(timeout);
+		return $globals.Timeout._on_(timeout);
 	>
 ! !
 
@@ -633,7 +633,7 @@ receiver
 selector
 	<
 		if(self.selector) {
-			return smalltalk.js2st(self.selector);
+			return $core.js2st(self.selector);
 		} else {
 			return nil;
 		}

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


+ 2 - 2
src/Kernel-Objects.st

@@ -17,7 +17,7 @@ identityHash
 	<
 		var hash=self.identityHash;
 		if (hash) return hash;
-		hash=smalltalk.nextId();
+		hash=$core.nextId();
 		Object.defineProperty(self, 'identityHash', {value:hash});
 		return hash;
 	>
@@ -95,7 +95,7 @@ perform: aString
 !
 
 perform: aString withArguments: aCollection
-	<return smalltalk.send(self, aString._asJavaScriptMethodName(), aCollection)>
+	<return $core.send(self, aString._asJavaScriptMethodName(), aCollection)>
 ! !
 
 !ProtoObject methodsFor: 'printing'!

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


+ 2 - 2
src/Kernel-Tests.st

@@ -141,13 +141,13 @@ testNewWithValues
 	function TestConstructor(arg1, arg2, arg3) {}
 	TestConstructor.prototype.name = 'theTestPrototype';
 
-	var wrappedConstructor = _st(TestConstructor);
+	var wrappedConstructor = $recv(TestConstructor);
 	var result = wrappedConstructor._newWithValues_([1, 2, 3 ]);
 	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);
 >
 !
 

+ 29 - 28
src/Kernel-Transcript.js

@@ -1,14 +1,15 @@
 define("amber_core/Kernel-Transcript", ["amber/boot", "amber_core/Kernel-Objects"], function($boot){
-var smalltalk=$boot.vm,nil=$boot.nil,_st=$boot.asReceiver,globals=$boot.globals;
-smalltalk.addPackage('Kernel-Transcript');
-smalltalk.packages["Kernel-Transcript"].transport = {"type":"amd","amdNamespace":"amber_core"};
+var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
+var smalltalk=$core,_st=$recv,globals=$globals;
+$core.addPackage('Kernel-Transcript');
+$core.packages["Kernel-Transcript"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('ConsoleTranscript', globals.Object, ['textarea'], 'Kernel-Transcript');
+$core.addClass('ConsoleTranscript', $globals.Object, ['textarea'], 'Kernel-Transcript');
 //>>excludeStart("ide", pragmas.excludeIdeData);
-globals.ConsoleTranscript.comment="I am a specific transcript emitting to the JavaScript console.\x0a\x0aIf no other transcript is registered, I am the default.";
+$globals.ConsoleTranscript.comment="I am a specific transcript emitting to the JavaScript console.\x0a\x0aIf no other transcript is registered, I am the default.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "clear",
 protocol: 'printing',
 fn: function (){
@@ -23,10 +24,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.ConsoleTranscript);
+$globals.ConsoleTranscript);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "cr",
 protocol: 'printing',
 fn: function (){
@@ -41,10 +42,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.ConsoleTranscript);
+$globals.ConsoleTranscript);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "open",
 protocol: 'actions',
 fn: function (){
@@ -59,47 +60,47 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.ConsoleTranscript);
+$globals.ConsoleTranscript);
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "show:",
 protocol: 'printing',
 fn: function (anObject){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
-console.log(String(_st(anObject)._asString()));
+console.log(String($recv(anObject)._asString()));
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject},globals.ConsoleTranscript)});
+}, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject},$globals.ConsoleTranscript)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anObject"],
-source: "show: anObject\x0a\x22Smalltalk objects should have no trouble displaying themselves on the Transcript; Javascript objects don't know how, so must be wrapped in a JSObectProxy.\x22\x0a<console.log(String(_st(anObject)._asString()))>",
+source: "show: anObject\x0a\x22Smalltalk objects should have no trouble displaying themselves on the Transcript; Javascript objects don't know how, so must be wrapped in a JSObectProxy.\x22\x0a<console.log(String($recv(anObject)._asString()))>",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
-globals.ConsoleTranscript);
+$globals.ConsoleTranscript);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "initialize",
 protocol: 'initialization',
 fn: function (){
 var self=this;
-function $Transcript(){return globals.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
+function $Transcript(){return $globals.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
-_st($Transcript())._registerIfNone_(self._new());
+$recv($Transcript())._registerIfNone_(self._new());
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.ConsoleTranscript.klass)});
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ConsoleTranscript.klass)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -109,6 +110,6 @@ referencedClasses: ["Transcript"],
 //>>excludeEnd("ide");
 messageSends: ["registerIfNone:", "new"]
 }),
-globals.ConsoleTranscript.klass);
+$globals.ConsoleTranscript.klass);
 
 });

+ 1 - 1
src/Kernel-Transcript.st

@@ -24,7 +24,7 @@ cr
 
 show: anObject
 "Smalltalk objects should have no trouble displaying themselves on the Transcript; Javascript objects don't know how, so must be wrapped in a JSObectProxy."
-<console.log(String(_st(anObject)._asString()))>
+<console.log(String($recv(anObject)._asString()))>
 ! !
 
 !ConsoleTranscript class methodsFor: 'initialization'!

File diff suppressed because it is too large
+ 202 - 201
src/SUnit-Tests.js


File diff suppressed because it is too large
+ 210 - 209
src/SUnit.js


File diff suppressed because it is too large
+ 188 - 187
src/Web.js


+ 1 - 1
support/boot.js

@@ -1161,5 +1161,5 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 		brikz.rebuild();
 	};
 
-	return { vm: api, nil: brikz.root.nil, globals: globals, asReceiver: brikz.asReceiver.asReceiver };
+	return { api: api, /*deprecated:*/vm: api, nil: brikz.root.nil, globals: globals, asReceiver: brikz.asReceiver.asReceiver };
 });

+ 10 - 6
support/helpers.js

@@ -1,7 +1,7 @@
 define("amber/helpers", ["amber/boot", "require"], function (boot, require) {
     var globals = boot.globals,
         exports = Object.create(globals), // backward compatibility, use {} later
-        vm = boot.vm,
+        api = boot.api,
         nil = boot.nil;
 
     // API
@@ -13,8 +13,8 @@ define("amber/helpers", ["amber/boot", "require"], function (boot, require) {
             window.alert("Error loading helios.\nIf not present, you can install it with 'bower install helios --save-dev'.\nThe error follows:\n" + err);
         });
     };
-    Object.defineProperty(exports, "vm", {
-        value: vm,
+    Object.defineProperty(exports, "api", {
+        value: api,
         enumerable: true, configurable: true, writable: false
     });
     Object.defineProperty(exports, "globals", {
@@ -56,7 +56,7 @@ define("amber/helpers", ["amber/boot", "require"], function (boot, require) {
     }
 
     exports.initialize = function (options) {
-        globals.SmalltalkSettings['transport.defaultAmdNamespace'] = vm.defaultAmdNamespace;
+        globals.SmalltalkSettings['transport.defaultAmdNamespace'] = api.defaultAmdNamespace;
         settingsInLocalStorage();
         if (exports.defaultAmdNamespace) {
             console.warn("`smalltalk.defaultAmdNamespace = 'namespace';` is deprecated. Please use `smalltalk.initialize({'transport.defaultAmdNamespace': 'namespace'});` instead.");
@@ -64,13 +64,17 @@ define("amber/helpers", ["amber/boot", "require"], function (boot, require) {
         }
         mixinToSettings(options || {});
         console.warn("smalltalk.ClassName is deprecated. Please use smalltalk.globals.ClassName instead.");
-        return vm.initialize();
+        return api.initialize();
     };
 
     // Backward compatibility, deprecated
 
     Object.defineProperty(exports, "smalltalk", {
-        value: vm,
+        value: api,
+        enumerable: true, configurable: true, writable: false
+    });
+    Object.defineProperty(exports, "vm", {
+        value: api,
         enumerable: true, configurable: true, writable: false
     });
     exports.defaultAmdNamespace = null;

Some files were not shown because too many files changed in this diff