Просмотр исходного кода

Merge branch 'requirejs-wip' into requirejs-with-folder-restructure

Conflicts:
	bin/amberc.js
	support/amber4browser.js
Herbert Vojčík 10 лет назад
Родитель
Сommit
f32e155854
88 измененных файлов с 1661 добавлено и 1096 удалено
  1. 130 75
      bin/amberc.js
  2. 1 2
      grunt/tasks/grunt-amberc.js
  3. 1 1
      grunt/tasks/grunt-peg.js
  4. 2 0
      js/Benchfib.deploy.js
  5. 2 0
      js/Benchfib.js
  6. 2 0
      js/Canvas.deploy.js
  7. 2 0
      js/Canvas.js
  8. 2 0
      js/Compiler-AST.deploy.js
  9. 2 0
      js/Compiler-AST.js
  10. 2 0
      js/Compiler-Core.deploy.js
  11. 2 0
      js/Compiler-Core.js
  12. 2 0
      js/Compiler-Exceptions.deploy.js
  13. 2 0
      js/Compiler-Exceptions.js
  14. 2 0
      js/Compiler-IR.deploy.js
  15. 2 0
      js/Compiler-IR.js
  16. 2 0
      js/Compiler-Inlining.deploy.js
  17. 2 0
      js/Compiler-Inlining.js
  18. 2 0
      js/Compiler-Interpreter.deploy.js
  19. 2 0
      js/Compiler-Interpreter.js
  20. 2 0
      js/Compiler-Semantic.deploy.js
  21. 2 0
      js/Compiler-Semantic.js
  22. 2 0
      js/Compiler-Tests.deploy.js
  23. 2 0
      js/Compiler-Tests.js
  24. 2 0
      js/Examples.deploy.js
  25. 2 0
      js/Examples.js
  26. 2 0
      js/Helios-Announcements.deploy.js
  27. 2 0
      js/Helios-Announcements.js
  28. 2 0
      js/Helios-Browser.deploy.js
  29. 2 0
      js/Helios-Browser.js
  30. 2 0
      js/Helios-Commands-Browser.deploy.js
  31. 2 0
      js/Helios-Commands-Browser.js
  32. 2 0
      js/Helios-Commands-Core.deploy.js
  33. 2 0
      js/Helios-Commands-Core.js
  34. 2 0
      js/Helios-Commands-Tools.deploy.js
  35. 2 0
      js/Helios-Commands-Tools.js
  36. 2 0
      js/Helios-Commands.deploy.js
  37. 2 0
      js/Helios-Commands.js
  38. 2 0
      js/Helios-Core.deploy.js
  39. 2 0
      js/Helios-Core.js
  40. 2 0
      js/Helios-Debugger.deploy.js
  41. 2 0
      js/Helios-Debugger.js
  42. 2 0
      js/Helios-Exceptions.deploy.js
  43. 2 0
      js/Helios-Exceptions.js
  44. 2 0
      js/Helios-Inspector.deploy.js
  45. 2 0
      js/Helios-Inspector.js
  46. 2 0
      js/Helios-KeyBindings.deploy.js
  47. 2 0
      js/Helios-KeyBindings.js
  48. 2 0
      js/Helios-Layout.deploy.js
  49. 2 0
      js/Helios-Layout.js
  50. 2 0
      js/Helios-References.deploy.js
  51. 2 0
      js/Helios-References.js
  52. 2 0
      js/Helios-Transcript.deploy.js
  53. 2 0
      js/Helios-Transcript.js
  54. 2 0
      js/Helios-Workspace-Tests.deploy.js
  55. 2 0
      js/Helios-Workspace-Tests.js
  56. 2 0
      js/Helios-Workspace.deploy.js
  57. 2 0
      js/Helios-Workspace.js
  58. 2 0
      js/IDE.deploy.js
  59. 2 0
      js/IDE.js
  60. 420 360
      js/Importer-Exporter.deploy.js
  61. 547 461
      js/Importer-Exporter.js
  62. 2 0
      js/Kernel-Announcements.deploy.js
  63. 2 0
      js/Kernel-Announcements.js
  64. 2 0
      js/Kernel-Classes.deploy.js
  65. 2 0
      js/Kernel-Classes.js
  66. 2 0
      js/Kernel-Collections.deploy.js
  67. 2 0
      js/Kernel-Collections.js
  68. 2 0
      js/Kernel-Exceptions.deploy.js
  69. 2 0
      js/Kernel-Exceptions.js
  70. 2 0
      js/Kernel-Methods.deploy.js
  71. 2 0
      js/Kernel-Methods.js
  72. 2 0
      js/Kernel-Objects.deploy.js
  73. 2 0
      js/Kernel-Objects.js
  74. 2 0
      js/Kernel-Tests.deploy.js
  75. 2 0
      js/Kernel-Tests.js
  76. 2 0
      js/Kernel-Transcript.deploy.js
  77. 2 0
      js/Kernel-Transcript.js
  78. 2 0
      js/SUnit-Tests.deploy.js
  79. 2 0
      js/SUnit-Tests.js
  80. 2 0
      js/SUnit.deploy.js
  81. 2 0
      js/SUnit.js
  82. 2 0
      js/Spaces.deploy.js
  83. 2 0
      js/Spaces.js
  84. 1 1
      package.json
  85. 397 192
      st/Importer-Exporter.st
  86. 2 1
      support/amber4browser.js
  87. 4 2
      support/smalltalk.js
  88. 2 1
      test/Test.js

+ 130 - 75
bin/amberc.js

@@ -8,8 +8,6 @@
  * Execute 'node compiler.js' without arguments or with -h / --help for help.
  */
 
-var amdefine = require("amdefine");
-
 /**
  * Map the async filter function onto array and evaluate callback, once all have finished.
  * Taken from: http://howtonode.org/control-flow-part-iii
@@ -44,32 +42,100 @@ function always_resolve(callback) {
 }
 
 
+/**
+ * Helper for concatenating Amber generated AMD modules.
+ * The produced output can be exported and run as an independent program.
+ *
+ * var concatenator = createConcatenator();
+ * concatenator.start(); // write the required AMD define header
+ * concatenator.add(module1);
+ * concatenator.addId(module1_ID);
+ * //...
+ * concatenator.finish("//some last code");
+ * var concatenation = concatenator.toString();
+ * // The variable concatenation contains the concatenated result
+ * // which can either be stored in a file or interpreted with eval().
+ */
+function createConcatenator () {
+	var defineAmdDefine = function () {
+		var path = require('path');
+		return ($AMDEFINE_SRC$)();
+	};
+
+	// The createAmdefineString is hack to help injecting amdefine into the concatenated output.
+	//
+	// Usually, the line 'var define = require('amdefine')(module), requirejs = define.require;'
+	// is needed when using amdefine with node and npm installed.
+	// var f = require('amdefine') itself returns one big self-sufficient function which must be called
+	// as f(module) to get the define you can use.
+	//
+	// However, amdefine needs the definition of the 'path' variable (node's internal 'path' module).
+	// To create this dependency the defineAmdDefine() function is used which defines
+	// the path variable first and adds a placeholder for the amdefine function/sourcecode.
+	// The defineAmdDefine() function is then converted to its string representation
+	// and the placeholder is replaced with the actual sourcecode of the amdefine function.
+	var createAmdefineString = function() {
+		return ('' + defineAmdDefine).replace('$AMDEFINE_SRC$', '' + require('amdefine'));
+	}
+
+	return {
+		elements: [],
+		ids: [],
+		add: function () {
+			this.elements.push.apply(this.elements, arguments);
+		},
+		addId: function () {
+			this.ids.push.apply(this.ids, arguments);
+		},
+		forEach: function () {
+			this.elements.forEach.apply(this.elements, arguments);
+		},
+		start: function () {
+			this.add(
+				'var define = (' + createAmdefineString() + ')(), requirejs = define.require;',
+				'define("amber_vm/browser-compatibility", [], {});'
+			);
+		},
+		finish: function (realWork) {
+			this.add(
+				'define("amber_vm/_init", ["amber_vm/smalltalk","' + this.ids.join('","') + '"], function (smalltalk) {',
+				'smalltalk.initialize();',
+				realWork,
+				'});', 'requirejs("amber_vm/_init");'
+			);
+		},
+		toString: function () {
+			return this.elements.join('\n');
+		}
+	};
+}
+
 /**
  * Combine several async functions and evaluate callback once all of them have finished.
  * Taken from: http://howtonode.org/control-flow
  */
 function Combo(callback) {
-  this.callback = callback;
-  this.items = 0;
-  this.results = [];
+	this.callback = callback;
+	this.items = 0;
+	this.results = [];
 }
 
 Combo.prototype = {
-  add: function () {
-	var self = this,
+	add: function () {
+		var self = this,
 		id = this.items;
-	this.items++;
-	return function () {
-	  self.check(id, arguments);
-	};
-  },
-  check: function (id, arguments) {
-	this.results[id] = Array.prototype.slice.call(arguments);
-	this.items--;
-	if (this.items == 0) {
-	  this.callback.apply(this, this.results);
+		this.items++;
+		return function () {
+			self.check(id, arguments);
+		};
+	},
+	check: function (id, arguments) {
+		this.results[id] = Array.prototype.slice.call(arguments);
+		this.items--;
+		if (this.items == 0) {
+			this.callback.apply(this, this.results);
+		}
 	}
-  }
 };
 
 var path = require('path'),
@@ -103,7 +169,6 @@ var createDefaults = function(amber_dir, finished_callback){
 
 	return {
 		'load': [],
-//		'init': path.join(amber_dir, 'support', 'init.js'),
 		'main': undefined,
 		'mainfile': undefined,
 		'stFiles': [],
@@ -167,9 +232,6 @@ AmberC.prototype.check_configuration_ok = function(configuration) {
 	if (undefined === configuration) {
 		throw new Error('AmberC.check_configuration_ok(): missing configuration object');
 	}
-	if (undefined === configuration.init) {
-//		throw new Error('AmberC.check_configuration_ok(): init value missing in configuration object');
-	}
 
 	if (0 === configuration.jsFiles.length && 0 === configuration.stFiles.lenght) {
 		throw new Error('AmberC.check_configuration_ok(): no files to compile/link specified in configuration object');
@@ -227,7 +289,9 @@ AmberC.prototype.check_for_closure_compiler = function(callback) {
  */
 AmberC.prototype.resolve_js = function(filename, callback) {
 	var special = filename[0] == "@";
-	if (special) { filename = filename.slice(1); }
+	if (special) {
+		filename = filename.slice(1);
+	}
 	var baseName = path.basename(filename, '.js');
 	var jsFile = baseName + this.defaults.loadsuffix + '.js';
 	var amberJsFile = path.join(this.amber_dir, special?'support':'js', jsFile);
@@ -332,7 +396,7 @@ AmberC.prototype.resolve_libraries = function() {
 	// Resolve libraries listed in this.kernel_libraries
 	var self = this;
 	var all_resolved = new Combo(function(resolved_kernel_files, resolved_compiler_files) {
-		self.resolve_init(resolved_compiler_files[0]);
+		self.create_compiler(resolved_compiler_files[0]);
 	});
 	this.resolve_kernel(all_resolved.add());
 	this.resolve_compiler(all_resolved.add());
@@ -392,23 +456,6 @@ AmberC.prototype.resolve_compiler = function(callback) {
 };
 
 
-/**
- * Resolves default.init and adds it to compilerFiles.
- * Followed by create_compiler().
- */
-AmberC.prototype.resolve_init = function(compilerFiles) {
-	// check and add init.js
-//	var initFile = this.defaults.init;
-//	if ('.js' !== path.extname(initFile)) {
-//		initFile = this.resolve_js(initFile);
-//		this.defaults.init = initFile;
-//	}
-//	compilerFiles.push(initFile);
-
-	this.create_compiler(compilerFiles);
-};
-
-
 /**
  * Read all .js files needed by compiler and eval() them.
  * The finished Compiler gets stored in defaults.smalltalk.
@@ -417,19 +464,23 @@ AmberC.prototype.resolve_init = function(compilerFiles) {
 AmberC.prototype.create_compiler = function(compilerFilesArray) {
 	var self = this;
 	var compiler_files = new Combo(function() {
-		var define = amdefine(module), requirejs = define.require;
-		define("amber_vm/browser-compatibility", [], {});
+		var builder = createConcatenator();
+		builder.add('(function() {');
+		builder.start();
 
-		var content = '(function() {';
 		Array.prototype.slice.call(arguments).forEach(function(data) {
 			// data is an array where index 0 is the error code and index 1 contains the data
-			content += data[1];
-			var match = (""+data[1]).match(/^define\("([^"]*)"/);
-			if (match) content += 'requirejs("'+match[1]+'");\n';
+			builder.add(data[1]);
+			// matches and returns the "module_id" string in the AMD definition: define("module_id", ...)
+			var match = ('' + data[1]).match(/^define\("([^"]*)"/);
+			if (match) {
+				builder.addId(match[1]);
+			}
 		});
-		content = content + 'return requirejs("amber_vm/smalltalk");})();';
-		self.defaults.smalltalk = eval(content);
-		self.defaults.smalltalk.initialize();
+		// store the generated smalltalk env in self.defaults.smalltalk
+		builder.finish('self.defaults.smalltalk = smalltalk;');
+		builder.add('})();');
+		eval(builder.toString());
 		console.log('Compiler loaded');
 		self.defaults.smalltalk.ErrorHandler._setCurrent_(self.defaults.smalltalk.RethrowErrorHandler._new());
 
@@ -505,9 +556,15 @@ AmberC.prototype.category_export = function() {
 		console.log('Exporting ' + (defaults.deploy ? '(debug + deploy)' : '(debug)')
 			+ ' category ' + category + ' as ' + jsFile
 			+ (defaults.deploy ? ' and ' + jsFileDeploy : ''));
-		fs.writeFile(jsFile, defaults.smalltalk.Exporter._new()._exportPackage_(category), function(err) {
+		var smalltalk = defaults.smalltalk;
+		var pluggableExporter = smalltalk.PluggableExporter;
+		var packageObject = smalltalk.Package._named_(category);
+        packageObject._amdNamespace_("amber");
+		fs.writeFile(jsFile, smalltalk.String._streamContents_(function (stream) {
+			pluggableExporter._newUsing_(smalltalk.Exporter._amdRecipe())._exportPackage_on_(packageObject, stream); }), function(err) {
 			if (defaults.deploy) {
-				fs.writeFile(jsFileDeploy, defaults.smalltalk.StrippedExporter._new()._exportPackage_(category), callback);
+				fs.writeFile(jsFileDeploy, smalltalk.String._streamContents_(function (stream) {
+					pluggableExporter._newUsing_(smalltalk.StrippedExporter._amdRecipe())._exportPackage_on_(packageObject, stream); }), callback);
 			} else {
 				callback(null, null);
 			}
@@ -582,11 +639,6 @@ AmberC.prototype.compose_js_files = function() {
 		program_files.push.apply(program_files, compiledFiles);
 	}
 
-	if (undefined !== defaults.init) {
-//		console.log('Adding initializer ' + defaults.init);
-//		program_files.push(defaults.init);
-	}
-
 	console.ambercLog('Writing program file: %s.js', programFile);
 
 	var fileStream = fs.createWriteStream(programFile + defaults.suffix_used + '.js');
@@ -599,41 +651,44 @@ AmberC.prototype.compose_js_files = function() {
 		self.optimize();
 	});
 
-	var defineDefine = function () {
-		var path = require('path');
-		var amdefine = $SRC$;
-		var define = amdefine(module);
-		var result = function () {
-			var id = arguments[0];
-			setTimeout(function () { define.require(id); }, 0);
-			return define.apply(this, arguments);
-		};
-		result.amd = {};
-		return result;
-	};
+	var builder = createConcatenator();
+	builder.start();
 
-	fileStream.write('var define = ('+(''+defineDefine).replace('$SRC$', ""+amdefine)+')();\n'
-		+ 'define("amber_vm/browser-compatibility", [], {});\n');
 	program_files.forEach(function(file) {
 		if(fs.existsSync(file)) {
 			console.log('Adding : ' + file);
-			fileStream.write(fs.readFileSync(file));
+			var buffer = fs.readFileSync(file);
+			// matches and returns the "module_id" string in the AMD define: define("module_id", ...)
+			var match = buffer.toString().match(/^define\("([^"]*)"/);
+			if (match /*&& match[1].slice(0,9) !== "amber_vm/"*/) {
+				builder.addId(match[1]);
+			}
+			builder.add(buffer);
 		} else {
 			fileStream.end();
 			throw(new Error('Can not find file ' + file));
 		}
 	});
-	fileStream.write('define("amber_vm/_init", ["amber_vm/smalltalk"], function (st) { st.initialize(); });\n');
+
+	var mainFunctionOrFile = '';
+
 	if (undefined !== defaults.main) {
 		console.log('Adding call to: %s>>main', defaults.main);
-		fileStream.write('smalltalk.' + defaults.main + '._main()');
+		mainFunctionOrFile += 'smalltalk.' + defaults.main + '._main();';
 	}
 
 	if (undefined !== defaults.mainfile && fs.existsSync(defaults.mainfile)) {
 		console.log('Adding main file: ' + defaults.mainfile);
-		fileStream.write(fs.readFileSync(defaults.mainfile));
+		mainFunctionOrFile += '\n' + fs.readFileSync(defaults.mainfile);
 	}
 
+	builder.finish(mainFunctionOrFile);
+
+	console.log('Writing...');
+	builder.forEach(function (element) {
+		fileStream.write(element);
+		fileStream.write('\n');
+	});
 	console.log('Done.');
 	fileStream.end();
 };

+ 1 - 2
grunt/tasks/grunt-amberc.js

@@ -49,8 +49,7 @@ module.exports = function(grunt) {
     // generate the amberc configuration out of the given target properties
     var configuration = generateCompilerConfiguration(this.data, grunt.config('amberc.options.amber_dir'));
 
-    // run the compiler
-    // change back to the old working directory and call the async callback once finished
+    // run the compiler and call the async callback once finished
     var self = this;
     compiler.main(configuration, function(){
       // signal that task has finished

+ 1 - 1
grunt/tasks/grunt-peg.js

@@ -23,7 +23,7 @@ module.exports = function(grunt) {
       export_var: 'module.exports'
     });
     var parser = PEG.buildParser(grunt.file.read(this.data.src), options);
-    var content = 'define("amber_vm/parser", ["./smalltalk","./nil"],function(smalltalk,nil){\n'+options.export_var + ' = ' + parser.toSource() + ';\n});';
+    var content = 'define("amber_vm/parser", ["./smalltalk", "./nil"], function(smalltalk, nil) {\n'+options.export_var + ' = ' + parser.toSource() + ';\n});';
     grunt.file.write(this.data.dest, content);
   });
 };

+ 2 - 0
js/Benchfib.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Benchfib", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Benchfib');
+smalltalk.packages["Benchfib"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('Benchfib', smalltalk.Object, [], 'Benchfib');
 
 smalltalk.addMethod(

+ 2 - 0
js/Benchfib.js

@@ -1,5 +1,7 @@
 define("amber/Benchfib", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Benchfib');
+smalltalk.packages["Benchfib"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('Benchfib', smalltalk.Object, [], 'Benchfib');
 
 smalltalk.addMethod(

+ 2 - 0
js/Canvas.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Canvas", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Canvas');
+smalltalk.packages["Canvas"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HTMLCanvas', smalltalk.Object, ['root'], 'Canvas');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Canvas.js

@@ -1,5 +1,7 @@
 define("amber/Canvas", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Canvas');
+smalltalk.packages["Canvas"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HTMLCanvas', smalltalk.Object, ['root'], 'Canvas');
 smalltalk.HTMLCanvas.comment="I am a canvas for building HTML.\x0a\x0aI provide the `#tag:` method to create a `TagBrush` (wrapping a DOM element) and convenience methods in the `tags` protocol.\x0a\x0a## API\x0a\x0aMy instances are used as the argument of the `#renderOn:` method of `Widget` objects.\x0a\x0aThe `#with:` method is used to compose HTML, nesting tags. `#with:` can take a `TagBrush`, a `String`, a `BlockClosure` or a `Widget` as argument.\x0a\x0a## Usage example:\x0a\x0a    aCanvas a \x0a        with: [ aCanvas span with: 'click me' ];\x0a        onClick: [ window alert: 'clicked!' ]";
 smalltalk.addMethod(

+ 2 - 0
js/Compiler-AST.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Compiler-AST", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-AST');
+smalltalk.packages["Compiler-AST"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('Node', smalltalk.Object, ['parent', 'position', 'nodes', 'shouldBeInlined', 'shouldBeAliased'], 'Compiler-AST');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Compiler-AST.js

@@ -1,5 +1,7 @@
 define("amber/Compiler-AST", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-AST');
+smalltalk.packages["Compiler-AST"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('Node', smalltalk.Object, ['parent', 'position', 'nodes', 'shouldBeInlined', 'shouldBeAliased'], 'Compiler-AST');
 smalltalk.Node.comment="I am the abstract root class of the abstract syntax tree.\x0a\x0aConcrete classes should implement `#accept:` to allow visiting.\x0a\x0a`position` holds a point containing line and column number of the symbol location in the original source file.";
 smalltalk.addMethod(

+ 2 - 0
js/Compiler-Core.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Compiler-Core", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Core');
+smalltalk.packages["Compiler-Core"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('AbstractCodeGenerator', smalltalk.Object, ['currentClass', 'source'], 'Compiler-Core');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Compiler-Core.js

@@ -1,5 +1,7 @@
 define("amber/Compiler-Core", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Core');
+smalltalk.packages["Compiler-Core"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('AbstractCodeGenerator', smalltalk.Object, ['currentClass', 'source'], 'Compiler-Core');
 smalltalk.AbstractCodeGenerator.comment="I am the abstract super class of all code generators and provide their common API.";
 smalltalk.addMethod(

+ 2 - 0
js/Compiler-Exceptions.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Compiler-Exceptions", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Exceptions');
+smalltalk.packages["Compiler-Exceptions"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('CompilerError', smalltalk.Error, [], 'Compiler-Exceptions');
 
 

+ 2 - 0
js/Compiler-Exceptions.js

@@ -1,5 +1,7 @@
 define("amber/Compiler-Exceptions", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Exceptions');
+smalltalk.packages["Compiler-Exceptions"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('CompilerError', smalltalk.Error, [], 'Compiler-Exceptions');
 smalltalk.CompilerError.comment="I am the common superclass of all compiling errors.";
 

+ 2 - 0
js/Compiler-IR.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Compiler-IR", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-IR');
+smalltalk.packages["Compiler-IR"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('IRASTTranslator', smalltalk.NodeVisitor, ['source', 'theClass', 'method', 'sequence', 'nextAlias'], 'Compiler-IR');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Compiler-IR.js

@@ -1,5 +1,7 @@
 define("amber/Compiler-IR", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-IR');
+smalltalk.packages["Compiler-IR"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('IRASTTranslator', smalltalk.NodeVisitor, ['source', 'theClass', 'method', 'sequence', 'nextAlias'], 'Compiler-IR');
 smalltalk.IRASTTranslator.comment="I am the AST (abstract syntax tree) visitor responsible for building the intermediate representation graph.";
 smalltalk.addMethod(

+ 2 - 0
js/Compiler-Inlining.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Compiler-Inlining", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Inlining');
+smalltalk.packages["Compiler-Inlining"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('IRInlinedAssignment', smalltalk.IRAssignment, [], 'Compiler-Inlining');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Compiler-Inlining.js

@@ -1,5 +1,7 @@
 define("amber/Compiler-Inlining", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Inlining');
+smalltalk.packages["Compiler-Inlining"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('IRInlinedAssignment', smalltalk.IRAssignment, [], 'Compiler-Inlining');
 smalltalk.IRInlinedAssignment.comment="I represent an inlined assignment instruction.";
 smalltalk.addMethod(

+ 2 - 0
js/Compiler-Interpreter.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Compiler-Interpreter", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Interpreter');
+smalltalk.packages["Compiler-Interpreter"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('AIContext', smalltalk.NodeVisitor, ['methodContext', 'outerContext', 'pc', 'locals', 'method'], 'Compiler-Interpreter');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Compiler-Interpreter.js

@@ -1,5 +1,7 @@
 define("amber/Compiler-Interpreter", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Interpreter');
+smalltalk.packages["Compiler-Interpreter"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('AIContext', smalltalk.NodeVisitor, ['methodContext', 'outerContext', 'pc', 'locals', 'method'], 'Compiler-Interpreter');
 smalltalk.AIContext.comment="I am like a `MethodContext`, used by the `ASTInterpreter`.\x0aUnlike a `MethodContext`, my instances are not read-only.\x0a\x0aWhen debugging, my instances are created by copying the current `MethodContext` (thisContext)";
 smalltalk.addMethod(

+ 2 - 0
js/Compiler-Semantic.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Compiler-Semantic", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Semantic');
+smalltalk.packages["Compiler-Semantic"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('LexicalScope', smalltalk.Object, ['node', 'instruction', 'temps', 'args', 'outerScope'], 'Compiler-Semantic');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Compiler-Semantic.js

@@ -1,5 +1,7 @@
 define("amber/Compiler-Semantic", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Semantic');
+smalltalk.packages["Compiler-Semantic"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('LexicalScope', smalltalk.Object, ['node', 'instruction', 'temps', 'args', 'outerScope'], 'Compiler-Semantic');
 smalltalk.LexicalScope.comment="I represent a lexical scope where variable names are associated with ScopeVars\x0aInstances are used for block scopes. Method scopes are instances of MethodLexicalScope.\x0a\x0aI am attached to a ScopeVar and method/block nodes.\x0aEach context (method/closure) get a fresh scope that inherits from its outer scope.";
 smalltalk.addMethod(

+ 2 - 0
js/Compiler-Tests.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Compiler-Tests", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Tests');
+smalltalk.packages["Compiler-Tests"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('ASTVisitorTest', smalltalk.TestCase, [], 'Compiler-Tests');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Compiler-Tests.js

@@ -1,5 +1,7 @@
 define("amber/Compiler-Tests", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Tests');
+smalltalk.packages["Compiler-Tests"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('ASTVisitorTest', smalltalk.TestCase, [], 'Compiler-Tests');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Examples.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Examples", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Examples');
+smalltalk.packages["Examples"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('Counter', smalltalk.Widget, ['count', 'header'], 'Examples');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Examples.js

@@ -1,5 +1,7 @@
 define("amber/Examples", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Examples');
+smalltalk.packages["Examples"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('Counter', smalltalk.Widget, ['count', 'header'], 'Examples');
 smalltalk.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 new appendToJQuery: 'body' asJQuery";
 smalltalk.addMethod(

+ 2 - 0
js/Helios-Announcements.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Announcements", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Announcements');
+smalltalk.packages["Helios-Announcements"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLAboutToChange', smalltalk.Object, ['actionBlock'], 'Helios-Announcements');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Announcements.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Announcements", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Announcements');
+smalltalk.packages["Helios-Announcements"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLAboutToChange', smalltalk.Object, ['actionBlock'], 'Helios-Announcements');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Browser.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Browser", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Browser');
+smalltalk.packages["Helios-Browser"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLBrowser', smalltalk.HLWidget, ['model', 'packagesListWidget', 'classesListWidget', 'protocolsListWidget', 'methodsListWidget', 'sourceWidget', 'bottomDiv'], 'Helios-Browser');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Browser.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Browser", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Browser');
+smalltalk.packages["Helios-Browser"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLBrowser', smalltalk.HLWidget, ['model', 'packagesListWidget', 'classesListWidget', 'protocolsListWidget', 'methodsListWidget', 'sourceWidget', 'bottomDiv'], 'Helios-Browser');
 smalltalk.HLBrowser.comment="I render a system browser with 4 panes (Packages, Classes, Protocols, Methods) and a source area.";
 smalltalk.addMethod(

+ 2 - 0
js/Helios-Commands-Browser.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Commands-Browser", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Commands-Browser');
+smalltalk.packages["Helios-Commands-Browser"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLBrowserCommand', smalltalk.HLToolCommand, [], 'Helios-Commands-Browser');
 
 smalltalk.addMethod(

+ 2 - 0
js/Helios-Commands-Browser.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Commands-Browser", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Commands-Browser');
+smalltalk.packages["Helios-Commands-Browser"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLBrowserCommand', smalltalk.HLToolCommand, [], 'Helios-Commands-Browser');
 
 smalltalk.addMethod(

+ 2 - 0
js/Helios-Commands-Core.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Commands-Core", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Commands-Core');
+smalltalk.packages["Helios-Commands-Core"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLCommand', smalltalk.Object, ['input'], 'Helios-Commands-Core');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Commands-Core.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Commands-Core", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Commands-Core');
+smalltalk.packages["Helios-Commands-Core"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLCommand', smalltalk.Object, ['input'], 'Helios-Commands-Core');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Commands-Tools.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Commands-Tools", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Commands-Tools');
+smalltalk.packages["Helios-Commands-Tools"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLToolCommand', smalltalk.HLModelCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Commands-Tools.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Commands-Tools", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Commands-Tools');
+smalltalk.packages["Helios-Commands-Tools"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLToolCommand', smalltalk.HLModelCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Commands.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Commands", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Commands');
+smalltalk.packages["Helios-Commands"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLCommand', smalltalk.Object, [], 'Helios-Commands');
 smalltalk.addMethod(
 "_asActionBinding",

+ 2 - 0
js/Helios-Commands.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Commands", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Commands');
+smalltalk.packages["Helios-Commands"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLCommand', smalltalk.Object, [], 'Helios-Commands');
 smalltalk.addMethod(
 "_asActionBinding",

+ 2 - 0
js/Helios-Core.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Core", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Core');
+smalltalk.packages["Helios-Core"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLModel', smalltalk.Object, ['announcer', 'environment'], 'Helios-Core');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Core.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Core", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Core');
+smalltalk.packages["Helios-Core"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLModel', smalltalk.Object, ['announcer', 'environment'], 'Helios-Core');
 smalltalk.HLModel.comment="I am the abstract superclass of all models of Helios.\x0aI am the \x22Model\x22 part of the MVC pattern implementation in Helios.\x0a\x0aI provide access to an `Environment` object and both a local (model-specific) and global (system-specific) announcer.\x0a\x0aThe `#withChangesDo:` method is handy for performing model changes ensuring that all widgets are aware of the change and can prevent it from happening.\x0a\x0aModifications of the system should be done via commands (see `HLCommand` and subclasses).\x0a\x0a";
 smalltalk.addMethod(

+ 2 - 0
js/Helios-Debugger.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Debugger", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Debugger');
+smalltalk.packages["Helios-Debugger"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLContextInspectorDecorator', smalltalk.Object, ['context'], 'Helios-Debugger');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Debugger.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Debugger", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Debugger');
+smalltalk.packages["Helios-Debugger"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLContextInspectorDecorator', smalltalk.Object, ['context'], 'Helios-Debugger');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Exceptions.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Exceptions", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Exceptions');
+smalltalk.packages["Helios-Exceptions"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLError', smalltalk.Error, [], 'Helios-Exceptions');
 
 

+ 2 - 0
js/Helios-Exceptions.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Exceptions", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Exceptions');
+smalltalk.packages["Helios-Exceptions"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLError', smalltalk.Error, [], 'Helios-Exceptions');
 
 

+ 2 - 0
js/Helios-Inspector.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Inspector", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Inspector');
+smalltalk.packages["Helios-Inspector"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLInspectorDisplayWidget', smalltalk.HLNavigationListWidget, ['model'], 'Helios-Inspector');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Inspector.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Inspector", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Inspector');
+smalltalk.packages["Helios-Inspector"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLInspectorDisplayWidget', smalltalk.HLNavigationListWidget, ['model'], 'Helios-Inspector');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-KeyBindings.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Helios-KeyBindings", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-KeyBindings');
+smalltalk.packages["Helios-KeyBindings"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLBinding', smalltalk.Object, ['key', 'label'], 'Helios-KeyBindings');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-KeyBindings.js

@@ -1,5 +1,7 @@
 define("amber/Helios-KeyBindings", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-KeyBindings');
+smalltalk.packages["Helios-KeyBindings"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLBinding', smalltalk.Object, ['key', 'label'], 'Helios-KeyBindings');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Layout.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Layout", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Layout');
+smalltalk.packages["Helios-Layout"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLContainer', smalltalk.HLWidget, ['splitter'], 'Helios-Layout');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Layout.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Layout", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Layout');
+smalltalk.packages["Helios-Layout"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLContainer', smalltalk.HLWidget, ['splitter'], 'Helios-Layout');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-References.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Helios-References", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-References');
+smalltalk.packages["Helios-References"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLMethodReference', smalltalk.Object, ['selector', 'methodClass'], 'Helios-References');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-References.js

@@ -1,5 +1,7 @@
 define("amber/Helios-References", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-References');
+smalltalk.packages["Helios-References"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLMethodReference', smalltalk.Object, ['selector', 'methodClass'], 'Helios-References');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Transcript.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Transcript", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Transcript');
+smalltalk.packages["Helios-Transcript"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLTranscript', smalltalk.HLWidget, ['textarea'], 'Helios-Transcript');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Transcript.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Transcript", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Transcript');
+smalltalk.packages["Helios-Transcript"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLTranscript', smalltalk.HLWidget, ['textarea'], 'Helios-Transcript');
 smalltalk.HLTranscript.comment="I am a widget responsible for displaying transcript contents.\x0a\x0a## Transcript API\x0a\x0a    Transcript \x0a        show: 'hello world';\x0a        cr;\x0a        show: anObject.\x0a\x0a    Transcript clear.\x0a\x0aSee the `Transcript` class.";
 smalltalk.addMethod(

+ 2 - 0
js/Helios-Workspace-Tests.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Workspace-Tests", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Workspace-Tests');
+smalltalk.packages["Helios-Workspace-Tests"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLCodeWidgetTest', smalltalk.TestCase, [], 'Helios-Workspace-Tests');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Workspace-Tests.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Workspace-Tests", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Workspace-Tests');
+smalltalk.packages["Helios-Workspace-Tests"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLCodeWidgetTest', smalltalk.TestCase, [], 'Helios-Workspace-Tests');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Workspace.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Workspace", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Workspace');
+smalltalk.packages["Helios-Workspace"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLCodeModel', smalltalk.Object, ['announcer', 'environment', 'receiver'], 'Helios-Workspace');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Helios-Workspace.js

@@ -1,5 +1,7 @@
 define("amber/Helios-Workspace", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Workspace');
+smalltalk.packages["Helios-Workspace"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('HLCodeModel', smalltalk.Object, ['announcer', 'environment', 'receiver'], 'Helios-Workspace');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/IDE.deploy.js

@@ -1,5 +1,7 @@
 define("amber/IDE", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('IDE');
+smalltalk.packages["IDE"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('ClassesList', smalltalk.Widget, ['browser', 'ul', 'nodes'], 'IDE');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/IDE.js

@@ -1,5 +1,7 @@
 define("amber/IDE", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('IDE');
+smalltalk.packages["IDE"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('ClassesList', smalltalk.Widget, ['browser', 'ul', 'nodes'], 'IDE');
 smalltalk.addMethod(
 smalltalk.method({

Разница между файлами не показана из-за своего большого размера
+ 420 - 360
js/Importer-Exporter.deploy.js


Разница между файлами не показана из-за своего большого размера
+ 547 - 461
js/Importer-Exporter.js


+ 2 - 0
js/Kernel-Announcements.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Kernel-Announcements", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Announcements');
+smalltalk.packages["Kernel-Announcements"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('AnnouncementSubscription', smalltalk.Object, ['valuable', 'announcementClass'], 'Kernel-Announcements');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Kernel-Announcements.js

@@ -1,5 +1,7 @@
 define("amber/Kernel-Announcements", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Announcements');
+smalltalk.packages["Kernel-Announcements"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('AnnouncementSubscription', smalltalk.Object, ['valuable', 'announcementClass'], 'Kernel-Announcements');
 smalltalk.AnnouncementSubscription.comment="I am a single entry in a subscription registry of an `Announcer`.\x0aSeveral subscriptions by the same object is possible.";
 smalltalk.addMethod(

+ 2 - 0
js/Kernel-Classes.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Kernel-Classes", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Classes');
+smalltalk.packages["Kernel-Classes"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel-Classes');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Kernel-Classes.js

@@ -1,5 +1,7 @@
 define("amber/Kernel-Classes", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Classes');
+smalltalk.packages["Kernel-Classes"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel-Classes');
 smalltalk.Behavior.comment="I am the superclass of all class objects.\x0a\x0aI define the protocol for creating instances of a class with `#basicNew` and `#new` (see `boot.js` for class constructors details).\x0a\x0aMy instances know about the subclass/superclass relationships between classes, contain the description that instances are created from,\x0aand hold the method dictionary that's associated with each class.\x0a\x0aI also provides methods for compiling methods, examining the method dictionary, and iterating over the class hierarchy.";
 smalltalk.addMethod(

+ 2 - 0
js/Kernel-Collections.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Kernel-Collections", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Collections');
+smalltalk.packages["Kernel-Collections"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel-Collections');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Kernel-Collections.js

@@ -1,5 +1,7 @@
 define("amber/Kernel-Collections", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Collections');
+smalltalk.packages["Kernel-Collections"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel-Collections');
 smalltalk.Association.comment="I represent a pair of associated objects, a key and a value. My instances can serve as entries in a dictionary.\x0a\x0aInstances can be created with the class-side method `#key:value:`";
 smalltalk.addMethod(

+ 2 - 0
js/Kernel-Exceptions.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Kernel-Exceptions", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Exceptions');
+smalltalk.packages["Kernel-Exceptions"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel-Exceptions');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Kernel-Exceptions.js

@@ -1,5 +1,7 @@
 define("amber/Kernel-Exceptions", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Exceptions');
+smalltalk.packages["Kernel-Exceptions"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel-Exceptions');
 smalltalk.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.";
 smalltalk.addMethod(

+ 2 - 0
js/Kernel-Methods.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Kernel-Methods", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Methods');
+smalltalk.packages["Kernel-Methods"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel-Methods');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Kernel-Methods.js

@@ -1,5 +1,7 @@
 define("amber/Kernel-Methods", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Methods');
+smalltalk.packages["Kernel-Methods"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel-Methods');
 smalltalk.BlockClosure.comment="I represent a lexical closure.\x0aI am is directly mapped to JavaScript Function.\x0a\x0a## API\x0a\x0a1. Evaluation\x0a\x0a    My instances get evaluated with the `#value*` methods in the 'evaluating' protocol.\x0a\x0a    Example: ` [ :x | x + 1 ] value: 3 \x22Answers 4\x22 `\x0a\x0a2. Control structures\x0a\x0a    Blocks are used (together with `Boolean`) for control structures (methods in the `controlling` protocol).\x0a\x0a    Example: `aBlock whileTrue: [ ... ]`\x0a\x0a3. Error handling\x0a\x0a    I provide the `#on:do:` method for handling exceptions.\x0a\x0a    Example: ` aBlock on: MessageNotUnderstood do: [ :ex | ... ] `";
 smalltalk.addMethod(

+ 2 - 0
js/Kernel-Objects.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Kernel-Objects", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Objects');
+smalltalk.packages["Kernel-Objects"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel-Objects');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Kernel-Objects.js

@@ -1,5 +1,7 @@
 define("amber/Kernel-Objects", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Objects');
+smalltalk.packages["Kernel-Objects"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel-Objects');
 smalltalk.Object.comment="**I am the root of the Smalltalk class system**. All classes in the system are subclasses of me.\x0a\x0aI provide default behavior common to all normal objects, such as:\x0a\x0a- accessing\x0a- copying\x0a- comparison\x0a- error handling\x0a- message sending\x0a- reflection\x0a\x0aAlso utility messages that all objects should respond to are defined here.\x0a\x0aI have no instance variable.\x0a\x0a##Access\x0a\x0aInstance variables can be accessed with `#instVarAt:` and `#instVarAt:put:`. `#instanceVariableNames` answers a collection of all instance variable names.\x0aAccessing JavaScript properties of an object is done through `#basicAt:`, `#basicAt:put:` and `basicDelete:`.\x0a\x0a##Copying\x0a\x0aCopying an object is handled by `#copy` and `#deepCopy`. The first one performs a shallow copy of the receiver, while the second one performs a deep copy.\x0aThe hook method `#postCopy` can be overriden in subclasses to copy fields as necessary to complete the full copy. It will be sent by the copy of the receiver.\x0a\x0a##Comparison\x0a\x0aI understand equality `#=` and identity `#==` comparison.\x0a\x0a##Error handling\x0a\x0a- `#halt` is the typical message to use for inserting breakpoints during debugging.\x0a- `#error:` throws a generic error exception\x0a- `#doesNotUnderstand:` handles the fact that there was an attempt to send the given message to the receiver but the receiver does not understand this message.\x0a\x09Overriding this message can be useful to implement proxies for example.";
 smalltalk.addMethod(

+ 2 - 0
js/Kernel-Tests.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Kernel-Tests", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Tests');
+smalltalk.packages["Kernel-Tests"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('BlockClosureTest', smalltalk.TestCase, [], 'Kernel-Tests');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Kernel-Tests.js

@@ -1,5 +1,7 @@
 define("amber/Kernel-Tests", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Tests');
+smalltalk.packages["Kernel-Tests"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('BlockClosureTest', smalltalk.TestCase, [], 'Kernel-Tests');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Kernel-Transcript.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Kernel-Transcript", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Transcript');
+smalltalk.packages["Kernel-Transcript"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('ConsoleTranscript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Kernel-Transcript.js

@@ -1,5 +1,7 @@
 define("amber/Kernel-Transcript", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Transcript');
+smalltalk.packages["Kernel-Transcript"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('ConsoleTranscript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
 smalltalk.ConsoleTranscript.comment="I am a specific transcript emitting to the JavaScript console.\x0a\x0aIf no other transcript is registered, I am the default.";
 smalltalk.addMethod(

+ 2 - 0
js/SUnit-Tests.deploy.js

@@ -1,5 +1,7 @@
 define("amber/SUnit-Tests", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('SUnit-Tests');
+smalltalk.packages["SUnit-Tests"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('ExampleSetTest', smalltalk.TestCase, ['empty', 'full'], 'SUnit-Tests');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/SUnit-Tests.js

@@ -1,5 +1,7 @@
 define("amber/SUnit-Tests", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('SUnit-Tests');
+smalltalk.packages["SUnit-Tests"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('ExampleSetTest', smalltalk.TestCase, ['empty', 'full'], 'SUnit-Tests');
 smalltalk.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.";
 smalltalk.addMethod(

+ 2 - 0
js/SUnit.deploy.js

@@ -1,5 +1,7 @@
 define("amber/SUnit", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('SUnit');
+smalltalk.packages["SUnit"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('ResultAnnouncement', smalltalk.Object, ['result'], 'SUnit');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/SUnit.js

@@ -1,5 +1,7 @@
 define("amber/SUnit", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('SUnit');
+smalltalk.packages["SUnit"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('ResultAnnouncement', smalltalk.Object, ['result'], 'SUnit');
 smalltalk.ResultAnnouncement.comment="I get signaled when a `TestCase` has been run.\x0a\x0aMy instances hold the result (instance of `TestResult`) of the test run.";
 smalltalk.addMethod(

+ 2 - 0
js/Spaces.deploy.js

@@ -1,5 +1,7 @@
 define("amber/Spaces", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Spaces');
+smalltalk.packages["Spaces"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('ObjectSpace', smalltalk.Object, ['frame'], 'Spaces');
 smalltalk.addMethod(
 smalltalk.method({

+ 2 - 0
js/Spaces.js

@@ -1,5 +1,7 @@
 define("amber/Spaces", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Spaces');
+smalltalk.packages["Spaces"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('ObjectSpace', smalltalk.Object, ['frame'], 'Spaces');
 smalltalk.ObjectSpace.comment="I am a connection to another Smalltalk environment.\x0aThe implementation creates an iframe on the same location as the window, and connect to the Amber environment.\x0a\x0a\x0a\x0a## Usage example:\x0a\x0a\x09| space |\x0a\x09\x0a\x09space := ObjectSpace new.\x0a\x09space do: [ smalltalk ] \x22Answers aSmalltalk\x22\x0a\x09(space do: [ smalltalk ]) == smalltalk \x22Answers false\x22\x0a\x09\x0a\x09space release \x22Remove the object space environment\x22";
 smalltalk.addMethod(

+ 1 - 1
package.json

@@ -39,6 +39,6 @@
     "grunt-contrib-jshint": "~0.3.0",
     "grunt-image-embed": "~0.1.3",
     "grunt-contrib-mincss": "~0.3.2",
-    "amdefine": "0.0.5"
+    "amdefine": "0.0.6"
   }
 }

+ 397 - 192
st/Importer-Exporter.st

@@ -1,5 +1,189 @@
-define("amber/Importer-Exporter", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 Smalltalk current createPackage: 'Importer-Exporter'!
+Object subclass: #AmdExporter
+	instanceVariableNames: ''
+	package: 'Importer-Exporter'!
+
+!AmdExporter class methodsFor: 'exporting-output'!
+
+exportPackageEpilogueOf: aPackage on: aStream
+	aStream
+		nextPutAll: '});';
+		lf
+!
+
+exportPackagePrologueOf: aPackage on: aStream
+	aStream
+		nextPutAll: 'define("';
+		nextPutAll: (aPackage amdNamespace ifNil: [ 'amber' ]); "ifNil: only for LegacyPH, it should not happen with AmdPH"
+		nextPutAll: '/';
+		nextPutAll: aPackage name;
+		nextPutAll: '", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){';
+		lf
+!
+
+exportPackageTransportOf: aPackage on: aStream
+	aStream
+		nextPutAll: 'smalltalk.packages[';
+		nextPutAll: aPackage name asJavascript;
+		nextPutAll: '].transport = ';
+		nextPutAll: aPackage transportJson;
+		nextPutAll: ';';
+		lf
+! !
+
+Object subclass: #ChunkExporter
+	instanceVariableNames: ''
+	package: 'Importer-Exporter'!
+!ChunkExporter commentStamp!
+I am an exporter dedicated to outputting Amber source code in the classic Smalltalk chunk format.
+
+I do not output any compiled code.!
+
+!ChunkExporter class methodsFor: 'exporting-accessing'!
+
+extensionCategoriesOfPackage: package
+	"Issue #143: sort protocol alphabetically"
+
+	| name map result |
+	name := package name.
+	result := OrderedCollection new.
+	(Package sortedClasses: Smalltalk current classes) do: [:each |
+		{each. each class} do: [:aClass |
+			map := Dictionary new.
+			aClass protocolsDo: [:category :methods |
+				(category match: '^\*', name) ifTrue: [ map at: category put: methods ]].
+			result addAll: ((map keys sorted: [:a :b | a <= b ]) collect: [:category |
+				#{ 'methods'->(map at: category). 'name'->category. 'class'->aClass}]) ]].
+	^result
+!
+
+methodsOfCategory: category
+	"Issue #143: sort methods alphabetically"
+
+	^(category at: #methods) sorted: [:a :b | a selector <= b selector]
+!
+
+ownCategoriesOfClass: aClass
+	"Issue #143: sort protocol alphabetically"
+
+	| map |
+	map := Dictionary new.
+	aClass protocolsDo: [:category :methods |
+		(category match: '^\*') ifFalse: [ map at: category put: methods ]].
+	^(map keys sorted: [:a :b | a <= b ]) collect: [:category |
+		#{
+			'methods'->(map at: category).
+			'name'->category.
+			'class'->aClass }]
+!
+
+ownCategoriesOfMetaClass: aClass
+	"Issue #143: sort protocol alphabetically"
+
+	^self ownCategoriesOfClass: aClass class
+! !
+
+!ChunkExporter class methodsFor: 'exporting-output'!
+
+exportCategoryEpilogueOf: category on: aStream
+	aStream nextPutAll: ' !!'; lf; lf
+!
+
+exportCategoryPrologueOf: category on: aStream
+	aStream
+		nextPutAll: '!!', (self classNameFor: (category at: #class));
+		nextPutAll: ' methodsFor: ''', (category at: #name), '''!!'
+!
+
+exportDefinitionOf: aClass on: aStream
+	"Chunk format."
+
+	aStream
+		nextPutAll: (self classNameFor: aClass superclass);
+		nextPutAll: ' subclass: #', (self classNameFor: aClass); lf;
+		tab; nextPutAll: 'instanceVariableNames: '''.
+	aClass instanceVariableNames
+		do: [:each | aStream nextPutAll: each]
+		separatedBy: [aStream nextPutAll: ' '].
+	aStream
+		nextPutAll: ''''; lf;
+		tab; nextPutAll: 'package: ''', aClass category, '''!!'; lf.
+	aClass comment notEmpty ifTrue: [
+		aStream
+		nextPutAll: '!!', (self classNameFor: aClass), ' commentStamp!!';lf;
+		nextPutAll: (self chunkEscape: aClass comment), '!!';lf].
+	aStream lf
+!
+
+exportMetaDefinitionOf: aClass on: aStream
+
+	aClass class instanceVariableNames isEmpty ifFalse: [
+		aStream
+			nextPutAll: (self classNameFor: aClass class);
+			nextPutAll: ' instanceVariableNames: '''.
+		aClass class instanceVariableNames
+			do: [:each | aStream nextPutAll: each]
+			separatedBy: [aStream nextPutAll: ' '].
+		aStream
+			nextPutAll: '''!!'; lf; lf]
+!
+
+exportMethod: aMethod on: aStream
+	aStream
+		lf; lf; nextPutAll: (self chunkEscape: aMethod source); lf;
+		nextPutAll: '!!'
+!
+
+exportPackageDefinitionOf: package on: aStream
+	"Chunk format."
+
+	aStream
+		nextPutAll: 'Smalltalk current createPackage: ''', package name, '''!!';
+		lf
+! !
+
+!ChunkExporter class methodsFor: 'fileOut'!
+
+recipe
+	"Export a given package."
+
+	| exportCategoryRecipe |
+	exportCategoryRecipe := {
+		self -> #exportCategoryPrologueOf:on:.
+		{
+			self -> #methodsOfCategory:.
+			self -> #exportMethod:on: }.
+		self -> #exportCategoryEpilogueOf:on: }.
+
+	^{
+		self -> #exportPackageDefinitionOf:on:.
+		{
+			PluggableExporter -> #ownClassesOfPackage:.
+			self -> #exportDefinitionOf:on:.
+			{ self -> #ownCategoriesOfClass: }, exportCategoryRecipe.
+			self -> #exportMetaDefinitionOf:on:.
+			{ self -> #ownCategoriesOfMetaClass: }, exportCategoryRecipe }.
+		{ self -> #extensionCategoriesOfPackage: }, exportCategoryRecipe
+	}
+! !
+
+!ChunkExporter class methodsFor: 'private'!
+
+chunkEscape: aString
+	"Replace all occurrences of !! with !!!! and trim at both ends."
+
+	^(aString replace: '!!' with: '!!!!') trimBoth
+!
+
+classNameFor: aClass
+	^aClass isMetaclass
+		ifTrue: [aClass instanceClass name, ' class']
+		ifFalse: [
+		aClass isNil
+			ifTrue: ['nil']
+			ifFalse: [aClass name]]
+! !
+
 Object subclass: #ChunkParser
 	instanceVariableNames: 'stream'
 	package: 'Importer-Exporter'!
@@ -65,59 +249,40 @@ I am typically used to save code outside of the Amber runtime (committing to dis
 
 Use `#exportAll`, `#exportClass:` or `#exportPackage:` methods.!
 
-!Exporter methodsFor: 'fileOut'!
+!Exporter class methodsFor: 'exporting-accessing'!
 
-exportAll
-	"Export all packages in the system."
+extensionMethodsOfPackage: package
+	"Issue #143: sort classes and methods alphabetically"
 
-	^String streamContents: [:stream |
-		Smalltalk current packages do: [:pkg |
-		stream nextPutAll: (self exportPackage: pkg name)]]
+	| name result |
+	name := package name.
+	result := OrderedCollection new.
+	(Package sortedClasses: Smalltalk current classes) do: [:each |
+		{each. each class} do: [:aClass |
+			result addAll: (((aClass methodDictionary values)
+				sorted: [:a :b | a selector <= b selector])
+				select: [:method | method category match: '^\*', name]) ]].
+	^result
 !
 
-exportClass: aClass
-	"Export a single class. Subclasses override these methods."
+ownMethodsOfClass: aClass
+	"Issue #143: sort methods alphabetically"
 
-	^String streamContents: [:stream |
-		self exportDefinitionOf: aClass on: stream.
-		self exportMethodsOf: aClass on: stream.
-		self exportMetaDefinitionOf: aClass on: stream.
-		self exportMethodsOf: aClass class on: stream]
+	^((aClass methodDictionary values) sorted: [:a :b | a selector <= b selector])
+		reject: [:each | (each category match: '^\*')]
 !
 
-exportPackage: packageName
-	"Export a given package by name."
-
-	| package |
-	^String streamContents: [:stream |
-		package := Smalltalk current packageAt: packageName.
-		self exportPackagePrologueOf: package on: stream.
-		[
-			self exportPackageDefinitionOf: package on: stream.
+ownMethodsOfMetaClass: aClass
+	"Issue #143: sort methods alphabetically"
 
-			"Export classes in dependency order.
-			Update (issue #171): Remove duplicates for export"
-			package sortedClasses asSet do: [:each |
-						stream nextPutAll: (self exportClass: each)].
-			self exportPackageExtensionsOf: package on: stream
-		] ensure: [
-			self exportPackageEpilogueOn: stream
-		]]
+	^self ownMethodsOfClass: aClass class
 ! !
 
-!Exporter methodsFor: 'private'!
-
-classNameFor: aClass
-	^aClass isMetaclass
-		ifTrue: [aClass instanceClass name, '.klass']
-		ifFalse: [
-		aClass isNil
-			ifTrue: ['nil']
-			ifFalse: [aClass name]]
-!
+!Exporter class methodsFor: 'exporting-output'!
 
 exportDefinitionOf: aClass on: aStream
 	aStream
+		lf;
 		nextPutAll: 'smalltalk.addClass(';
 		nextPutAll: '''', (self classNameFor: aClass), ''', ';
 		nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);
@@ -141,6 +306,7 @@ exportDefinitionOf: aClass on: aStream
 !
 
 exportMetaDefinitionOf: aClass on: aStream
+	aStream lf.
 	aClass class instanceVariableNames isEmpty ifFalse: [
 		aStream
 		nextPutAll: 'smalltalk.', (self classNameFor: aClass class);
@@ -151,7 +317,7 @@ exportMetaDefinitionOf: aClass on: aStream
 		aStream nextPutAll: '];', String lf]
 !
 
-exportMethod: aMethod of: aClass on: aStream
+exportMethod: aMethod on: aStream
 	aStream
 		nextPutAll: 'smalltalk.addMethod(';lf;
 		"nextPutAll: aMethod selector asSelector asJavascript, ',';lf;"
@@ -166,19 +332,10 @@ exportMethod: aMethod of: aClass on: aStream
 	aStream
 		lf;
 		nextPutAll: '}),';lf;
-		nextPutAll: 'smalltalk.', (self classNameFor: aClass);
+		nextPutAll: 'smalltalk.', (self classNameFor: aMethod methodClass);
 		nextPutAll: ');';lf;lf
 !
 
-exportMethodsOf: aClass on: aStream
-	"Issue #143: sort methods alphabetically"
-
-	((aClass methodDictionary values) sorted: [:a :b | a selector <= b selector]) do: [:each |
-		(each category match: '^\*') ifFalse: [
-			self exportMethod: each of: aClass on: aStream]].
-	aStream lf
-!
-
 exportPackageDefinitionOf: package on: aStream
 	aStream
 		nextPutAll: 'smalltalk.addPackage(';
@@ -186,154 +343,62 @@ exportPackageDefinitionOf: package on: aStream
 		lf
 !
 
-exportPackageEpilogueOn: aStream
+exportPackageEpilogueOf: aPackage on: aStream
 	aStream
-		nextPutAll: '});';
+		nextPutAll: '})(global_smalltalk,global_nil,global__st);';
 		lf
 !
 
-exportPackageExtensionsOf: package on: aStream
-	"Issue #143: sort classes and methods alphabetically"
-
-	| name |
-	name := package name.
-	(Package sortedClasses: Smalltalk current classes) do: [:each |
-		{each. each class} do: [:aClass |
-			((aClass methodDictionary values) sorted: [:a :b | a selector <= b selector]) do: [:method |
-				(method category match: '^\*', name) ifTrue: [
-					self exportMethod: method of: aClass on: aStream ]]]]
-!
-
 exportPackagePrologueOf: aPackage on: aStream
 	aStream
-		nextPutAll: 'define("amber/';
-		nextPutAll: aPackage name;
-		nextPutAll: '", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){';
+		nextPutAll: '(function(smalltalk,nil,_st){';
 		lf
 ! !
 
-Exporter subclass: #ChunkExporter
-	instanceVariableNames: ''
-	package: 'Importer-Exporter'!
-!ChunkExporter commentStamp!
-I am an exporter dedicated to outputting Amber source code in the classic Smalltalk chunk format.
-
-I do not output any compiled code.!
-
-!ChunkExporter methodsFor: 'private'!
-
-chunkEscape: aString
-	"Replace all occurrences of !! with !!!! and trim at both ends."
+!Exporter class methodsFor: 'fileOut'!
+
+amdRecipe
+	"Export a given package with amd transport type."
+
+	| legacy |
+	legacy := self recipe.
+	^(legacy copyFrom: 1 to: 2),
+	{ AmdExporter -> #exportPackageTransportOf:on: },
+	(legacy copyFrom: 3 to: legacy size)
+!
+
+recipe
+	"Export a given package."
+
+	^{
+		AmdExporter -> #exportPackagePrologueOf:on:.
+		self -> #exportPackageDefinitionOf:on:.
+		{
+			PluggableExporter -> #ownClassesOfPackage:.
+			self -> #exportDefinitionOf:on:.
+			{
+				self -> #ownMethodsOfClass:.
+				self -> #exportMethod:on: }.
+			self -> #exportMetaDefinitionOf:on:.
+			{
+				self -> #ownMethodsOfMetaClass:.
+				self -> #exportMethod:on: } }.
+		{
+			self -> #extensionMethodsOfPackage:.
+			self -> #exportMethod:on: }.
+		AmdExporter -> #exportPackageEpilogueOf:on:
+	}
+! !
 
-	^(aString replace: '!!' with: '!!!!') trimBoth
-!
+!Exporter class methodsFor: 'private'!
 
 classNameFor: aClass
 	^aClass isMetaclass
-		ifTrue: [aClass instanceClass name, ' class']
+		ifTrue: [aClass instanceClass name, '.klass']
 		ifFalse: [
 		aClass isNil
 			ifTrue: ['nil']
 			ifFalse: [aClass name]]
-!
-
-exportDefinitionOf: aClass on: aStream
-	"Chunk format."
-
-	aStream
-		nextPutAll: (self classNameFor: aClass superclass);
-		nextPutAll: ' subclass: #', (self classNameFor: aClass); lf;
-		tab; nextPutAll: 'instanceVariableNames: '''.
-	aClass instanceVariableNames
-		do: [:each | aStream nextPutAll: each]
-		separatedBy: [aStream nextPutAll: ' '].
-	aStream
-		nextPutAll: ''''; lf;
-		tab; nextPutAll: 'package: ''', aClass category, '''!!'; lf.
-	aClass comment notEmpty ifTrue: [
-		aStream
-		nextPutAll: '!!', (self classNameFor: aClass), ' commentStamp!!';lf;
-		nextPutAll: (self chunkEscape: aClass comment), '!!';lf].
-	aStream lf
-!
-
-exportMetaDefinitionOf: aClass on: aStream
-
-	aClass class instanceVariableNames isEmpty ifFalse: [
-		aStream
-			nextPutAll: (self classNameFor: aClass class);
-			nextPutAll: ' instanceVariableNames: '''.
-		aClass class instanceVariableNames
-			do: [:each | aStream nextPutAll: each]
-			separatedBy: [aStream nextPutAll: ' '].
-		aStream
-			nextPutAll: '''!!'; lf; lf]
-!
-
-exportMethod: aMethod of: aClass on: aStream
-	aStream
-		lf; lf; nextPutAll: (self chunkEscape: aMethod source); lf;
-		nextPutAll: '!!'
-!
-
-exportMethods: methods category: category of: aClass on: aStream
-	"Issue #143: sort methods alphabetically"
-
-	aStream
-		nextPutAll: '!!', (self classNameFor: aClass);
-		nextPutAll: ' methodsFor: ''', category, '''!!'.
-		(methods sorted: [:a :b | a selector <= b selector]) do: [:each |
-				self exportMethod: each of: aClass on: aStream].
-	aStream nextPutAll: ' !!'; lf; lf
-!
-
-exportMethodsOf: aClass on: aStream
-	"Issue #143: sort protocol alphabetically"
-
-	| map |
-	map := Dictionary new.
-	aClass protocolsDo: [:category :methods |
-		(category match: '^\*') ifFalse: [ map at: category put: methods ]].
-	(map keys sorted: [:a :b | a <= b ]) do: [:category | | methods |
-		methods := map at: category.
-		self
-			exportMethods: methods
-			category: category
-			of: aClass
-			on: aStream ]
-!
-
-exportPackageDefinitionOf: package on: aStream
-	"Chunk format."
-
-	aStream
-		nextPutAll: 'Smalltalk current createPackage: ''', package name, '''!!';
-		lf
-!
-
-exportPackageEpilogueOn: aStream
-!
-
-exportPackageExtensionsOf: package on: aStream
-	"We need to override this one too since we need to group
-	all methods in a given protocol under a leading methodsFor: chunk
-	for that class."
-
-	"Issue #143: sort protocol alphabetically"
-
-	| name map |
-	name := package name.
-	(Package sortedClasses: Smalltalk current classes) do: [:each |
-		{each. each class} do: [:aClass |
-			map := Dictionary new.
-			aClass protocolsDo: [:category :methods |
-				(category match: '^\*', name) ifTrue: [ map at: category put: methods ]].
-			(map keys sorted: [:a :b | a <= b ]) do: [:category | | methods |
-				methods := map at: category.
-				self exportMethods: methods category: category of: aClass on: aStream ]]]
-!
-
-exportPackagePrologueOn: aStream
 ! !
 
 Exporter subclass: #StrippedExporter
@@ -342,10 +407,11 @@ Exporter subclass: #StrippedExporter
 !StrippedExporter commentStamp!
 I export Amber code into a JavaScript string, but without any optional associated data like the Amber source code.!
 
-!StrippedExporter methodsFor: 'private'!
+!StrippedExporter class methodsFor: 'exporting-output'!
 
 exportDefinitionOf: aClass on: aStream
 	aStream
+		lf;
 		nextPutAll: 'smalltalk.addClass(';
 		nextPutAll: '''', (self classNameFor: aClass), ''', ';
 		nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);
@@ -360,7 +426,7 @@ exportDefinitionOf: aClass on: aStream
 	aStream lf
 !
 
-exportMethod: aMethod of: aClass on: aStream
+exportMethod: aMethod on: aStream
 	aStream
 		nextPutAll: 'smalltalk.addMethod(';lf;
 		"nextPutAll: aMethod selector asSelector asJavascript, ',';lf;"
@@ -369,7 +435,7 @@ exportMethod: aMethod of: aClass on: aStream
 		nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;
 		nextPutAll: 'messageSends: ', aMethod messageSends asJavascript;
 		nextPutAll: '}),';lf;
-		nextPutAll: 'smalltalk.', (self classNameFor: aClass);
+		nextPutAll: 'smalltalk.', (self classNameFor: aMethod methodClass);
 		nextPutAll: ');';lf;lf
 ! !
 
@@ -415,7 +481,8 @@ commit: aPackage
 	self commitChannels
 		do: [ :commitStrategyFactory || fileContents commitStrategy |
 			commitStrategy := commitStrategyFactory value: aPackage.
-			fileContents := (commitStrategy key exportPackage: aPackage name).
+			fileContents := String streamContents: [ :stream |
+				(PluggableExporter newUsing: commitStrategy key) exportPackage: aPackage on: stream ].
 			self ajaxPutAt: commitStrategy value data: fileContents ]
 		displayingProgress: 'Committing package ', aPackage name
 ! !
@@ -461,6 +528,74 @@ registerFor: aString
 	PackageHandler register: self for: aString
 ! !
 
+PackageHandler subclass: #AmdPackageHandler
+	instanceVariableNames: ''
+	package: 'Importer-Exporter'!
+!AmdPackageHandler commentStamp!
+I am responsible for handling package loading and committing.
+
+I should not be used directly. Instead, use the corresponding `Package` methods.!
+
+!AmdPackageHandler methodsFor: 'committing'!
+
+commitChannels
+	^{ 
+		[ :pkg | Exporter amdRecipe -> (pkg commitPathJs, '/', pkg name, '.js') ].
+		[ :pkg | StrippedExporter amdRecipe -> (pkg commitPathJs, '/', pkg name, '.deploy.js') ].
+		[ :pkg | ChunkExporter recipe -> (pkg commitPathSt, '/', pkg name, '.st') ]
+	}
+!
+
+commitPathJsFor: aPackage
+	^self toUrl: (self namespaceFor: aPackage)
+!
+
+commitPathStFor: aPackage
+	"if _source is not mapped, .st commit will likely fail"
+	^self toUrl: (self namespaceFor: aPackage), '/_source'.
+!
+
+namespaceFor: aPackage
+	^aPackage amdNamespace
+		ifNil: [ aPackage amdNamespace: self class defaultNamespace; amdNamespace ]
+! !
+
+!AmdPackageHandler methodsFor: 'private'!
+
+toUrl: aString
+	(Smalltalk current at: '_amd_require')
+		ifNil: [ self error: 'AMD loader not present' ]
+		ifNotNil: [ :require | ^(require basicAt: 'toUrl') value: aString ]
+! !
+
+AmdPackageHandler class instanceVariableNames: 'defaultNamespace'!
+
+!AmdPackageHandler class methodsFor: 'commit paths'!
+
+commitPathsFromLoader
+	"TODO"
+!
+
+defaultNamespace
+	^ defaultNamespace ifNil: [ self error: 'AMD default namespace not set.' ]
+!
+
+defaultNamespace: aString
+	defaultNamespace := aString
+!
+
+resetCommitPaths
+	defaultNamespace := nil
+! !
+
+!AmdPackageHandler class methodsFor: 'initialization'!
+
+initialize
+	super initialize.
+	self registerFor: 'amd'.
+	self commitPathsFromLoader
+! !
+
 PackageHandler subclass: #LegacyPackageHandler
 	instanceVariableNames: ''
 	package: 'Importer-Exporter'!
@@ -473,9 +608,9 @@ I should not be used directly. Instead, use the corresponding `Package` methods.
 
 commitChannels
 	^{ 
-		[ :pkg | Exporter new -> (pkg commitPathJs, '/', pkg name, '.js') ].
-		[ :pkg | StrippedExporter new -> (pkg commitPathJs, '/', pkg name, '.deploy.js') ].
-		[ :pkg | ChunkExporter new -> (pkg commitPathSt, '/', pkg name, '.st') ]
+		[ :pkg | Exporter recipe -> (pkg commitPathJs, '/', pkg name, '.js') ].
+		[ :pkg | StrippedExporter recipe -> (pkg commitPathJs, '/', pkg name, '.deploy.js') ].
+		[ :pkg | ChunkExporter recipe -> (pkg commitPathSt, '/', pkg name, '.st') ]
 	}
 !
 
@@ -567,14 +702,80 @@ loadPackages: aCollection prefix: aString
 	^ self new loadPackages: aCollection prefix: aString
 ! !
 
+Object subclass: #PluggableExporter
+	instanceVariableNames: 'recipe'
+	package: 'Importer-Exporter'!
+
+!PluggableExporter methodsFor: 'accessing'!
+
+recipe
+	^recipe
+!
+
+recipe: anArray
+	recipe := anArray
+! !
+
+!PluggableExporter methodsFor: 'fileOut'!
+
+export: anObject usingRecipe: anArray on: aStream
+	| args |
+	args := { anObject. aStream }.
+	anArray do: [ :each | | val |
+		val := each value.
+		val == each
+			ifFalse: [ "association"
+				each key perform: val withArguments: args ]
+			ifTrue: [ "sub-array"
+				| selection |
+				selection := each first key perform: each first value withArguments: { anObject }.
+				selection do: [ :eachPart |	self export: eachPart usingRecipe: each allButFirst on: aStream ]]]
+!
+
+exportAll
+	"Export all packages in the system."
+
+	^String streamContents: [:stream |
+		Smalltalk current packages do: [:pkg |
+		self exportPackage: pkg on: stream]]
+!
+
+exportPackage: aPackage on: aStream
+	self export: aPackage usingRecipe: self recipe on: aStream
+! !
+
+!PluggableExporter class methodsFor: 'exporting-accessing'!
+
+newUsing: recipe
+	^self new recipe: recipe; yourself
+!
+
+ownClassesOfPackage: package
+	"Export classes in dependency order.
+	Update (issue #171): Remove duplicates for export"
+	^package sortedClasses asSet
+! !
+
 !Package methodsFor: '*Importer-Exporter'!
 
+amdNamespace
+<return (self.transport && self.transport.amdNamespace) || nil>
+!
+
+amdNamespace: aString
+<
+	if (!!self.transport) { self.transport = { type: 'amd' }; }
+	if (self.transport.type !!== 'amd') { throw new Error('Package '+self._name()+' has transport type '+self.transport.type+', not "amd".'); }
+	self.transport.amdNamespace = aString;
+>
+!
+
 commit
 	^ self transport commit: self
 !
 
 commitPathJs
-	^ (extension ifNil: [ extension := #{} ]) at: #commitPathJs ifAbsentPut: [self transport commitPathJsFor: self]
+	^ (extension ifNil: [ extension := #{} ]) at: #commitPathJs ifAbsent: [self transport commitPathJsFor: self]
 !
 
 commitPathJs: aString
@@ -582,7 +783,7 @@ commitPathJs: aString
 !
 
 commitPathSt
-	^ (extension ifNil: [ extension := #{} ]) at: #commitPathSt ifAbsentPut: [self transport commitPathStFor: self]
+	^ (extension ifNil: [ extension := #{} ]) at: #commitPathSt ifAbsent: [self transport commitPathStFor: self]
 !
 
 commitPathSt: aString
@@ -593,6 +794,10 @@ transport
 	^ PackageHandler for: self transportType
 !
 
+transportJson
+	<return JSON.stringify(self.transport || null);>
+!
+
 transportType
 	<return (self.transport && self.transport.type) || 'unknown';>
 ! !

+ 2 - 1
support/amber4browser.js

@@ -22,6 +22,7 @@ require = function (require) {
             'amber_set': '.',
             'amber_vm': '.',
             'amber': '../js',
+            'amber/_source': '../st',
             'jquery': 'jQuery/jquery-1.8.2.min',
             'jquery-ui': 'jQuery/jquery-ui-1.8.16.custom.min'
         },
@@ -119,7 +120,7 @@ require = function (require) {
                 deps: [ './Compiler-IR' ]
             },
             'amber/Compiler-Interpreter': {
-                deps: [ './Compiler-Core' ]
+                deps: [ './Compiler-AST' ]
             },
             'amber/IDE': {
                 deps: [ './Canvas', './Kernel-Exceptions' ]

+ 4 - 2
support/smalltalk.js

@@ -1,4 +1,6 @@
-define("amber_vm/smalltalk", ["./boot"], function (boot) {
-    return boot.smalltalk;
+define("amber_vm/smalltalk", ["require", "./boot"], function (require, boot) {
+    var smalltalk = boot.smalltalk;
+    smalltalk._amd_require = require;
+    return  smalltalk;
 });
 

+ 2 - 1
test/Test.js

@@ -1,5 +1,7 @@
 define("amber/Test", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Test');
+smalltalk.packages["Test"].transport = {"type":"amd","amdNamespace":"amber"};
+
 smalltalk.addClass('NodeTestRunner', smalltalk.Object, [], 'Test');
 
 smalltalk.addMethod(
@@ -67,5 +69,4 @@ referencedClasses: ["OrderedCollection", "TestCase", "TestSuiteRunner", "ResultA
 }),
 smalltalk.NodeTestRunner.klass);
 
-
 });

Некоторые файлы не были показаны из-за большого количества измененных файлов