1
0
Selaa lähdekoodia

Merge pull request #813 from herby/require-amd-in-bootjs

Sets amdRequire in boot.js. Fixes #808.
Nicolas Petton 11 vuotta sitten
vanhempi
commit
9e51be96d3
2 muutettua tiedostoa jossa 4 lisäystä ja 10 poistoa
  1. 2 2
      support/boot.js
  2. 2 8
      support/smalltalk.js

+ 2 - 2
support/boot.js

@@ -38,7 +38,7 @@
  ==================================================================== */
 
 
-define("amber_vm/boot", [ './browser-compatibility' ], function () {
+define("amber_vm/boot", [ 'require', './browser-compatibility' ], function (require) {
 
 	/* Reconfigurable micro composition system, https://github.com/amber-smalltalk/brikz */
 
@@ -1096,7 +1096,7 @@ define("amber_vm/boot", [ './browser-compatibility' ], function () {
 	/* Adds AMD and requirejs related methods to the smalltalk object */
 	function AMDBrik(brikz, st) {
 		this.__init__ = function () {
-			st.amdRequire = st.amdRequire || null;
+			st.amdRequire = require;
 			st.defaultTransportType = st.defaultTransportType || "amd";
 			st.defaultAmdNamespace = st.defaultAmdNamespace || "amber_core";
 		};

+ 2 - 8
support/smalltalk.js

@@ -1,10 +1,4 @@
-define("amber_vm/smalltalk", ["require", "module", "./boot"], function (require, module, boot) {
-    var smalltalk = boot.smalltalk;
-	smalltalk.amdRequire = require;
-//    var config = module.config && module.config();
-//    if (config) {
-//		smalltalk.defaultAmdNamespace = config.defaultNamespace;
-//    }
-    return  smalltalk;
+define("amber_vm/smalltalk", ["./boot"], function (boot) {
+    return boot.smalltalk;
 });