import java.io.*;
import java.util.*;
+// FIXME: review, use redblacktrees
/** A JavaScript JSArray */
-public class JSArray extends JSCallable {
+public class JSArray extends JS {
private Vec vec = new Vec();
public JSArray() { }
public JSArray(int size) { vec.setSize(size); }
return super.callMethod(method, a0, a1, a2, rest, nargs);
}
- public Object get(Object key) throws JS.Exn {
+ public Object get(Object key) throws JSExn {
if (key instanceof Number) {
int i = intVal(key);
if (i == Integer.MIN_VALUE) return super.get(key);
}
};
private Object sort(Object tmp) {
- if(tmp instanceof JSCallable) {
+ if(tmp instanceof JS) {
final JSArray funcArgs = new JSArray(2);
- final JSCallable jsFunc = (JSCallable) tmp;
+ final JS jsFunc = (JS) tmp;
vec.sort(new Vec.CompareFunc() {
public int compare(Object a, Object b) {
funcArgs.setElementAt(a,0);