2
0
Quellcode durchsuchen

Merge branch 'master' into amber-config-used

Conflicts:
	support/amber.js
	support/helios/set.js
Herbert Vojčík vor 10 Jahren
Ursprung
Commit
e58dc2774d

+ 2 - 2
external/amber-cli/package.json

@@ -1,6 +1,6 @@
 {
   "name": "amber-cli",
-  "version": "0.12.1",
+  "version": "0.12.2",
   "description": "An implementation of the Smalltalk language that runs on top of the JS runtime.",
   "homepage": "http://amber-lang.net",
   "keywords": [
@@ -40,7 +40,7 @@
     "grunt-init-amber": "~0.12.0",
     "grunt-init": "~0.3.1",
     "bower": "~1.3.2",
-    "amber-dev": "~0.1.1",
+    "amber-dev": "~0.1.2",
     "grunt-cli": "~0.1.13"
   }
 }

+ 116 - 46
external/amber-cli/src/AmberCli.js

@@ -38,6 +38,23 @@ referencedClasses: []
 }),
 globals.AmberCli.klass);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "config:",
+protocol: 'commands',
+fn: function (args){
+var self=this;
+function $Configurator(){return globals.Configurator||(typeof Configurator=="undefined"?nil:Configurator)}
+return smalltalk.withContext(function($ctx1) { 
+_st(_st($Configurator())._new())._start();
+return self}, function($ctx1) {$ctx1.fill(self,"config:",{args:args},globals.AmberCli.klass)})},
+args: ["args"],
+source: "config: args\x0a\x09Configurator new start",
+messageSends: ["start", "new"],
+referencedClasses: ["Configurator"]
+}),
+globals.AmberCli.klass);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "handleArguments:",
@@ -253,7 +270,100 @@ referencedClasses: []
 globals.AmberCli.klass);
 
 
-smalltalk.addClass('FileServer', globals.Object, ['path', 'http', 'fs', 'url', 'host', 'port', 'basePath', 'util', 'username', 'password', 'fallbackPage'], 'AmberCli');
+smalltalk.addClass('BaseFileManipulator', globals.Object, ['path', 'fs'], 'AmberCli');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "dirname",
+protocol: 'private',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return __dirname;
+return self}, function($ctx1) {$ctx1.fill(self,"dirname",{},globals.BaseFileManipulator)})},
+args: [],
+source: "dirname\x0a\x09<return __dirname>",
+messageSends: [],
+referencedClasses: []
+}),
+globals.BaseFileManipulator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "initialize",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+($ctx1.supercall = true, globals.BaseFileManipulator.superclass.fn.prototype._initialize.apply(_st(self), []));
+$ctx1.supercall = false;
+self["@path"]=_st(require)._value_("path");
+$ctx1.sendIdx["value:"]=1;
+self["@fs"]=_st(require)._value_("fs");
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.BaseFileManipulator)})},
+args: [],
+source: "initialize\x0a\x09super initialize.\x0a\x09path := require value: 'path'.\x0a\x09fs := require value: 'fs'",
+messageSends: ["initialize", "value:"],
+referencedClasses: []
+}),
+globals.BaseFileManipulator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "rootDirname",
+protocol: 'private',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(self["@path"])._join_with_(self._dirname(),"..");
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"rootDirname",{},globals.BaseFileManipulator)})},
+args: [],
+source: "rootDirname\x0a\x09^ path join: self dirname with: '..'",
+messageSends: ["join:with:", "dirname"],
+referencedClasses: []
+}),
+globals.BaseFileManipulator);
+
+
+
+smalltalk.addClass('Configurator', globals.BaseFileManipulator, [], 'AmberCli');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "initialize",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+($ctx1.supercall = true, globals.Configurator.superclass.fn.prototype._initialize.apply(_st(self), []));
+$ctx1.supercall = false;
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.Configurator)})},
+args: [],
+source: "initialize\x0a\x09super initialize",
+messageSends: ["initialize"],
+referencedClasses: []
+}),
+globals.Configurator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "start",
+protocol: 'action',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(require)._value_("amber-dev/lib/config"))._writeConfig_(_st(process)._cwd());
+return self}, function($ctx1) {$ctx1.fill(self,"start",{},globals.Configurator)})},
+args: [],
+source: "start\x0a\x09(require value: 'amber-dev/lib/config')\x0a\x09\x09writeConfig: process cwd",
+messageSends: ["writeConfig:", "value:", "cwd"],
+referencedClasses: []
+}),
+globals.Configurator);
+
+
+
+smalltalk.addClass('FileServer', globals.BaseFileManipulator, ['http', 'url', 'host', 'port', 'basePath', 'util', 'username', 'password', 'fallbackPage'], 'AmberCli');
 globals.FileServer.comment="I am the Amber Smalltalk FileServer.\x0aMy runtime requirement is a functional Node.js executable.\x0a\x0aTo start a FileServer instance on port `4000` use the following code:\x0a\x0a    FileServer new start\x0a\x0aA parameterized instance can be created with the following code:\x0a\x0a    FileServer createServerWithArguments: options\x0a\x0aHere, `options` is an array of commandline style strings each followed by a value e.g. `#('--port', '6000', '--host', '0.0.0.0')`.\x0aA list of all available parameters can be printed to the commandline by passing `--help` as parameter.\x0aSee the `Options` section for further details on how options are mapped to instance methods.\x0a\x0aAfter startup FileServer checks if the directory layout required by Amber is present and logs a warning on absence.\x0a\x0a\x0a## Options\x0a\x0aEach option is of the form `--some-option-string` which is transformed into a selector of the format `someOptionString:`.\x0aThe trailing `--` gets removed, each `-[a-z]` gets transformed into the according uppercase letter, and a `:` is appended to create a selector which takes a single argument.\x0aAfterwards, the selector gets executed on the `FileServer` instance with the value following in the options array as parameter.\x0a\x0a## Adding new commandline parameters\x0a\x0aAdding new commandline parameters to `FileServer` is as easy as adding a new single parameter method to the `accessing` protocol.";
 smalltalk.addMethod(
 smalltalk.method({
@@ -550,14 +660,10 @@ return smalltalk.withContext(function($ctx1) {
 var $1;
 ($ctx1.supercall = true, globals.FileServer.superclass.fn.prototype._initialize.apply(_st(self), []));
 $ctx1.supercall = false;
-self["@path"]=self._require_("path");
-$ctx1.sendIdx["require:"]=1;
 self["@http"]=self._require_("http");
-$ctx1.sendIdx["require:"]=2;
-self["@fs"]=self._require_("fs");
-$ctx1.sendIdx["require:"]=3;
+$ctx1.sendIdx["require:"]=1;
 self["@util"]=self._require_("util");
-$ctx1.sendIdx["require:"]=4;
+$ctx1.sendIdx["require:"]=2;
 self["@url"]=self._require_("url");
 $1=self._class();
 $ctx1.sendIdx["class"]=1;
@@ -568,7 +674,7 @@ self["@password"]=nil;
 self["@fallbackPage"]=nil;
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.FileServer)})},
 args: [],
-source: "initialize\x0a\x09super initialize.\x0a\x09path := self require: 'path'.\x0a\x09http := self require: 'http'.\x0a\x09fs := self require: 'fs'.\x0a\x09util := self require: 'util'.\x0a\x09url := self require: 'url'.\x0a\x09host := self class defaultHost.\x0a\x09port := self class defaultPort.\x0a\x09username := nil.\x0a\x09password := nil.\x0a\x09fallbackPage := nil.",
+source: "initialize\x0a\x09super initialize.\x0a\x09http := self require: 'http'.\x0a\x09util := self require: 'util'.\x0a\x09url := self require: 'url'.\x0a\x09host := self class defaultHost.\x0a\x09port := self class defaultPort.\x0a\x09username := nil.\x0a\x09password := nil.\x0a\x09fallbackPage := nil.",
 messageSends: ["initialize", "require:", "defaultHost", "class", "defaultPort"],
 referencedClasses: []
 }),
@@ -1385,7 +1491,7 @@ referencedClasses: []
 globals.FileServer.klass);
 
 
-smalltalk.addClass('Initer', globals.Object, ['path', 'childProcess', 'nmPath'], 'AmberCli');
+smalltalk.addClass('Initer', globals.BaseFileManipulator, ['childProcess', 'nmPath'], 'AmberCli');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "bowerInstallThenDo:",
@@ -1407,22 +1513,6 @@ referencedClasses: []
 }),
 globals.Initer);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "dirname",
-protocol: 'private',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return __dirname;
-return self}, function($ctx1) {$ctx1.fill(self,"dirname",{},globals.Initer)})},
-args: [],
-source: "dirname\x0a\x09<return __dirname>",
-messageSends: [],
-referencedClasses: []
-}),
-globals.Initer);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "finishMessage",
@@ -1506,13 +1596,11 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
 ($ctx1.supercall = true, globals.Initer.superclass.fn.prototype._initialize.apply(_st(self), []));
 $ctx1.supercall = false;
-self["@path"]=_st(require)._value_("path");
-$ctx1.sendIdx["value:"]=1;
 self["@childProcess"]=_st(require)._value_("child_process");
 self["@nmPath"]=_st(self["@path"])._join_with_(self._rootDirname(),"node_modules");
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.Initer)})},
 args: [],
-source: "initialize\x0a\x09super initialize.\x0a\x09path := require value: 'path'.\x0a\x09childProcess := require value: 'child_process'.\x0a\x09nmPath := path join: self rootDirname with: 'node_modules'",
+source: "initialize\x0a\x09super initialize.\x0a\x09childProcess := require value: 'child_process'.\x0a\x09nmPath := path join: self rootDirname with: 'node_modules'",
 messageSends: ["initialize", "value:", "join:with:", "rootDirname"],
 referencedClasses: []
 }),
@@ -1539,24 +1627,6 @@ referencedClasses: []
 }),
 globals.Initer);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "rootDirname",
-protocol: 'private',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self["@path"])._join_with_(self._dirname(),"..");
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"rootDirname",{},globals.Initer)})},
-args: [],
-source: "rootDirname\x0a\x09^ path join: self dirname with: '..'",
-messageSends: ["join:with:", "dirname"],
-referencedClasses: []
-}),
-globals.Initer);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "start",

+ 47 - 17
external/amber-cli/src/AmberCli.st

@@ -55,6 +55,10 @@ selectorForCommandLineSwitch: aSwitch
 
 !AmberCli class methodsFor: 'commands'!
 
+config: args
+	Configurator new start
+!
+
 help: args
 	Transcript show: 'Available commands'.
 	self commandLineSwitches do: [ :each | console log: each ]
@@ -104,8 +108,47 @@ main
 		ifFalse: [^self handleArguments: args]
 ! !
 
-Object subclass: #FileServer
-	instanceVariableNames: 'path http fs url host port basePath util username password fallbackPage'
+Object subclass: #BaseFileManipulator
+	instanceVariableNames: 'path fs'
+	package: 'AmberCli'!
+
+!BaseFileManipulator methodsFor: 'initialization'!
+
+initialize
+	super initialize.
+	path := require value: 'path'.
+	fs := require value: 'fs'
+! !
+
+!BaseFileManipulator methodsFor: 'private'!
+
+dirname
+	<return __dirname>
+!
+
+rootDirname
+	^ path join: self dirname with: '..'
+! !
+
+BaseFileManipulator subclass: #Configurator
+	instanceVariableNames: ''
+	package: 'AmberCli'!
+
+!Configurator methodsFor: 'action'!
+
+start
+	(require value: 'amber-dev/lib/config')
+		writeConfig: process cwd
+! !
+
+!Configurator methodsFor: 'initialization'!
+
+initialize
+	super initialize
+! !
+
+BaseFileManipulator subclass: #FileServer
+	instanceVariableNames: 'http url host port basePath util username password fallbackPage'
 	package: 'AmberCli'!
 !FileServer commentStamp!
 I am the Amber Smalltalk FileServer.
@@ -191,9 +234,7 @@ checkDirectoryLayout
 
 initialize
 	super initialize.
-	path := self require: 'path'.
 	http := self require: 'http'.
-	fs := self require: 'fs'.
 	util := self require: 'util'.
 	url := self require: 'url'.
 	host := self class defaultHost.
@@ -937,8 +978,8 @@ main
 		^ fileServer start]
 ! !
 
-Object subclass: #Initer
-	instanceVariableNames: 'path childProcess nmPath'
+BaseFileManipulator subclass: #Initer
+	instanceVariableNames: 'childProcess nmPath'
 	package: 'AmberCli'!
 
 !Initer methodsFor: 'action'!
@@ -1030,21 +1071,10 @@ start
 
 initialize
 	super initialize.
-	path := require value: 'path'.
 	childProcess := require value: 'child_process'.
 	nmPath := path join: self rootDirname with: 'node_modules'
 ! !
 
-!Initer methodsFor: 'private'!
-
-dirname
-	<return __dirname>
-!
-
-rootDirname
-	^ path join: self dirname with: '..'
-! !
-
 Object subclass: #NodeTestRunner
 	instanceVariableNames: ''
 	package: 'AmberCli'!

+ 355 - 204
external/amber-cli/support/amber-cli.js

@@ -409,7 +409,6 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 
 		this.__init__ = function () {
 			st.addPackage("Kernel-Objects");
-			st.addPackage("Kernel-Infrastructure");
 			st.wrapClassName("ProtoObject", "Kernel-Objects", SmalltalkProtoObject, undefined, false);
 			st.wrapClassName("Object", "Kernel-Objects", SmalltalkObject, globals.ProtoObject, false);
 			st.wrapClassName("UndefinedObject", "Kernel-Objects", SmalltalkNil, globals.Object, false);
@@ -434,6 +433,7 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 		inherits(SmalltalkClassOrganizer, SmalltalkOrganizer);
 
 		this.__init__ = function () {
+			st.addPackage("Kernel-Infrastructure");
 			st.wrapClassName("Organizer", "Kernel-Infrastructure", SmalltalkOrganizer, globals.Object, false);
 			st.wrapClassName("PackageOrganizer", "Kernel-Infrastructure", SmalltalkPackageOrganizer, globals.Organizer, false);
 			st.wrapClassName("ClassOrganizer", "Kernel-Infrastructure", SmalltalkClassOrganizer, globals.Organizer, false);
@@ -491,8 +491,7 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 
 		function createHandler(selector) {
 			return function() {
-				var args = Array.prototype.slice.call(arguments);
-				return brikz.messageSend.messageNotUnderstood(this, selector, args);
+				return brikz.messageSend.messageNotUnderstood(this, selector, arguments);
 			};
 		}
 
@@ -522,9 +521,6 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 		st.initClass = function(klass) {
 			if(klass.wrapped) {
 				copySuperclass(klass);
-			}
-
-			if(klass.wrapped) {
 				dnu.installHandlers(klass);
 			}
 		};
@@ -594,6 +590,7 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 
 		var org = brikz.ensure("organize");
 		var root = brikz.ensure("root");
+		brikz.ensure("classInit");
 		var nil = root.nil;
 		var rootAsClass = root.rootAsClass;
 		var SmalltalkObject = root.Object;
@@ -621,6 +618,7 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 			globals.ProtoObject.klass.superclass = rootAsClass.klass = globals.Class;
 			addSubclass(globals.ProtoObject.klass);
 
+			st.addPackage("Kernel-Infrastructure");
 			st.wrapClassName("Package", "Kernel-Infrastructure", SmalltalkPackage, globals.Object, false);
 		};
 
@@ -685,6 +683,13 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 			return 'Smalltalk ' + this.className;
 		};
 
+		function wireKlass(klass) {
+			Object.defineProperty(klass.fn.prototype, "klass", {
+				value: klass,
+				enumerable: false, configurable: true, writable: true
+			});
+		}
+
 		function setupClass(klass, spec) {
 			spec = spec || {};
 			klass.iVarNames = spec.iVarNames || [];
@@ -695,10 +700,7 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 				value: Object.create(null),
 				enumerable: false, configurable: true, writable: true
 			});
-			Object.defineProperty(klass.fn.prototype, "klass", {
-				value: klass,
-				enumerable: false, configurable: true, writable: true
-			});
+			wireKlass(klass);
 		}
 
 		/* Add a package to the smalltalk.packages object, creating a new one if needed.
@@ -724,11 +726,9 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 		 A Package is lazily created if it does not exist with given name. */
 
 		st.addClass = function(className, superclass, iVarNames, pkgName) {
-			if (superclass == nil) { superclass = null; }
-
 			// While subclassing nil is allowed, it might be an error, so
 			// warn about it.
-			if (superclass === null) {
+			if (typeof superclass == 'undefined' || superclass == nil) {
 				console.warn('Compiling ' + className + ' as a subclass of `nil`. A dependency might be missing.');
 			}
 			rawAddClass(pkgName, className, superclass, iVarNames, false, null);
@@ -741,6 +741,7 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 				throw new Error("Missing package "+pkgName);
 			}
 
+			if (!superclass || superclass == nil) { superclass = null; }
 			if(globals[className] && globals[className].superclass == superclass) {
 				//            globals[className].superclass = superclass;
 				globals[className].iVarNames = iVarNames || [];
@@ -808,10 +809,7 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 			klass.fn = constructor;
 
 			// The fn property changed. We need to add back the klass property to the prototype
-			Object.defineProperty(klass.fn.prototype, "klass", {
-				value: klass,
-				enumerable: false, configurable: true, writable: true
-			});
+			wireKlass(klass);
 
 			st.initClass(klass);
 		};
@@ -1055,13 +1053,10 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 
 		/* Converts a JavaScript object to valid Smalltalk Object */
 		st.readJSObject = function(js) {
-			var object = js;
-			var readObject = (js.constructor === Object);
-			var readArray = (js.constructor === Array);
+			var readObject = js.constructor === Object;
+			var readArray = js.constructor === Array;
+			var object = readObject ? globals.Dictionary._new() : readArray ? [] : js;
 
-			if(readObject) {
-				object = globals.Dictionary._new();
-			}
 			for(var i in js) {
 				if(readObject) {
 					object._at_put_(i, st.readJSObject(js[i]));
@@ -1195,7 +1190,7 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 			return result;
 		}
 
-		/* Wrap a JavaScript exception in a Smalltalk Exception. 
+		/* Wrap a JavaScript exception in a Smalltalk Exception.
 
 		 In case of a RangeError, stub the stack after 100 contexts to
 		 avoid another RangeError later when the stack is manipulated. */
@@ -1299,7 +1294,7 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 			return receiver._doesNotUnderstand_(
 				globals.Message._new()
 					._selector_(st.convertSelector(selector))
-					._arguments_(args)
+					._arguments_([].slice.call(args))
 			);
 		}
 
@@ -1318,11 +1313,11 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 
 		function callJavaScriptMethod(receiver, selector, args) {
 			var jsSelector = selector._asJavaScriptSelector();
-			var jsProperty = receiver[jsSelector];
-			if(typeof jsProperty === "function" && !/^[A-Z]/.test(jsSelector)) {
-				return jsProperty.apply(receiver, args);
-			} else if(jsProperty !== undefined) {
-				if(args[0]) {
+			if (jsSelector in receiver) {
+				var jsProperty = receiver[jsSelector];
+				if (typeof jsProperty === "function" && !/^[A-Z]/.test(jsSelector)) {
+					return jsProperty.apply(receiver, args);
+				} else if (args.length > 0) {
 					receiver[jsSelector] = args[0];
 					return nil;
 				} else {
@@ -1402,27 +1397,27 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 		};
 	}
 
-    /* Defines asReceiver to be present at load time */
-    /* (logically it belongs more to PrimitiveBrik) */
-    function AsReceiverBrik(brikz, st) {
-
-        var nil = brikz.ensure("root").nil;
-
-        /**
-         * This function is used all over the compiled amber code.
-         * It takes any value (JavaScript or Smalltalk)
-         * and returns a proper Amber Smalltalk receiver.
-         *
-         * null or undefined -> nil,
-         * plain JS object -> wrapped JS object,
-         * otherwise unchanged
-         */
-        this.asReceiver = function (o) {
-            if (o == null) { return nil; }
-            if (o.klass) { return o; }
-            return globals.JSObjectProxy._on_(o);
-        };
-    }
+	/* Defines asReceiver to be present at load time */
+	/* (logically it belongs more to PrimitiveBrik) */
+	function AsReceiverBrik(brikz, st) {
+
+		var nil = brikz.ensure("root").nil;
+
+		/**
+		 * This function is used all over the compiled amber code.
+		 * It takes any value (JavaScript or Smalltalk)
+		 * and returns a proper Amber Smalltalk receiver.
+		 *
+		 * null or undefined -> nil,
+		 * plain JS object -> wrapped JS object,
+		 * otherwise unchanged
+		 */
+		this.asReceiver = function (o) {
+			if (o == null) { return nil; }
+			if (o.klass) { return o; }
+			return globals.JSObjectProxy._on_(o);
+		};
+	}
 
 
 	/* Making smalltalk that can load */
@@ -1477,7 +1472,7 @@ var smalltalk=$boot.vm,nil=$boot.nil,_st=$boot.asReceiver,globals=$boot.globals;
 smalltalk.addPackage('Kernel-Objects');
 smalltalk.packages["Kernel-Objects"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('ProtoObject', globals.nil, [], 'Kernel-Objects');
+smalltalk.addClass('ProtoObject', null, [], 'Kernel-Objects');
 globals.ProtoObject.comment="I implement the basic behavior required for any object in Amber.\x0a\x0aIn most cases, subclassing `ProtoObject` is wrong and `Object` should be used instead. However subclassing `ProtoObject` can be useful in some special cases like proxy implementations.";
 smalltalk.addMethod(
 smalltalk.method({
@@ -18780,31 +18775,6 @@ referencedClasses: []
 }),
 globals.Package);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "isTestPackage",
-protocol: 'testing',
-fn: function (){
-var self=this;
-function $TestCase(){return globals.TestCase||(typeof TestCase=="undefined"?nil:TestCase)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self._classes())._anySatisfy_((function(each){
-return smalltalk.withContext(function($ctx2) {
-return _st(_st(each)._includesBehavior_($TestCase()))._and_((function(){
-return smalltalk.withContext(function($ctx3) {
-return _st(_st(each)._isAbstract())._not();
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"isTestPackage",{},globals.Package)})},
-args: [],
-source: "isTestPackage\x0a\x09^ self classes anySatisfy: [ :each |\x0a\x09\x09(each includesBehavior: TestCase) and: [ \x0a\x09\x09\x09each isAbstract not ] ]",
-messageSends: ["anySatisfy:", "classes", "and:", "includesBehavior:", "not", "isAbstract"],
-referencedClasses: ["TestCase"]
-}),
-globals.Package);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "loadDependencies",
@@ -40946,7 +40916,7 @@ globals.SmalltalkParser = (function() {
   };
 })();
 });
-define("amber_core/SUnit", ["amber/boot", "amber_core/Kernel-Objects", "amber_core/Kernel-Exceptions"], function($boot){
+define("amber_core/SUnit", ["amber/boot", "amber_core/Kernel-Objects", "amber_core/Kernel-Exceptions", "amber_core/Kernel-Classes", "amber_core/Kernel-Infrastructure"], function($boot){
 var smalltalk=$boot.vm,nil=$boot.nil,_st=$boot.asReceiver,globals=$boot.globals;
 smalltalk.addPackage('SUnit');
 smalltalk.packages["SUnit"].transport = {"type":"amd","amdNamespace":"amber_core"};
@@ -42180,6 +42150,49 @@ referencedClasses: []
 }),
 globals.TestSuiteRunner.klass);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "isTestClass",
+protocol: '*SUnit',
+fn: function (){
+var self=this;
+function $TestCase(){return globals.TestCase||(typeof TestCase=="undefined"?nil:TestCase)}
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(self._includesBehavior_($TestCase()))._and_((function(){
+return smalltalk.withContext(function($ctx2) {
+return _st(self._isAbstract())._not();
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"isTestClass",{},globals.Behavior)})},
+args: [],
+source: "isTestClass\x0a\x09^(self includesBehavior: TestCase) and: [ \x0a\x09\x09\x09self isAbstract not ]",
+messageSends: ["and:", "includesBehavior:", "not", "isAbstract"],
+referencedClasses: ["TestCase"]
+}),
+globals.Behavior);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "isTestPackage",
+protocol: '*SUnit',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(self._classes())._anySatisfy_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(each)._isTestClass();
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"isTestPackage",{},globals.Package)})},
+args: [],
+source: "isTestPackage\x0a\x09^ self classes anySatisfy: [ :each | each isTestClass ]",
+messageSends: ["anySatisfy:", "classes", "isTestClass"],
+referencedClasses: []
+}),
+globals.Package);
+
 });
 
 define("amber_core/Kernel-ImportExport", ["amber/boot", "amber_core/Kernel-Objects", "amber_core/Kernel-Infrastructure"], function($boot){
@@ -42769,36 +42782,6 @@ globals.ChunkExporter);
 
 smalltalk.addClass('Exporter', globals.AbstractExporter, [], 'Kernel-ImportExport');
 globals.Exporter.comment="I am responsible for outputting Amber code into a JavaScript string.\x0a\x0aThe generated output is enough to reconstruct the exported data, including Smalltalk source code and other metadata.\x0a\x0a## Use case\x0a\x0aI am typically used to save code outside of the Amber runtime (committing to disk, etc.).";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "classNameFor:",
-protocol: 'convenience',
-fn: function (aClass){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$4,$1;
-$2=_st(aClass)._isMetaclass();
-if(smalltalk.assert($2)){
-$3=_st(_st(aClass)._instanceClass())._name();
-$ctx1.sendIdx["name"]=1;
-$1=_st($3).__comma(".klass");
-} else {
-$4=_st(aClass)._isNil();
-if(smalltalk.assert($4)){
-$1="nil";
-} else {
-$1=_st(aClass)._name();
-};
-};
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass},globals.Exporter)})},
-args: ["aClass"],
-source: "classNameFor: aClass\x0a\x09^ aClass isMetaclass\x0a\x09\x09ifTrue: [ aClass instanceClass name, '.klass' ]\x0a\x09\x09ifFalse: [\x0a\x09\x09\x09aClass isNil\x0a\x09\x09\x09\x09ifTrue: [ 'nil' ]\x0a\x09\x09\x09\x09ifFalse: [ aClass name ] ]",
-messageSends: ["ifTrue:ifFalse:", "isMetaclass", ",", "name", "instanceClass", "isNil"],
-referencedClasses: []
-}),
-globals.Exporter);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "exportDefinitionOf:on:",
@@ -42806,34 +42789,30 @@ protocol: 'output',
 fn: function (aClass,aStream){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$5,$4,$6,$8,$7,$9,$11,$10,$12;
+var $2,$1,$3,$4,$6,$5,$7,$9,$8,$10;
 _st(aStream)._lf();
 $ctx1.sendIdx["lf"]=1;
 _st(aStream)._nextPutAll_("smalltalk.addClass(");
 $ctx1.sendIdx["nextPutAll:"]=1;
-$3=self._classNameFor_(aClass);
-$ctx1.sendIdx["classNameFor:"]=1;
-$2="'".__comma($3);
+$2="'".__comma(self._classNameFor_(aClass));
 $ctx1.sendIdx[","]=2;
 $1=_st($2).__comma("', ");
 $ctx1.sendIdx[","]=1;
 _st(aStream)._nextPutAll_($1);
 $ctx1.sendIdx["nextPutAll:"]=2;
-$5=self._classNameFor_(_st(aClass)._superclass());
-$ctx1.sendIdx["classNameFor:"]=2;
-$4="globals.".__comma($5);
-$ctx1.sendIdx[","]=3;
-_st(aStream)._nextPutAll_($4);
+$3=self._jsClassNameFor_(_st(aClass)._superclass());
+$ctx1.sendIdx["jsClassNameFor:"]=1;
+_st(aStream)._nextPutAll_($3);
 $ctx1.sendIdx["nextPutAll:"]=3;
-$6=_st(aStream)._nextPutAll_(", [");
+$4=_st(aStream)._nextPutAll_(", [");
 $ctx1.sendIdx["nextPutAll:"]=4;
 _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$8="'".__comma(each);
-$ctx2.sendIdx[","]=5;
-$7=_st($8).__comma("'");
+$6="'".__comma(each);
 $ctx2.sendIdx[","]=4;
-return _st(aStream)._nextPutAll_($7);
+$5=_st($6).__comma("'");
+$ctx2.sendIdx[","]=3;
+return _st(aStream)._nextPutAll_($5);
 $ctx2.sendIdx["nextPutAll:"]=5;
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
 return smalltalk.withContext(function($ctx2) {
@@ -42844,30 +42823,28 @@ _st(aStream)._nextPutAll_("], '");
 $ctx1.sendIdx["nextPutAll:"]=7;
 _st(aStream)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
 $ctx1.sendIdx["nextPutAll:"]=8;
-$9=_st(aStream)._nextPutAll_(");");
+$7=_st(aStream)._nextPutAll_(");");
 $ctx1.sendIdx["nextPutAll:"]=9;
-$11=_st(aClass)._comment();
+$9=_st(aClass)._comment();
 $ctx1.sendIdx["comment"]=1;
-$10=_st($11)._notEmpty();
-if(smalltalk.assert($10)){
+$8=_st($9)._notEmpty();
+if(smalltalk.assert($8)){
 _st(aStream)._lf();
 $ctx1.sendIdx["lf"]=2;
-_st(aStream)._nextPutAll_("globals.");
+_st(aStream)._nextPutAll_(self._jsClassNameFor_(aClass));
 $ctx1.sendIdx["nextPutAll:"]=10;
-_st(aStream)._nextPutAll_(self._classNameFor_(aClass));
-$ctx1.sendIdx["nextPutAll:"]=11;
 _st(aStream)._nextPutAll_(".comment=");
-$ctx1.sendIdx["nextPutAll:"]=12;
+$ctx1.sendIdx["nextPutAll:"]=11;
 _st(aStream)._nextPutAll_(_st(_st(aClass)._comment())._asJavascript());
-$ctx1.sendIdx["nextPutAll:"]=13;
-$12=_st(aStream)._nextPutAll_(";");
-$12;
+$ctx1.sendIdx["nextPutAll:"]=12;
+$10=_st(aStream)._nextPutAll_(";");
+$10;
 };
 _st(aStream)._lf();
 return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},globals.Exporter)})},
 args: ["aClass", "aStream"],
-source: "exportDefinitionOf: aClass on: aStream\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: 'smalltalk.addClass(';\x0a\x09\x09nextPutAll: '''', (self classNameFor: aClass), ''', ';\x0a\x09\x09nextPutAll: 'globals.', (self classNameFor: aClass superclass);\x0a\x09\x09nextPutAll: ', ['.\x0a\x09aClass instanceVariableNames\x0a\x09\x09do: [ :each | aStream nextPutAll: '''', each, '''' ]\x0a\x09\x09separatedBy: [ aStream nextPutAll: ', ' ].\x0a\x09aStream\x0a\x09\x09nextPutAll: '], ''';\x0a\x09\x09nextPutAll: aClass category, '''';\x0a\x09\x09nextPutAll: ');'.\x0a\x09aClass comment notEmpty ifTrue: [\x0a\x09\x09aStream\x0a\x09\x09\x09lf;\x0a\x09\x09nextPutAll: 'globals.';\x0a\x09\x09nextPutAll: (self classNameFor: aClass);\x0a\x09\x09nextPutAll: '.comment=';\x0a\x09\x09nextPutAll: aClass comment asJavascript;\x0a\x09\x09nextPutAll: ';' ].\x0a\x09aStream lf",
-messageSends: ["lf", "nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "notEmpty", "comment", "asJavascript"],
+source: "exportDefinitionOf: aClass on: aStream\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: 'smalltalk.addClass(';\x0a\x09\x09nextPutAll: '''', (self classNameFor: aClass), ''', ';\x0a\x09\x09nextPutAll: (self jsClassNameFor: aClass superclass);\x0a\x09\x09nextPutAll: ', ['.\x0a\x09aClass instanceVariableNames\x0a\x09\x09do: [ :each | aStream nextPutAll: '''', each, '''' ]\x0a\x09\x09separatedBy: [ aStream nextPutAll: ', ' ].\x0a\x09aStream\x0a\x09\x09nextPutAll: '], ''';\x0a\x09\x09nextPutAll: aClass category, '''';\x0a\x09\x09nextPutAll: ');'.\x0a\x09aClass comment notEmpty ifTrue: [\x0a\x09\x09aStream\x0a\x09\x09\x09lf;\x0a\x09\x09nextPutAll: (self jsClassNameFor: aClass);\x0a\x09\x09nextPutAll: '.comment=';\x0a\x09\x09nextPutAll: aClass comment asJavascript;\x0a\x09\x09nextPutAll: ';' ].\x0a\x09aStream lf",
+messageSends: ["lf", "nextPutAll:", ",", "classNameFor:", "jsClassNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "notEmpty", "comment", "asJavascript"],
 referencedClasses: []
 }),
 globals.Exporter);
@@ -42880,7 +42857,7 @@ fn: function (aClass,aStream){
 var self=this;
 function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$6,$5,$4,$7,$9,$8;
+var $3,$2,$1,$5,$4,$6,$8,$7;
 _st(aStream)._lf();
 $ctx1.sendIdx["lf"]=1;
 $3=_st(aClass)._class();
@@ -42889,23 +42866,21 @@ $2=_st($3)._instanceVariableNames();
 $ctx1.sendIdx["instanceVariableNames"]=1;
 $1=_st($2)._isEmpty();
 if(! smalltalk.assert($1)){
-$6=_st(aClass)._class();
+$5=_st(aClass)._class();
 $ctx1.sendIdx["class"]=2;
-$5=self._classNameFor_($6);
-$4="globals.".__comma($5);
-$ctx1.sendIdx[","]=1;
+$4=self._jsClassNameFor_($5);
 _st(aStream)._nextPutAll_($4);
 $ctx1.sendIdx["nextPutAll:"]=1;
-$7=_st(aStream)._nextPutAll_(".iVarNames = [");
+$6=_st(aStream)._nextPutAll_(".iVarNames = [");
 $ctx1.sendIdx["nextPutAll:"]=2;
-$7;
+$6;
 _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$9="'".__comma(each);
-$ctx2.sendIdx[","]=3;
-$8=_st($9).__comma("'");
+$8="'".__comma(each);
 $ctx2.sendIdx[","]=2;
-return _st(aStream)._nextPutAll_($8);
+$7=_st($8).__comma("'");
+$ctx2.sendIdx[","]=1;
+return _st(aStream)._nextPutAll_($7);
 $ctx2.sendIdx["nextPutAll:"]=3;
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}),(function(){
 return smalltalk.withContext(function($ctx2) {
@@ -42916,8 +42891,8 @@ _st(aStream)._nextPutAll_("];".__comma(_st($String())._lf()));
 };
 return self}, function($ctx1) {$ctx1.fill(self,"exportMetaDefinitionOf:on:",{aClass:aClass,aStream:aStream},globals.Exporter)})},
 args: ["aClass", "aStream"],
-source: "exportMetaDefinitionOf: aClass on: aStream\x0a\x09aStream lf.\x0a\x09aClass class instanceVariableNames isEmpty ifFalse: [\x0a\x09\x09aStream\x0a\x09\x09nextPutAll: 'globals.', (self classNameFor: aClass class);\x0a\x09\x09nextPutAll: '.iVarNames = ['.\x0a\x09\x09aClass class instanceVariableNames\x0a\x09\x09do: [ :each | aStream nextPutAll: '''', each, '''' ]\x0a\x09\x09separatedBy: [ aStream nextPutAll: ',' ].\x0a\x09\x09aStream nextPutAll: '];', String lf ]",
-messageSends: ["lf", "ifFalse:", "isEmpty", "instanceVariableNames", "class", "nextPutAll:", ",", "classNameFor:", "do:separatedBy:"],
+source: "exportMetaDefinitionOf: aClass on: aStream\x0a\x09aStream lf.\x0a\x09aClass class instanceVariableNames isEmpty ifFalse: [\x0a\x09\x09aStream\x0a\x09\x09nextPutAll: (self jsClassNameFor: aClass class);\x0a\x09\x09nextPutAll: '.iVarNames = ['.\x0a\x09\x09aClass class instanceVariableNames\x0a\x09\x09do: [ :each | aStream nextPutAll: '''', each, '''' ]\x0a\x09\x09separatedBy: [ aStream nextPutAll: ',' ].\x0a\x09\x09aStream nextPutAll: '];', String lf ]",
+messageSends: ["lf", "ifFalse:", "isEmpty", "instanceVariableNames", "class", "nextPutAll:", "jsClassNameFor:", "do:separatedBy:", ","],
 referencedClasses: ["String"]
 }),
 globals.Exporter);
@@ -42929,7 +42904,7 @@ protocol: 'output',
 fn: function (aMethod,aStream){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$5,$4,$7,$6,$10,$9,$8,$13,$12,$11,$16,$15,$14,$18,$17,$19;
+var $3,$2,$1,$5,$4,$7,$6,$10,$9,$8,$13,$12,$11,$16,$15,$14,$17,$18;
 _st(aStream)._nextPutAll_("smalltalk.addMethod(");
 $ctx1.sendIdx["nextPutAll:"]=1;
 _st(aStream)._lf();
@@ -42994,9 +42969,7 @@ _st(aStream)._nextPutAll_($14);
 $ctx1.sendIdx["nextPutAll:"]=8;
 _st(aStream)._lf();
 $ctx1.sendIdx["lf"]=8;
-$18="referencedClasses: ".__comma(_st(_st(aMethod)._referencedClasses())._asJavascript());
-$ctx1.sendIdx[","]=13;
-$17=_st(aStream)._nextPutAll_($18);
+$17=_st(aStream)._nextPutAll_("referencedClasses: ".__comma(_st(_st(aMethod)._referencedClasses())._asJavascript()));
 $ctx1.sendIdx["nextPutAll:"]=9;
 _st(aStream)._lf();
 $ctx1.sendIdx["lf"]=9;
@@ -43004,16 +42977,16 @@ _st(aStream)._nextPutAll_("}),");
 $ctx1.sendIdx["nextPutAll:"]=10;
 _st(aStream)._lf();
 $ctx1.sendIdx["lf"]=10;
-_st(aStream)._nextPutAll_("globals.".__comma(self._classNameFor_(_st(aMethod)._methodClass())));
+_st(aStream)._nextPutAll_(self._jsClassNameFor_(_st(aMethod)._methodClass()));
 $ctx1.sendIdx["nextPutAll:"]=11;
 _st(aStream)._nextPutAll_(");");
 _st(aStream)._lf();
 $ctx1.sendIdx["lf"]=11;
-$19=_st(aStream)._lf();
+$18=_st(aStream)._lf();
 return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},globals.Exporter)})},
 args: ["aMethod", "aStream"],
-source: "exportMethod: aMethod on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09\x22nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x22\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'protocol: ''', aMethod protocol, ''',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;\x0a\x09\x09nextPutAll: 'args: ', aMethod arguments asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'source: ', aMethod source asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'messageSends: ', aMethod messageSends asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ', aMethod referencedClasses asJavascript.\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: 'globals.', (self classNameFor: aMethod methodClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
-messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "protocol", "compiledSource", "fn", "arguments", "source", "messageSends", "referencedClasses", "classNameFor:", "methodClass"],
+source: "exportMethod: aMethod on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09\x22nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x22\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'protocol: ''', aMethod protocol, ''',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;\x0a\x09\x09nextPutAll: 'args: ', aMethod arguments asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'source: ', aMethod source asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'messageSends: ', aMethod messageSends asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ', aMethod referencedClasses asJavascript.\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: (self jsClassNameFor: aMethod methodClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
+messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "protocol", "compiledSource", "fn", "arguments", "source", "messageSends", "referencedClasses", "jsClassNameFor:", "methodClass"],
 referencedClasses: []
 }),
 globals.Exporter);
@@ -43146,6 +43119,34 @@ referencedClasses: []
 }),
 globals.Exporter);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "jsClassNameFor:",
+protocol: 'convenience',
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1,$receiver;
+$2=_st(aClass)._isMetaclass();
+if(smalltalk.assert($2)){
+$1=_st(self._jsClassNameFor_(_st(aClass)._instanceClass())).__comma(".klass");
+$ctx1.sendIdx[","]=1;
+} else {
+if(($receiver = aClass) == null || $receiver.isNil){
+$1="null";
+} else {
+$1="globals.".__comma(_st(aClass)._name());
+};
+};
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"jsClassNameFor:",{aClass:aClass},globals.Exporter)})},
+args: ["aClass"],
+source: "jsClassNameFor: aClass\x0a\x09^ aClass isMetaclass\x0a\x09\x09ifTrue: [ (self jsClassNameFor: aClass instanceClass), '.klass' ]\x0a\x09\x09ifFalse: [\x0a\x09\x09\x09aClass\x0a\x09\x09\x09\x09ifNil: [ 'null' ]\x0a\x09\x09\x09\x09ifNotNil: [ 'globals.', aClass name ] ]",
+messageSends: ["ifTrue:ifFalse:", "isMetaclass", ",", "jsClassNameFor:", "instanceClass", "ifNil:ifNotNil:", "name"],
+referencedClasses: []
+}),
+globals.Exporter);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "ownMethodsOfClass:",
@@ -50516,6 +50517,22 @@ globals.ConsoleTranscriptTest);
 
 
 smalltalk.addClass('JSObjectProxyTest', globals.TestCase, [], 'Kernel-Tests');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "jsNull",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return null;
+return self}, function($ctx1) {$ctx1.fill(self,"jsNull",{},globals.JSObjectProxyTest)})},
+args: [],
+source: "jsNull\x0a\x09<return null>",
+messageSends: [],
+referencedClasses: []
+}),
+globals.JSObjectProxyTest);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "jsObject",
@@ -50523,10 +50540,26 @@ protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': void 0};
+return {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': void 0};
 return self}, function($ctx1) {$ctx1.fill(self,"jsObject",{},globals.JSObjectProxyTest)})},
 args: [],
-source: "jsObject\x0a\x09<return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': void 0}>",
+source: "jsObject\x0a\x09<return {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': void 0}>",
+messageSends: [],
+referencedClasses: []
+}),
+globals.JSObjectProxyTest);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "jsUndefined",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return;
+return self}, function($ctx1) {$ctx1.fill(self,"jsUndefined",{},globals.JSObjectProxyTest)})},
+args: [],
+source: "jsUndefined\x0a\x09<return>",
 messageSends: [],
 referencedClasses: []
 }),
@@ -50861,6 +50894,54 @@ referencedClasses: ["MessageNotUnderstood"]
 }),
 globals.JSObjectProxyTest);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "testSetPropertyWithFalsyValue",
+protocol: 'tests',
+fn: function (){
+var self=this;
+var jsObject;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4,$5;
+jsObject=self._jsObject();
+$1=_st(jsObject)._a();
+$ctx1.sendIdx["a"]=1;
+self._assert_equals_($1,(1));
+$ctx1.sendIdx["assert:equals:"]=1;
+_st(jsObject)._a_(self._jsNull());
+$ctx1.sendIdx["a:"]=1;
+$2=_st(jsObject)._a();
+$ctx1.sendIdx["a"]=2;
+self._assert_equals_($2,nil);
+$ctx1.sendIdx["assert:equals:"]=2;
+_st(jsObject)._a_((0));
+$ctx1.sendIdx["a:"]=2;
+$3=_st(jsObject)._a();
+$ctx1.sendIdx["a"]=3;
+self._assert_equals_($3,(0));
+$ctx1.sendIdx["assert:equals:"]=3;
+_st(jsObject)._a_(self._jsUndefined());
+$ctx1.sendIdx["a:"]=3;
+$4=_st(jsObject)._a();
+$ctx1.sendIdx["a"]=4;
+self._assert_equals_($4,nil);
+$ctx1.sendIdx["assert:equals:"]=4;
+_st(jsObject)._a_("");
+$ctx1.sendIdx["a:"]=4;
+$5=_st(jsObject)._a();
+$ctx1.sendIdx["a"]=5;
+self._assert_equals_($5,"");
+$ctx1.sendIdx["assert:equals:"]=5;
+_st(jsObject)._a_(false);
+self._assert_equals_(_st(jsObject)._a(),false);
+return self}, function($ctx1) {$ctx1.fill(self,"testSetPropertyWithFalsyValue",{jsObject:jsObject},globals.JSObjectProxyTest)})},
+args: [],
+source: "testSetPropertyWithFalsyValue\x0a\x09| jsObject |\x0a\x09jsObject := self jsObject.\x0a\x09self assert: (jsObject a) equals: 1.\x0a\x0a\x09jsObject a: self jsNull.\x0a\x09self assert: (jsObject a) equals: nil.\x0a\x09jsObject a: 0.\x0a\x09self assert: (jsObject a) equals: 0.\x0a\x09jsObject a: self jsUndefined.\x0a\x09self assert: (jsObject a) equals: nil.\x0a\x09jsObject a: ''.\x0a\x09self assert: (jsObject a) equals: ''.\x0a\x09jsObject a: false.\x0a\x09self assert: (jsObject a) equals: false",
+messageSends: ["jsObject", "assert:equals:", "a", "a:", "jsNull", "jsUndefined"],
+referencedClasses: []
+}),
+globals.JSObjectProxyTest);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testValue",
@@ -56337,6 +56418,23 @@ referencedClasses: []
 }),
 globals.AmberCli.klass);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "config:",
+protocol: 'commands',
+fn: function (args){
+var self=this;
+function $Configurator(){return globals.Configurator||(typeof Configurator=="undefined"?nil:Configurator)}
+return smalltalk.withContext(function($ctx1) { 
+_st(_st($Configurator())._new())._start();
+return self}, function($ctx1) {$ctx1.fill(self,"config:",{args:args},globals.AmberCli.klass)})},
+args: ["args"],
+source: "config: args\x0a\x09Configurator new start",
+messageSends: ["start", "new"],
+referencedClasses: ["Configurator"]
+}),
+globals.AmberCli.klass);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "handleArguments:",
@@ -56552,7 +56650,100 @@ referencedClasses: []
 globals.AmberCli.klass);
 
 
-smalltalk.addClass('FileServer', globals.Object, ['path', 'http', 'fs', 'url', 'host', 'port', 'basePath', 'util', 'username', 'password', 'fallbackPage'], 'AmberCli');
+smalltalk.addClass('BaseFileManipulator', globals.Object, ['path', 'fs'], 'AmberCli');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "dirname",
+protocol: 'private',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return __dirname;
+return self}, function($ctx1) {$ctx1.fill(self,"dirname",{},globals.BaseFileManipulator)})},
+args: [],
+source: "dirname\x0a\x09<return __dirname>",
+messageSends: [],
+referencedClasses: []
+}),
+globals.BaseFileManipulator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "initialize",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+($ctx1.supercall = true, globals.BaseFileManipulator.superclass.fn.prototype._initialize.apply(_st(self), []));
+$ctx1.supercall = false;
+self["@path"]=_st(require)._value_("path");
+$ctx1.sendIdx["value:"]=1;
+self["@fs"]=_st(require)._value_("fs");
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.BaseFileManipulator)})},
+args: [],
+source: "initialize\x0a\x09super initialize.\x0a\x09path := require value: 'path'.\x0a\x09fs := require value: 'fs'",
+messageSends: ["initialize", "value:"],
+referencedClasses: []
+}),
+globals.BaseFileManipulator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "rootDirname",
+protocol: 'private',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(self["@path"])._join_with_(self._dirname(),"..");
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"rootDirname",{},globals.BaseFileManipulator)})},
+args: [],
+source: "rootDirname\x0a\x09^ path join: self dirname with: '..'",
+messageSends: ["join:with:", "dirname"],
+referencedClasses: []
+}),
+globals.BaseFileManipulator);
+
+
+
+smalltalk.addClass('Configurator', globals.BaseFileManipulator, [], 'AmberCli');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "initialize",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+($ctx1.supercall = true, globals.Configurator.superclass.fn.prototype._initialize.apply(_st(self), []));
+$ctx1.supercall = false;
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.Configurator)})},
+args: [],
+source: "initialize\x0a\x09super initialize",
+messageSends: ["initialize"],
+referencedClasses: []
+}),
+globals.Configurator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "start",
+protocol: 'action',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(require)._value_("amber-dev/lib/config"))._writeConfig_(_st(process)._cwd());
+return self}, function($ctx1) {$ctx1.fill(self,"start",{},globals.Configurator)})},
+args: [],
+source: "start\x0a\x09(require value: 'amber-dev/lib/config')\x0a\x09\x09writeConfig: process cwd",
+messageSends: ["writeConfig:", "value:", "cwd"],
+referencedClasses: []
+}),
+globals.Configurator);
+
+
+
+smalltalk.addClass('FileServer', globals.BaseFileManipulator, ['http', 'url', 'host', 'port', 'basePath', 'util', 'username', 'password', 'fallbackPage'], 'AmberCli');
 globals.FileServer.comment="I am the Amber Smalltalk FileServer.\x0aMy runtime requirement is a functional Node.js executable.\x0a\x0aTo start a FileServer instance on port `4000` use the following code:\x0a\x0a    FileServer new start\x0a\x0aA parameterized instance can be created with the following code:\x0a\x0a    FileServer createServerWithArguments: options\x0a\x0aHere, `options` is an array of commandline style strings each followed by a value e.g. `#('--port', '6000', '--host', '0.0.0.0')`.\x0aA list of all available parameters can be printed to the commandline by passing `--help` as parameter.\x0aSee the `Options` section for further details on how options are mapped to instance methods.\x0a\x0aAfter startup FileServer checks if the directory layout required by Amber is present and logs a warning on absence.\x0a\x0a\x0a## Options\x0a\x0aEach option is of the form `--some-option-string` which is transformed into a selector of the format `someOptionString:`.\x0aThe trailing `--` gets removed, each `-[a-z]` gets transformed into the according uppercase letter, and a `:` is appended to create a selector which takes a single argument.\x0aAfterwards, the selector gets executed on the `FileServer` instance with the value following in the options array as parameter.\x0a\x0a## Adding new commandline parameters\x0a\x0aAdding new commandline parameters to `FileServer` is as easy as adding a new single parameter method to the `accessing` protocol.";
 smalltalk.addMethod(
 smalltalk.method({
@@ -56849,14 +57040,10 @@ return smalltalk.withContext(function($ctx1) {
 var $1;
 ($ctx1.supercall = true, globals.FileServer.superclass.fn.prototype._initialize.apply(_st(self), []));
 $ctx1.supercall = false;
-self["@path"]=self._require_("path");
-$ctx1.sendIdx["require:"]=1;
 self["@http"]=self._require_("http");
-$ctx1.sendIdx["require:"]=2;
-self["@fs"]=self._require_("fs");
-$ctx1.sendIdx["require:"]=3;
+$ctx1.sendIdx["require:"]=1;
 self["@util"]=self._require_("util");
-$ctx1.sendIdx["require:"]=4;
+$ctx1.sendIdx["require:"]=2;
 self["@url"]=self._require_("url");
 $1=self._class();
 $ctx1.sendIdx["class"]=1;
@@ -56867,7 +57054,7 @@ self["@password"]=nil;
 self["@fallbackPage"]=nil;
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.FileServer)})},
 args: [],
-source: "initialize\x0a\x09super initialize.\x0a\x09path := self require: 'path'.\x0a\x09http := self require: 'http'.\x0a\x09fs := self require: 'fs'.\x0a\x09util := self require: 'util'.\x0a\x09url := self require: 'url'.\x0a\x09host := self class defaultHost.\x0a\x09port := self class defaultPort.\x0a\x09username := nil.\x0a\x09password := nil.\x0a\x09fallbackPage := nil.",
+source: "initialize\x0a\x09super initialize.\x0a\x09http := self require: 'http'.\x0a\x09util := self require: 'util'.\x0a\x09url := self require: 'url'.\x0a\x09host := self class defaultHost.\x0a\x09port := self class defaultPort.\x0a\x09username := nil.\x0a\x09password := nil.\x0a\x09fallbackPage := nil.",
 messageSends: ["initialize", "require:", "defaultHost", "class", "defaultPort"],
 referencedClasses: []
 }),
@@ -57684,7 +57871,7 @@ referencedClasses: []
 globals.FileServer.klass);
 
 
-smalltalk.addClass('Initer', globals.Object, ['path', 'childProcess', 'nmPath'], 'AmberCli');
+smalltalk.addClass('Initer', globals.BaseFileManipulator, ['childProcess', 'nmPath'], 'AmberCli');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "bowerInstallThenDo:",
@@ -57706,22 +57893,6 @@ referencedClasses: []
 }),
 globals.Initer);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "dirname",
-protocol: 'private',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return __dirname;
-return self}, function($ctx1) {$ctx1.fill(self,"dirname",{},globals.Initer)})},
-args: [],
-source: "dirname\x0a\x09<return __dirname>",
-messageSends: [],
-referencedClasses: []
-}),
-globals.Initer);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "finishMessage",
@@ -57805,13 +57976,11 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
 ($ctx1.supercall = true, globals.Initer.superclass.fn.prototype._initialize.apply(_st(self), []));
 $ctx1.supercall = false;
-self["@path"]=_st(require)._value_("path");
-$ctx1.sendIdx["value:"]=1;
 self["@childProcess"]=_st(require)._value_("child_process");
 self["@nmPath"]=_st(self["@path"])._join_with_(self._rootDirname(),"node_modules");
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.Initer)})},
 args: [],
-source: "initialize\x0a\x09super initialize.\x0a\x09path := require value: 'path'.\x0a\x09childProcess := require value: 'child_process'.\x0a\x09nmPath := path join: self rootDirname with: 'node_modules'",
+source: "initialize\x0a\x09super initialize.\x0a\x09childProcess := require value: 'child_process'.\x0a\x09nmPath := path join: self rootDirname with: 'node_modules'",
 messageSends: ["initialize", "value:", "join:with:", "rootDirname"],
 referencedClasses: []
 }),
@@ -57838,24 +58007,6 @@ referencedClasses: []
 }),
 globals.Initer);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "rootDirname",
-protocol: 'private',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self["@path"])._join_with_(self._dirname(),"..");
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"rootDirname",{},globals.Initer)})},
-args: [],
-source: "rootDirname\x0a\x09^ path join: self dirname with: '..'",
-messageSends: ["join:with:", "dirname"],
-referencedClasses: []
-}),
-globals.Initer);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "start",

+ 23 - 0
external/amber-dev/lib/config.js

@@ -0,0 +1,23 @@
+/**
+ * Wrapper around amd-config-builder.
+ * Can be used in cli and in grunt task.
+ */
+
+var configBuilder = require('amd-config-builder'),
+    path = require('path'),
+    fs = require('fs');
+
+exports.writeConfig = function (searchDir, fileForConfig) {
+    searchDir = searchDir || path.join(__dirname, '../../..');
+    fileForConfig = fileForConfig || 'config.js';
+
+    configBuilder.produceConfigObject(searchDir, function (err, result) {
+        if (err) throw err;
+        var text = "/* DO NOT EDIT! This file is generated. */\n" +
+            "\n" +
+            "require.config(" + JSON.stringify(result, null, 2) + ");";
+        fs.writeFile(path.join(searchDir, fileForConfig), text, function (err) {
+            if (err) throw err;
+        });
+    });
+};

+ 3 - 2
external/amber-dev/package.json

@@ -1,6 +1,6 @@
 {
   "name": "amber-dev",
-  "version": "0.1.1",
+  "version": "0.1.2",
   "description": "Development goodies for Amber Smalltalk",
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1"
@@ -16,6 +16,7 @@
   },
   "dependencies": {
     "amdefine": "0.0.8",
-    "es6-promise": "~0.1.1"
+    "es6-promise": "~0.1.1",
+    "amd-config-builder": "~0.1.2"
   }
 }

+ 1 - 1
internal/index.html

@@ -13,7 +13,7 @@
 <script type='text/javascript'>
     require.config({baseUrl: '..'});
     require(
-        ["amber/devel", "amber_cli/AmberCli"],
+        ["amber/devel", "helios/all", "amber_cli/AmberCli"],
         function (smalltalk) {
             smalltalk.initialize({'transport.defaultAmdNamespace': "amber_core"});
         }

+ 66 - 78
src/Kernel-ImportExport.js

@@ -585,36 +585,6 @@ globals.ChunkExporter);
 
 smalltalk.addClass('Exporter', globals.AbstractExporter, [], 'Kernel-ImportExport');
 globals.Exporter.comment="I am responsible for outputting Amber code into a JavaScript string.\x0a\x0aThe generated output is enough to reconstruct the exported data, including Smalltalk source code and other metadata.\x0a\x0a## Use case\x0a\x0aI am typically used to save code outside of the Amber runtime (committing to disk, etc.).";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "classNameFor:",
-protocol: 'convenience',
-fn: function (aClass){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$4,$1;
-$2=_st(aClass)._isMetaclass();
-if(smalltalk.assert($2)){
-$3=_st(_st(aClass)._instanceClass())._name();
-$ctx1.sendIdx["name"]=1;
-$1=_st($3).__comma(".klass");
-} else {
-$4=_st(aClass)._isNil();
-if(smalltalk.assert($4)){
-$1="nil";
-} else {
-$1=_st(aClass)._name();
-};
-};
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass},globals.Exporter)})},
-args: ["aClass"],
-source: "classNameFor: aClass\x0a\x09^ aClass isMetaclass\x0a\x09\x09ifTrue: [ aClass instanceClass name, '.klass' ]\x0a\x09\x09ifFalse: [\x0a\x09\x09\x09aClass isNil\x0a\x09\x09\x09\x09ifTrue: [ 'nil' ]\x0a\x09\x09\x09\x09ifFalse: [ aClass name ] ]",
-messageSends: ["ifTrue:ifFalse:", "isMetaclass", ",", "name", "instanceClass", "isNil"],
-referencedClasses: []
-}),
-globals.Exporter);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "exportDefinitionOf:on:",
@@ -622,34 +592,30 @@ protocol: 'output',
 fn: function (aClass,aStream){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$5,$4,$6,$8,$7,$9,$11,$10,$12;
+var $2,$1,$3,$4,$6,$5,$7,$9,$8,$10;
 _st(aStream)._lf();
 $ctx1.sendIdx["lf"]=1;
 _st(aStream)._nextPutAll_("smalltalk.addClass(");
 $ctx1.sendIdx["nextPutAll:"]=1;
-$3=self._classNameFor_(aClass);
-$ctx1.sendIdx["classNameFor:"]=1;
-$2="'".__comma($3);
+$2="'".__comma(self._classNameFor_(aClass));
 $ctx1.sendIdx[","]=2;
 $1=_st($2).__comma("', ");
 $ctx1.sendIdx[","]=1;
 _st(aStream)._nextPutAll_($1);
 $ctx1.sendIdx["nextPutAll:"]=2;
-$5=self._classNameFor_(_st(aClass)._superclass());
-$ctx1.sendIdx["classNameFor:"]=2;
-$4="globals.".__comma($5);
-$ctx1.sendIdx[","]=3;
-_st(aStream)._nextPutAll_($4);
+$3=self._jsClassNameFor_(_st(aClass)._superclass());
+$ctx1.sendIdx["jsClassNameFor:"]=1;
+_st(aStream)._nextPutAll_($3);
 $ctx1.sendIdx["nextPutAll:"]=3;
-$6=_st(aStream)._nextPutAll_(", [");
+$4=_st(aStream)._nextPutAll_(", [");
 $ctx1.sendIdx["nextPutAll:"]=4;
 _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$8="'".__comma(each);
-$ctx2.sendIdx[","]=5;
-$7=_st($8).__comma("'");
+$6="'".__comma(each);
 $ctx2.sendIdx[","]=4;
-return _st(aStream)._nextPutAll_($7);
+$5=_st($6).__comma("'");
+$ctx2.sendIdx[","]=3;
+return _st(aStream)._nextPutAll_($5);
 $ctx2.sendIdx["nextPutAll:"]=5;
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
 return smalltalk.withContext(function($ctx2) {
@@ -660,30 +626,28 @@ _st(aStream)._nextPutAll_("], '");
 $ctx1.sendIdx["nextPutAll:"]=7;
 _st(aStream)._nextPutAll_(_st(_st(aClass)._category()).__comma("'"));
 $ctx1.sendIdx["nextPutAll:"]=8;
-$9=_st(aStream)._nextPutAll_(");");
+$7=_st(aStream)._nextPutAll_(");");
 $ctx1.sendIdx["nextPutAll:"]=9;
-$11=_st(aClass)._comment();
+$9=_st(aClass)._comment();
 $ctx1.sendIdx["comment"]=1;
-$10=_st($11)._notEmpty();
-if(smalltalk.assert($10)){
+$8=_st($9)._notEmpty();
+if(smalltalk.assert($8)){
 _st(aStream)._lf();
 $ctx1.sendIdx["lf"]=2;
-_st(aStream)._nextPutAll_("globals.");
+_st(aStream)._nextPutAll_(self._jsClassNameFor_(aClass));
 $ctx1.sendIdx["nextPutAll:"]=10;
-_st(aStream)._nextPutAll_(self._classNameFor_(aClass));
-$ctx1.sendIdx["nextPutAll:"]=11;
 _st(aStream)._nextPutAll_(".comment=");
-$ctx1.sendIdx["nextPutAll:"]=12;
+$ctx1.sendIdx["nextPutAll:"]=11;
 _st(aStream)._nextPutAll_(_st(_st(aClass)._comment())._asJavascript());
-$ctx1.sendIdx["nextPutAll:"]=13;
-$12=_st(aStream)._nextPutAll_(";");
-$12;
+$ctx1.sendIdx["nextPutAll:"]=12;
+$10=_st(aStream)._nextPutAll_(";");
+$10;
 };
 _st(aStream)._lf();
 return self}, function($ctx1) {$ctx1.fill(self,"exportDefinitionOf:on:",{aClass:aClass,aStream:aStream},globals.Exporter)})},
 args: ["aClass", "aStream"],
-source: "exportDefinitionOf: aClass on: aStream\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: 'smalltalk.addClass(';\x0a\x09\x09nextPutAll: '''', (self classNameFor: aClass), ''', ';\x0a\x09\x09nextPutAll: 'globals.', (self classNameFor: aClass superclass);\x0a\x09\x09nextPutAll: ', ['.\x0a\x09aClass instanceVariableNames\x0a\x09\x09do: [ :each | aStream nextPutAll: '''', each, '''' ]\x0a\x09\x09separatedBy: [ aStream nextPutAll: ', ' ].\x0a\x09aStream\x0a\x09\x09nextPutAll: '], ''';\x0a\x09\x09nextPutAll: aClass category, '''';\x0a\x09\x09nextPutAll: ');'.\x0a\x09aClass comment notEmpty ifTrue: [\x0a\x09\x09aStream\x0a\x09\x09\x09lf;\x0a\x09\x09nextPutAll: 'globals.';\x0a\x09\x09nextPutAll: (self classNameFor: aClass);\x0a\x09\x09nextPutAll: '.comment=';\x0a\x09\x09nextPutAll: aClass comment asJavascript;\x0a\x09\x09nextPutAll: ';' ].\x0a\x09aStream lf",
-messageSends: ["lf", "nextPutAll:", ",", "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "notEmpty", "comment", "asJavascript"],
+source: "exportDefinitionOf: aClass on: aStream\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: 'smalltalk.addClass(';\x0a\x09\x09nextPutAll: '''', (self classNameFor: aClass), ''', ';\x0a\x09\x09nextPutAll: (self jsClassNameFor: aClass superclass);\x0a\x09\x09nextPutAll: ', ['.\x0a\x09aClass instanceVariableNames\x0a\x09\x09do: [ :each | aStream nextPutAll: '''', each, '''' ]\x0a\x09\x09separatedBy: [ aStream nextPutAll: ', ' ].\x0a\x09aStream\x0a\x09\x09nextPutAll: '], ''';\x0a\x09\x09nextPutAll: aClass category, '''';\x0a\x09\x09nextPutAll: ');'.\x0a\x09aClass comment notEmpty ifTrue: [\x0a\x09\x09aStream\x0a\x09\x09\x09lf;\x0a\x09\x09nextPutAll: (self jsClassNameFor: aClass);\x0a\x09\x09nextPutAll: '.comment=';\x0a\x09\x09nextPutAll: aClass comment asJavascript;\x0a\x09\x09nextPutAll: ';' ].\x0a\x09aStream lf",
+messageSends: ["lf", "nextPutAll:", ",", "classNameFor:", "jsClassNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "notEmpty", "comment", "asJavascript"],
 referencedClasses: []
 }),
 globals.Exporter);
@@ -696,7 +660,7 @@ fn: function (aClass,aStream){
 var self=this;
 function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$6,$5,$4,$7,$9,$8;
+var $3,$2,$1,$5,$4,$6,$8,$7;
 _st(aStream)._lf();
 $ctx1.sendIdx["lf"]=1;
 $3=_st(aClass)._class();
@@ -705,23 +669,21 @@ $2=_st($3)._instanceVariableNames();
 $ctx1.sendIdx["instanceVariableNames"]=1;
 $1=_st($2)._isEmpty();
 if(! smalltalk.assert($1)){
-$6=_st(aClass)._class();
+$5=_st(aClass)._class();
 $ctx1.sendIdx["class"]=2;
-$5=self._classNameFor_($6);
-$4="globals.".__comma($5);
-$ctx1.sendIdx[","]=1;
+$4=self._jsClassNameFor_($5);
 _st(aStream)._nextPutAll_($4);
 $ctx1.sendIdx["nextPutAll:"]=1;
-$7=_st(aStream)._nextPutAll_(".iVarNames = [");
+$6=_st(aStream)._nextPutAll_(".iVarNames = [");
 $ctx1.sendIdx["nextPutAll:"]=2;
-$7;
+$6;
 _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$9="'".__comma(each);
-$ctx2.sendIdx[","]=3;
-$8=_st($9).__comma("'");
+$8="'".__comma(each);
 $ctx2.sendIdx[","]=2;
-return _st(aStream)._nextPutAll_($8);
+$7=_st($8).__comma("'");
+$ctx2.sendIdx[","]=1;
+return _st(aStream)._nextPutAll_($7);
 $ctx2.sendIdx["nextPutAll:"]=3;
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}),(function(){
 return smalltalk.withContext(function($ctx2) {
@@ -732,8 +694,8 @@ _st(aStream)._nextPutAll_("];".__comma(_st($String())._lf()));
 };
 return self}, function($ctx1) {$ctx1.fill(self,"exportMetaDefinitionOf:on:",{aClass:aClass,aStream:aStream},globals.Exporter)})},
 args: ["aClass", "aStream"],
-source: "exportMetaDefinitionOf: aClass on: aStream\x0a\x09aStream lf.\x0a\x09aClass class instanceVariableNames isEmpty ifFalse: [\x0a\x09\x09aStream\x0a\x09\x09nextPutAll: 'globals.', (self classNameFor: aClass class);\x0a\x09\x09nextPutAll: '.iVarNames = ['.\x0a\x09\x09aClass class instanceVariableNames\x0a\x09\x09do: [ :each | aStream nextPutAll: '''', each, '''' ]\x0a\x09\x09separatedBy: [ aStream nextPutAll: ',' ].\x0a\x09\x09aStream nextPutAll: '];', String lf ]",
-messageSends: ["lf", "ifFalse:", "isEmpty", "instanceVariableNames", "class", "nextPutAll:", ",", "classNameFor:", "do:separatedBy:"],
+source: "exportMetaDefinitionOf: aClass on: aStream\x0a\x09aStream lf.\x0a\x09aClass class instanceVariableNames isEmpty ifFalse: [\x0a\x09\x09aStream\x0a\x09\x09nextPutAll: (self jsClassNameFor: aClass class);\x0a\x09\x09nextPutAll: '.iVarNames = ['.\x0a\x09\x09aClass class instanceVariableNames\x0a\x09\x09do: [ :each | aStream nextPutAll: '''', each, '''' ]\x0a\x09\x09separatedBy: [ aStream nextPutAll: ',' ].\x0a\x09\x09aStream nextPutAll: '];', String lf ]",
+messageSends: ["lf", "ifFalse:", "isEmpty", "instanceVariableNames", "class", "nextPutAll:", "jsClassNameFor:", "do:separatedBy:", ","],
 referencedClasses: ["String"]
 }),
 globals.Exporter);
@@ -745,7 +707,7 @@ protocol: 'output',
 fn: function (aMethod,aStream){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$5,$4,$7,$6,$10,$9,$8,$13,$12,$11,$16,$15,$14,$18,$17,$19;
+var $3,$2,$1,$5,$4,$7,$6,$10,$9,$8,$13,$12,$11,$16,$15,$14,$17,$18;
 _st(aStream)._nextPutAll_("smalltalk.addMethod(");
 $ctx1.sendIdx["nextPutAll:"]=1;
 _st(aStream)._lf();
@@ -810,9 +772,7 @@ _st(aStream)._nextPutAll_($14);
 $ctx1.sendIdx["nextPutAll:"]=8;
 _st(aStream)._lf();
 $ctx1.sendIdx["lf"]=8;
-$18="referencedClasses: ".__comma(_st(_st(aMethod)._referencedClasses())._asJavascript());
-$ctx1.sendIdx[","]=13;
-$17=_st(aStream)._nextPutAll_($18);
+$17=_st(aStream)._nextPutAll_("referencedClasses: ".__comma(_st(_st(aMethod)._referencedClasses())._asJavascript()));
 $ctx1.sendIdx["nextPutAll:"]=9;
 _st(aStream)._lf();
 $ctx1.sendIdx["lf"]=9;
@@ -820,16 +780,16 @@ _st(aStream)._nextPutAll_("}),");
 $ctx1.sendIdx["nextPutAll:"]=10;
 _st(aStream)._lf();
 $ctx1.sendIdx["lf"]=10;
-_st(aStream)._nextPutAll_("globals.".__comma(self._classNameFor_(_st(aMethod)._methodClass())));
+_st(aStream)._nextPutAll_(self._jsClassNameFor_(_st(aMethod)._methodClass()));
 $ctx1.sendIdx["nextPutAll:"]=11;
 _st(aStream)._nextPutAll_(");");
 _st(aStream)._lf();
 $ctx1.sendIdx["lf"]=11;
-$19=_st(aStream)._lf();
+$18=_st(aStream)._lf();
 return self}, function($ctx1) {$ctx1.fill(self,"exportMethod:on:",{aMethod:aMethod,aStream:aStream},globals.Exporter)})},
 args: ["aMethod", "aStream"],
-source: "exportMethod: aMethod on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09\x22nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x22\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'protocol: ''', aMethod protocol, ''',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;\x0a\x09\x09nextPutAll: 'args: ', aMethod arguments asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'source: ', aMethod source asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'messageSends: ', aMethod messageSends asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ', aMethod referencedClasses asJavascript.\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: 'globals.', (self classNameFor: aMethod methodClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
-messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "protocol", "compiledSource", "fn", "arguments", "source", "messageSends", "referencedClasses", "classNameFor:", "methodClass"],
+source: "exportMethod: aMethod on: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: 'smalltalk.addMethod(';lf;\x0a\x09\x09\x22nextPutAll: aMethod selector asSelector asJavascript, ',';lf;\x22\x0a\x09\x09nextPutAll: 'smalltalk.method({';lf;\x0a\x09\x09nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'protocol: ''', aMethod protocol, ''',';lf;\x0a\x09\x09nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;\x0a\x09\x09nextPutAll: 'args: ', aMethod arguments asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'source: ', aMethod source asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'messageSends: ', aMethod messageSends asJavascript, ',';lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ', aMethod referencedClasses asJavascript.\x0a\x09aStream\x0a\x09\x09lf;\x0a\x09\x09nextPutAll: '}),';lf;\x0a\x09\x09nextPutAll: (self jsClassNameFor: aMethod methodClass);\x0a\x09\x09nextPutAll: ');';lf;lf",
+messageSends: ["nextPutAll:", "lf", ",", "asJavascript", "selector", "protocol", "compiledSource", "fn", "arguments", "source", "messageSends", "referencedClasses", "jsClassNameFor:", "methodClass"],
 referencedClasses: []
 }),
 globals.Exporter);
@@ -962,6 +922,34 @@ referencedClasses: []
 }),
 globals.Exporter);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "jsClassNameFor:",
+protocol: 'convenience',
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1,$receiver;
+$2=_st(aClass)._isMetaclass();
+if(smalltalk.assert($2)){
+$1=_st(self._jsClassNameFor_(_st(aClass)._instanceClass())).__comma(".klass");
+$ctx1.sendIdx[","]=1;
+} else {
+if(($receiver = aClass) == null || $receiver.isNil){
+$1="null";
+} else {
+$1="globals.".__comma(_st(aClass)._name());
+};
+};
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"jsClassNameFor:",{aClass:aClass},globals.Exporter)})},
+args: ["aClass"],
+source: "jsClassNameFor: aClass\x0a\x09^ aClass isMetaclass\x0a\x09\x09ifTrue: [ (self jsClassNameFor: aClass instanceClass), '.klass' ]\x0a\x09\x09ifFalse: [\x0a\x09\x09\x09aClass\x0a\x09\x09\x09\x09ifNil: [ 'null' ]\x0a\x09\x09\x09\x09ifNotNil: [ 'globals.', aClass name ] ]",
+messageSends: ["ifTrue:ifFalse:", "isMetaclass", ",", "jsClassNameFor:", "instanceClass", "ifNil:ifNotNil:", "name"],
+referencedClasses: []
+}),
+globals.Exporter);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "ownMethodsOfClass:",

+ 9 - 10
src/Kernel-ImportExport.st

@@ -247,13 +247,13 @@ ownMethodsOfMetaClass: aClass
 
 !Exporter methodsFor: 'convenience'!
 
-classNameFor: aClass
+jsClassNameFor: aClass
 	^ aClass isMetaclass
-		ifTrue: [ aClass instanceClass name, '.klass' ]
+		ifTrue: [ (self jsClassNameFor: aClass instanceClass), '.klass' ]
 		ifFalse: [
-			aClass isNil
-				ifTrue: [ 'nil' ]
-				ifFalse: [ aClass name ] ]
+			aClass
+				ifNil: [ 'null' ]
+				ifNotNil: [ 'globals.', aClass name ] ]
 ! !
 
 !Exporter methodsFor: 'output'!
@@ -263,7 +263,7 @@ exportDefinitionOf: aClass on: aStream
 		lf;
 		nextPutAll: 'smalltalk.addClass(';
 		nextPutAll: '''', (self classNameFor: aClass), ''', ';
-		nextPutAll: 'globals.', (self classNameFor: aClass superclass);
+		nextPutAll: (self jsClassNameFor: aClass superclass);
 		nextPutAll: ', ['.
 	aClass instanceVariableNames
 		do: [ :each | aStream nextPutAll: '''', each, '''' ]
@@ -275,8 +275,7 @@ exportDefinitionOf: aClass on: aStream
 	aClass comment notEmpty ifTrue: [
 		aStream
 			lf;
-		nextPutAll: 'globals.';
-		nextPutAll: (self classNameFor: aClass);
+		nextPutAll: (self jsClassNameFor: aClass);
 		nextPutAll: '.comment=';
 		nextPutAll: aClass comment asJavascript;
 		nextPutAll: ';' ].
@@ -287,7 +286,7 @@ exportMetaDefinitionOf: aClass on: aStream
 	aStream lf.
 	aClass class instanceVariableNames isEmpty ifFalse: [
 		aStream
-		nextPutAll: 'globals.', (self classNameFor: aClass class);
+		nextPutAll: (self jsClassNameFor: aClass class);
 		nextPutAll: '.iVarNames = ['.
 		aClass class instanceVariableNames
 		do: [ :each | aStream nextPutAll: '''', each, '''' ]
@@ -310,7 +309,7 @@ exportMethod: aMethod on: aStream
 	aStream
 		lf;
 		nextPutAll: '}),';lf;
-		nextPutAll: 'globals.', (self classNameFor: aMethod methodClass);
+		nextPutAll: (self jsClassNameFor: aMethod methodClass);
 		nextPutAll: ');';lf;lf
 !
 

+ 1 - 1
src/Kernel-Objects.js

@@ -3,7 +3,7 @@ var smalltalk=$boot.vm,nil=$boot.nil,_st=$boot.asReceiver,globals=$boot.globals;
 smalltalk.addPackage('Kernel-Objects');
 smalltalk.packages["Kernel-Objects"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('ProtoObject', globals.nil, [], 'Kernel-Objects');
+smalltalk.addClass('ProtoObject', null, [], 'Kernel-Objects');
 globals.ProtoObject.comment="I implement the basic behavior required for any object in Amber.\x0a\x0aIn most cases, subclassing `ProtoObject` is wrong and `Object` should be used instead. However subclassing `ProtoObject` can be useful in some special cases like proxy implementations.";
 smalltalk.addMethod(
 smalltalk.method({

+ 1 - 1
src/Kernel-Tests.js

@@ -6201,7 +6201,7 @@ _st(jsObject)._a_(false);
 self._assert_equals_(_st(jsObject)._a(),false);
 return self}, function($ctx1) {$ctx1.fill(self,"testSetPropertyWithFalsyValue",{jsObject:jsObject},globals.JSObjectProxyTest)})},
 args: [],
-source: "testSetPropertyWithFalsyValue\x0a\x09| jsObject |\x0a\x09jsObject := self jsObject.\x0a\x09self assert: (jsObject a) equals: 1.\x0a\x0a\x09jsObject a: self jsNull.\x0a\x09self assert: (jsObject a) equals: nil.\x0a\x09jsObject a: 0.\x0a\x09self assert: (jsObject a) equals: 0.\x0a\x09jsObject a: self jsUndefined.\x0a\x09self assert: (jsObject a) equals: nil.\x0a\x09jsObject a: ''.\x0a\x09self assert: (jsObject a) equals: ''.\x0a\x09jsObject a: false.\x0a\x09self assert: (jsObject a) equals: false\x0a\x0a\x0a\x09",
+source: "testSetPropertyWithFalsyValue\x0a\x09| jsObject |\x0a\x09jsObject := self jsObject.\x0a\x09self assert: (jsObject a) equals: 1.\x0a\x0a\x09jsObject a: self jsNull.\x0a\x09self assert: (jsObject a) equals: nil.\x0a\x09jsObject a: 0.\x0a\x09self assert: (jsObject a) equals: 0.\x0a\x09jsObject a: self jsUndefined.\x0a\x09self assert: (jsObject a) equals: nil.\x0a\x09jsObject a: ''.\x0a\x09self assert: (jsObject a) equals: ''.\x0a\x09jsObject a: false.\x0a\x09self assert: (jsObject a) equals: false",
 messageSends: ["jsObject", "assert:equals:", "a", "a:", "jsNull", "jsUndefined"],
 referencedClasses: []
 }),

+ 2 - 2
support/boot.js

@@ -448,8 +448,8 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 		st.addClass = function(className, superclass, iVarNames, pkgName) {
 			// While subclassing nil is allowed, it might be an error, so
 			// warn about it.
-			if (!superclass || superclass == nil) {
-				console.warn('Creating ' + className + ' as a subclass of `nil`. A dependency might be missing.');
+			if (typeof superclass == 'undefined' || superclass == nil) {
+				console.warn('Compiling ' + className + ' as a subclass of `nil`. A dependency might be missing.');
 			}
 			rawAddClass(pkgName, className, superclass, iVarNames, false, null);
 		};

+ 0 - 35
support/helios/all.js

@@ -1,35 +0,0 @@
-define([
-	'amber/helpers', // pre-fetch, dep of amber/deploy
-	'amber/deploy', // pre-fetch, dep of amber/lang
-	'amber/lang',
-	'amber/codemirror',
-    'jquery-ui',
-    'amber_lib/jquery-tabby/jquery.textarea',
-    'amber_core/IDE',
-    'amber_core/Examples',
-    'amber_core/Benchfib',
-    'bootstrap2.3.2/js/bootstrap',
-    'amber_lib/showdown/compressed/showdown',
-    './Helios-Core',
-    './Helios-Exceptions',
-    './Helios-Helpers',
-    './Helios-Commands-Core',
-    './Helios-Commands-Tools',
-    './Helios-Commands-Browser',
-    './Helios-Commands-SUnit',
-    './Helios-Layout',
-    './Helios-KeyBindings',
-    './Helios-Browser',
-    './Helios-Workspace',
-    './Helios-Transcript',
-    './Helios-SUnit',
-    './Helios-SUnit-Tests',
-    './Helios-Debugger',
-    './Helios-Inspector',
-    './Helios-References',
-    './Helios-Announcements',
-    './Helios-Workspace-Tests',
-    'css!./resources/helios',
-	'css!./resources/helios-niflheim',
-    'css!./resources/niflheim'
-], function (smalltalk) { return smalltalk; });

+ 1 - 1
support/helios/index.html

@@ -15,7 +15,7 @@
         <script type='text/javascript'>
           require.config({baseUrl: '../..'});
           require(
-                  ["helios/all"],
+                  ["helios/set"],
                   function (smalltalk) {
                       window.onbeforeunload = function() {
                           return 'Do you want to close Amber? All uncommitted changes will be lost.';

+ 1 - 1
support/helios/resources/helios.css

@@ -452,7 +452,7 @@ body[id="helios"] .tool_container .pane .nav-pills i.package {
   background-image: url('package.png');
 }
 body[id="helios"] .tool_container .pane .nav-pills i.override {
-  background-image: url('resources/override.png ');
+  background-image: url('override.png ');
 }
 body[id="helios"] .tool_container .pane .nav-pills i.overridden {
   background-image: url('overridden.png');

+ 1 - 1
support/helios/resources/helios.less

@@ -531,7 +531,7 @@ body[id="helios"] {
 		background-image: url('package.png');
 	}
 	.tool_container .pane .nav-pills i.override {
-		background-image: url('resources/override.png ');
+		background-image: url('override.png ');
 	}
 	.tool_container .pane .nav-pills i.overridden {
 		background-image: url('overridden.png');

+ 10 - 0
support/helios/resources/set-inner.js

@@ -0,0 +1,10 @@
+// Loading this in nested file so that require.config
+// with shim dependencies is in effect.
+// See http://stackoverflow.com/questions/21647956/how-to-config-requirejs-shim-dependencies-just-in-time/
+
+define([
+	'amber/devel-inner',
+	'bootstrap2.3.2/js/bootstrap',
+	'amber_lib/showdown/compressed/showdown',
+    'helios/all'
+]);

+ 17 - 0
support/helios/set.js

@@ -0,0 +1,17 @@
+define([
+	'amber/helpers', // pre-fetch, dep of amber/deploy
+	'amber/deploy', // pre-fetch, dep of amber/lang
+	'amber/lang',
+	'amber/codemirror',
+    'jquery-ui',
+    'amber_lib/jquery-tabby/jquery.textarea',
+    'amber_core/IDE',
+    'amber_core/Examples',
+    'amber_core/Benchfib',
+    'bootstrap2.3.2/js/bootstrap',
+    'amber_lib/showdown/compressed/showdown',
+    './all',
+    'css!./resources/helios',
+	'css!./resources/helios-niflheim',
+    'css!./resources/niflheim'
+], function (smalltalk) { return smalltalk; });

+ 4 - 2
support/helios/src/Helios-References.js

@@ -606,11 +606,13 @@ protocol: 'actions',
 fn: function (aMethod){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
+($ctx1.supercall = true, globals.HLReferencesListWidget.superclass.fn.prototype._selectItem_.apply(_st(self), [aMethod]));
+$ctx1.supercall = false;
 _st(self._model())._selectedMethod_(aMethod);
 return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aMethod:aMethod},globals.HLReferencesListWidget)})},
 args: ["aMethod"],
-source: "selectItem: aMethod\x0a\x09self model selectedMethod: aMethod",
-messageSends: ["selectedMethod:", "model"],
+source: "selectItem: aMethod\x0a\x09super selectItem: aMethod.\x0a\x09self model selectedMethod: aMethod",
+messageSends: ["selectItem:", "selectedMethod:", "model"],
 referencedClasses: []
 }),
 globals.HLReferencesListWidget);

+ 1 - 0
support/helios/src/Helios-References.st

@@ -171,6 +171,7 @@ observeModel
 !
 
 selectItem: aMethod
+	super selectItem: aMethod.
 	self model selectedMethod: aMethod
 ! !
 

+ 63 - 4
support/helios/src/Helios-SUnit.js

@@ -440,15 +440,14 @@ var $1,$2;
 $1=_st(html)._button();
 _st($1)._class_("button");
 _st($1)._with_("Select all");
-$ctx1.sendIdx["with:"]=1;
-$2=_st($1)._with_((function(){
+$2=_st($1)._onClick_((function(){
 return smalltalk.withContext(function($ctx2) {
 return _st(self._model())._selectAllClasses();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},globals.HLSUnitClassesListWidget)})},
 args: ["html"],
-source: "renderButtonsOn: html\x0a\x09html button\x0a\x09\x09class: 'button'; \x0a\x09\x09with: 'Select all';\x0a\x09\x09with: [ self model selectAllClasses ]",
-messageSends: ["class:", "button", "with:", "selectAllClasses", "model"],
+source: "renderButtonsOn: html\x0a\x09html button\x0a\x09\x09class: 'button'; \x0a\x09\x09with: 'Select all';\x0a\x09\x09onClick: [ self model selectAllClasses ]",
+messageSends: ["class:", "button", "with:", "onClick:", "selectAllClasses", "model"],
 referencedClasses: []
 }),
 globals.HLSUnitClassesListWidget);
@@ -1045,6 +1044,28 @@ referencedClasses: ["HLSUnitResults"]
 }),
 globals.HLSUnit);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "unregister",
+protocol: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+($ctx1.supercall = true, globals.HLSUnit.superclass.fn.prototype._unregister.apply(_st(self), []));
+$ctx1.supercall = false;
+$ctx1.sendIdx["unregister"]=1;
+_st([self._packagesListWidget(),self._classesListWidget(),self._resultWidget(),self._errorsWidget(),self._failuresWidget()])._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(each)._unregister();
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLSUnit)})},
+args: [],
+source: "unregister\x0a\x09super unregister.\x0a\x0a\x09{ \x0a\x09\x09self packagesListWidget.\x0a\x09\x09self classesListWidget.\x0a\x09\x09self resultWidget.\x0a\x09\x09self errorsWidget.\x0a\x09\x09self failuresWidget\x0a\x09} \x0a\x09\x09do: [ :each | each unregister ]",
+messageSends: ["unregister", "do:", "packagesListWidget", "classesListWidget", "resultWidget", "errorsWidget", "failuresWidget"],
+referencedClasses: []
+}),
+globals.HLSUnit);
+
 
 smalltalk.addMethod(
 smalltalk.method({
@@ -1939,6 +1960,24 @@ referencedClasses: []
 }),
 globals.HLSUnitResultStatus);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "unregister",
+protocol: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+($ctx1.supercall = true, globals.HLSUnitResultStatus.superclass.fn.prototype._unregister.apply(_st(self), []));
+$ctx1.supercall = false;
+_st(_st(self._model())._announcer())._unsubscribe_(self);
+return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLSUnitResultStatus)})},
+args: [],
+source: "unregister\x0a\x09super unregister.\x0a\x09self model announcer unsubscribe: self.",
+messageSends: ["unregister", "unsubscribe:", "announcer", "model"],
+referencedClasses: []
+}),
+globals.HLSUnitResultStatus);
+
 
 
 smalltalk.addClass('HLSUnitResults', globals.HLWidget, ['model', 'progressBarWidget', 'resultStatusWidget'], 'Helios-SUnit');
@@ -2122,5 +2161,25 @@ referencedClasses: ["HLSUnitResultStatus"]
 }),
 globals.HLSUnitResults);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "unregister",
+protocol: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+($ctx1.supercall = true, globals.HLSUnitResults.superclass.fn.prototype._unregister.apply(_st(self), []));
+$ctx1.supercall = false;
+$ctx1.sendIdx["unregister"]=1;
+_st(_st(self._model())._announcer())._unsubscribe_(self);
+_st(self._resultStatusWidget())._unregister();
+return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLSUnitResults)})},
+args: [],
+source: "unregister\x0a\x09super unregister.\x0a\x09self model announcer unsubscribe: self.\x0a\x09self resultStatusWidget unregister.",
+messageSends: ["unregister", "unsubscribe:", "announcer", "model", "resultStatusWidget"],
+referencedClasses: []
+}),
+globals.HLSUnitResults);
+
 
 });

+ 29 - 1
support/helios/src/Helios-SUnit.st

@@ -163,7 +163,7 @@ renderButtonsOn: html
 	html button
 		class: 'button'; 
 		with: 'Select all';
-		with: [ self model selectAllClasses ]
+		onClick: [ self model selectAllClasses ]
 !
 
 renderItemLabel: aClass on: html
@@ -304,6 +304,21 @@ resultSection
 			with: self errorsWidget)
 ! !
 
+!HLSUnit methodsFor: 'actions'!
+
+unregister
+	super unregister.
+
+	{ 
+		self packagesListWidget.
+		self classesListWidget.
+		self resultWidget.
+		self errorsWidget.
+		self failuresWidget
+	} 
+		do: [ :each | each unregister ]
+! !
+
 !HLSUnit methodsFor: 'keybindings'!
 
 registerBindingsOn: aBindingGroup
@@ -617,6 +632,11 @@ observeModel
 		on: ResultAnnouncement
 		send: #onResultAnnouncement:
 		to: self
+!
+
+unregister
+	super unregister.
+	self model announcer unsubscribe: self.
 ! !
 
 !HLSUnitResultStatus methodsFor: 'printing'!
@@ -685,6 +705,14 @@ resultStatusWidget
 		yourself]
 ! !
 
+!HLSUnitResults methodsFor: 'actions'!
+
+unregister
+	super unregister.
+	self model announcer unsubscribe: self.
+	self resultStatusWidget unregister.
+! !
+
 !HLSUnitResults methodsFor: 'initialization'!
 
 observeModel

+ 21 - 0
support/helios/src/all.js

@@ -0,0 +1,21 @@
+define([
+	'./Helios-Core',
+	'./Helios-Exceptions',
+	'./Helios-Helpers',
+	'./Helios-Commands-Core',
+	'./Helios-Commands-Tools',
+	'./Helios-Commands-Browser',
+	'./Helios-Commands-SUnit',
+	'./Helios-Layout',
+	'./Helios-KeyBindings',
+	'./Helios-Browser',
+	'./Helios-Workspace',
+	'./Helios-Transcript',
+	'./Helios-SUnit',
+	'./Helios-SUnit-Tests',
+	'./Helios-Debugger',
+	'./Helios-Inspector',
+	'./Helios-References',
+	'./Helios-Announcements',
+	'./Helios-Workspace-Tests'
+]);