Browse Source

smalltalk -> $vm

Herbert Vojčík 10 years ago
parent
commit
044b3dfd75

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


+ 43 - 43
src/Benchfib.js

@@ -1,20 +1,20 @@
 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 $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
 var $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
 var smalltalk=$vm,_st=$recv,globals=$globals;
 var smalltalk=$vm,_st=$recv,globals=$globals;
-smalltalk.addPackage('Benchfib');
-smalltalk.packages["Benchfib"].transport = {"type":"amd","amdNamespace":"amber_core"};
+$vm.addPackage('Benchfib');
+$vm.packages["Benchfib"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
 
-smalltalk.addClass('Benchfib', globals.Object, [], 'Benchfib');
+$vm.addClass('Benchfib', globals.Object, [], 'Benchfib');
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 result=(0)._tinyBenchmarks();
 result=(0)._tinyBenchmarks();
 _st(console)._log_("0 tinyBenchmarks => ".__comma(result));
 _st(console)._log_("0 tinyBenchmarks => ".__comma(result));
@@ -32,18 +32,18 @@ messageSends: ["tinyBenchmarks", "log:", ","]
 }),
 }),
 globals.Benchfib.klass);
 globals.Benchfib.klass);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.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($vm.assert($2)){
 $1=(1);
 $1=(1);
 } else {
 } else {
 $5=self.__minus((1));
 $5=self.__minus((1));
@@ -74,8 +74,8 @@ messageSends: ["ifTrue:ifFalse:", "<", "+", "benchFib", "-"]
 }),
 }),
 globals.Number);
 globals.Number);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "benchmark",
 selector: "benchmark",
 protocol: '*Benchfib',
 protocol: '*Benchfib',
 fn: function (){
 fn: function (){
@@ -83,13 +83,13 @@ 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 $vm.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 $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 count=(0);
 count=(0);
 count;
 count;
@@ -97,7 +97,7 @@ flags=_st($Array())._new();
 flags;
 flags;
 _st(size)._timesRepeat_((function(){
 _st(size)._timesRepeat_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return _st(flags)._add_(true);
 return _st(flags)._add_(true);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -106,10 +106,10 @@ return _st(flags)._add_(true);
 }));
 }));
 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 $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 $1=_st(flags)._at_(i);
 $1=_st(flags)._at_(i);
-if(smalltalk.assert($1)){
+if($vm.assert($1)){
 prime=_st(i).__plus((1));
 prime=_st(i).__plus((1));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx3.sendIdx["+"]=1;
 $ctx3.sendIdx["+"]=1;
@@ -122,7 +122,7 @@ $ctx3.sendIdx["+"]=2;
 k;
 k;
 _st((function(){
 _st((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx4) {
+return $vm.withContext(function($ctx4) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return _st(k).__lt_eq(size);
 return _st(k).__lt_eq(size);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -130,7 +130,7 @@ return _st(k).__lt_eq(size);
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 }))._whileTrue_((function(){
 }))._whileTrue_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx4) {
+return $vm.withContext(function($ctx4) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 _st(flags)._at_put_(k,false);
 _st(flags)._at_put_(k,false);
 k=_st(k).__plus(prime);
 k=_st(k).__plus(prime);
@@ -171,14 +171,14 @@ messageSends: ["to:do:", "new", "timesRepeat:", "add:", "ifTrue:", "at:", "+", "
 }),
 }),
 globals.Number);
 globals.Number);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 if (this < 2) {
 if (this < 2) {
 return 1;
 return 1;
@@ -198,14 +198,14 @@ messageSends: []
 }),
 }),
 globals.Number);
 globals.Number);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 
 
 var size = 8190;
 var size = 8190;
@@ -243,8 +243,8 @@ messageSends: []
 }),
 }),
 globals.Number);
 globals.Number);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "jstinyBenchmarks",
 selector: "jstinyBenchmarks",
 protocol: '*Benchfib',
 protocol: '*Benchfib',
 fn: function (){
 fn: function (){
@@ -252,17 +252,17 @@ 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 $vm.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(){
 _st((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 t1=_st($Date())._millisecondsToRun_((function(){
 t1=_st($Date())._millisecondsToRun_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return _st(n1)._jsbenchmark();
 return _st(n1)._jsbenchmark();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -282,7 +282,7 @@ $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 $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 n1=_st(n1).__star((2));
 n1=_st(n1).__star((2));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -299,11 +299,11 @@ $ctx1.sendIdx["whileTrue:"]=1;
 n2=(28);
 n2=(28);
 _st((function(){
 _st((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 t2=_st($Date())._millisecondsToRun_((function(){
 t2=_st($Date())._millisecondsToRun_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 r=_st(n2)._jsbenchFib();
 r=_st(n2)._jsbenchFib();
 return r;
 return r;
@@ -318,7 +318,7 @@ return _st(t2).__lt((1000));
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 }))._whileTrue_((function(){
 }))._whileTrue_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 n2=_st(n2).__plus((1));
 n2=_st(n2).__plus((1));
 return n2;
 return n2;
@@ -365,8 +365,8 @@ messageSends: ["whileTrue:", "millisecondsToRun:", "jsbenchmark", "<", "*", "jsb
 }),
 }),
 globals.Number);
 globals.Number);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "tinyBenchmarks",
 selector: "tinyBenchmarks",
 protocol: '*Benchfib',
 protocol: '*Benchfib',
 fn: function (){
 fn: function (){
@@ -374,17 +374,17 @@ 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 $vm.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(){
 _st((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 t1=_st($Date())._millisecondsToRun_((function(){
 t1=_st($Date())._millisecondsToRun_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return _st(n1)._benchmark();
 return _st(n1)._benchmark();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -404,7 +404,7 @@ $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 $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 n1=_st(n1).__star((2));
 n1=_st(n1).__star((2));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -421,11 +421,11 @@ $ctx1.sendIdx["whileTrue:"]=1;
 n2=(16);
 n2=(16);
 _st((function(){
 _st((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 t2=_st($Date())._millisecondsToRun_((function(){
 t2=_st($Date())._millisecondsToRun_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 r=_st(n2)._benchFib();
 r=_st(n2)._benchFib();
 return r;
 return r;
@@ -440,7 +440,7 @@ return _st(t2).__lt((1000));
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 }))._whileTrue_((function(){
 }))._whileTrue_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 n2=_st(n2).__plus((1));
 n2=_st(n2).__plus((1));
 return n2;
 return n2;

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


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


+ 37 - 37
src/Compiler-Exceptions.js

@@ -1,45 +1,45 @@
 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 $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
 var $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
 var smalltalk=$vm,_st=$recv,globals=$globals;
 var smalltalk=$vm,_st=$recv,globals=$globals;
-smalltalk.addPackage('Compiler-Exceptions');
-smalltalk.packages["Compiler-Exceptions"].transport = {"type":"amd","amdNamespace":"amber_core"};
+$vm.addPackage('Compiler-Exceptions');
+$vm.packages["Compiler-Exceptions"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
 
-smalltalk.addClass('CompilerError', globals.Error, [], 'Compiler-Exceptions');
+$vm.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');
+$vm.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');
+$vm.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');
+$vm.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');
+$vm.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({
+$vm.addMethod(
+$vm.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 $vm.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());
@@ -57,8 +57,8 @@ messageSends: [",", "variableName"]
 }),
 }),
 globals.InvalidAssignmentError);
 globals.InvalidAssignmentError);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "variableName",
 selector: "variableName",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -77,8 +77,8 @@ messageSends: []
 }),
 }),
 globals.InvalidAssignmentError);
 globals.InvalidAssignmentError);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "variableName:",
 selector: "variableName:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aString){
 fn: function (aString){
@@ -98,18 +98,18 @@ globals.InvalidAssignmentError);
 
 
 
 
 
 
-smalltalk.addClass('ShadowingVariableError', globals.SemanticError, ['variableName'], 'Compiler-Exceptions');
+$vm.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({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 $1=_st("Variable shadowing error: ".__comma(self._variableName())).__comma(" is already defined");
 $1=_st("Variable shadowing error: ".__comma(self._variableName())).__comma(" is already defined");
@@ -130,8 +130,8 @@ messageSends: [",", "variableName"]
 }),
 }),
 globals.ShadowingVariableError);
 globals.ShadowingVariableError);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "variableName",
 selector: "variableName",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -150,8 +150,8 @@ messageSends: []
 }),
 }),
 globals.ShadowingVariableError);
 globals.ShadowingVariableError);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "variableName:",
 selector: "variableName:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aString){
 fn: function (aString){
@@ -171,18 +171,18 @@ globals.ShadowingVariableError);
 
 
 
 
 
 
-smalltalk.addClass('UnknownVariableError', globals.SemanticError, ['variableName'], 'Compiler-Exceptions');
+$vm.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({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 $1=_st("Unknown Variable error: ".__comma(self._variableName())).__comma(" is not defined");
 $1=_st("Unknown Variable error: ".__comma(self._variableName())).__comma(" is not defined");
@@ -203,8 +203,8 @@ messageSends: [",", "variableName"]
 }),
 }),
 globals.UnknownVariableError);
 globals.UnknownVariableError);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "variableName",
 selector: "variableName",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -223,8 +223,8 @@ messageSends: []
 }),
 }),
 globals.UnknownVariableError);
 globals.UnknownVariableError);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "variableName:",
 selector: "variableName:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aString){
 fn: function (aString){
@@ -244,18 +244,18 @@ globals.UnknownVariableError);
 
 
 
 
 
 
-smalltalk.addClass('RethrowErrorHandler', globals.Object, [], 'Compiler-Exceptions');
+$vm.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({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 throw anError;
 throw anError;
 return self;
 return self;
@@ -272,14 +272,14 @@ messageSends: []
 }),
 }),
 globals.RethrowErrorHandler);
 globals.RethrowErrorHandler);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._basicSignal_(anError);
 self._basicSignal_(anError);
 return self;
 return self;

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


+ 5 - 5
src/Compiler-IR.st

@@ -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: '$vm.getThisContext()' ]
 		ifFalse: [ self stream nextPutAll: anIRVariable variable alias ]
 		ifFalse: [ self stream nextPutAll: anIRVariable variable alias ]
 !
 !
 
 
@@ -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 $vm.withContext(function(', anIRClosure scope alias, ') {';
 		lf;
 		lf;
 		nextPutAll: '//>>excludeEnd("ctx");';
 		nextPutAll: '//>>excludeEnd("ctx");';
 		lf.
 		lf.
@@ -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 $vm.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: '$vm.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($vm.thisContext.pc){'; lf."
 	aBlock value.
 	aBlock value.
 	"stream
 	"stream
 		nextPutAll: '};'; lf"
 		nextPutAll: '};'; lf"

File diff suppressed because it is too large
+ 161 - 161
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: '!!$vm.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: '$vm.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: '$vm.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($vm.assert(true) {
 		a = 1;
 		a = 1;
 	};!
 	};!
 
 

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


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


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


+ 22 - 22
src/Examples.js

@@ -1,26 +1,26 @@
 define("amber_core/Examples", ["amber/boot", "amber_core/Web"], function($boot){
 define("amber_core/Examples", ["amber/boot", "amber_core/Web"], function($boot){
 var $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
 var $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
 var smalltalk=$vm,_st=$recv,globals=$globals;
 var smalltalk=$vm,_st=$recv,globals=$globals;
-smalltalk.addPackage('Examples');
-smalltalk.packages["Examples"].transport = {"type":"amd","amdNamespace":"amber_core"};
+$vm.addPackage('Examples');
+$vm.packages["Examples"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
 
-smalltalk.addClass('Counter', globals.Widget, ['count', 'header'], 'Examples');
+$vm.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({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self["@count"]=_st(self["@count"]).__minus((1));
 self["@count"]=_st(self["@count"]).__minus((1));
 _st(self["@header"])._contents_((function(html){
 _st(self["@header"])._contents_((function(html){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return _st(html)._with_(_st(self["@count"])._asString());
 return _st(html)._with_(_st(self["@count"])._asString());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -41,19 +41,19 @@ messageSends: ["-", "contents:", "with:", "asString"]
 }),
 }),
 globals.Counter);
 globals.Counter);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self["@count"]=_st(self["@count"]).__plus((1));
 self["@count"]=_st(self["@count"]).__plus((1));
 _st(self["@header"])._contents_((function(html){
 _st(self["@header"])._contents_((function(html){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return _st(html)._with_(_st(self["@count"])._asString());
 return _st(html)._with_(_st(self["@count"])._asString());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -74,14 +74,14 @@ messageSends: ["+", "contents:", "with:", "asString"]
 }),
 }),
 globals.Counter);
 globals.Counter);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 (
 (
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -106,14 +106,14 @@ messageSends: ["initialize"]
 }),
 }),
 globals.Counter);
 globals.Counter);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.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();
 $1=_st(html)._h1();
@@ -133,7 +133,7 @@ $ctx1.sendIdx["with:"]=2;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 $4=_st($3)._onClick_((function(){
 $4=_st($3)._onClick_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self._increase();
 return self._increase();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -147,7 +147,7 @@ $5=_st(html)._button();
 _st($5)._with_("--");
 _st($5)._with_("--");
 $6=_st($5)._onClick_((function(){
 $6=_st($5)._onClick_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self._decrease();
 return self._decrease();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -169,14 +169,14 @@ messageSends: ["with:", "h1", "asString", "yourself", "button", "onClick:", "inc
 globals.Counter);
 globals.Counter);
 
 
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 _st(self._new())._appendToJQuery_("body"._asJQuery());
 _st(self._new())._appendToJQuery_("body"._asJQuery());
 return self;
 return self;

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


+ 138 - 138
src/Kernel-Announcements.js

@@ -1,15 +1,15 @@
 define("amber_core/Kernel-Announcements", ["amber/boot", "amber_core/Kernel-Objects"], function($boot){
 define("amber_core/Kernel-Announcements", ["amber/boot", "amber_core/Kernel-Objects"], function($boot){
 var $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
 var $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
 var smalltalk=$vm,_st=$recv,globals=$globals;
 var smalltalk=$vm,_st=$recv,globals=$globals;
-smalltalk.addPackage('Kernel-Announcements');
-smalltalk.packages["Kernel-Announcements"].transport = {"type":"amd","amdNamespace":"amber_core"};
+$vm.addPackage('Kernel-Announcements');
+$vm.packages["Kernel-Announcements"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
 
-smalltalk.addClass('AnnouncementSubscription', globals.Object, ['valuable', 'announcementClass'], 'Kernel-Announcements');
+$vm.addClass('AnnouncementSubscription', globals.Object, ['valuable', 'announcementClass'], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.AnnouncementSubscription.comment="I am a single entry in a subscription registry of an `Announcer`.\x0aSeveral subscriptions by the same object is possible.";
 globals.AnnouncementSubscription.comment="I am a single entry in a subscription registry of an `Announcer`.\x0aSeveral subscriptions by the same object is possible.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "announcementClass",
 selector: "announcementClass",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -28,8 +28,8 @@ messageSends: []
 }),
 }),
 globals.AnnouncementSubscription);
 globals.AnnouncementSubscription);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "announcementClass:",
 selector: "announcementClass:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aClass){
 fn: function (aClass){
@@ -47,14 +47,14 @@ messageSends: []
 }),
 }),
 globals.AnnouncementSubscription);
 globals.AnnouncementSubscription);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "block",
 selector: "block",
 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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 self._deprecatedAPI();
 self._deprecatedAPI();
@@ -73,14 +73,14 @@ messageSends: ["deprecatedAPI", "valuable"]
 }),
 }),
 globals.AnnouncementSubscription);
 globals.AnnouncementSubscription);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "block:",
 selector: "block:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aValuable){
 fn: function (aValuable){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._deprecatedAPI();
 self._deprecatedAPI();
 self._valuable_(aValuable);
 self._valuable_(aValuable);
@@ -98,18 +98,18 @@ messageSends: ["deprecatedAPI", "valuable:"]
 }),
 }),
 globals.AnnouncementSubscription);
 globals.AnnouncementSubscription);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "deliver:",
 selector: "deliver:",
 protocol: 'announcing',
 protocol: 'announcing',
 fn: function (anAnnouncement){
 fn: function (anAnnouncement){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 $1=self._handlesAnnouncement_(anAnnouncement);
 $1=self._handlesAnnouncement_(anAnnouncement);
-if(smalltalk.assert($1)){
+if($vm.assert($1)){
 _st(self._valuable())._value_(anAnnouncement);
 _st(self._valuable())._value_(anAnnouncement);
 };
 };
 return self;
 return self;
@@ -126,15 +126,15 @@ messageSends: ["ifTrue:", "handlesAnnouncement:", "value:", "valuable"]
 }),
 }),
 globals.AnnouncementSubscription);
 globals.AnnouncementSubscription);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "handlesAnnouncement:",
 selector: "handlesAnnouncement:",
 protocol: 'announcing',
 protocol: 'announcing',
 fn: function (anAnnouncement){
 fn: function (anAnnouncement){
 var self=this;
 var self=this;
 function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $3,$4,$2,$1,$receiver;
 var $3,$4,$2,$1,$receiver;
 $3=_st($Smalltalk())._globals();
 $3=_st($Smalltalk())._globals();
@@ -170,14 +170,14 @@ messageSends: ["ifNil:ifNotNil:", "at:", "globals", "name", "announcementClass",
 }),
 }),
 globals.AnnouncementSubscription);
 globals.AnnouncementSubscription);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "receiver",
 selector: "receiver",
 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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 $1=_st(self._valuable())._receiver();
 $1=_st(self._valuable())._receiver();
@@ -195,8 +195,8 @@ messageSends: ["receiver", "valuable"]
 }),
 }),
 globals.AnnouncementSubscription);
 globals.AnnouncementSubscription);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "valuable",
 selector: "valuable",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -215,8 +215,8 @@ messageSends: []
 }),
 }),
 globals.AnnouncementSubscription);
 globals.AnnouncementSubscription);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "valuable:",
 selector: "valuable:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aValuable){
 fn: function (aValuable){
@@ -236,12 +236,12 @@ globals.AnnouncementSubscription);
 
 
 
 
 
 
-smalltalk.addClass('AnnouncementValuable', globals.Object, ['valuable', 'receiver'], 'Kernel-Announcements');
+$vm.addClass('AnnouncementValuable', globals.Object, ['valuable', 'receiver'], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.AnnouncementValuable.comment="I wrap `valuable` objects (typically instances of `BlockClosure`) with a `receiver` to be able to unregister subscriptions based on a `receiver`.";
 globals.AnnouncementValuable.comment="I wrap `valuable` objects (typically instances of `BlockClosure`) with a `receiver` to be able to unregister subscriptions based on a `receiver`.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "receiver",
 selector: "receiver",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -260,8 +260,8 @@ messageSends: []
 }),
 }),
 globals.AnnouncementValuable);
 globals.AnnouncementValuable);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "receiver:",
 selector: "receiver:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (anObject){
 fn: function (anObject){
@@ -279,8 +279,8 @@ messageSends: []
 }),
 }),
 globals.AnnouncementValuable);
 globals.AnnouncementValuable);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "valuable",
 selector: "valuable",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -299,8 +299,8 @@ messageSends: []
 }),
 }),
 globals.AnnouncementValuable);
 globals.AnnouncementValuable);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "valuable:",
 selector: "valuable:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (anObject){
 fn: function (anObject){
@@ -318,14 +318,14 @@ messageSends: []
 }),
 }),
 globals.AnnouncementValuable);
 globals.AnnouncementValuable);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "value",
 selector: "value",
 protocol: 'evaluating',
 protocol: 'evaluating',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 $1=_st(self._valuable())._value();
 $1=_st(self._valuable())._value();
@@ -343,14 +343,14 @@ messageSends: ["value", "valuable"]
 }),
 }),
 globals.AnnouncementValuable);
 globals.AnnouncementValuable);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "value:",
 selector: "value:",
 protocol: 'evaluating',
 protocol: 'evaluating',
 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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 $1=_st(self._valuable())._value_(anObject);
 $1=_st(self._valuable())._value_(anObject);
@@ -370,22 +370,22 @@ globals.AnnouncementValuable);
 
 
 
 
 
 
-smalltalk.addClass('Announcer', globals.Object, ['registry', 'subscriptions'], 'Kernel-Announcements');
+$vm.addClass('Announcer', globals.Object, ['registry', 'subscriptions'], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.Announcer.comment="I hold annoncement subscriptions (instances of `AnnouncementSubscription`) in a private registry.\x0aI announce (trigger) announces, which are then dispatched to all subscriptions.\x0a\x0aThe code is based on the announcements as [described by Vassili Bykov](http://www.cincomsmalltalk.com/userblogs/vbykov/blogView?searchCategory=Announcements%20Framework).\x0a\x0a## API\x0a\x0aUse `#announce:` to trigger an announcement.\x0a\x0aUse `#on:do:` or `#on:send:to:` to register subscriptions.\x0a\x0aWhen using `#on:send:to:`, unregistration can be done with `#unregister:`.\x0a\x0a## Usage example:\x0a\x0a    SystemAnnouncer current\x0a        on: ClassAdded\x0a        do: [ :ann | window alert: ann theClass name, ' added' ].";
 globals.Announcer.comment="I hold annoncement subscriptions (instances of `AnnouncementSubscription`) in a private registry.\x0aI announce (trigger) announces, which are then dispatched to all subscriptions.\x0a\x0aThe code is based on the announcements as [described by Vassili Bykov](http://www.cincomsmalltalk.com/userblogs/vbykov/blogView?searchCategory=Announcements%20Framework).\x0a\x0a## API\x0a\x0aUse `#announce:` to trigger an announcement.\x0a\x0aUse `#on:do:` or `#on:send:to:` to register subscriptions.\x0a\x0aWhen using `#on:send:to:`, unregistration can be done with `#unregister:`.\x0a\x0a## Usage example:\x0a\x0a    SystemAnnouncer current\x0a        on: ClassAdded\x0a        do: [ :ann | window alert: ann theClass name, ' added' ].";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "announce:",
 selector: "announce:",
 protocol: 'announcing',
 protocol: 'announcing',
 fn: function (anAnnouncement){
 fn: function (anAnnouncement){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 _st(self["@subscriptions"])._do_((function(each){
 _st(self["@subscriptions"])._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return _st(each)._deliver_(anAnnouncement);
 return _st(each)._deliver_(anAnnouncement);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -406,15 +406,15 @@ messageSends: ["do:", "deliver:"]
 }),
 }),
 globals.Announcer);
 globals.Announcer);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "initialize",
 selector: "initialize",
 protocol: 'initialization',
 protocol: 'initialization',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
 function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 (
 (
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -439,14 +439,14 @@ messageSends: ["initialize", "new"]
 }),
 }),
 globals.Announcer);
 globals.Announcer);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "on:do:",
 selector: "on:do:",
 protocol: 'subscribing',
 protocol: 'subscribing',
 fn: function (aClass,aBlock){
 fn: function (aClass,aBlock){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._on_do_for_(aClass,aBlock,nil);
 self._on_do_for_(aClass,aBlock,nil);
 return self;
 return self;
@@ -463,8 +463,8 @@ messageSends: ["on:do:for:"]
 }),
 }),
 globals.Announcer);
 globals.Announcer);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "on:do:for:",
 selector: "on:do:for:",
 protocol: 'subscribing',
 protocol: 'subscribing',
 fn: function (aClass,aBlock,aReceiver){
 fn: function (aClass,aBlock,aReceiver){
@@ -472,7 +472,7 @@ var self=this;
 function $AnnouncementSubscription(){return globals.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
 function $AnnouncementSubscription(){return globals.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
 function $AnnouncementValuable(){return globals.AnnouncementValuable||(typeof AnnouncementValuable=="undefined"?nil:AnnouncementValuable)}
 function $AnnouncementValuable(){return globals.AnnouncementValuable||(typeof AnnouncementValuable=="undefined"?nil:AnnouncementValuable)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1,$3,$4,$6,$7,$5,$8,$2;
 var $1,$3,$4,$6,$7,$5,$8,$2;
 $1=self["@subscriptions"];
 $1=self["@subscriptions"];
@@ -511,8 +511,8 @@ messageSends: ["add:", "valuable:", "new", "receiver:", "yourself", "announcemen
 }),
 }),
 globals.Announcer);
 globals.Announcer);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "on:doOnce:",
 selector: "on:doOnce:",
 protocol: 'subscribing',
 protocol: 'subscribing',
 fn: function (aClass,aBlock){
 fn: function (aClass,aBlock){
@@ -520,7 +520,7 @@ var self=this;
 var subscription;
 var subscription;
 function $AnnouncementSubscription(){return globals.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
 function $AnnouncementSubscription(){return globals.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1,$2;
 var $1,$2;
 $1=_st($AnnouncementSubscription())._new();
 $1=_st($AnnouncementSubscription())._new();
@@ -529,7 +529,7 @@ $2=_st($1)._yourself();
 subscription=$2;
 subscription=$2;
 _st(subscription)._valuable_((function(ann){
 _st(subscription)._valuable_((function(ann){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 _st(self["@subscriptions"])._remove_(subscription);
 _st(self["@subscriptions"])._remove_(subscription);
 return _st(aBlock)._value_(ann);
 return _st(aBlock)._value_(ann);
@@ -552,8 +552,8 @@ messageSends: ["announcementClass:", "new", "yourself", "valuable:", "remove:",
 }),
 }),
 globals.Announcer);
 globals.Announcer);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "on:send:to:",
 selector: "on:send:to:",
 protocol: 'subscribing',
 protocol: 'subscribing',
 fn: function (aClass,aSelector,anObject){
 fn: function (aClass,aSelector,anObject){
@@ -561,7 +561,7 @@ var self=this;
 function $AnnouncementSubscription(){return globals.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
 function $AnnouncementSubscription(){return globals.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
 function $MessageSend(){return globals.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
 function $MessageSend(){return globals.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1,$3,$4,$6,$7,$5,$8,$2;
 var $1,$3,$4,$6,$7,$5,$8,$2;
 $1=self["@subscriptions"];
 $1=self["@subscriptions"];
@@ -597,18 +597,18 @@ messageSends: ["add:", "valuable:", "new", "receiver:", "selector:", "yourself",
 }),
 }),
 globals.Announcer);
 globals.Announcer);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "unsubscribe:",
 selector: "unsubscribe:",
 protocol: 'subscribing',
 protocol: 'subscribing',
 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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self["@subscriptions"]=_st(self["@subscriptions"])._reject_((function(each){
 self["@subscriptions"]=_st(self["@subscriptions"])._reject_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return _st(_st(each)._receiver()).__eq(anObject);
 return _st(_st(each)._receiver()).__eq(anObject);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -631,20 +631,20 @@ globals.Announcer);
 
 
 
 
 
 
-smalltalk.addClass('SystemAnnouncer', globals.Announcer, [], 'Kernel-Announcements');
+$vm.addClass('SystemAnnouncer', globals.Announcer, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.SystemAnnouncer.comment="My unique instance is the global announcer handling all Amber system-related announces.\x0a\x0a## API\x0a\x0aAccess to the unique instance is done via `#current`";
 globals.SystemAnnouncer.comment="My unique instance is the global announcer handling all Amber system-related announces.\x0a\x0a## API\x0a\x0aAccess to the unique instance is done via `#current`";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 
 
 globals.SystemAnnouncer.klass.iVarNames = ['current'];
 globals.SystemAnnouncer.klass.iVarNames = ['current'];
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "current",
 selector: "current",
 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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $2,$1,$receiver;
 var $2,$1,$receiver;
 $2=self["@current"];
 $2=self["@current"];
@@ -675,14 +675,14 @@ messageSends: ["ifNil:", "new"]
 }),
 }),
 globals.SystemAnnouncer.klass);
 globals.SystemAnnouncer.klass);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "new",
 selector: "new",
 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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._shouldNotImplement();
 self._shouldNotImplement();
 return self;
 return self;
@@ -700,13 +700,13 @@ messageSends: ["shouldNotImplement"]
 globals.SystemAnnouncer.klass);
 globals.SystemAnnouncer.klass);
 
 
 
 
-smalltalk.addClass('SystemAnnouncement', globals.Object, [], 'Kernel-Announcements');
+$vm.addClass('SystemAnnouncement', globals.Object, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.SystemAnnouncement.comment="I am the superclass of all system announcements";
 globals.SystemAnnouncement.comment="I am the superclass of all system announcements";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "heliosClass",
 selector: "heliosClass",
 protocol: 'helios',
 protocol: 'helios',
 fn: function (){
 fn: function (){
@@ -724,12 +724,12 @@ messageSends: []
 globals.SystemAnnouncement.klass);
 globals.SystemAnnouncement.klass);
 
 
 
 
-smalltalk.addClass('ClassAnnouncement', globals.SystemAnnouncement, ['theClass'], 'Kernel-Announcements');
+$vm.addClass('ClassAnnouncement', globals.SystemAnnouncement, ['theClass'], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ClassAnnouncement.comment="I am the abstract superclass of class-related announcements.";
 globals.ClassAnnouncement.comment="I am the abstract superclass of class-related announcements.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "theClass",
 selector: "theClass",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -748,8 +748,8 @@ messageSends: []
 }),
 }),
 globals.ClassAnnouncement);
 globals.ClassAnnouncement);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "theClass:",
 selector: "theClass:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aClass){
 fn: function (aClass){
@@ -769,30 +769,30 @@ globals.ClassAnnouncement);
 
 
 
 
 
 
-smalltalk.addClass('ClassAdded', globals.ClassAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('ClassAdded', globals.ClassAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ClassAdded.comment="I am emitted when a class is added to the system.\x0aSee ClassBuilder >> #addSubclassOf:... methods";
 globals.ClassAdded.comment="I am emitted when a class is added to the system.\x0aSee ClassBuilder >> #addSubclassOf:... methods";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 
 
 
 
-smalltalk.addClass('ClassCommentChanged', globals.ClassAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('ClassCommentChanged', globals.ClassAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ClassCommentChanged.comment="I am emitted when the comment of a class changes. (Behavior >> #comment)";
 globals.ClassCommentChanged.comment="I am emitted when the comment of a class changes. (Behavior >> #comment)";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 
 
 
 
-smalltalk.addClass('ClassDefinitionChanged', globals.ClassAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('ClassDefinitionChanged', globals.ClassAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ClassDefinitionChanged.comment="I am emitted when the definition of a class changes.\x0aSee ClassBuilder >> #class:instanceVariableNames:";
 globals.ClassDefinitionChanged.comment="I am emitted when the definition of a class changes.\x0aSee ClassBuilder >> #class:instanceVariableNames:";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 
 
 
 
-smalltalk.addClass('ClassMigrated', globals.ClassAnnouncement, ['oldClass'], 'Kernel-Announcements');
+$vm.addClass('ClassMigrated', globals.ClassAnnouncement, ['oldClass'], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ClassMigrated.comment="I am emitted when a class is migrated.";
 globals.ClassMigrated.comment="I am emitted when a class is migrated.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "oldClass",
 selector: "oldClass",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -811,8 +811,8 @@ messageSends: []
 }),
 }),
 globals.ClassMigrated);
 globals.ClassMigrated);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "oldClass:",
 selector: "oldClass:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aClass){
 fn: function (aClass){
@@ -832,12 +832,12 @@ globals.ClassMigrated);
 
 
 
 
 
 
-smalltalk.addClass('ClassMoved', globals.ClassAnnouncement, ['oldPackage'], 'Kernel-Announcements');
+$vm.addClass('ClassMoved', globals.ClassAnnouncement, ['oldPackage'], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ClassMoved.comment="I am emitted when a class is moved from one package to another.";
 globals.ClassMoved.comment="I am emitted when a class is moved from one package to another.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "oldPackage",
 selector: "oldPackage",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -856,8 +856,8 @@ messageSends: []
 }),
 }),
 globals.ClassMoved);
 globals.ClassMoved);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "oldPackage:",
 selector: "oldPackage:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aPackage){
 fn: function (aPackage){
@@ -877,24 +877,24 @@ globals.ClassMoved);
 
 
 
 
 
 
-smalltalk.addClass('ClassRemoved', globals.ClassAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('ClassRemoved', globals.ClassAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ClassRemoved.comment="I am emitted when a class is removed.\x0aSee Smalltalk >> #removeClass:";
 globals.ClassRemoved.comment="I am emitted when a class is removed.\x0aSee Smalltalk >> #removeClass:";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 
 
 
 
-smalltalk.addClass('ClassRenamed', globals.ClassAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('ClassRenamed', globals.ClassAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ClassRenamed.comment="I am emitted when a class is renamed.\x0aSee ClassBuilder >> #renameClass:to:";
 globals.ClassRenamed.comment="I am emitted when a class is renamed.\x0aSee ClassBuilder >> #renameClass:to:";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 
 
 
 
-smalltalk.addClass('MethodAnnouncement', globals.SystemAnnouncement, ['method'], 'Kernel-Announcements');
+$vm.addClass('MethodAnnouncement', globals.SystemAnnouncement, ['method'], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.MethodAnnouncement.comment="I am the abstract superclass of method-related announcements.";
 globals.MethodAnnouncement.comment="I am the abstract superclass of method-related announcements.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "method",
 selector: "method",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -913,8 +913,8 @@ messageSends: []
 }),
 }),
 globals.MethodAnnouncement);
 globals.MethodAnnouncement);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "method:",
 selector: "method:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aCompiledMethod){
 fn: function (aCompiledMethod){
@@ -934,18 +934,18 @@ globals.MethodAnnouncement);
 
 
 
 
 
 
-smalltalk.addClass('MethodAdded', globals.MethodAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('MethodAdded', globals.MethodAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.MethodAdded.comment="I am emitted when a `CompiledMethod` is added to a class.";
 globals.MethodAdded.comment="I am emitted when a `CompiledMethod` is added to a class.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 
 
 
 
-smalltalk.addClass('MethodModified', globals.MethodAnnouncement, ['oldMethod'], 'Kernel-Announcements');
+$vm.addClass('MethodModified', globals.MethodAnnouncement, ['oldMethod'], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.MethodModified.comment="I am emitted when a `CompiledMethod` is modified (a new method is installed). I hold a reference to the old method being replaced.";
 globals.MethodModified.comment="I am emitted when a `CompiledMethod` is modified (a new method is installed). I hold a reference to the old method being replaced.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "oldMethod",
 selector: "oldMethod",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -964,8 +964,8 @@ messageSends: []
 }),
 }),
 globals.MethodModified);
 globals.MethodModified);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "oldMethod:",
 selector: "oldMethod:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aMethod){
 fn: function (aMethod){
@@ -985,12 +985,12 @@ globals.MethodModified);
 
 
 
 
 
 
-smalltalk.addClass('MethodMoved', globals.MethodAnnouncement, ['oldProtocol'], 'Kernel-Announcements');
+$vm.addClass('MethodMoved', globals.MethodAnnouncement, ['oldProtocol'], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.MethodMoved.comment="I am emitted when a `CompiledMethod` is moved to another protocol. I hold a refernce to the old protocol of the method.";
 globals.MethodMoved.comment="I am emitted when a `CompiledMethod` is moved to another protocol. I hold a refernce to the old protocol of the method.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "oldProtocol",
 selector: "oldProtocol",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -1009,8 +1009,8 @@ messageSends: []
 }),
 }),
 globals.MethodMoved);
 globals.MethodMoved);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "oldProtocol:",
 selector: "oldProtocol:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aString){
 fn: function (aString){
@@ -1030,18 +1030,18 @@ globals.MethodMoved);
 
 
 
 
 
 
-smalltalk.addClass('MethodRemoved', globals.MethodAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('MethodRemoved', globals.MethodAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.MethodRemoved.comment="I am emitted when a `CompiledMethod` is removed from a class.";
 globals.MethodRemoved.comment="I am emitted when a `CompiledMethod` is removed from a class.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 
 
 
 
-smalltalk.addClass('PackageAnnouncement', globals.SystemAnnouncement, ['package'], 'Kernel-Announcements');
+$vm.addClass('PackageAnnouncement', globals.SystemAnnouncement, ['package'], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.PackageAnnouncement.comment="I am the abstract superclass of package-related announcements.";
 globals.PackageAnnouncement.comment="I am the abstract superclass of package-related announcements.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "package",
 selector: "package",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -1060,8 +1060,8 @@ messageSends: []
 }),
 }),
 globals.PackageAnnouncement);
 globals.PackageAnnouncement);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "package:",
 selector: "package:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aPackage){
 fn: function (aPackage){
@@ -1081,43 +1081,43 @@ globals.PackageAnnouncement);
 
 
 
 
 
 
-smalltalk.addClass('PackageAdded', globals.PackageAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('PackageAdded', globals.PackageAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.PackageAdded.comment="I am emitted when a `Package` is added to the system.";
 globals.PackageAdded.comment="I am emitted when a `Package` is added to the system.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 
 
 
 
-smalltalk.addClass('PackageClean', globals.PackageAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('PackageClean', globals.PackageAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.PackageClean.comment="I am emitted when a package is committed and becomes clean.";
 globals.PackageClean.comment="I am emitted when a package is committed and becomes clean.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 
 
 
 
-smalltalk.addClass('PackageDirty', globals.PackageAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('PackageDirty', globals.PackageAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.PackageDirty.comment="I am emitted when a package becomes dirty.";
 globals.PackageDirty.comment="I am emitted when a package becomes dirty.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 
 
 
 
-smalltalk.addClass('PackageRemoved', globals.PackageAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('PackageRemoved', globals.PackageAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.PackageRemoved.comment="I am emitted when a `Package` is removed from the system.";
 globals.PackageRemoved.comment="I am emitted when a `Package` is removed from the system.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 
 
 
 
-smalltalk.addClass('ProtocolAnnouncement', globals.SystemAnnouncement, ['theClass', 'protocol'], 'Kernel-Announcements');
+$vm.addClass('ProtocolAnnouncement', globals.SystemAnnouncement, ['theClass', 'protocol'], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ProtocolAnnouncement.comment="I am the abstract superclass of protocol-related announcements.";
 globals.ProtocolAnnouncement.comment="I am the abstract superclass of protocol-related announcements.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "package",
 selector: "package",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 function $Package(){return globals.Package||(typeof Package=="undefined"?nil:Package)}
 function $Package(){return globals.Package||(typeof Package=="undefined"?nil:Package)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $2,$1,$3,$4;
 var $2,$1,$3,$4;
 $2=self._protocol();
 $2=self._protocol();
@@ -1125,7 +1125,7 @@ $2=self._protocol();
 $ctx1.sendIdx["protocol"]=1;
 $ctx1.sendIdx["protocol"]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 $1=_st($2)._beginsWith_("*");
 $1=_st($2)._beginsWith_("*");
-if(! smalltalk.assert($1)){
+if(!$vm.assert($1)){
 $3=_st(self._theClass())._package();
 $3=_st(self._theClass())._package();
 return $3;
 return $3;
 };
 };
@@ -1147,8 +1147,8 @@ messageSends: ["ifFalse:", "beginsWith:", "protocol", "package", "theClass", "na
 }),
 }),
 globals.ProtocolAnnouncement);
 globals.ProtocolAnnouncement);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "protocol",
 selector: "protocol",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -1167,8 +1167,8 @@ messageSends: []
 }),
 }),
 globals.ProtocolAnnouncement);
 globals.ProtocolAnnouncement);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "protocol:",
 selector: "protocol:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aString){
 fn: function (aString){
@@ -1186,8 +1186,8 @@ messageSends: []
 }),
 }),
 globals.ProtocolAnnouncement);
 globals.ProtocolAnnouncement);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "theClass",
 selector: "theClass",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -1206,8 +1206,8 @@ messageSends: []
 }),
 }),
 globals.ProtocolAnnouncement);
 globals.ProtocolAnnouncement);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "theClass:",
 selector: "theClass:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aClass){
 fn: function (aClass){
@@ -1227,13 +1227,13 @@ globals.ProtocolAnnouncement);
 
 
 
 
 
 
-smalltalk.addClass('ProtocolAdded', globals.ProtocolAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('ProtocolAdded', globals.ProtocolAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ProtocolAdded.comment="I am emitted when a protocol is added to a class.";
 globals.ProtocolAdded.comment="I am emitted when a protocol is added to a class.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
 
 
 
 
-smalltalk.addClass('ProtocolRemoved', globals.ProtocolAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('ProtocolRemoved', globals.ProtocolAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ProtocolRemoved.comment="I am emitted when a protocol is removed from a class.";
 globals.ProtocolRemoved.comment="I am emitted when a protocol is removed from a class.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");

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


+ 7 - 7
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 `$vm.setClassConstructor'"
 	
 	
-	<smalltalk.setClassConstructor(self, aJavaScriptFunction);>
+	<$vm.setClassConstructor(self, aJavaScriptFunction);>
 !
 !
 
 
 lookupSelector: selector
 lookupSelector: selector
@@ -316,11 +316,11 @@ new
 !Behavior methodsFor: 'private'!
 !Behavior methodsFor: 'private'!
 
 
 basicAddCompiledMethod: aMethod
 basicAddCompiledMethod: aMethod
-	<smalltalk.addMethod(aMethod, self)>
+	<$vm.addMethod(aMethod, self)>
 !
 !
 
 
 basicRemoveCompiledMethod: aMethod
 basicRemoveCompiledMethod: aMethod
-	<smalltalk.removeMethod(aMethod,self)>
+	<$vm.removeMethod(aMethod,self)>
 ! !
 ! !
 
 
 !Behavior methodsFor: 'testing'!
 !Behavior methodsFor: 'testing'!
@@ -712,7 +712,7 @@ 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);
+		$vm.addClass(aString, aClass, aCollection, packageName);
 		return globals[aString]
 		return globals[aString]
 	>
 	>
 !
 !
@@ -728,7 +728,7 @@ basicClass: aClass instanceVariables: aCollection
 !
 !
 
 
 basicRemoveClass: aClass
 basicRemoveClass: aClass
-	<smalltalk.removeClass(aClass)>
+	<$vm.removeClass(aClass)>
 !
 !
 
 
 basicRenameClass: aClass to: aString
 basicRenameClass: aClass to: aString
@@ -756,7 +756,7 @@ rawRenameClass: aClass to: aString
 !ClassBuilder methodsFor: 'public'!
 !ClassBuilder methodsFor: 'public'!
 
 
 setupClass: aClass
 setupClass: aClass
-	<smalltalk.init(aClass);>
+	<$vm.init(aClass);>
 ! !
 ! !
 
 
 Object subclass: #ClassCategoryReader
 Object subclass: #ClassCategoryReader

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


+ 1 - 1
src/Kernel-Collections.st

@@ -1497,7 +1497,7 @@ asJSON
 !
 !
 
 
 asJavaScriptMethodName
 asJavaScriptMethodName
-	<return smalltalk.st2js(self)>
+	<return $vm.st2js(self)>
 !
 !
 
 
 asJavascript
 asJavascript

+ 101 - 100
src/Kernel-Exceptions.js

@@ -1,21 +1,21 @@
 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 $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
 var $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
 var smalltalk=$vm,_st=$recv,globals=$globals;
 var smalltalk=$vm,_st=$recv,globals=$globals;
-smalltalk.addPackage('Kernel-Exceptions');
-smalltalk.packages["Kernel-Exceptions"].transport = {"type":"amd","amdNamespace":"amber_core"};
+$vm.addPackage('Kernel-Exceptions');
+$vm.packages["Kernel-Exceptions"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
 
-smalltalk.addClass('Error', globals.Object, ['messageText'], 'Kernel-Exceptions');
+$vm.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({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self.amberHandled = true;
 self.amberHandled = true;
 return self;
 return self;
@@ -32,14 +32,14 @@ messageSends: []
 }),
 }),
 globals.Error);
 globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self.amberHandled = false;
 self.amberHandled = false;
 return self;
 return self;
@@ -56,14 +56,14 @@ messageSends: []
 }),
 }),
 globals.Error);
 globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self.context;
 return self.context;
 return self;
 return self;
@@ -80,14 +80,14 @@ messageSends: []
 }),
 }),
 globals.Error);
 globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._messageText_("Errorclass: ".__comma(_st(self._class())._name()));
 self._messageText_("Errorclass: ".__comma(_st(self._class())._name()));
 return self;
 return self;
@@ -104,14 +104,14 @@ messageSends: ["messageText:", ",", "name", "class"]
 }),
 }),
 globals.Error);
 globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self.smalltalkError === true;
 return self.smalltalkError === true;
 return self;
 return self;
@@ -128,14 +128,14 @@ messageSends: []
 }),
 }),
 globals.Error);
 globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self.stack;
 return self.stack;
 return self;
 return self;
@@ -152,8 +152,8 @@ messageSends: []
 }),
 }),
 globals.Error);
 globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "messageText",
 selector: "messageText",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -172,8 +172,8 @@ messageSends: []
 }),
 }),
 globals.Error);
 globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "messageText:",
 selector: "messageText:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aString){
 fn: function (aString){
@@ -191,14 +191,14 @@ messageSends: []
 }),
 }),
 globals.Error);
 globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 
 
 		self.amberHandled = false;
 		self.amberHandled = false;
@@ -218,19 +218,20 @@ messageSends: []
 }),
 }),
 globals.Error);
 globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 
 
 		self.amberHandled = false;
 		self.amberHandled = false;
-		self.context = smalltalk.getThisContext(); 
-		self.smalltalkError = true; throw(self)
+		self.context = $vm.getThisContext(); 
+		self.smalltalkError = true;
+		throw self;
 	;
 	;
 return self;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -239,21 +240,21 @@ return self;
 },
 },
 //>>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 = $vm.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({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._messageText_(aString);
 self._messageText_(aString);
 self._signal();
 self._signal();
@@ -271,14 +272,14 @@ messageSends: ["messageText:", "signal"]
 }),
 }),
 globals.Error);
 globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 $1=self._signalerContextFrom_(self._context());
 $1=self._signalerContextFrom_(self._context());
@@ -296,19 +297,19 @@ messageSends: ["signalerContextFrom:", "context"]
 }),
 }),
 globals.Error);
 globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $4,$3,$2,$1;
 var $4,$3,$2,$1;
 $1=_st(aContext)._findContextSuchThat_((function(context){
 $1=_st(aContext)._findContextSuchThat_((function(context){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 $4=_st(context)._receiver();
 $4=_st(context)._receiver();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -320,7 +321,7 @@ $ctx2.sendIdx["=="]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 $2=_st($3)._or_((function(){
 $2=_st($3)._or_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return _st(_st(context)._receiver()).__eq_eq(self._class());
 return _st(_st(context)._receiver()).__eq_eq(self._class());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -346,14 +347,14 @@ messageSends: ["findContextSuchThat:", "not", "or:", "==", "receiver", "class"]
 }),
 }),
 globals.Error);
 globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self.amberHandled || false;
 return self.amberHandled || false;
 return self;
 return self;
@@ -371,8 +372,8 @@ messageSends: []
 globals.Error);
 globals.Error);
 
 
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "heliosClass",
 selector: "heliosClass",
 protocol: 'helios',
 protocol: 'helios',
 fn: function (){
 fn: function (){
@@ -389,14 +390,14 @@ messageSends: []
 }),
 }),
 globals.Error.klass);
 globals.Error.klass);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 $1=_st(self._new())._signal();
 $1=_st(self._new())._signal();
@@ -414,14 +415,14 @@ messageSends: ["signal", "new"]
 }),
 }),
 globals.Error.klass);
 globals.Error.klass);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 $1=_st(self._new())._signal_(aString);
 $1=_st(self._new())._signal_(aString);
@@ -440,12 +441,12 @@ messageSends: ["signal:", "new"]
 globals.Error.klass);
 globals.Error.klass);
 
 
 
 
-smalltalk.addClass('Halt', globals.Error, [], 'Kernel-Exceptions');
+$vm.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({
+$vm.addMethod(
+$vm.method({
 selector: "messageText",
 selector: "messageText",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -462,19 +463,19 @@ messageSends: []
 }),
 }),
 globals.Halt);
 globals.Halt);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $4,$3,$2,$1;
 var $4,$3,$2,$1;
 $1=_st(aContext)._findContextSuchThat_((function(context){
 $1=_st(aContext)._findContextSuchThat_((function(context){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 $4=_st(context)._receiver();
 $4=_st(context)._receiver();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -486,11 +487,11 @@ $ctx2.sendIdx["=="]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 $2=_st($3)._or_((function(){
 $2=_st($3)._or_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return _st(_st(_st(context)._receiver()).__eq_eq(self._class()))._or_((function(){
 return _st(_st(_st(context)._receiver()).__eq_eq(self._class()))._or_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx4) {
+return $vm.withContext(function($ctx4) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return _st(_st(_st(context)._method())._selector()).__eq("halt");
 return _st(_st(_st(context)._method())._selector()).__eq("halt");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -525,18 +526,18 @@ globals.Halt);
 
 
 
 
 
 
-smalltalk.addClass('JavaScriptException', globals.Error, ['exception'], 'Kernel-Exceptions');
+$vm.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({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self.context = aMethodContext;
 self.context = aMethodContext;
 return self;
 return self;
@@ -553,8 +554,8 @@ messageSends: []
 }),
 }),
 globals.JavaScriptException);
 globals.JavaScriptException);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "exception",
 selector: "exception",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -573,8 +574,8 @@ messageSends: []
 }),
 }),
 globals.JavaScriptException);
 globals.JavaScriptException);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "exception:",
 selector: "exception:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (anException){
 fn: function (anException){
@@ -592,14 +593,14 @@ messageSends: []
 }),
 }),
 globals.JavaScriptException);
 globals.JavaScriptException);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return 'JavaScript exception: ' + self["@exception"].toString();
 return 'JavaScript exception: ' + self["@exception"].toString();
 return self;
 return self;
@@ -617,14 +618,14 @@ messageSends: []
 globals.JavaScriptException);
 globals.JavaScriptException);
 
 
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $2,$3,$1;
 var $2,$3,$1;
 $2=self._new();
 $2=self._new();
@@ -645,14 +646,14 @@ messageSends: ["exception:", "new", "yourself"]
 }),
 }),
 globals.JavaScriptException.klass);
 globals.JavaScriptException.klass);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $2,$3,$1;
 var $2,$3,$1;
 $2=self._new();
 $2=self._new();
@@ -675,12 +676,12 @@ messageSends: ["exception:", "new", "context:", "yourself"]
 globals.JavaScriptException.klass);
 globals.JavaScriptException.klass);
 
 
 
 
-smalltalk.addClass('MessageNotUnderstood', globals.Error, ['message', 'receiver'], 'Kernel-Exceptions');
+$vm.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({
+$vm.addMethod(
+$vm.method({
 selector: "message",
 selector: "message",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -699,8 +700,8 @@ messageSends: []
 }),
 }),
 globals.MessageNotUnderstood);
 globals.MessageNotUnderstood);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "message:",
 selector: "message:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (aMessage){
 fn: function (aMessage){
@@ -718,14 +719,14 @@ messageSends: []
 }),
 }),
 globals.MessageNotUnderstood);
 globals.MessageNotUnderstood);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.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=_st(_st(_st(self._receiver())._asString()).__comma(" does not understand #")).__comma(_st(self._message())._selector());
@@ -746,8 +747,8 @@ messageSends: [",", "asString", "receiver", "selector", "message"]
 }),
 }),
 globals.MessageNotUnderstood);
 globals.MessageNotUnderstood);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "receiver",
 selector: "receiver",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -766,8 +767,8 @@ messageSends: []
 }),
 }),
 globals.MessageNotUnderstood);
 globals.MessageNotUnderstood);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "receiver:",
 selector: "receiver:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (anObject){
 fn: function (anObject){
@@ -787,12 +788,12 @@ globals.MessageNotUnderstood);
 
 
 
 
 
 
-smalltalk.addClass('NonBooleanReceiver', globals.Error, ['object'], 'Kernel-Exceptions');
+$vm.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({
+$vm.addMethod(
+$vm.method({
 selector: "object",
 selector: "object",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (){
 fn: function (){
@@ -811,8 +812,8 @@ messageSends: []
 }),
 }),
 globals.NonBooleanReceiver);
 globals.NonBooleanReceiver);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "object:",
 selector: "object:",
 protocol: 'accessing',
 protocol: 'accessing',
 fn: function (anObject){
 fn: function (anObject){
@@ -832,7 +833,7 @@ globals.NonBooleanReceiver);
 
 
 
 
 
 
-smalltalk.addClass('PackageCommitError', globals.Error, [], 'Kernel-Exceptions');
+$vm.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 = $vm.getThisContext(); 
+		self.smalltalkError = true;
+		throw self;
 	>
 	>
 !
 !
 
 

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


+ 5 - 5
src/Kernel-ImportExport.st

@@ -261,7 +261,7 @@ jsClassNameFor: aClass
 exportDefinitionOf: aClass on: aStream
 exportDefinitionOf: aClass on: aStream
 	aStream
 	aStream
 		lf;
 		lf;
-		nextPutAll: 'smalltalk.addClass(';
+		nextPutAll: '$vm.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: '$vm.addMethod(';lf;
+		nextPutAll: '$vm.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: '$vm.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: '$vm.packages[';
 		nextPutAll: aPackage name asJavascript;
 		nextPutAll: aPackage name asJavascript;
 		nextPutAll: '].transport = ';
 		nextPutAll: '].transport = ';
 		nextPutAll: aPackage transport asJSONString;
 		nextPutAll: aPackage transport asJSONString;

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


+ 13 - 13
src/Kernel-Infrastructure.st

@@ -424,7 +424,7 @@ doesNotUnderstand: aMessage
 
 
 forwardMessage: aString withArguments: anArray
 forwardMessage: aString withArguments: anArray
 	<
 	<
-		return smalltalk.accessJavaScript(self._jsObject(), aString, anArray);
+		return $vm.accessJavaScript(self._jsObject(), aString, anArray);
 	>
 	>
 !
 !
 
 
@@ -1145,7 +1145,7 @@ globals
 !
 !
 
 
 includesKey: aKey
 includesKey: aKey
-	<return smalltalk.hasOwnProperty(aKey)>
+	<return $vm.hasOwnProperty(aKey)>
 !
 !
 
 
 parse: aString
 parse: aString
@@ -1164,12 +1164,12 @@ pseudoVariableNames
 !
 !
 
 
 readJSObject: anObject
 readJSObject: anObject
-	<return smalltalk.readJSObject(anObject)>
+	<return $vm.readJSObject(anObject)>
 !
 !
 
 
 reservedWords
 reservedWords
 	"JavaScript reserved words"
 	"JavaScript reserved words"
-	<return smalltalk.reservedWords>
+	<return $vm.reservedWords>
 !
 !
 
 
 settings
 settings
@@ -1204,7 +1204,7 @@ defaultAmdNamespace: aString
 !SmalltalkImage methodsFor: 'classes'!
 !SmalltalkImage methodsFor: 'classes'!
 
 
 classes
 classes
-	<return smalltalk.classes()>
+	<return $vm.classes()>
 !
 !
 
 
 removeClass: aClass
 removeClass: aClass
@@ -1245,7 +1245,7 @@ deleteGlobalJsVariable: aString
 
 
 globalJsVariables
 globalJsVariables
 	"Array of global JavaScript variables"
 	"Array of global JavaScript variables"
-	<return smalltalk.globalJsVariables>
+	<return $vm.globalJsVariables>
 ! !
 ! !
 
 
 !SmalltalkImage methodsFor: 'packages'!
 !SmalltalkImage methodsFor: 'packages'!
@@ -1265,7 +1265,7 @@ createPackage: packageName
 !
 !
 
 
 packageAt: packageName
 packageAt: packageName
-	<return smalltalk.packages[packageName]>
+	<return $vm.packages[packageName]>
 !
 !
 
 
 packageAt: packageName ifAbsent: aBlock
 packageAt: packageName ifAbsent: aBlock
@@ -1276,8 +1276,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($vm.packages).map(function(k) {
+			return $vm.packages[k];
 		})
 		})
 	>
 	>
 !
 !
@@ -1307,7 +1307,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 $vm.addPackage(packageName)>
 !
 !
 
 
 basicParse: aString
 basicParse: aString
@@ -1325,14 +1325,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)>
+	<$vm.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 $vm.packages[packageName]>
 ! !
 ! !
 
 
 !SmalltalkImage methodsFor: 'testing'!
 !SmalltalkImage methodsFor: 'testing'!
@@ -1374,7 +1374,7 @@ do: aBlock displayingProgress: aString
 !String methodsFor: '*Kernel-Infrastructure'!
 !String methodsFor: '*Kernel-Infrastructure'!
 
 
 asJavaScriptPropertyName
 asJavaScriptPropertyName
-<return smalltalk.st2prop(self)>
+<return $vm.st2prop(self)>
 !
 !
 
 
 asJavaScriptSelector
 asJavaScriptSelector

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


+ 4 - 4
src/Kernel-Methods.st

@@ -47,7 +47,7 @@ whileFalse
 !
 !
 
 
 whileFalse: aBlock
 whileFalse: aBlock
-	<while(!!smalltalk.assert(self._value())) {aBlock._value()}>
+	<while(!!$vm.assert(self._value())) {aBlock._value()}>
 !
 !
 
 
 whileTrue
 whileTrue
@@ -55,13 +55,13 @@ whileTrue
 !
 !
 
 
 whileTrue: aBlock
 whileTrue: aBlock
-	<while(smalltalk.assert(self._value())) {aBlock._value()}>
+	<while($vm.assert(self._value())) {aBlock._value()}>
 ! !
 ! !
 
 
 !BlockClosure methodsFor: 'converting'!
 !BlockClosure methodsFor: 'converting'!
 
 
 asCompiledMethod: aString
 asCompiledMethod: aString
-	<return smalltalk.method({selector:aString, fn:self});>
+	<return $vm.method({selector:aString, fn:self});>
 !
 !
 
 
 currySelf
 currySelf
@@ -633,7 +633,7 @@ receiver
 selector
 selector
 	<
 	<
 		if(self.selector) {
 		if(self.selector) {
-			return smalltalk.js2st(self.selector);
+			return $vm.js2st(self.selector);
 		} else {
 		} else {
 			return nil;
 			return nil;
 		}
 		}

File diff suppressed because it is too large
+ 168 - 168
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=$vm.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 $vm.send(self, aString._asJavaScriptMethodName(), aCollection)>
 ! !
 ! !
 
 
 !ProtoObject methodsFor: 'printing'!
 !ProtoObject methodsFor: 'printing'!

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


+ 15 - 15
src/Kernel-Transcript.js

@@ -1,15 +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 $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
 var $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
 var smalltalk=$vm,_st=$recv,globals=$globals;
 var smalltalk=$vm,_st=$recv,globals=$globals;
-smalltalk.addPackage('Kernel-Transcript');
-smalltalk.packages["Kernel-Transcript"].transport = {"type":"amd","amdNamespace":"amber_core"};
+$vm.addPackage('Kernel-Transcript');
+$vm.packages["Kernel-Transcript"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
 
-smalltalk.addClass('ConsoleTranscript', globals.Object, ['textarea'], 'Kernel-Transcript');
+$vm.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({
+$vm.addMethod(
+$vm.method({
 selector: "clear",
 selector: "clear",
 protocol: 'printing',
 protocol: 'printing',
 fn: function (){
 fn: function (){
@@ -26,8 +26,8 @@ messageSends: []
 }),
 }),
 globals.ConsoleTranscript);
 globals.ConsoleTranscript);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "cr",
 selector: "cr",
 protocol: 'printing',
 protocol: 'printing',
 fn: function (){
 fn: function (){
@@ -44,8 +44,8 @@ messageSends: []
 }),
 }),
 globals.ConsoleTranscript);
 globals.ConsoleTranscript);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "open",
 selector: "open",
 protocol: 'actions',
 protocol: 'actions',
 fn: function (){
 fn: function (){
@@ -62,14 +62,14 @@ messageSends: []
 }),
 }),
 globals.ConsoleTranscript);
 globals.ConsoleTranscript);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 console.log(String(_st(anObject)._asString()));
 console.log(String(_st(anObject)._asString()));
 return self;
 return self;
@@ -87,15 +87,15 @@ messageSends: []
 globals.ConsoleTranscript);
 globals.ConsoleTranscript);
 
 
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.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 $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 _st($Transcript())._registerIfNone_(self._new());
 _st($Transcript())._registerIfNone_(self._new());
 return self;
 return self;

+ 98 - 98
src/SUnit-Tests.js

@@ -1,22 +1,22 @@
 define("amber_core/SUnit-Tests", ["amber/boot", "amber_core/SUnit"], function($boot){
 define("amber_core/SUnit-Tests", ["amber/boot", "amber_core/SUnit"], function($boot){
 var $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
 var $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
 var smalltalk=$vm,_st=$recv,globals=$globals;
 var smalltalk=$vm,_st=$recv,globals=$globals;
-smalltalk.addPackage('SUnit-Tests');
-smalltalk.packages["SUnit-Tests"].transport = {"type":"amd","amdNamespace":"amber_core"};
+$vm.addPackage('SUnit-Tests');
+$vm.packages["SUnit-Tests"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
 
-smalltalk.addClass('ExampleSetTest', globals.TestCase, ['empty', 'full'], 'SUnit-Tests');
+$vm.addClass('ExampleSetTest', globals.TestCase, ['empty', 'full'], 'SUnit-Tests');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ExampleSetTest.comment="ExampleSetTest is taken from Pharo 1.4.\x0a\x0aTHe purpose of this class is to demonstrate a simple use case of the test framework.";
 globals.ExampleSetTest.comment="ExampleSetTest is taken from Pharo 1.4.\x0a\x0aTHe purpose of this class is to demonstrate a simple use case of the test framework.";
 //>>excludeEnd("ide");
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "setUp",
 selector: "setUp",
 protocol: 'running',
 protocol: 'running',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 function $Set(){return globals.Set||(typeof Set=="undefined"?nil:Set)}
 function $Set(){return globals.Set||(typeof Set=="undefined"?nil:Set)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self["@empty"]=_st($Set())._new();
 self["@empty"]=_st($Set())._new();
 self["@full"]=_st($Set())._with_with_((5),"abc");
 self["@full"]=_st($Set())._with_with_((5),"abc");
@@ -34,14 +34,14 @@ messageSends: ["new", "with:with:"]
 }),
 }),
 globals.ExampleSetTest);
 globals.ExampleSetTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "testAdd",
 selector: "testAdd",
 protocol: 'tests',
 protocol: 'tests',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 _st(self["@empty"])._add_((5));
 _st(self["@empty"])._add_((5));
 self._assert_(_st(self["@empty"])._includes_((5)));
 self._assert_(_st(self["@empty"])._includes_((5)));
@@ -59,14 +59,14 @@ messageSends: ["add:", "assert:", "includes:"]
 }),
 }),
 globals.ExampleSetTest);
 globals.ExampleSetTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "testGrow",
 selector: "testGrow",
 protocol: 'tests',
 protocol: 'tests',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 _st(self["@empty"])._addAll_((1)._to_((100)));
 _st(self["@empty"])._addAll_((1)._to_((100)));
 self._assert_equals_(_st(self["@empty"])._size(),(100));
 self._assert_equals_(_st(self["@empty"])._size(),(100));
@@ -84,19 +84,19 @@ messageSends: ["addAll:", "to:", "assert:equals:", "size"]
 }),
 }),
 globals.ExampleSetTest);
 globals.ExampleSetTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "testIllegal",
 selector: "testIllegal",
 protocol: 'tests',
 protocol: 'tests',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
 function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._should_raise_((function(){
 self._should_raise_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return _st(self["@empty"])._at_((5));
 return _st(self["@empty"])._at_((5));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -108,7 +108,7 @@ $ctx1.sendIdx["should:raise:"]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._should_raise_((function(){
 self._should_raise_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return _st(self["@empty"])._at_put_((5),"abc");
 return _st(self["@empty"])._at_put_((5),"abc");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -129,14 +129,14 @@ messageSends: ["should:raise:", "at:", "at:put:"]
 }),
 }),
 globals.ExampleSetTest);
 globals.ExampleSetTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "testIncludes",
 selector: "testIncludes",
 protocol: 'tests',
 protocol: 'tests',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 $1=_st(self["@full"])._includes_((5));
 $1=_st(self["@full"])._includes_((5));
@@ -162,14 +162,14 @@ messageSends: ["assert:", "includes:"]
 }),
 }),
 globals.ExampleSetTest);
 globals.ExampleSetTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "testOccurrences",
 selector: "testOccurrences",
 protocol: 'tests',
 protocol: 'tests',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1,$2;
 var $1,$2;
 $1=_st(self["@empty"])._occurrencesOf_((0));
 $1=_st(self["@empty"])._occurrencesOf_((0));
@@ -204,14 +204,14 @@ messageSends: ["assert:equals:", "occurrencesOf:", "add:"]
 }),
 }),
 globals.ExampleSetTest);
 globals.ExampleSetTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "testRemove",
 selector: "testRemove",
 protocol: 'tests',
 protocol: 'tests',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 _st(self["@full"])._remove_((5));
 _st(self["@full"])._remove_((5));
@@ -237,21 +237,21 @@ globals.ExampleSetTest);
 
 
 
 
 
 
-smalltalk.addClass('SUnitAsyncTest', globals.TestCase, ['flag'], 'SUnit-Tests');
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addClass('SUnitAsyncTest', globals.TestCase, ['flag'], 'SUnit-Tests');
+$vm.addMethod(
+$vm.method({
 selector: "fakeError",
 selector: "fakeError",
 protocol: 'helpers',
 protocol: 'helpers',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self["@flag"]="bad";
 self["@flag"]="bad";
 self._timeout_((30));
 self._timeout_((30));
 self["@flag"]=_st(self._async_((function(){
 self["@flag"]=_st(self._async_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self["@flag"]="ok";
 self["@flag"]="ok";
 self["@flag"];
 self["@flag"];
@@ -274,20 +274,20 @@ messageSends: ["timeout:", "valueWithTimeout:", "async:", "error:"]
 }),
 }),
 globals.SUnitAsyncTest);
 globals.SUnitAsyncTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "fakeErrorFailingInTearDown",
 selector: "fakeErrorFailingInTearDown",
 protocol: 'helpers',
 protocol: 'helpers',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self["@flag"]="bad";
 self["@flag"]="bad";
 self._timeout_((30));
 self._timeout_((30));
 self["@flag"]=_st(self._async_((function(){
 self["@flag"]=_st(self._async_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self._error_("Intentional");
 return self._error_("Intentional");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -308,20 +308,20 @@ messageSends: ["timeout:", "valueWithTimeout:", "async:", "error:"]
 }),
 }),
 globals.SUnitAsyncTest);
 globals.SUnitAsyncTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "fakeFailure",
 selector: "fakeFailure",
 protocol: 'helpers',
 protocol: 'helpers',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self["@flag"]="bad";
 self["@flag"]="bad";
 self._timeout_((30));
 self._timeout_((30));
 self["@flag"]=_st(self._async_((function(){
 self["@flag"]=_st(self._async_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self["@flag"]="ok";
 self["@flag"]="ok";
 self["@flag"];
 self["@flag"];
@@ -344,14 +344,14 @@ messageSends: ["timeout:", "valueWithTimeout:", "async:", "assert:"]
 }),
 }),
 globals.SUnitAsyncTest);
 globals.SUnitAsyncTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "fakeMultipleTimeoutFailing",
 selector: "fakeMultipleTimeoutFailing",
 protocol: 'helpers',
 protocol: 'helpers',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 self._timeout_((100));
 self._timeout_((100));
@@ -360,12 +360,12 @@ $ctx1.sendIdx["timeout:"]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 $1=self._async_((function(){
 $1=self._async_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._timeout_((20));
 self._timeout_((20));
 return _st(self._async_((function(){
 return _st(self._async_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self._finished();
 return self._finished();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -397,14 +397,14 @@ messageSends: ["timeout:", "valueWithTimeout:", "async:", "finished"]
 }),
 }),
 globals.SUnitAsyncTest);
 globals.SUnitAsyncTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "fakeMultipleTimeoutPassing",
 selector: "fakeMultipleTimeoutPassing",
 protocol: 'helpers',
 protocol: 'helpers',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 self._timeout_((20));
 self._timeout_((20));
@@ -413,12 +413,12 @@ $ctx1.sendIdx["timeout:"]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 $1=self._async_((function(){
 $1=self._async_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._timeout_((40));
 self._timeout_((40));
 return _st(self._async_((function(){
 return _st(self._async_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self._finished();
 return self._finished();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -450,19 +450,19 @@ messageSends: ["timeout:", "valueWithTimeout:", "async:", "finished"]
 }),
 }),
 globals.SUnitAsyncTest);
 globals.SUnitAsyncTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "fakeTimeout",
 selector: "fakeTimeout",
 protocol: 'helpers',
 protocol: 'helpers',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._timeout_((10));
 self._timeout_((10));
 _st(self._async_((function(){
 _st(self._async_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self._finished();
 return self._finished();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -483,19 +483,19 @@ messageSends: ["timeout:", "valueWithTimeout:", "async:", "finished"]
 }),
 }),
 globals.SUnitAsyncTest);
 globals.SUnitAsyncTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "selectorSetOf:",
 selector: "selectorSetOf:",
 protocol: 'private',
 protocol: 'private',
 fn: function (aCollection){
 fn: function (aCollection){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 $1=_st(_st(aCollection)._collect_((function(each){
 $1=_st(_st(aCollection)._collect_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return _st(each)._selector();
 return _st(each)._selector();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -516,8 +516,8 @@ messageSends: ["asSet", "collect:", "selector"]
 }),
 }),
 globals.SUnitAsyncTest);
 globals.SUnitAsyncTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "setUp",
 selector: "setUp",
 protocol: 'running',
 protocol: 'running',
 fn: function (){
 fn: function (){
@@ -535,14 +535,14 @@ messageSends: []
 }),
 }),
 globals.SUnitAsyncTest);
 globals.SUnitAsyncTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "tearDown",
 selector: "tearDown",
 protocol: 'running',
 protocol: 'running',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._assert_equals_("ok",self["@flag"]);
 self._assert_equals_("ok",self["@flag"]);
 return self;
 return self;
@@ -559,8 +559,8 @@ messageSends: ["assert:equals:"]
 }),
 }),
 globals.SUnitAsyncTest);
 globals.SUnitAsyncTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "testAsyncErrorsAndFailures",
 selector: "testAsyncErrorsAndFailures",
 protocol: 'tests',
 protocol: 'tests',
 fn: function (){
 fn: function (){
@@ -569,12 +569,12 @@ var suite,runner,result,assertBlock;
 function $TestSuiteRunner(){return globals.TestSuiteRunner||(typeof TestSuiteRunner=="undefined"?nil:TestSuiteRunner)}
 function $TestSuiteRunner(){return globals.TestSuiteRunner||(typeof TestSuiteRunner=="undefined"?nil:TestSuiteRunner)}
 function $ResultAnnouncement(){return globals.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
 function $ResultAnnouncement(){return globals.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1,$2,$3,$4;
 var $1,$2,$3,$4;
 suite=["fakeError", "fakeErrorFailingInTearDown", "fakeFailure", "testPass"]._collect_((function(each){
 suite=["fakeError", "fakeErrorFailingInTearDown", "fakeFailure", "testPass"]._collect_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return _st(self._class())._selector_(each);
 return _st(self._class())._selector_(each);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -589,7 +589,7 @@ $ctx1.sendIdx["result"]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 assertBlock=self._async_((function(){
 assertBlock=self._async_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 $1=self._selectorSetOf_(_st(result)._errors());
 $1=self._selectorSetOf_(_st(result)._errors());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -611,10 +611,10 @@ return self._finished();
 }));
 }));
 _st(_st(runner)._announcer())._on_do_($ResultAnnouncement(),(function(ann){
 _st(_st(runner)._announcer())._on_do_($ResultAnnouncement(),(function(ann){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 $3=_st(_st(ann)._result()).__eq_eq(result);
 $3=_st(_st(ann)._result()).__eq_eq(result);
-if(smalltalk.assert($3)){
+if($vm.assert($3)){
 $4=_st(_st(result)._runs()).__eq(_st(result)._total());
 $4=_st(_st(result)._runs()).__eq(_st(result)._total());
 return _st($4)._ifTrue_(assertBlock);
 return _st($4)._ifTrue_(assertBlock);
 };
 };
@@ -637,19 +637,19 @@ messageSends: ["collect:", "selector:", "class", "on:", "timeout:", "result", "a
 }),
 }),
 globals.SUnitAsyncTest);
 globals.SUnitAsyncTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "testAsyncNeedsTimeout",
 selector: "testAsyncNeedsTimeout",
 protocol: 'tests',
 protocol: 'tests',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
 function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._should_raise_((function(){
 self._should_raise_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self._async_((function(){
 return self._async_((function(){
 
 
@@ -664,7 +664,7 @@ $ctx2.sendIdx["async:"]=1;
 self._timeout_((0));
 self._timeout_((0));
 self._shouldnt_raise_((function(){
 self._shouldnt_raise_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self._async_((function(){
 return self._async_((function(){
 
 
@@ -688,19 +688,19 @@ messageSends: ["should:raise:", "async:", "timeout:", "shouldnt:raise:", "finish
 }),
 }),
 globals.SUnitAsyncTest);
 globals.SUnitAsyncTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "testFinishedNeedsTimeout",
 selector: "testFinishedNeedsTimeout",
 protocol: 'tests',
 protocol: 'tests',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
 function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._should_raise_((function(){
 self._should_raise_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self._finished();
 return self._finished();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -713,7 +713,7 @@ $ctx2.sendIdx["finished"]=1;
 self._timeout_((0));
 self._timeout_((0));
 self._shouldnt_raise_((function(){
 self._shouldnt_raise_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return self._finished();
 return self._finished();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -734,14 +734,14 @@ messageSends: ["should:raise:", "finished", "timeout:", "shouldnt:raise:"]
 }),
 }),
 globals.SUnitAsyncTest);
 globals.SUnitAsyncTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "testIsAsyncReturnsCorrectValues",
 selector: "testIsAsyncReturnsCorrectValues",
 protocol: 'tests',
 protocol: 'tests',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1,$2;
 var $1,$2;
 $1=self._isAsync();
 $1=self._isAsync();
@@ -774,20 +774,20 @@ messageSends: ["deny:", "isAsync", "timeout:", "assert:", "finished"]
 }),
 }),
 globals.SUnitAsyncTest);
 globals.SUnitAsyncTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "testPass",
 selector: "testPass",
 protocol: 'tests',
 protocol: 'tests',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self["@flag"]="bad";
 self["@flag"]="bad";
 self._timeout_((10));
 self._timeout_((10));
 self["@flag"]=_st(self._async_((function(){
 self["@flag"]=_st(self._async_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._assert_(true);
 self._assert_(true);
 self._finished();
 self._finished();
@@ -811,8 +811,8 @@ messageSends: ["timeout:", "valueWithTimeout:", "async:", "assert:", "finished"]
 }),
 }),
 globals.SUnitAsyncTest);
 globals.SUnitAsyncTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "testTimeouts",
 selector: "testTimeouts",
 protocol: 'tests',
 protocol: 'tests',
 fn: function (){
 fn: function (){
@@ -822,12 +822,12 @@ function $TestSuiteRunner(){return globals.TestSuiteRunner||(typeof TestSuiteRun
 function $Set(){return globals.Set||(typeof Set=="undefined"?nil:Set)}
 function $Set(){return globals.Set||(typeof Set=="undefined"?nil:Set)}
 function $ResultAnnouncement(){return globals.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
 function $ResultAnnouncement(){return globals.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1,$2,$3;
 var $1,$2,$3;
 suite=["fakeTimeout", "fakeMultipleTimeoutFailing", "fakeMultipleTimeoutPassing", "testPass"]._collect_((function(each){
 suite=["fakeTimeout", "fakeMultipleTimeoutFailing", "fakeMultipleTimeoutPassing", "testPass"]._collect_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 return _st(self._class())._selector_(each);
 return _st(self._class())._selector_(each);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -842,7 +842,7 @@ $ctx1.sendIdx["result"]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 assertBlock=self._async_((function(){
 assertBlock=self._async_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 $1=self._selectorSetOf_(_st(result)._errors());
 $1=self._selectorSetOf_(_st(result)._errors());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -860,10 +860,10 @@ return self._finished();
 }));
 }));
 _st(_st(runner)._announcer())._on_do_($ResultAnnouncement(),(function(ann){
 _st(_st(runner)._announcer())._on_do_($ResultAnnouncement(),(function(ann){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 $2=_st(_st(ann)._result()).__eq_eq(result);
 $2=_st(_st(ann)._result()).__eq_eq(result);
-if(smalltalk.assert($2)){
+if($vm.assert($2)){
 $3=_st(_st(result)._runs()).__eq(_st(result)._total());
 $3=_st(_st(result)._runs()).__eq(_st(result)._total());
 return _st($3)._ifTrue_(assertBlock);
 return _st($3)._ifTrue_(assertBlock);
 };
 };
@@ -886,15 +886,15 @@ messageSends: ["collect:", "selector:", "class", "on:", "timeout:", "result", "a
 }),
 }),
 globals.SUnitAsyncTest);
 globals.SUnitAsyncTest);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "testTwoAsyncPassesWithFinishedOnlyOneIsRun",
 selector: "testTwoAsyncPassesWithFinishedOnlyOneIsRun",
 protocol: 'tests',
 protocol: 'tests',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 var x;
 var x;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 var $1;
 var $1;
 self["@flag"]="bad";
 self["@flag"]="bad";
@@ -902,7 +902,7 @@ self._timeout_((10));
 x=(0);
 x=(0);
 $1=self._async_((function(){
 $1=self._async_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._finished();
 self._finished();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -932,7 +932,7 @@ $ctx1.sendIdx["valueWithTimeout:"]=1;
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self["@flag"]=_st(self._async_((function(){
 self["@flag"]=_st(self._async_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 //>>excludeEnd("ctx");
 self._finished();
 self._finished();
 self["@flag"]="ok";
 self["@flag"]="ok";

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


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


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