X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fjs%2FRegexp.java;h=18c6aeb995e0fa788b6feda6a1f41fa5ca7eef3c;hb=8235361e8601ae7b36ab707058de3b52225d15a2;hp=dd77580739c5f03a19201a3656efdc101c6d8877;hpb=5f24fa01863f5f21f8ce5351f22b59cce07aa4e8;p=org.ibex.core.git diff --git a/src/org/xwt/js/Regexp.java b/src/org/xwt/js/Regexp.java index dd77580..18c6aeb 100644 --- a/src/org/xwt/js/Regexp.java +++ b/src/org/xwt/js/Regexp.java @@ -35,13 +35,21 @@ public class Regexp extends JS.Obj { _put("ignoreCase",wrapBool(flags & RE.REG_ICASE)); _put("multiline",wrapBool(flags & RE.REG_MULTILINE)); } - // FIXME: Do whatever we need to do to take advantage of the GETCALL bytecode when its available - final JS.Callable execFN = new JS.Callable() { public Object call(JS.Array args) { return exec(args); } }; - final JS.Callable testFN = new JS.Callable() { public Object call(JS.Array args) { return test(args); } }; - final JS.Callable toStringFN = new JS.Callable() { public Object call(JS.Array args) { return Regexp.this.toString(); } }; - _put("exec",execFN); - _put("test",testFN); - _put("toString",toStringFN); + } + + public Object callMethod(Object method, Array args, boolean checkOnly) throws JS.Exn { + if (method.equals("exec")) { + if (checkOnly) return Boolean.TRUE; + return exec(args); + } else if (method.equals("test")) { + if (checkOnly) return Boolean.TRUE; + return test(args); + } else if (method.equals("toString")) { + if (checkOnly) return Boolean.TRUE; + return toString(); + } + if (checkOnly) return Boolean.FALSE; + return null; } // gcj bug...