Jelajahi Sumber

Merge pull request #825 from herby/gh-822

Fixes #822
Nicolas Petton 11 tahun lalu
induk
melakukan
fe932a5def
8 mengubah file dengan 42 tambahan dan 19 penghapusan
  1. 3 3
      cli/index.html
  2. 3 3
      helios.html
  3. 3 3
      index.html
  4. 0 1
      support/deploy.js
  5. 1 1
      support/devel.js
  6. 1 1
      support/helios.js
  7. 30 6
      support/helpers.js
  8. 1 1
      support/lang.js

+ 3 - 3
cli/index.html

@@ -22,9 +22,9 @@
         ["amber/devel",
             "amber_cli/AmberCli" ],
         function (smalltalk) {
-            smalltalk.defaultAmdNamespace = 'amber_cli';
-            smalltalk.initialize();
-            smalltalk.Browser._openOn_(smalltalk.AmberCli);
+            smalltalk.vm.defaultAmdNamespace = 'amber_cli';
+            smalltalk.vm.initialize();
+            smalltalk.globals.Browser._openOn_(smalltalk.AmberCli);
         }
     );
     </script> 

+ 3 - 3
helios.html

@@ -20,9 +20,9 @@
                           return 'Do you want to close Amber? All uncommitted changes will be lost.';
                       };
 
-                      smalltalk.defaultAmdNamespace = "amber_core";
-                      smalltalk.initialize();
-					  smalltalk.HLManager._setup();
+                      smalltalk.vm.defaultAmdNamespace = "amber_core";
+                      smalltalk.vm.initialize();
+					  smalltalk.globals.HLManager._setup();
                   }
           );
       </script>

+ 3 - 3
index.html

@@ -14,10 +14,10 @@
     require(
         ["amber/devel"],
         function (smalltalk) {
-            smalltalk.defaultAmdNamespace = "amber_core";
-            smalltalk.initialize();
+            smalltalk.vm.defaultAmdNamespace = "amber_core";
+            smalltalk.vm.initialize();
 
-            smalltalk.Browser._open()
+            smalltalk.globals.Browser._open()
         }
     );
 </script>

+ 0 - 1
support/deploy.js

@@ -1,5 +1,4 @@
 define([
-    'amber_vm/smalltalk',
     './helpers',
     'jquery',
     'amber_core/Kernel-Objects',

+ 1 - 1
support/devel.js

@@ -1,5 +1,5 @@
 define([
-	'amber_vm/smalltalk', // pre-fetch, dep of ./deploy
+	'./helpers', // pre-fetch, dep of ./deploy
 	'./deploy', // pre-fetch, dep of ./lang
 	'./lang',
 	'jquery-ui',

+ 1 - 1
support/helios.js

@@ -1,5 +1,5 @@
 define([
-	'amber_vm/smalltalk', // pre-fetch, dep of ./deploy
+	'./helpers', // pre-fetch, dep of ./deploy
 	'./deploy', // pre-fetch, dep of ./lang
 	'./lang',
 	'jquery-ui',

+ 30 - 6
support/helpers.js

@@ -1,12 +1,36 @@
-define("amber/helpers", ["amber_vm/smalltalk", "require"], function (smalltalk, require) {
-    var exports = {
-        popupHelios: function () {
-            window.open(require.toUrl('amber_helios/html/helios.html'), "Helios", "menubar=no, status=no, scrollbars=no, menubar=no, width=1000, height=600");
-        }
+define("amber/helpers", ["amber_vm/smalltalk", "amber_vm/globals", "require"], function (vm, globals, require) {
+    var exports = Object.create(globals);
+
+    // API
+
+    exports.popupHelios = function () {
+        window.open(require.toUrl('amber_helios/html/helios.html'), "Helios", "menubar=no, status=no, scrollbars=no, menubar=no, width=1000, height=600");
     };
+    Object.defineProperty(exports, "vm", {
+        value: vm,
+        enumerable: true, configurable: true, writable: false
+    });
+    Object.defineProperty(exports, "globals", {
+        value: globals,
+        enumerable: true, configurable: true, writable: false
+    });
+
+    // Backward compatibility, deprecated
+
     Object.defineProperty(exports, "smalltalk", {
-        value: smalltalk,
+        value: vm,
         enumerable: true, configurable: true, writable: false
     });
+    exports.defaultAmdNamespace = null;
+    exports.initialize = function () {
+        console.warn("smalltalk.defaultAmdNamespace is deprecated. Please use smalltalk.vm.defaultAmdNamespace instead.");
+        console.warn("smalltalk.initialize is deprecated. Please  use smalltalk.vm.initialize instead.");
+        console.warn("smalltalk.ClassName is deprecated. Please  use smalltalk.globals.ClassName instead.");
+        vm.defaultAmdNamespace = exports.defaultAmdNamespace || vm.defaultAmdNamespace;
+        return vm.initialize();
+    };
+
+    // Exports
+
     return  exports;
 });

+ 1 - 1
support/lang.js

@@ -1,5 +1,5 @@
 define([
-	'amber_vm/smalltalk', // pre-fetch, dep of ./deploy
+	'./helpers', // pre-fetch, dep of ./deploy
 	'./deploy',
 	'amber_vm/parser',
 	'amber_core/Kernel-ImportExport',