From f63da7aeac2f942be41aefde91002d14117a8573 Mon Sep 17 00:00:00 2001 From: adam Date: Sun, 16 Jan 2005 04:48:03 +0000 Subject: [PATCH 1/1] fixed bug related to removal of JS.call(JS[]) darcs-hash:20050116044803-5007d-f5e248f8cde4fd041795725961a8c06902867d2d.gz --- src/org/ibex/js/JSFunction.java | 4 +++- src/org/ibex/js/JSRegexp.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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)); -- 1.7.10.4