Explorar o código

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

New names of internal variables.
Herbert Vojčík %!s(int64=9) %!d(string=hai) anos
pai
achega
0629e32d7b

+ 10 - 0
API-CHANGES.txt

@@ -5,6 +5,10 @@
 * smalltalk.selector is now smalltalk.st2js
 * smalltalk.selector is now smalltalk.st2js
 * smalltalk.convertSelector is now smalltalk.js2st
 * smalltalk.convertSelector is now smalltalk.js2st
 * Collection >> ifEmpty:ifNotEmpty: family passes self to ifNotEmpty: block
 * 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.
 + smalltalk.
   + accessJavaScript
   + accessJavaScript
@@ -13,6 +17,12 @@
   + postMessageTo:origin:
   + postMessageTo:origin:
 + Class >>
 + Class >>
   + heliosClass
   + heliosClass
++ SmalltalkImage >>
+  + core
++ amber/boot exports
+  + api
++ amber/{devel,deploy,lang} exports
+  + api
 
 
 - ProtoObject class >>
 - ProtoObject class >>
   - heliosClass
   - heliosClass

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 221 - 220
external/amber-cli/src/AmberCli.js


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

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 202 - 201
src/Compiler-AST.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 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){
 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);
 //>>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");
 //>>excludeEnd("ide");
 
 
 
 
-smalltalk.addClass('ParseError', globals.CompilerError, [], 'Compiler-Exceptions');
+$core.addClass('ParseError', $globals.CompilerError, [], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>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");
 //>>excludeEnd("ide");
 
 
 
 
-smalltalk.addClass('SemanticError', globals.CompilerError, [], 'Compiler-Exceptions');
+$core.addClass('SemanticError', $globals.CompilerError, [], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>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");
 //>>excludeEnd("ide");
 
 
 
 
-smalltalk.addClass('InliningError', globals.SemanticError, [], 'Compiler-Exceptions');
+$core.addClass('InliningError', $globals.SemanticError, [], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>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");
 //>>excludeEnd("ide");
 
 
 
 
-smalltalk.addClass('InvalidAssignmentError', globals.SemanticError, ['variableName'], 'Compiler-Exceptions');
+$core.addClass('InvalidAssignmentError', $globals.SemanticError, ['variableName'], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>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");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "messageText",
 selector: "messageText",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 $1=" Invalid assignment to variable: ".__comma(self._variableName());
 $1=" Invalid assignment to variable: ".__comma(self._variableName());
 return $1;
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"messageText",{},globals.InvalidAssignmentError)});
+}, function($ctx1) {$ctx1.fill(self,"messageText",{},$globals.InvalidAssignmentError)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -54,10 +55,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: [",", "variableName"]
 messageSends: [",", "variableName"]
 }),
 }),
-globals.InvalidAssignmentError);
+$globals.InvalidAssignmentError);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "variableName",
 selector: "variableName",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -74,10 +75,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.InvalidAssignmentError);
+$globals.InvalidAssignmentError);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "variableName:",
 selector: "variableName:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aString){
 fn: function (aString){
@@ -93,31 +94,31 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 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);
 //>>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");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "messageText",
 selector: "messageText",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 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);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx[","]=1;
 $ctx1.sendIdx[","]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return $1;
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"messageText",{},globals.ShadowingVariableError)});
+}, function($ctx1) {$ctx1.fill(self,"messageText",{},$globals.ShadowingVariableError)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -127,10 +128,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: [",", "variableName"]
 messageSends: [",", "variableName"]
 }),
 }),
-globals.ShadowingVariableError);
+$globals.ShadowingVariableError);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "variableName",
 selector: "variableName",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -147,10 +148,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.ShadowingVariableError);
+$globals.ShadowingVariableError);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "variableName:",
 selector: "variableName:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aString){
 fn: function (aString){
@@ -166,31 +167,31 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 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);
 //>>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");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "messageText",
 selector: "messageText",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 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);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx[","]=1;
 $ctx1.sendIdx[","]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return $1;
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"messageText",{},globals.UnknownVariableError)});
+}, function($ctx1) {$ctx1.fill(self,"messageText",{},$globals.UnknownVariableError)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -200,10 +201,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: [",", "variableName"]
 messageSends: [",", "variableName"]
 }),
 }),
-globals.UnknownVariableError);
+$globals.UnknownVariableError);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "variableName",
 selector: "variableName",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -220,10 +221,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.UnknownVariableError);
+$globals.UnknownVariableError);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "variableName:",
 selector: "variableName:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aString){
 fn: function (aString){
@@ -239,27 +240,27 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.UnknownVariableError);
+$globals.UnknownVariableError);
 
 
 
 
 
 
-smalltalk.addClass('RethrowErrorHandler', globals.Object, [], 'Compiler-Exceptions');
+$core.addClass('RethrowErrorHandler', $globals.Object, [], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>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");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "basicSignal:",
 selector: "basicSignal:",
 protocol: 'error handling',
 protocol: 'error handling',
 fn: function (anError){
 fn: function (anError){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 throw anError;
 throw anError;
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>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");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -269,21 +270,21 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.RethrowErrorHandler);
+$globals.RethrowErrorHandler);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "handleError:",
 selector: "handleError:",
 protocol: 'error handling',
 protocol: 'error handling',
 fn: function (anError){
 fn: function (anError){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._basicSignal_(anError);
 self._basicSignal_(anError);
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>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");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -293,7 +294,7 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: ["basicSignal:"]
 messageSends: ["basicSignal:"]
 }),
 }),
-globals.RethrowErrorHandler);
+$globals.RethrowErrorHandler);
 
 
 
 
 });
 });

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 239 - 238
src/Compiler-IR.js


+ 9 - 9
src/Compiler-IR.st

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

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 227 - 226
src/Compiler-Inlining.js


+ 4 - 4
src/Compiler-Inlining.st

@@ -270,7 +270,7 @@ visitIRInlinedClosure: anIRInlinedClosure
 
 
 visitIRInlinedIfFalse: anIRInlinedIfFalse
 visitIRInlinedIfFalse: anIRInlinedIfFalse
 	self stream nextPutIf: [
 	self stream nextPutIf: [
-		self stream nextPutAll: '!! smalltalk.assert('.
+		self stream nextPutAll: '!!$core.assert('.
 		self visit: anIRInlinedIfFalse instructions first.
 		self visit: anIRInlinedIfFalse instructions first.
 		self stream nextPutAll: ')' ]
 		self stream nextPutAll: ')' ]
 		with: [ self visit: anIRInlinedIfFalse instructions last ]
 		with: [ self visit: anIRInlinedIfFalse instructions last ]
@@ -288,7 +288,7 @@ visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil
 
 
 visitIRInlinedIfTrue: anIRInlinedIfTrue
 visitIRInlinedIfTrue: anIRInlinedIfTrue
 	self stream nextPutIf: [
 	self stream nextPutIf: [
-		self stream nextPutAll: 'smalltalk.assert('.
+		self stream nextPutAll: '$core.assert('.
 		self visit: anIRInlinedIfTrue instructions first.
 		self visit: anIRInlinedIfTrue instructions first.
 		self stream nextPutAll: ')' ]
 		self stream nextPutAll: ')' ]
 		with: [ self visit: anIRInlinedIfTrue instructions last ]
 		with: [ self visit: anIRInlinedIfTrue instructions last ]
@@ -297,7 +297,7 @@ visitIRInlinedIfTrue: anIRInlinedIfTrue
 visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse
 visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse
 	self stream
 	self stream
 		nextPutIfElse: [
 		nextPutIfElse: [
-			self stream nextPutAll: 'smalltalk.assert('.
+			self stream nextPutAll: '$core.assert('.
 			self visit: anIRInlinedIfTrueIfFalse instructions first.
 			self visit: anIRInlinedIfTrueIfFalse instructions first.
 			self stream nextPutAll: ')' ]
 			self stream nextPutAll: ')' ]
 		with: [ self visit: anIRInlinedIfTrueIfFalse instructions second ]
 		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:
 Will produce:
 
 
-	if(smalltalk.assert(true) {
+	if($core.assert(true) {
 		a = 1;
 		a = 1;
 	};!
 	};!
 
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 217 - 216
src/Compiler-Interpreter.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 200 - 199
src/Compiler-Semantic.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 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){
 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);
 //>>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");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "decrease",
 selector: "decrease",
 protocol: 'actions',
 protocol: 'actions',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>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);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-return _st(html)._with_(_st(self["@count"])._asString());
+return $recv(html)._with_($recv(self["@count"])._asString());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)});
 }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 }));
 }));
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"decrease",{},globals.Counter)});
+}, function($ctx1) {$ctx1.fill(self,"decrease",{},$globals.Counter)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -38,30 +39,30 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: ["-", "contents:", "with:", "asString"]
 messageSends: ["-", "contents:", "with:", "asString"]
 }),
 }),
-globals.Counter);
+$globals.Counter);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "increase",
 selector: "increase",
 protocol: 'actions',
 protocol: 'actions',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>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);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-return _st(html)._with_(_st(self["@count"])._asString());
+return $recv(html)._with_($recv(self["@count"])._asString());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)});
 }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 }));
 }));
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"increase",{},globals.Counter)});
+}, function($ctx1) {$ctx1.fill(self,"increase",{},$globals.Counter)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -71,29 +72,29 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: ["+", "contents:", "with:", "asString"]
 messageSends: ["+", "contents:", "with:", "asString"]
 }),
 }),
-globals.Counter);
+$globals.Counter);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "initialize",
 selector: "initialize",
 protocol: 'initialization',
 protocol: 'initialization',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 (
 (
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = true, 
 $ctx1.supercall = true, 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-globals.Counter.superclass.fn.prototype._initialize.apply(_st(self), []));
+$globals.Counter.superclass.fn.prototype._initialize.apply($recv(self), []));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
 //>>excludeEnd("ctx");;
 self["@count"]=(0);
 self["@count"]=(0);
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.Counter)});
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.Counter)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -103,36 +104,36 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: ["initialize"]
 messageSends: ["initialize"]
 }),
 }),
-globals.Counter);
+$globals.Counter);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "renderOn:",
 selector: "renderOn:",
 protocol: 'rendering',
 protocol: 'rendering',
 fn: function (html){
 fn: function (html){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1,$2,$3,$4,$5,$6;
 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);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["with:"]=1;
 $ctx1.sendIdx["with:"]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-$2=_st($1)._yourself();
+$2=$recv($1)._yourself();
 self["@header"]=$2;
 self["@header"]=$2;
-$3=_st(html)._button();
+$3=$recv(html)._button();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["button"]=1;
 $ctx1.sendIdx["button"]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-_st($3)._with_("++");
+$recv($3)._with_("++");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["with:"]=2;
 $ctx1.sendIdx["with:"]=2;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-$4=_st($3)._onClick_((function(){
+$4=$recv($3)._onClick_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self._increase();
 return self._increase();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -142,11 +143,11 @@ return self._increase();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["onClick:"]=1;
 $ctx1.sendIdx["onClick:"]=1;
 //>>excludeEnd("ctx");
 //>>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);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self._decrease();
 return self._decrease();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -155,7 +156,7 @@ return self._decrease();
 }));
 }));
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>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");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -165,22 +166,22 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: ["with:", "h1", "asString", "yourself", "button", "onClick:", "increase", "decrease"]
 messageSends: ["with:", "h1", "asString", "yourself", "button", "onClick:", "increase", "decrease"]
 }),
 }),
-globals.Counter);
+$globals.Counter);
 
 
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "tryExample",
 selector: "tryExample",
 protocol: 'example',
 protocol: 'example',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-_st(self._new())._appendToJQuery_("body"._asJQuery());
+$recv(self._new())._appendToJQuery_("body"._asJQuery());
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"tryExample",{},globals.Counter.klass)});
+}, function($ctx1) {$ctx1.fill(self,"tryExample",{},$globals.Counter.klass)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -190,6 +191,6 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: ["appendToJQuery:", "new", "asJQuery"]
 messageSends: ["appendToJQuery:", "new", "asJQuery"]
 }),
 }),
-globals.Counter.klass);
+$globals.Counter.klass);
 
 
 });
 });

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 223 - 222
src/IDE.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 224 - 223
src/Kernel-Announcements.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 213 - 212
src/Kernel-Classes.js


+ 14 - 14
src/Kernel-Classes.st

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

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 204 - 203
src/Kernel-Collections.js


+ 3 - 3
src/Kernel-Collections.st

@@ -958,7 +958,7 @@ indexOf: anObject ifAbsent: aBlock
 	<
 	<
 		self = self._numericallyIndexable();
 		self = self._numericallyIndexable();
 		for(var i=0; i < self.length; i++) {
 		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();
 		return aBlock._value();
 	>
 	>
@@ -975,7 +975,7 @@ indexOf: anObject startingAt: start ifAbsent: aBlock
 	<
 	<
 		self = self._numericallyIndexable();
 		self = self._numericallyIndexable();
 		for(var i=start - 1; i < self.length; i++){
 		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();
 		return aBlock._value();
 	>
 	>
@@ -1497,7 +1497,7 @@ asJSON
 !
 !
 
 
 asJavaScriptMethodName
 asJavaScriptMethodName
-	<return smalltalk.st2js(self)>
+	<return $core.st2js(self)>
 !
 !
 
 
 asJavascript
 asJavascript

+ 183 - 181
src/Kernel-Exceptions.js

@@ -1,25 +1,26 @@
 define("amber_core/Kernel-Exceptions", ["amber/boot", "amber_core/Kernel-Objects"], function($boot){
 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);
 //>>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");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "beHandled",
 selector: "beHandled",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self.amberHandled = true;
 self.amberHandled = true;
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"beHandled",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"beHandled",{},$globals.Error)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -29,21 +30,21 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.Error);
+$globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "beUnhandled",
 selector: "beUnhandled",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self.amberHandled = false;
 self.amberHandled = false;
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"beUnhandled",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"beUnhandled",{},$globals.Error)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -53,21 +54,21 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.Error);
+$globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "context",
 selector: "context",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self.context;
 return self.context;
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"context",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"context",{},$globals.Error)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -77,21 +78,21 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.Error);
+$globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "initialize",
 selector: "initialize",
 protocol: 'initialization',
 protocol: 'initialization',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-self._messageText_("Errorclass: ".__comma(_st(self._class())._name()));
+self._messageText_("Errorclass: ".__comma($recv(self._class())._name()));
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.Error)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -101,21 +102,21 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: ["messageText:", ",", "name", "class"]
 messageSends: ["messageText:", ",", "name", "class"]
 }),
 }),
-globals.Error);
+$globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "isSmalltalkError",
 selector: "isSmalltalkError",
 protocol: 'testing',
 protocol: 'testing',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self.smalltalkError === true;
 return self.smalltalkError === true;
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"isSmalltalkError",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"isSmalltalkError",{},$globals.Error)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -125,21 +126,21 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.Error);
+$globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "jsStack",
 selector: "jsStack",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self.stack;
 return self.stack;
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"jsStack",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"jsStack",{},$globals.Error)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -149,10 +150,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.Error);
+$globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "messageText",
 selector: "messageText",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -169,10 +170,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.Error);
+$globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "messageText:",
 selector: "messageText:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aString){
 fn: function (aString){
@@ -188,16 +189,16 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.Error);
+$globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "resignal",
 selector: "resignal",
 protocol: 'signaling',
 protocol: 'signaling',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 
 
 		self.amberHandled = false;
 		self.amberHandled = false;
@@ -205,7 +206,7 @@ return smalltalk.withContext(function($ctx1) {
 	;
 	;
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"resignal",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"resignal",{},$globals.Error)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -215,50 +216,51 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.Error);
+$globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "signal",
 selector: "signal",
 protocol: 'signaling',
 protocol: 'signaling',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 
 
 		self.amberHandled = false;
 		self.amberHandled = false;
-		self.context = smalltalk.getThisContext(); 
-		self.smalltalkError = true; throw(self)
+		self.context = $core.getThisContext(); 
+		self.smalltalkError = true;
+		throw self;
 	;
 	;
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"signal",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"signal",{},$globals.Error)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
 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: [],
 referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.Error);
+$globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "signal:",
 selector: "signal:",
 protocol: 'signaling',
 protocol: 'signaling',
 fn: function (aString){
 fn: function (aString){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._messageText_(aString);
 self._messageText_(aString);
 self._signal();
 self._signal();
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>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");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -268,22 +270,22 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: ["messageText:", "signal"]
 messageSends: ["messageText:", "signal"]
 }),
 }),
-globals.Error);
+$globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "signalerContext",
 selector: "signalerContext",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 $1=self._signalerContextFrom_(self._context());
 $1=self._signalerContextFrom_(self._context());
 return $1;
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"signalerContext",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"signalerContext",{},$globals.Error)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -293,47 +295,47 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: ["signalerContextFrom:", "context"]
 messageSends: ["signalerContextFrom:", "context"]
 }),
 }),
-globals.Error);
+$globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "signalerContextFrom:",
 selector: "signalerContextFrom:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aContext){
 fn: function (aContext){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $4,$3,$2,$1;
 var $4,$3,$2,$1;
-$1=_st(aContext)._findContextSuchThat_((function(context){
+$1=$recv(aContext)._findContextSuchThat_((function(context){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-$4=_st(context)._receiver();
+$4=$recv(context)._receiver();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["receiver"]=1;
 $ctx2.sendIdx["receiver"]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-$3=_st($4).__eq_eq(self);
+$3=$recv($4).__eq_eq(self);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["=="]=1;
 $ctx2.sendIdx["=="]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-$2=_st($3)._or_((function(){
+$2=$recv($3)._or_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-return _st(_st(context)._receiver()).__eq_eq(self._class());
+return $recv($recv(context)._receiver()).__eq_eq(self._class());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 }));
 }));
-return _st($2)._not();
+return $recv($2)._not();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({context:context},$ctx1,1)});
 }, function($ctx2) {$ctx2.fillBlock({context:context},$ctx1,1)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 }));
 }));
 return $1;
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>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");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -343,21 +345,21 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: ["findContextSuchThat:", "not", "or:", "==", "receiver", "class"]
 messageSends: ["findContextSuchThat:", "not", "or:", "==", "receiver", "class"]
 }),
 }),
-globals.Error);
+$globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "wasHandled",
 selector: "wasHandled",
 protocol: 'testing',
 protocol: 'testing',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self.amberHandled || false;
 return self.amberHandled || false;
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"wasHandled",{},globals.Error)});
+}, function($ctx1) {$ctx1.fill(self,"wasHandled",{},$globals.Error)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -367,11 +369,11 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.Error);
+$globals.Error);
 
 
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "heliosClass",
 selector: "heliosClass",
 protocol: 'helios',
 protocol: 'helios',
 fn: function (){
 fn: function (){
@@ -386,22 +388,22 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.Error.klass);
+$globals.Error.klass);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "signal",
 selector: "signal",
 protocol: 'instance creation',
 protocol: 'instance creation',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
-$1=_st(self._new())._signal();
+$1=$recv(self._new())._signal();
 return $1;
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"signal",{},globals.Error.klass)});
+}, function($ctx1) {$ctx1.fill(self,"signal",{},$globals.Error.klass)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -411,22 +413,22 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: ["signal", "new"]
 messageSends: ["signal", "new"]
 }),
 }),
-globals.Error.klass);
+$globals.Error.klass);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "signal:",
 selector: "signal:",
 protocol: 'instance creation',
 protocol: 'instance creation',
 fn: function (aString){
 fn: function (aString){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
-$1=_st(self._new())._signal_(aString);
+$1=$recv(self._new())._signal_(aString);
 return $1;
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>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");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -436,15 +438,15 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: ["signal:", "new"]
 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);
 //>>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");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "messageText",
 selector: "messageText",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -459,39 +461,39 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.Halt);
+$globals.Halt);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "signalerContextFrom:",
 selector: "signalerContextFrom:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aContext){
 fn: function (aContext){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $4,$3,$2,$1;
 var $4,$3,$2,$1;
-$1=_st(aContext)._findContextSuchThat_((function(context){
+$1=$recv(aContext)._findContextSuchThat_((function(context){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-$4=_st(context)._receiver();
+$4=$recv(context)._receiver();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["receiver"]=1;
 $ctx2.sendIdx["receiver"]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-$3=_st($4).__eq_eq(self);
+$3=$recv($4).__eq_eq(self);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["=="]=1;
 $ctx2.sendIdx["=="]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-$2=_st($3)._or_((function(){
+$2=$recv($3)._or_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 //>>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);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx4) {
+return $core.withContext(function($ctx4) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-return _st(_st(_st(context)._method())._selector()).__eq("halt");
+return $recv($recv($recv(context)._method())._selector()).__eq("halt");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)});
 }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
@@ -503,14 +505,14 @@ return _st(_st(_st(context)._method())._selector()).__eq("halt");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["or:"]=1;
 $ctx2.sendIdx["or:"]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-return _st($2)._not();
+return $recv($2)._not();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({context:context},$ctx1,1)});
 }, function($ctx2) {$ctx2.fillBlock({context:context},$ctx1,1)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 }));
 }));
 return $1;
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>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");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -520,27 +522,27 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: ["findContextSuchThat:", "not", "or:", "==", "receiver", "class", "=", "selector", "method"]
 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);
 //>>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");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "context:",
 selector: "context:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aMethodContext){
 fn: function (aMethodContext){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self.context = aMethodContext;
 self.context = aMethodContext;
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>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");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -550,10 +552,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.JavaScriptException);
+$globals.JavaScriptException);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "exception",
 selector: "exception",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -570,10 +572,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.JavaScriptException);
+$globals.JavaScriptException);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "exception:",
 selector: "exception:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (anException){
 fn: function (anException){
@@ -589,21 +591,21 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.JavaScriptException);
+$globals.JavaScriptException);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "messageText",
 selector: "messageText",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return 'JavaScript exception: ' + self["@exception"].toString();
 return 'JavaScript exception: ' + self["@exception"].toString();
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"messageText",{},globals.JavaScriptException)});
+}, function($ctx1) {$ctx1.fill(self,"messageText",{},$globals.JavaScriptException)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -613,26 +615,26 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.JavaScriptException);
+$globals.JavaScriptException);
 
 
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "on:",
 selector: "on:",
 protocol: 'instance creation',
 protocol: 'instance creation',
 fn: function (anException){
 fn: function (anException){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $2,$3,$1;
 var $2,$3,$1;
 $2=self._new();
 $2=self._new();
-_st($2)._exception_(anException);
-$3=_st($2)._yourself();
+$recv($2)._exception_(anException);
+$3=$recv($2)._yourself();
 $1=$3;
 $1=$3;
 return $1;
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>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");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -642,26 +644,26 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: ["exception:", "new", "yourself"]
 messageSends: ["exception:", "new", "yourself"]
 }),
 }),
-globals.JavaScriptException.klass);
+$globals.JavaScriptException.klass);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "on:context:",
 selector: "on:context:",
 protocol: 'instance creation',
 protocol: 'instance creation',
 fn: function (anException,aMethodContext){
 fn: function (anException,aMethodContext){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $2,$3,$1;
 var $2,$3,$1;
 $2=self._new();
 $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;
 $1=$3;
 return $1;
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>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");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -671,15 +673,15 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: ["exception:", "new", "context:", "yourself"]
 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);
 //>>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");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "message",
 selector: "message",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -696,10 +698,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.MessageNotUnderstood);
+$globals.MessageNotUnderstood);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "message:",
 selector: "message:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aMessage){
 fn: function (aMessage){
@@ -715,25 +717,25 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.MessageNotUnderstood);
+$globals.MessageNotUnderstood);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "messageText",
 selector: "messageText",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 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);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx[","]=1;
 $ctx1.sendIdx[","]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return $1;
 return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"messageText",{},globals.MessageNotUnderstood)});
+}, function($ctx1) {$ctx1.fill(self,"messageText",{},$globals.MessageNotUnderstood)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -743,10 +745,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: [",", "asString", "receiver", "selector", "message"]
 messageSends: [",", "asString", "receiver", "selector", "message"]
 }),
 }),
-globals.MessageNotUnderstood);
+$globals.MessageNotUnderstood);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "receiver",
 selector: "receiver",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -763,10 +765,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.MessageNotUnderstood);
+$globals.MessageNotUnderstood);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "receiver:",
 selector: "receiver:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (anObject){
 fn: function (anObject){
@@ -782,16 +784,16 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 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);
 //>>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");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "object",
 selector: "object",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -808,10 +810,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.NonBooleanReceiver);
+$globals.NonBooleanReceiver);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "object:",
 selector: "object:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (anObject){
 fn: function (anObject){
@@ -827,13 +829,13 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.NonBooleanReceiver);
+$globals.NonBooleanReceiver);
 
 
 
 
 
 
-smalltalk.addClass('PackageCommitError', globals.Error, [], 'Kernel-Exceptions');
+$core.addClass('PackageCommitError', $globals.Error, [], 'Kernel-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>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");
 //>>excludeEnd("ide");
 
 
 });
 });

+ 3 - 2
src/Kernel-Exceptions.st

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

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 231 - 230
src/Kernel-ImportExport.js


+ 9 - 7
src/Kernel-ImportExport.st

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

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

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 202 - 201
src/Kernel-Methods.js


+ 6 - 6
src/Kernel-Methods.st

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

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 215 - 214
src/Kernel-Objects.js


+ 2 - 2
src/Kernel-Objects.st

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

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 211 - 210
src/Kernel-Tests.js


+ 2 - 2
src/Kernel-Tests.st

@@ -141,13 +141,13 @@ testNewWithValues
 	function TestConstructor(arg1, arg2, arg3) {}
 	function TestConstructor(arg1, arg2, arg3) {}
 	TestConstructor.prototype.name = 'theTestPrototype';
 	TestConstructor.prototype.name = 'theTestPrototype';
 
 
-	var wrappedConstructor = _st(TestConstructor);
+	var wrappedConstructor = $recv(TestConstructor);
 	var result = wrappedConstructor._newWithValues_([1, 2, 3 ]);
 	var result = wrappedConstructor._newWithValues_([1, 2, 3 ]);
 	self._assert_(result instanceof TestConstructor);
 	self._assert_(result instanceof TestConstructor);
 	self._assert_equals_(result.name, 'theTestPrototype');
 	self._assert_equals_(result.name, 'theTestPrototype');
 
 
 	"newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made."
 	"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){
 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);
 //>>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");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "clear",
 selector: "clear",
 protocol: 'printing',
 protocol: 'printing',
 fn: function (){
 fn: function (){
@@ -23,10 +24,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.ConsoleTranscript);
+$globals.ConsoleTranscript);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "cr",
 selector: "cr",
 protocol: 'printing',
 protocol: 'printing',
 fn: function (){
 fn: function (){
@@ -41,10 +42,10 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.ConsoleTranscript);
+$globals.ConsoleTranscript);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "open",
 selector: "open",
 protocol: 'actions',
 protocol: 'actions',
 fn: function (){
 fn: function (){
@@ -59,47 +60,47 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.ConsoleTranscript);
+$globals.ConsoleTranscript);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "show:",
 selector: "show:",
 protocol: 'printing',
 protocol: 'printing',
 fn: function (anObject){
 fn: function (anObject){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-console.log(String(_st(anObject)._asString()));
+console.log(String($recv(anObject)._asString()));
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>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");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["anObject"],
 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: [],
 referencedClasses: [],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: []
 messageSends: []
 }),
 }),
-globals.ConsoleTranscript);
+$globals.ConsoleTranscript);
 
 
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$core.addMethod(
+$core.method({
 selector: "initialize",
 selector: "initialize",
 protocol: 'initialization',
 protocol: 'initialization',
 fn: function (){
 fn: function (){
 var self=this;
 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);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $core.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
-_st($Transcript())._registerIfNone_(self._new());
+$recv($Transcript())._registerIfNone_(self._new());
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.ConsoleTranscript.klass)});
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ConsoleTranscript.klass)});
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 },
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -109,6 +110,6 @@ referencedClasses: ["Transcript"],
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 messageSends: ["registerIfNone:", "new"]
 messageSends: ["registerIfNone:", "new"]
 }),
 }),
-globals.ConsoleTranscript.klass);
+$globals.ConsoleTranscript.klass);
 
 
 });
 });

+ 1 - 1
src/Kernel-Transcript.st

@@ -24,7 +24,7 @@ cr
 
 
 show: anObject
 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."
 "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'!
 !ConsoleTranscript class methodsFor: 'initialization'!

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 202 - 201
src/SUnit-Tests.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 210 - 209
src/SUnit.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 188 - 187
src/Web.js


+ 1 - 1
support/boot.js

@@ -1161,5 +1161,5 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 		brikz.rebuild();
 		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) {
 define("amber/helpers", ["amber/boot", "require"], function (boot, require) {
     var globals = boot.globals,
     var globals = boot.globals,
         exports = Object.create(globals), // backward compatibility, use {} later
         exports = Object.create(globals), // backward compatibility, use {} later
-        vm = boot.vm,
+        api = boot.api,
         nil = boot.nil;
         nil = boot.nil;
 
 
     // API
     // 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);
             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
         enumerable: true, configurable: true, writable: false
     });
     });
     Object.defineProperty(exports, "globals", {
     Object.defineProperty(exports, "globals", {
@@ -56,7 +56,7 @@ define("amber/helpers", ["amber/boot", "require"], function (boot, require) {
     }
     }
 
 
     exports.initialize = function (options) {
     exports.initialize = function (options) {
-        globals.SmalltalkSettings['transport.defaultAmdNamespace'] = vm.defaultAmdNamespace;
+        globals.SmalltalkSettings['transport.defaultAmdNamespace'] = api.defaultAmdNamespace;
         settingsInLocalStorage();
         settingsInLocalStorage();
         if (exports.defaultAmdNamespace) {
         if (exports.defaultAmdNamespace) {
             console.warn("`smalltalk.defaultAmdNamespace = 'namespace';` is deprecated. Please use `smalltalk.initialize({'transport.defaultAmdNamespace': 'namespace'});` instead.");
             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 || {});
         mixinToSettings(options || {});
         console.warn("smalltalk.ClassName is deprecated. Please use smalltalk.globals.ClassName instead.");
         console.warn("smalltalk.ClassName is deprecated. Please use smalltalk.globals.ClassName instead.");
-        return vm.initialize();
+        return api.initialize();
     };
     };
 
 
     // Backward compatibility, deprecated
     // Backward compatibility, deprecated
 
 
     Object.defineProperty(exports, "smalltalk", {
     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
         enumerable: true, configurable: true, writable: false
     });
     });
     exports.defaultAmdNamespace = null;
     exports.defaultAmdNamespace = null;

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio