Revision: 4353
          http://vexi.svn.sourceforge.net/vexi/?rev=4353&view=rev
Author:   mkpg2
Date:     2012-02-08 15:01:21 +0000 (Wed, 08 Feb 2012)
Log Message:
-----------
Fix. array["1"] should work.

Modified Paths:
--------------
    trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSU.java
    trunk/org.vexi-library.js/src/test/java/test/js/exec/array/TestArray.java
    trunk/org.vexi-library.js/src/test/java/test/js/exec/array/array_index.js

Modified: trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSU.java
===================================================================
--- trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSU.java        
2012-02-07 10:16:10 UTC (rev 4352)
+++ trunk/org.vexi-library.js/src/main/java/org/ibex/js/JSU.java        
2012-02-08 15:01:21 UTC (rev 4353)
@@ -86,13 +86,18 @@
     public static boolean toBoolean(JS o) { return isTruthy(o); }
 
     
-    static public boolean isInt(JS js) { return isInt32(js); } 
+    static public boolean isInt(JS js) {
+        return isInt32(js);
+    } 
     static public boolean isInt32(JS o) {
-        if(o == null) return true;
+        if(o == null) return false;
         if(o instanceof JSNumber) {
             JSNumber n = (JSNumber) o;
             return n.isInt32();
         }
+        JSNumber n = getNumber(o);
+        if(n!=null && n.isInt32())
+            return true;
         return false;
     }
     

Modified: 
trunk/org.vexi-library.js/src/test/java/test/js/exec/array/TestArray.java
===================================================================
--- trunk/org.vexi-library.js/src/test/java/test/js/exec/array/TestArray.java   
2012-02-07 10:16:10 UTC (rev 4352)
+++ trunk/org.vexi-library.js/src/test/java/test/js/exec/array/TestArray.java   
2012-02-08 15:01:21 UTC (rev 4353)
@@ -15,7 +15,7 @@
     
     public static void main(String[] args) throws Throwable {
        JSTestSuite jts = new JSTestSuite(TestArray.class);
-       TestCase t = jts.createTestCase(jts.getResourceDirs(), "slice.js");
+       TestCase t = jts.createTestCase(jts.getResourceDirs(), 
"array_index.js");
        t.runBare();
        }
 }

Modified: 
trunk/org.vexi-library.js/src/test/java/test/js/exec/array/array_index.js
===================================================================
--- trunk/org.vexi-library.js/src/test/java/test/js/exec/array/array_index.js   
2012-02-07 10:16:10 UTC (rev 4352)
+++ trunk/org.vexi-library.js/src/test/java/test/js/exec/array/array_index.js   
2012-02-08 15:01:21 UTC (rev 4353)
@@ -4,4 +4,6 @@
 var x = [];
 x[0.5+0.5] = "a";
 
-assert(x[0.5+0.5]=="a");
\ No newline at end of file
+assert(x[0.5+0.5]=="a");
+
+assert(x["1"]=="a");
\ No newline at end of file

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to