From: adam Date: Sun, 16 Jan 2005 04:48:03 +0000 (+0000) Subject: fixed bug related to removal of JS.call(JS[]) X-Git-Url: http://git.megacz.com/?p=org.ibex.js.git;a=commitdiff_plain;h=f63da7aeac2f942be41aefde91002d14117a8573 fixed bug related to removal of JS.call(JS[]) darcs-hash:20050116044803-5007d-f5e248f8cde4fd041795725961a8c06902867d2d.gz --- diff --git a/src/org/ibex/js/JSFunction.java b/src/org/ibex/js/JSFunction.java index a14bdec..fc5cb39 100644 --- a/src/org/ibex/js/JSFunction.java +++ b/src/org/ibex/js/JSFunction.java @@ -51,7 +51,9 @@ class JSFunction extends JS.Immutable implements ByteCodes, Tokens, Pausable { return ret; } - public JS call(JS[] args) throws JSExn { return (JS)new Interpreter(this, false, args).run(null); } + public JS call(JS method, JS[] args) throws JSExn { + if (method != null) return super.call(method, args); + return (JS)new Interpreter(this, false, args).run(null); } JSScope getParentScope() { return parentScope; } diff --git a/src/org/ibex/js/JSRegexp.java b/src/org/ibex/js/JSRegexp.java index 25b890f..e7e35f7 100644 --- a/src/org/ibex/js/JSRegexp.java +++ b/src/org/ibex/js/JSRegexp.java @@ -223,7 +223,7 @@ public class JSRegexp extends JS.Immutable { args[args.length - 1] = JSU.S(s); // note: can't perform pausing operations in here - sb.append(JSU.toString(replaceFunc.call(args))); + sb.append(JSU.toString(replaceFunc.call(null, args))); } else { sb.append(mySubstitute(match,replaceString,s));