X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjs%2FJSRegexp.java;h=00a6f40a12cecbe06d606a20aeb430351c40c8db;hp=e083902767571ad9f12ba17441e20fded1edc91e;hb=85c8f402be33df8440511492fb597fba9c2eb45f;hpb=0e9197be8053d1e3bc8699a8f527d34850024cd7 diff --git a/src/org/ibex/js/JSRegexp.java b/src/org/ibex/js/JSRegexp.java index e083902..00a6f40 100644 --- a/src/org/ibex/js/JSRegexp.java +++ b/src/org/ibex/js/JSRegexp.java @@ -40,12 +40,10 @@ public class JSRegexp extends JS { } } - public JS callMethod(JS method_, JS a0, JS a1, JS a2, JS[] rest, int nargs) throws JSExn { - if(!JS.isString(method_)) return super.callMethod(method_, a0, a1, a2, rest, nargs); - String method = JS.toString(method_); + public JS callMethod(JS method, JS a0, JS a1, JS a2, JS[] rest, int nargs) throws JSExn { switch(nargs) { case 1: { - //#switch(method) + //#jswitch(method) case "exec": { String s = JS.toString(a0); int start = global ? lastIndex : 0; @@ -70,19 +68,17 @@ public class JSRegexp extends JS { break; } case 2: { - //#switch(method) + //#jswitch(method) case "stringReplace": return stringReplace(a0, a1,a2); //#end break; } } - return super.callMethod(method_, a0, a1, a2, rest, nargs); + return super.callMethod(method, a0, a1, a2, rest, nargs); } - public JS get(JS key_) throws JSExn { - if(!JS.isString(key_)) return super.get(key_); - String key = JS.toString(key_); - //#switch(key) + public JS get(JS key) throws JSExn { + //#jswitch(key) case "exec": return METHOD; case "test": return METHOD; case "toString": return METHOD; @@ -92,7 +88,7 @@ public class JSRegexp extends JS { case "ignoreCase": return B(flags & RE.REG_ICASE); case "multiline": return B(flags & RE.REG_MULTILINE); //#end - return super.get(key_); + return super.get(key); } public void put(JS key, JS value) throws JSExn {