Browse Source

smalltalk -> $vm

Herbert Vojčík 9 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){
 var $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.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",
 protocol: 'not yet classified',
 fn: function (){
 var self=this;
 var result;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 result=(0)._tinyBenchmarks();
 _st(console)._log_("0 tinyBenchmarks => ".__comma(result));
@@ -32,18 +32,18 @@ messageSends: ["tinyBenchmarks", "log:", ","]
 }),
 globals.Benchfib.klass);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "benchFib",
 protocol: '*Benchfib',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $2,$5,$4,$3,$1;
 $2=self.__lt((2));
-if(smalltalk.assert($2)){
+if($vm.assert($2)){
 $1=(1);
 } else {
 $5=self.__minus((1));
@@ -74,8 +74,8 @@ messageSends: ["ifTrue:ifFalse:", "<", "+", "benchFib", "-"]
 }),
 globals.Number);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "benchmark",
 protocol: '*Benchfib',
 fn: function (){
@@ -83,13 +83,13 @@ var self=this;
 var size,flags,prime,k,count;
 function $Array(){return globals.Array||(typeof Array=="undefined"?nil:Array)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1,$2;
 size=(8190);
 (1)._to_do_(self,(function(iter){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 count=(0);
 count;
@@ -97,7 +97,7 @@ flags=_st($Array())._new();
 flags;
 _st(size)._timesRepeat_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 return _st(flags)._add_(true);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -106,10 +106,10 @@ return _st(flags)._add_(true);
 }));
 return (1)._to_do_(size,(function(i){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 $1=_st(flags)._at_(i);
-if(smalltalk.assert($1)){
+if($vm.assert($1)){
 prime=_st(i).__plus((1));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx3.sendIdx["+"]=1;
@@ -122,7 +122,7 @@ $ctx3.sendIdx["+"]=2;
 k;
 _st((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx4) {
+return $vm.withContext(function($ctx4) {
 //>>excludeEnd("ctx");
 return _st(k).__lt_eq(size);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -130,7 +130,7 @@ return _st(k).__lt_eq(size);
 //>>excludeEnd("ctx");
 }))._whileTrue_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx4) {
+return $vm.withContext(function($ctx4) {
 //>>excludeEnd("ctx");
 _st(flags)._at_put_(k,false);
 k=_st(k).__plus(prime);
@@ -171,14 +171,14 @@ messageSends: ["to:do:", "new", "timesRepeat:", "add:", "ifTrue:", "at:", "+", "
 }),
 globals.Number);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "jsbenchFib",
 protocol: '*Benchfib',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 if (this < 2) {
 return 1;
@@ -198,14 +198,14 @@ messageSends: []
 }),
 globals.Number);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "jsbenchmark",
 protocol: '*Benchfib',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 
 var size = 8190;
@@ -243,8 +243,8 @@ messageSends: []
 }),
 globals.Number);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "jstinyBenchmarks",
 protocol: '*Benchfib',
 fn: function (){
@@ -252,17 +252,17 @@ var self=this;
 var t1,t2,r,n1,n2;
 function $Date(){return globals.Date||(typeof Date=="undefined"?nil:Date)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $7,$6,$5,$4,$3,$2,$1;
 n1=(1);
 _st((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 t1=_st($Date())._millisecondsToRun_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 return _st(n1)._jsbenchmark();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -282,7 +282,7 @@ $ctx2.sendIdx["<"]=1;
 //>>excludeEnd("ctx");
 }))._whileTrue_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 n1=_st(n1).__star((2));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -299,11 +299,11 @@ $ctx1.sendIdx["whileTrue:"]=1;
 n2=(28);
 _st((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 t2=_st($Date())._millisecondsToRun_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 r=_st(n2)._jsbenchFib();
 return r;
@@ -318,7 +318,7 @@ return _st(t2).__lt((1000));
 //>>excludeEnd("ctx");
 }))._whileTrue_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 n2=_st(n2).__plus((1));
 return n2;
@@ -365,8 +365,8 @@ messageSends: ["whileTrue:", "millisecondsToRun:", "jsbenchmark", "<", "*", "jsb
 }),
 globals.Number);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "tinyBenchmarks",
 protocol: '*Benchfib',
 fn: function (){
@@ -374,17 +374,17 @@ var self=this;
 var t1,t2,r,n1,n2;
 function $Date(){return globals.Date||(typeof Date=="undefined"?nil:Date)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $7,$6,$5,$4,$3,$2,$1;
 n1=(1);
 _st((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 t1=_st($Date())._millisecondsToRun_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 return _st(n1)._benchmark();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -404,7 +404,7 @@ $ctx2.sendIdx["<"]=1;
 //>>excludeEnd("ctx");
 }))._whileTrue_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 n1=_st(n1).__star((2));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -421,11 +421,11 @@ $ctx1.sendIdx["whileTrue:"]=1;
 n2=(16);
 _st((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 t2=_st($Date())._millisecondsToRun_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 r=_st(n2)._benchFib();
 return r;
@@ -440,7 +440,7 @@ return _st(t2).__lt((1000));
 //>>excludeEnd("ctx");
 }))._whileTrue_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 n2=_st(n2).__plus((1));
 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){
 var $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.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);
 globals.CompilerError.comment="I am the common superclass of all compiling errors.";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('ParseError', globals.CompilerError, [], 'Compiler-Exceptions');
+$vm.addClass('ParseError', globals.CompilerError, [], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ParseError.comment="Instance of ParseError are signaled on any parsing error.\x0aSee `Smalltalk >> #parse:`";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('SemanticError', globals.CompilerError, [], 'Compiler-Exceptions');
+$vm.addClass('SemanticError', globals.CompilerError, [], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.SemanticError.comment="I represent an abstract semantic error thrown by the SemanticAnalyzer.\x0aSemantic errors can be unknown variable errors, etc.\x0aSee my subclasses for concrete errors.\x0a\x0aThe IDE should catch instances of Semantic error to deal with them when compiling";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('InliningError', globals.SemanticError, [], 'Compiler-Exceptions');
+$vm.addClass('InliningError', globals.SemanticError, [], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.InliningError.comment="Instances of InliningError are signaled when using an `InliningCodeGenerator`in a `Compiler`.";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('InvalidAssignmentError', globals.SemanticError, ['variableName'], 'Compiler-Exceptions');
+$vm.addClass('InvalidAssignmentError', globals.SemanticError, ['variableName'], 'Compiler-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.InvalidAssignmentError.comment="I get signaled when a pseudo variable gets assigned.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "messageText",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
 $1=" Invalid assignment to variable: ".__comma(self._variableName());
@@ -57,8 +57,8 @@ messageSends: [",", "variableName"]
 }),
 globals.InvalidAssignmentError);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "variableName",
 protocol: 'accessing',
 fn: function (){
@@ -77,8 +77,8 @@ messageSends: []
 }),
 globals.InvalidAssignmentError);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "variableName:",
 protocol: 'accessing',
 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);
 globals.ShadowingVariableError.comment="I get signaled when a variable in a block or method scope shadows a variable of the same name in an outer scope.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "messageText",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
 $1=_st("Variable shadowing error: ".__comma(self._variableName())).__comma(" is already defined");
@@ -130,8 +130,8 @@ messageSends: [",", "variableName"]
 }),
 globals.ShadowingVariableError);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "variableName",
 protocol: 'accessing',
 fn: function (){
@@ -150,8 +150,8 @@ messageSends: []
 }),
 globals.ShadowingVariableError);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "variableName:",
 protocol: 'accessing',
 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);
 globals.UnknownVariableError.comment="I get signaled when a variable is not defined.\x0aThe default behavior is to allow it, as this is how Amber currently is able to seamlessly send messages to JavaScript objects.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "messageText",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
 $1=_st("Unknown Variable error: ".__comma(self._variableName())).__comma(" is not defined");
@@ -203,8 +203,8 @@ messageSends: [",", "variableName"]
 }),
 globals.UnknownVariableError);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "variableName",
 protocol: 'accessing',
 fn: function (){
@@ -223,8 +223,8 @@ messageSends: []
 }),
 globals.UnknownVariableError);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "variableName:",
 protocol: 'accessing',
 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);
 globals.RethrowErrorHandler.comment="This class is used in the commandline version of the compiler.\x0aIt uses the handleError: message of ErrorHandler for printing the stacktrace and throws the error again as JS exception.\x0aAs a result Smalltalk errors are not swallowd by the Amber runtime and compilation can be aborted.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "basicSignal:",
 protocol: 'error handling',
 fn: function (anError){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 throw anError;
 return self;
@@ -272,14 +272,14 @@ messageSends: []
 }),
 globals.RethrowErrorHandler);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "handleError:",
 protocol: 'error handling',
 fn: function (anError){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self._basicSignal_(anError);
 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
 	anIRVariable variable name = 'thisContext'
-		ifTrue: [ self stream nextPutAll: 'smalltalk.getThisContext()' ]
+		ifTrue: [ self stream nextPutAll: '$vm.getThisContext()' ]
 		ifFalse: [ self stream nextPutAll: anIRVariable variable alias ]
 !
 
@@ -1122,7 +1122,7 @@ nextPutBlockContextFor: anIRClosure during: aBlock
 	self
 		nextPutAll: '//>>excludeStart("ctx", pragmas.excludeDebugContexts);';
 		lf;
-		nextPutAll: 'return smalltalk.withContext(function(', anIRClosure scope alias, ') {';
+		nextPutAll: 'return $vm.withContext(function(', anIRClosure scope alias, ') {';
 		lf;
 		nextPutAll: '//>>excludeEnd("ctx");';
 		lf.
@@ -1183,7 +1183,7 @@ nextPutContextFor: aMethod during: aBlock
 	self
 		nextPutAll: '//>>excludeStart("ctx", pragmas.excludeDebugContexts);';
 		lf;
-		nextPutAll: 'return smalltalk.withContext(function(', aMethod scope alias, ') { ';
+		nextPutAll: 'return $vm.withContext(function(', aMethod scope alias, ') { ';
 		lf;
 		nextPutAll: '//>>excludeEnd("ctx");';
 		lf.
@@ -1243,7 +1243,7 @@ nextPutIfElse: aBlock with: ifBlock with: elseBlock
 
 nextPutMethodDeclaration: aMethod with: aBlock
 	stream
-		nextPutAll: 'smalltalk.method({'; lf;
+		nextPutAll: '$vm.method({'; lf;
 		nextPutAll: 'selector: ', aMethod selector asJavascript, ','; lf;
 		nextPutAll: 'source: ', aMethod source asJavascript, ',';lf.
 	aBlock value.
@@ -1300,7 +1300,7 @@ nextPutSendIndexFor: anIRSend
 
 nextPutSequenceWith: aBlock
 	"stream
-		nextPutAll: 'switch(smalltalk.thisContext.pc){'; lf."
+		nextPutAll: 'switch($vm.thisContext.pc){'; lf."
 	aBlock value.
 	"stream
 		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
 	self stream nextPutIf: [
-		self stream nextPutAll: '!! smalltalk.assert('.
+		self stream nextPutAll: '!!$vm.assert('.
 		self visit: anIRInlinedIfFalse instructions first.
 		self stream nextPutAll: ')' ]
 		with: [ self visit: anIRInlinedIfFalse instructions last ]
@@ -288,7 +288,7 @@ visitIRInlinedIfNilIfNotNil: anIRInlinedIfNilIfNotNil
 
 visitIRInlinedIfTrue: anIRInlinedIfTrue
 	self stream nextPutIf: [
-		self stream nextPutAll: 'smalltalk.assert('.
+		self stream nextPutAll: '$vm.assert('.
 		self visit: anIRInlinedIfTrue instructions first.
 		self stream nextPutAll: ')' ]
 		with: [ self visit: anIRInlinedIfTrue instructions last ]
@@ -297,7 +297,7 @@ visitIRInlinedIfTrue: anIRInlinedIfTrue
 visitIRInlinedIfTrueIfFalse: anIRInlinedIfTrueIfFalse
 	self stream
 		nextPutIfElse: [
-			self stream nextPutAll: 'smalltalk.assert('.
+			self stream nextPutAll: '$vm.assert('.
 			self visit: anIRInlinedIfTrueIfFalse instructions first.
 			self stream nextPutAll: ')' ]
 		with: [ self visit: anIRInlinedIfTrueIfFalse instructions second ]
@@ -523,7 +523,7 @@ I inline message sends together with assignments by moving them around into the
 
 Will produce:
 
-	if(smalltalk.assert(true) {
+	if($vm.assert(true) {
 		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){
 var $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.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);
 globals.Counter.comment="This is a trivial Widget example mimicking the classic Counter example in Seaside.\x0aIn order to play with it, just evaluate the doit below in a workspace.\x0aThen take a look in the HTML document above the IDE.\x0a\x0a\x09\x09Counter tryExample";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "decrease",
 protocol: 'actions',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self["@count"]=_st(self["@count"]).__minus((1));
 _st(self["@header"])._contents_((function(html){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 return _st(html)._with_(_st(self["@count"])._asString());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -41,19 +41,19 @@ messageSends: ["-", "contents:", "with:", "asString"]
 }),
 globals.Counter);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "increase",
 protocol: 'actions',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self["@count"]=_st(self["@count"]).__plus((1));
 _st(self["@header"])._contents_((function(html){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 return _st(html)._with_(_st(self["@count"])._asString());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -74,14 +74,14 @@ messageSends: ["+", "contents:", "with:", "asString"]
 }),
 globals.Counter);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "initialize",
 protocol: 'initialization',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 (
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -106,14 +106,14 @@ messageSends: ["initialize"]
 }),
 globals.Counter);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "renderOn:",
 protocol: 'rendering',
 fn: function (html){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1,$2,$3,$4,$5,$6;
 $1=_st(html)._h1();
@@ -133,7 +133,7 @@ $ctx1.sendIdx["with:"]=2;
 //>>excludeEnd("ctx");
 $4=_st($3)._onClick_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 return self._increase();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -147,7 +147,7 @@ $5=_st(html)._button();
 _st($5)._with_("--");
 $6=_st($5)._onClick_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 return self._decrease();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -169,14 +169,14 @@ messageSends: ["with:", "h1", "asString", "yourself", "button", "onClick:", "inc
 globals.Counter);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "tryExample",
 protocol: 'example',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 _st(self._new())._appendToJQuery_("body"._asJQuery());
 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){
 var $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.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);
 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");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "announcementClass",
 protocol: 'accessing',
 fn: function (){
@@ -28,8 +28,8 @@ messageSends: []
 }),
 globals.AnnouncementSubscription);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "announcementClass:",
 protocol: 'accessing',
 fn: function (aClass){
@@ -47,14 +47,14 @@ messageSends: []
 }),
 globals.AnnouncementSubscription);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "block",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
 self._deprecatedAPI();
@@ -73,14 +73,14 @@ messageSends: ["deprecatedAPI", "valuable"]
 }),
 globals.AnnouncementSubscription);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "block:",
 protocol: 'accessing',
 fn: function (aValuable){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self._deprecatedAPI();
 self._valuable_(aValuable);
@@ -98,18 +98,18 @@ messageSends: ["deprecatedAPI", "valuable:"]
 }),
 globals.AnnouncementSubscription);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "deliver:",
 protocol: 'announcing',
 fn: function (anAnnouncement){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
 $1=self._handlesAnnouncement_(anAnnouncement);
-if(smalltalk.assert($1)){
+if($vm.assert($1)){
 _st(self._valuable())._value_(anAnnouncement);
 };
 return self;
@@ -126,15 +126,15 @@ messageSends: ["ifTrue:", "handlesAnnouncement:", "value:", "valuable"]
 }),
 globals.AnnouncementSubscription);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "handlesAnnouncement:",
 protocol: 'announcing',
 fn: function (anAnnouncement){
 var self=this;
 function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $3,$4,$2,$1,$receiver;
 $3=_st($Smalltalk())._globals();
@@ -170,14 +170,14 @@ messageSends: ["ifNil:ifNotNil:", "at:", "globals", "name", "announcementClass",
 }),
 globals.AnnouncementSubscription);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "receiver",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
 $1=_st(self._valuable())._receiver();
@@ -195,8 +195,8 @@ messageSends: ["receiver", "valuable"]
 }),
 globals.AnnouncementSubscription);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "valuable",
 protocol: 'accessing',
 fn: function (){
@@ -215,8 +215,8 @@ messageSends: []
 }),
 globals.AnnouncementSubscription);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "valuable:",
 protocol: 'accessing',
 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);
 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");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "receiver",
 protocol: 'accessing',
 fn: function (){
@@ -260,8 +260,8 @@ messageSends: []
 }),
 globals.AnnouncementValuable);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "receiver:",
 protocol: 'accessing',
 fn: function (anObject){
@@ -279,8 +279,8 @@ messageSends: []
 }),
 globals.AnnouncementValuable);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "valuable",
 protocol: 'accessing',
 fn: function (){
@@ -299,8 +299,8 @@ messageSends: []
 }),
 globals.AnnouncementValuable);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "valuable:",
 protocol: 'accessing',
 fn: function (anObject){
@@ -318,14 +318,14 @@ messageSends: []
 }),
 globals.AnnouncementValuable);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "value",
 protocol: 'evaluating',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
 $1=_st(self._valuable())._value();
@@ -343,14 +343,14 @@ messageSends: ["value", "valuable"]
 }),
 globals.AnnouncementValuable);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "value:",
 protocol: 'evaluating',
 fn: function (anObject){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
 $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);
 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");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "announce:",
 protocol: 'announcing',
 fn: function (anAnnouncement){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 _st(self["@subscriptions"])._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 return _st(each)._deliver_(anAnnouncement);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -406,15 +406,15 @@ messageSends: ["do:", "deliver:"]
 }),
 globals.Announcer);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "initialize",
 protocol: 'initialization',
 fn: function (){
 var self=this;
 function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 (
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -439,14 +439,14 @@ messageSends: ["initialize", "new"]
 }),
 globals.Announcer);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "on:do:",
 protocol: 'subscribing',
 fn: function (aClass,aBlock){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self._on_do_for_(aClass,aBlock,nil);
 return self;
@@ -463,8 +463,8 @@ messageSends: ["on:do:for:"]
 }),
 globals.Announcer);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "on:do:for:",
 protocol: 'subscribing',
 fn: function (aClass,aBlock,aReceiver){
@@ -472,7 +472,7 @@ var self=this;
 function $AnnouncementSubscription(){return globals.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
 function $AnnouncementValuable(){return globals.AnnouncementValuable||(typeof AnnouncementValuable=="undefined"?nil:AnnouncementValuable)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1,$3,$4,$6,$7,$5,$8,$2;
 $1=self["@subscriptions"];
@@ -511,8 +511,8 @@ messageSends: ["add:", "valuable:", "new", "receiver:", "yourself", "announcemen
 }),
 globals.Announcer);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "on:doOnce:",
 protocol: 'subscribing',
 fn: function (aClass,aBlock){
@@ -520,7 +520,7 @@ var self=this;
 var subscription;
 function $AnnouncementSubscription(){return globals.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1,$2;
 $1=_st($AnnouncementSubscription())._new();
@@ -529,7 +529,7 @@ $2=_st($1)._yourself();
 subscription=$2;
 _st(subscription)._valuable_((function(ann){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 _st(self["@subscriptions"])._remove_(subscription);
 return _st(aBlock)._value_(ann);
@@ -552,8 +552,8 @@ messageSends: ["announcementClass:", "new", "yourself", "valuable:", "remove:",
 }),
 globals.Announcer);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "on:send:to:",
 protocol: 'subscribing',
 fn: function (aClass,aSelector,anObject){
@@ -561,7 +561,7 @@ var self=this;
 function $AnnouncementSubscription(){return globals.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
 function $MessageSend(){return globals.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1,$3,$4,$6,$7,$5,$8,$2;
 $1=self["@subscriptions"];
@@ -597,18 +597,18 @@ messageSends: ["add:", "valuable:", "new", "receiver:", "selector:", "yourself",
 }),
 globals.Announcer);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "unsubscribe:",
 protocol: 'subscribing',
 fn: function (anObject){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self["@subscriptions"]=_st(self["@subscriptions"])._reject_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 return _st(_st(each)._receiver()).__eq(anObject);
 //>>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);
 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");
 
 globals.SystemAnnouncer.klass.iVarNames = ['current'];
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "current",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $2,$1,$receiver;
 $2=self["@current"];
@@ -675,14 +675,14 @@ messageSends: ["ifNil:", "new"]
 }),
 globals.SystemAnnouncer.klass);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "new",
 protocol: 'instance creation',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self._shouldNotImplement();
 return self;
@@ -700,13 +700,13 @@ messageSends: ["shouldNotImplement"]
 globals.SystemAnnouncer.klass);
 
 
-smalltalk.addClass('SystemAnnouncement', globals.Object, [], 'Kernel-Announcements');
+$vm.addClass('SystemAnnouncement', globals.Object, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.SystemAnnouncement.comment="I am the superclass of all system announcements";
 //>>excludeEnd("ide");
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "heliosClass",
 protocol: 'helios',
 fn: function (){
@@ -724,12 +724,12 @@ messageSends: []
 globals.SystemAnnouncement.klass);
 
 
-smalltalk.addClass('ClassAnnouncement', globals.SystemAnnouncement, ['theClass'], 'Kernel-Announcements');
+$vm.addClass('ClassAnnouncement', globals.SystemAnnouncement, ['theClass'], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ClassAnnouncement.comment="I am the abstract superclass of class-related announcements.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "theClass",
 protocol: 'accessing',
 fn: function (){
@@ -748,8 +748,8 @@ messageSends: []
 }),
 globals.ClassAnnouncement);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "theClass:",
 protocol: 'accessing',
 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);
 globals.ClassAdded.comment="I am emitted when a class is added to the system.\x0aSee ClassBuilder >> #addSubclassOf:... methods";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('ClassCommentChanged', globals.ClassAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('ClassCommentChanged', globals.ClassAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ClassCommentChanged.comment="I am emitted when the comment of a class changes. (Behavior >> #comment)";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('ClassDefinitionChanged', globals.ClassAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('ClassDefinitionChanged', globals.ClassAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ClassDefinitionChanged.comment="I am emitted when the definition of a class changes.\x0aSee ClassBuilder >> #class:instanceVariableNames:";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('ClassMigrated', globals.ClassAnnouncement, ['oldClass'], 'Kernel-Announcements');
+$vm.addClass('ClassMigrated', globals.ClassAnnouncement, ['oldClass'], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ClassMigrated.comment="I am emitted when a class is migrated.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "oldClass",
 protocol: 'accessing',
 fn: function (){
@@ -811,8 +811,8 @@ messageSends: []
 }),
 globals.ClassMigrated);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "oldClass:",
 protocol: 'accessing',
 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);
 globals.ClassMoved.comment="I am emitted when a class is moved from one package to another.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "oldPackage",
 protocol: 'accessing',
 fn: function (){
@@ -856,8 +856,8 @@ messageSends: []
 }),
 globals.ClassMoved);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "oldPackage:",
 protocol: 'accessing',
 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);
 globals.ClassRemoved.comment="I am emitted when a class is removed.\x0aSee Smalltalk >> #removeClass:";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('ClassRenamed', globals.ClassAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('ClassRenamed', globals.ClassAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ClassRenamed.comment="I am emitted when a class is renamed.\x0aSee ClassBuilder >> #renameClass:to:";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('MethodAnnouncement', globals.SystemAnnouncement, ['method'], 'Kernel-Announcements');
+$vm.addClass('MethodAnnouncement', globals.SystemAnnouncement, ['method'], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.MethodAnnouncement.comment="I am the abstract superclass of method-related announcements.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "method",
 protocol: 'accessing',
 fn: function (){
@@ -913,8 +913,8 @@ messageSends: []
 }),
 globals.MethodAnnouncement);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "method:",
 protocol: 'accessing',
 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);
 globals.MethodAdded.comment="I am emitted when a `CompiledMethod` is added to a class.";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('MethodModified', globals.MethodAnnouncement, ['oldMethod'], 'Kernel-Announcements');
+$vm.addClass('MethodModified', globals.MethodAnnouncement, ['oldMethod'], 'Kernel-Announcements');
 //>>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.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "oldMethod",
 protocol: 'accessing',
 fn: function (){
@@ -964,8 +964,8 @@ messageSends: []
 }),
 globals.MethodModified);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "oldMethod:",
 protocol: 'accessing',
 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);
 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");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "oldProtocol",
 protocol: 'accessing',
 fn: function (){
@@ -1009,8 +1009,8 @@ messageSends: []
 }),
 globals.MethodMoved);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "oldProtocol:",
 protocol: 'accessing',
 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);
 globals.MethodRemoved.comment="I am emitted when a `CompiledMethod` is removed from a class.";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('PackageAnnouncement', globals.SystemAnnouncement, ['package'], 'Kernel-Announcements');
+$vm.addClass('PackageAnnouncement', globals.SystemAnnouncement, ['package'], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.PackageAnnouncement.comment="I am the abstract superclass of package-related announcements.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "package",
 protocol: 'accessing',
 fn: function (){
@@ -1060,8 +1060,8 @@ messageSends: []
 }),
 globals.PackageAnnouncement);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "package:",
 protocol: 'accessing',
 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);
 globals.PackageAdded.comment="I am emitted when a `Package` is added to the system.";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('PackageClean', globals.PackageAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('PackageClean', globals.PackageAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.PackageClean.comment="I am emitted when a package is committed and becomes clean.";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('PackageDirty', globals.PackageAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('PackageDirty', globals.PackageAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.PackageDirty.comment="I am emitted when a package becomes dirty.";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('PackageRemoved', globals.PackageAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('PackageRemoved', globals.PackageAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.PackageRemoved.comment="I am emitted when a `Package` is removed from the system.";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('ProtocolAnnouncement', globals.SystemAnnouncement, ['theClass', 'protocol'], 'Kernel-Announcements');
+$vm.addClass('ProtocolAnnouncement', globals.SystemAnnouncement, ['theClass', 'protocol'], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ProtocolAnnouncement.comment="I am the abstract superclass of protocol-related announcements.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "package",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 function $Package(){return globals.Package||(typeof Package=="undefined"?nil:Package)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $2,$1,$3,$4;
 $2=self._protocol();
@@ -1125,7 +1125,7 @@ $2=self._protocol();
 $ctx1.sendIdx["protocol"]=1;
 //>>excludeEnd("ctx");
 $1=_st($2)._beginsWith_("*");
-if(! smalltalk.assert($1)){
+if(!$vm.assert($1)){
 $3=_st(self._theClass())._package();
 return $3;
 };
@@ -1147,8 +1147,8 @@ messageSends: ["ifFalse:", "beginsWith:", "protocol", "package", "theClass", "na
 }),
 globals.ProtocolAnnouncement);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "protocol",
 protocol: 'accessing',
 fn: function (){
@@ -1167,8 +1167,8 @@ messageSends: []
 }),
 globals.ProtocolAnnouncement);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "protocol:",
 protocol: 'accessing',
 fn: function (aString){
@@ -1186,8 +1186,8 @@ messageSends: []
 }),
 globals.ProtocolAnnouncement);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "theClass",
 protocol: 'accessing',
 fn: function (){
@@ -1206,8 +1206,8 @@ messageSends: []
 }),
 globals.ProtocolAnnouncement);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "theClass:",
 protocol: 'accessing',
 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);
 globals.ProtocolAdded.comment="I am emitted when a protocol is added to a class.";
 //>>excludeEnd("ide");
 
 
-smalltalk.addClass('ProtocolRemoved', globals.ProtocolAnnouncement, [], 'Kernel-Announcements');
+$vm.addClass('ProtocolRemoved', globals.ProtocolAnnouncement, [], 'Kernel-Announcements');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.ProtocolRemoved.comment="I am emitted when a protocol is removed from a class.";
 //>>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
 	"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
@@ -316,11 +316,11 @@ new
 !Behavior methodsFor: 'private'!
 
 basicAddCompiledMethod: aMethod
-	<smalltalk.addMethod(aMethod, self)>
+	<$vm.addMethod(aMethod, self)>
 !
 
 basicRemoveCompiledMethod: aMethod
-	<smalltalk.removeMethod(aMethod,self)>
+	<$vm.removeMethod(aMethod,self)>
 ! !
 
 !Behavior methodsFor: 'testing'!
@@ -712,7 +712,7 @@ installMethod: aCompiledMethod forClass: aBehavior protocol: aString
 
 basicAddSubclassOf: aClass named: aString instanceVariableNames: aCollection package: packageName
 	<
-		smalltalk.addClass(aString, aClass, aCollection, packageName);
+		$vm.addClass(aString, aClass, aCollection, packageName);
 		return globals[aString]
 	>
 !
@@ -728,7 +728,7 @@ basicClass: aClass instanceVariables: aCollection
 !
 
 basicRemoveClass: aClass
-	<smalltalk.removeClass(aClass)>
+	<$vm.removeClass(aClass)>
 !
 
 basicRenameClass: aClass to: aString
@@ -756,7 +756,7 @@ rawRenameClass: aClass to: aString
 !ClassBuilder methodsFor: 'public'!
 
 setupClass: aClass
-	<smalltalk.init(aClass);>
+	<$vm.init(aClass);>
 ! !
 
 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
-	<return smalltalk.st2js(self)>
+	<return $vm.st2js(self)>
 !
 
 asJavascript

+ 101 - 100
src/Kernel-Exceptions.js

@@ -1,21 +1,21 @@
 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 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);
 globals.Error.comment="From the ANSI standard:\x0a\x0aThis protocol describes the behavior of instances of class `Error`.\x0aThese are used to represent error conditions that prevent the normal continuation of processing.\x0aActual error exceptions used by an application may be subclasses of this class.\x0aAs `Error` is explicitly specified to be subclassable, conforming implementations must implement its behavior in a non-fragile manner.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "beHandled",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self.amberHandled = true;
 return self;
@@ -32,14 +32,14 @@ messageSends: []
 }),
 globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "beUnhandled",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self.amberHandled = false;
 return self;
@@ -56,14 +56,14 @@ messageSends: []
 }),
 globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "context",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 return self.context;
 return self;
@@ -80,14 +80,14 @@ messageSends: []
 }),
 globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "initialize",
 protocol: 'initialization',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self._messageText_("Errorclass: ".__comma(_st(self._class())._name()));
 return self;
@@ -104,14 +104,14 @@ messageSends: ["messageText:", ",", "name", "class"]
 }),
 globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "isSmalltalkError",
 protocol: 'testing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 return self.smalltalkError === true;
 return self;
@@ -128,14 +128,14 @@ messageSends: []
 }),
 globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "jsStack",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 return self.stack;
 return self;
@@ -152,8 +152,8 @@ messageSends: []
 }),
 globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "messageText",
 protocol: 'accessing',
 fn: function (){
@@ -172,8 +172,8 @@ messageSends: []
 }),
 globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "messageText:",
 protocol: 'accessing',
 fn: function (aString){
@@ -191,14 +191,14 @@ messageSends: []
 }),
 globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "resignal",
 protocol: 'signaling',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 
 		self.amberHandled = false;
@@ -218,19 +218,20 @@ messageSends: []
 }),
 globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "signal",
 protocol: 'signaling',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 
 		self.amberHandled = false;
-		self.context = smalltalk.getThisContext(); 
-		self.smalltalkError = true; throw(self)
+		self.context = $vm.getThisContext(); 
+		self.smalltalkError = true;
+		throw self;
 	;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -239,21 +240,21 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "signal\x0a\x09<\x0a\x09\x09self.amberHandled = false;\x0a\x09\x09self.context = smalltalk.getThisContext(); \x0a\x09\x09self.smalltalkError = true; throw(self)\x0a\x09>",
+source: "signal\x0a\x09<\x0a\x09\x09self.amberHandled = false;\x0a\x09\x09self.context = $vm.getThisContext(); \x0a\x09\x09self.smalltalkError = true;\x0a\x09\x09throw self;\x0a\x09>",
 referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: []
 }),
 globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "signal:",
 protocol: 'signaling',
 fn: function (aString){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self._messageText_(aString);
 self._signal();
@@ -271,14 +272,14 @@ messageSends: ["messageText:", "signal"]
 }),
 globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "signalerContext",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
 $1=self._signalerContextFrom_(self._context());
@@ -296,19 +297,19 @@ messageSends: ["signalerContextFrom:", "context"]
 }),
 globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "signalerContextFrom:",
 protocol: 'accessing',
 fn: function (aContext){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $4,$3,$2,$1;
 $1=_st(aContext)._findContextSuchThat_((function(context){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 $4=_st(context)._receiver();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -320,7 +321,7 @@ $ctx2.sendIdx["=="]=1;
 //>>excludeEnd("ctx");
 $2=_st($3)._or_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 return _st(_st(context)._receiver()).__eq_eq(self._class());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -346,14 +347,14 @@ messageSends: ["findContextSuchThat:", "not", "or:", "==", "receiver", "class"]
 }),
 globals.Error);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "wasHandled",
 protocol: 'testing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 return self.amberHandled || false;
 return self;
@@ -371,8 +372,8 @@ messageSends: []
 globals.Error);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "heliosClass",
 protocol: 'helios',
 fn: function (){
@@ -389,14 +390,14 @@ messageSends: []
 }),
 globals.Error.klass);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "signal",
 protocol: 'instance creation',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
 $1=_st(self._new())._signal();
@@ -414,14 +415,14 @@ messageSends: ["signal", "new"]
 }),
 globals.Error.klass);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "signal:",
 protocol: 'instance creation',
 fn: function (aString){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
 $1=_st(self._new())._signal_(aString);
@@ -440,12 +441,12 @@ messageSends: ["signal:", "new"]
 globals.Error.klass);
 
 
-smalltalk.addClass('Halt', globals.Error, [], 'Kernel-Exceptions');
+$vm.addClass('Halt', globals.Error, [], 'Kernel-Exceptions');
 //>>excludeStart("ide", pragmas.excludeIdeData);
 globals.Halt.comment="I am provided to support `Object>>#halt`.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "messageText",
 protocol: 'accessing',
 fn: function (){
@@ -462,19 +463,19 @@ messageSends: []
 }),
 globals.Halt);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "signalerContextFrom:",
 protocol: 'accessing',
 fn: function (aContext){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $4,$3,$2,$1;
 $1=_st(aContext)._findContextSuchThat_((function(context){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx2) {
+return $vm.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 $4=_st(context)._receiver();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -486,11 +487,11 @@ $ctx2.sendIdx["=="]=1;
 //>>excludeEnd("ctx");
 $2=_st($3)._or_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx3) {
+return $vm.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 return _st(_st(_st(context)._receiver()).__eq_eq(self._class()))._or_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx4) {
+return $vm.withContext(function($ctx4) {
 //>>excludeEnd("ctx");
 return _st(_st(_st(context)._method())._selector()).__eq("halt");
 //>>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);
 globals.JavaScriptException.comment="A JavaScriptException is thrown when a non-Smalltalk exception occurs while in the Smalltalk stack.\x0aSee `boot.js` `inContext()` and `BlockClosure >> on:do:`";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "context:",
 protocol: 'accessing',
 fn: function (aMethodContext){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 self.context = aMethodContext;
 return self;
@@ -553,8 +554,8 @@ messageSends: []
 }),
 globals.JavaScriptException);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "exception",
 protocol: 'accessing',
 fn: function (){
@@ -573,8 +574,8 @@ messageSends: []
 }),
 globals.JavaScriptException);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "exception:",
 protocol: 'accessing',
 fn: function (anException){
@@ -592,14 +593,14 @@ messageSends: []
 }),
 globals.JavaScriptException);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "messageText",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 return 'JavaScript exception: ' + self["@exception"].toString();
 return self;
@@ -617,14 +618,14 @@ messageSends: []
 globals.JavaScriptException);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "on:",
 protocol: 'instance creation',
 fn: function (anException){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $2,$3,$1;
 $2=self._new();
@@ -645,14 +646,14 @@ messageSends: ["exception:", "new", "yourself"]
 }),
 globals.JavaScriptException.klass);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "on:context:",
 protocol: 'instance creation',
 fn: function (anException,aMethodContext){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $2,$3,$1;
 $2=self._new();
@@ -675,12 +676,12 @@ messageSends: ["exception:", "new", "context:", "yourself"]
 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);
 globals.MessageNotUnderstood.comment="This exception is provided to support `Object>>doesNotUnderstand:`.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "message",
 protocol: 'accessing',
 fn: function (){
@@ -699,8 +700,8 @@ messageSends: []
 }),
 globals.MessageNotUnderstood);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "message:",
 protocol: 'accessing',
 fn: function (aMessage){
@@ -718,14 +719,14 @@ messageSends: []
 }),
 globals.MessageNotUnderstood);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "messageText",
 protocol: 'accessing',
 fn: function (){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 var $1;
 $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);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "receiver",
 protocol: 'accessing',
 fn: function (){
@@ -766,8 +767,8 @@ messageSends: []
 }),
 globals.MessageNotUnderstood);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "receiver:",
 protocol: 'accessing',
 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);
 globals.NonBooleanReceiver.comment="NonBooleanReceiver exceptions may be thrown when executing inlined methods such as `#ifTrue:` with a non boolean receiver.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "object",
 protocol: 'accessing',
 fn: function (){
@@ -811,8 +812,8 @@ messageSends: []
 }),
 globals.NonBooleanReceiver);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "object:",
 protocol: 'accessing',
 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);
 globals.PackageCommitError.comment="I get signaled when an attempt to commit a package has failed.";
 //>>excludeEnd("ide");

+ 3 - 2
src/Kernel-Exceptions.st

@@ -71,8 +71,9 @@ resignal
 signal
 	<
 		self.amberHandled = false;
-		self.context = smalltalk.getThisContext(); 
-		self.smalltalkError = true; throw(self)
+		self.context = $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
 	aStream
 		lf;
-		nextPutAll: 'smalltalk.addClass(';
+		nextPutAll: '$vm.addClass(';
 		nextPutAll: '''', (self classNameFor: aClass), ''', ';
 		nextPutAll: (self jsClassNameFor: aClass superclass);
 		nextPutAll: ', ['.
@@ -300,8 +300,8 @@ exportMetaDefinitionOf: aClass on: aStream
 
 exportMethod: aMethod on: aStream
 	aStream
-		nextPutAll: 'smalltalk.addMethod(';lf;
-		nextPutAll: 'smalltalk.method({';lf;
+		nextPutAll: '$vm.addMethod(';lf;
+		nextPutAll: '$vm.method({';lf;
 		nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;
 		nextPutAll: 'protocol: ''', aMethod protocol, ''',';lf;
 		nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;
@@ -340,7 +340,7 @@ exportPackage: aPackage on: aStream
 
 exportPackageDefinitionOf: aPackage on: aStream
 	aStream
-		nextPutAll: 'smalltalk.addPackage(';
+		nextPutAll: '$vm.addPackage(';
 		nextPutAll: '''', aPackage name, ''');';
 		lf
 !
@@ -359,7 +359,7 @@ exportPackagePrologueOf: aPackage on: aStream
 
 exportPackageTransportOf: aPackage on: aStream
 	aStream
-		nextPutAll: 'smalltalk.packages[';
+		nextPutAll: '$vm.packages[';
 		nextPutAll: aPackage name asJavascript;
 		nextPutAll: '].transport = ';
 		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
 	<
-		return smalltalk.accessJavaScript(self._jsObject(), aString, anArray);
+		return $vm.accessJavaScript(self._jsObject(), aString, anArray);
 	>
 !
 
@@ -1145,7 +1145,7 @@ globals
 !
 
 includesKey: aKey
-	<return smalltalk.hasOwnProperty(aKey)>
+	<return $vm.hasOwnProperty(aKey)>
 !
 
 parse: aString
@@ -1164,12 +1164,12 @@ pseudoVariableNames
 !
 
 readJSObject: anObject
-	<return smalltalk.readJSObject(anObject)>
+	<return $vm.readJSObject(anObject)>
 !
 
 reservedWords
 	"JavaScript reserved words"
-	<return smalltalk.reservedWords>
+	<return $vm.reservedWords>
 !
 
 settings
@@ -1204,7 +1204,7 @@ defaultAmdNamespace: aString
 !SmalltalkImage methodsFor: 'classes'!
 
 classes
-	<return smalltalk.classes()>
+	<return $vm.classes()>
 !
 
 removeClass: aClass
@@ -1245,7 +1245,7 @@ deleteGlobalJsVariable: aString
 
 globalJsVariables
 	"Array of global JavaScript variables"
-	<return smalltalk.globalJsVariables>
+	<return $vm.globalJsVariables>
 ! !
 
 !SmalltalkImage methodsFor: 'packages'!
@@ -1265,7 +1265,7 @@ createPackage: packageName
 !
 
 packageAt: packageName
-	<return smalltalk.packages[packageName]>
+	<return $vm.packages[packageName]>
 !
 
 packageAt: packageName ifAbsent: aBlock
@@ -1276,8 +1276,8 @@ packages
 	"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
 	"Create and bind a new bare package with given name and return it."
-	<return smalltalk.addPackage(packageName)>
+	<return $vm.addPackage(packageName)>
 !
 
 basicParse: aString
@@ -1325,14 +1325,14 @@ createPackage: packageName properties: aDict
 deleteClass: aClass
 	"Deletes a class by deleting its binding only. Use #removeClass instead"
 	
-	<smalltalk.removeClass(aClass)>
+	<$vm.removeClass(aClass)>
 !
 
 deletePackage: packageName
 	"Deletes a package by deleting its binding, but does not check if it contains classes etc.
 	To remove a package, use #removePackage instead."
 
-	<delete smalltalk.packages[packageName]>
+	<delete $vm.packages[packageName]>
 ! !
 
 !SmalltalkImage methodsFor: 'testing'!
@@ -1374,7 +1374,7 @@ do: aBlock displayingProgress: aString
 !String methodsFor: '*Kernel-Infrastructure'!
 
 asJavaScriptPropertyName
-<return smalltalk.st2prop(self)>
+<return $vm.st2prop(self)>
 !
 
 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
-	<while(!!smalltalk.assert(self._value())) {aBlock._value()}>
+	<while(!!$vm.assert(self._value())) {aBlock._value()}>
 !
 
 whileTrue
@@ -55,13 +55,13 @@ whileTrue
 !
 
 whileTrue: aBlock
-	<while(smalltalk.assert(self._value())) {aBlock._value()}>
+	<while($vm.assert(self._value())) {aBlock._value()}>
 ! !
 
 !BlockClosure methodsFor: 'converting'!
 
 asCompiledMethod: aString
-	<return smalltalk.method({selector:aString, fn:self});>
+	<return $vm.method({selector:aString, fn:self});>
 !
 
 currySelf
@@ -633,7 +633,7 @@ receiver
 selector
 	<
 		if(self.selector) {
-			return smalltalk.js2st(self.selector);
+			return $vm.js2st(self.selector);
 		} else {
 			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;
 		if (hash) return hash;
-		hash=smalltalk.nextId();
+		hash=$vm.nextId();
 		Object.defineProperty(self, 'identityHash', {value:hash});
 		return hash;
 	>
@@ -95,7 +95,7 @@ perform: aString
 !
 
 perform: aString withArguments: aCollection
-	<return smalltalk.send(self, aString._asJavaScriptMethodName(), aCollection)>
+	<return $vm.send(self, aString._asJavaScriptMethodName(), aCollection)>
 ! !
 
 !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){
 var $vm=$boot.vm,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.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);
 globals.ConsoleTranscript.comment="I am a specific transcript emitting to the JavaScript console.\x0a\x0aIf no other transcript is registered, I am the default.";
 //>>excludeEnd("ide");
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "clear",
 protocol: 'printing',
 fn: function (){
@@ -26,8 +26,8 @@ messageSends: []
 }),
 globals.ConsoleTranscript);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "cr",
 protocol: 'printing',
 fn: function (){
@@ -44,8 +44,8 @@ messageSends: []
 }),
 globals.ConsoleTranscript);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "open",
 protocol: 'actions',
 fn: function (){
@@ -62,14 +62,14 @@ messageSends: []
 }),
 globals.ConsoleTranscript);
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "show:",
 protocol: 'printing',
 fn: function (anObject){
 var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 console.log(String(_st(anObject)._asString()));
 return self;
@@ -87,15 +87,15 @@ messageSends: []
 globals.ConsoleTranscript);
 
 
-smalltalk.addMethod(
-smalltalk.method({
+$vm.addMethod(
+$vm.method({
 selector: "initialize",
 protocol: 'initialization',
 fn: function (){
 var self=this;
 function $Transcript(){return globals.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return smalltalk.withContext(function($ctx1) { 
+return $vm.withContext(function($ctx1) { 
 //>>excludeEnd("ctx");
 _st($Transcript())._registerIfNone_(self._new());
 return self;

+ 98 - 98
src/SUnit-Tests.js

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