fixes and additions to new js api
[org.ibex.core.git] / src / org / ibex / js / JSArray.java
index d9ffad1..305a5de 100644 (file)
@@ -127,8 +127,8 @@ public class JSArray extends JS.BT {
     public final int length() { return size(); }
     public final JS elementAt(int i) { 
         if(i < 0 || i >= size()) throw new ArrayIndexOutOfBoundsException(i);
-        JS o = (JS) getNode(i);
-        return o == NULL ? null : o;
+        Object o = getNode(i);
+        return o == NULL ? (JS)null : (JS)o;
     }
     public final void addElement(JS o) { 
         insertNode(size(),o==null ? NULL : o);
@@ -143,8 +143,8 @@ public class JSArray extends JS.BT {
     }
     public final JS removeElementAt(int i) {
         if(i < 0 || i >= size()) throw new ArrayIndexOutOfBoundsException(i);
-        JS o = (JS) deleteNode(i);
-        return o == NULL ? null : o;
+        Object o = deleteNode(i);
+        return o == NULL ? (JS)null : (JS)o;
     }
     
     public final int size() { return treeSize(); }