X-Git-Url: http://git.megacz.com/?p=org.ibex.js.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjs%2FJSReflection.java;h=9c2383005c364b5fd59fb8ee057806c4c9d69c27;hp=d6ecd759717efb5370d281fc96d2c3c6f0200966;hb=a1e6b7e9307319c0195b0efbe5e5354c128be481;hpb=f637057f12669bb9fe8d76a72e0bfcc898dc0715 diff --git a/src/org/ibex/js/JSReflection.java b/src/org/ibex/js/JSReflection.java index d6ecd75..9c23830 100644 --- a/src/org/ibex/js/JSReflection.java +++ b/src/org/ibex/js/JSReflection.java @@ -12,9 +12,9 @@ public class JSReflection extends JS.Immutable { public static JS wrap(Object o) throws JSExn { if (o == null) return null; - if (o instanceof String) return Script.S((String)o); - if (o instanceof Boolean) return Script.B(((Boolean)o).booleanValue()); - if (o instanceof Number) return Script.N((Number)o); + if (o instanceof String) return JSU.S((String)o); + if (o instanceof Boolean) return JSU.B(((Boolean)o).booleanValue()); + if (o instanceof Number) return JSU.N((Number)o); if (o instanceof JS) return (JS)o; if (o instanceof Object[]) { // FIXME: get element type here @@ -30,17 +30,17 @@ public class JSReflection extends JS.Immutable { return new Enumeration(null) { private int n = 0; public boolean _hasNext() { return n < arr.length; } - public JS _next() { return Script.N(n++); } + public JS _next() { return JSU.N(n++); } }; } - public JS get(JS key) throws JSExn { return wrap(arr[Script.toInt(key)]); } + public JS get(JS key) throws JSExn { return wrap(arr[JSU.toInt(key)]); } } // FIXME public static class Hash { } // FIXME public Enumeration keys() throws JSExn { } public JS get(JS key) throws JSExn { - String k = Script.toString(key); + String k = JSU.toString(key); try { Field f = this.getClass().getField(k); return wrap(f.get(this)); @@ -60,7 +60,7 @@ public class JSReflection extends JS.Immutable { } public JS call(JS method, JS[] args) throws JSExn { - String k = Script.toString(method); + String k = JSU.toString(method); try { java.lang.reflect.Method[] methods = this.getClass().getMethods(); for(int j=0; j