Browse Source

Fix readJSObject bug in boot.js

Fix a bug in **boot.js** in `readJSObject` where the *nullness* of the js wasn't treated.
Also fix tiny mistake in `package.json`
Adrian Castravete 8 years ago
parent
commit
4ec82ad5be
4 changed files with 6 additions and 2 deletions
  1. 1 1
      external/amber-cli/package.json
  2. 2 0
      external/amber-cli/support/amber-cli.js
  3. 1 1
      package.json
  4. 2 0
      support/boot.js

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

@@ -23,7 +23,7 @@
     "url": "git://github.com/amber-smalltalk/amber.git"
   },
   "engines": {
-    "node": ">=0.10.0 <0.13.0"
+    "node": ">=0.10.0 <0.13.0 || >=4.0.0"
   },
   "bugs": {
     "url": "https://github.com/amber-smalltalk/amber/issues?labels=in+cli"

+ 2 - 0
external/amber-cli/support/amber-cli.js

@@ -805,6 +805,8 @@ define("amber/boot", ['require', './browser-compatibility'], function (require)
 
         /* Converts a JavaScript object to valid Smalltalk Object */
         st.readJSObject = function (js) {
+            if (js == null)
+                return null;
             var readObject = js.constructor === Object;
             var readArray = js.constructor === Array;
             var object = readObject ? globals.Dictionary._new() : readArray ? [] : js;

+ 1 - 1
package.json

@@ -23,7 +23,7 @@
     "url": "git://github.com/amber-smalltalk/amber.git"
   },
   "engines": {
-    "node": ">=0.10.0 <0.13.0"
+    "node": ">=0.10.0 <0.13.0 || >=4.0.0"
   },
   "scripts": {
     "test": "grunt test && cd external && cd amber-cli && npm test && cd .. && cd .."

+ 2 - 0
support/boot.js

@@ -790,6 +790,8 @@ define("amber/boot", ['require', './browser-compatibility'], function (require)
 
         /* Converts a JavaScript object to valid Smalltalk Object */
         st.readJSObject = function (js) {
+            if (js == null)
+                return null;
             var readObject = js.constructor === Object;
             var readArray = js.constructor === Array;
             var object = readObject ? globals.Dictionary._new() : readArray ? [] : js;