remove JS.call(JS[]), JS.getInputStream()
[org.ibex.js.git] / src / org / ibex / js / JSArray.java
index 9124761..993e057 100644 (file)
@@ -54,14 +54,12 @@ public class JSArray extends Basket.Array implements JS, Basket.CompareFunc {
         size(i + 1); while (size() < i) add(null);
         set(i, val);
     }
-    public InputStream getInputStream() { return null; }
 
     public String[] getFormalArgs() { return empty; }
     public String coerceToString() { return "array"; } // FIXME
 
-    public Object run(Object o) throws JSExn { return call(null); }
+    public Object run(Object o) throws JSExn { return call(null, null); }
     public void pause() throws NotPausableException { throw new NotPausableException(); }
-    public JS call(JS[] args) throws JSExn { throw new JSExn("can not call an array as a function"); }
     public JS call(JS method, JS[] args) throws JSExn {
         //#switch(JSU.str(method))
         case "pop": return size() == 0 ? null : (JS)remove(size() - 1);
@@ -80,7 +78,6 @@ public class JSArray extends Basket.Array implements JS, Basket.CompareFunc {
             return JSU.N(size());
         case "splice": return splice(args);
         //#end
-
         throw new JSExn("arrays have no function: "+JSU.str(method));
     }
 
@@ -182,7 +179,7 @@ public class JSArray extends Basket.Array implements JS, Basket.CompareFunc {
     public int compare(Object a, Object b) throws JSExn.Wrapper {
         try {
             sortargs[0] = (JS)a; sortargs[1] = (JS)b;
-            return JSU.toInt(sort.call(sortargs));
+            return JSU.toInt(sort.call(null, sortargs));
         } catch (JSExn e) { throw new JSExn.Wrapper(e);
         } finally { sortargs[0] = null; sortargs[1] = null; }
     }