fixed bug related to removal of JS.call(JS[])
authoradam <adam@megacz.com>
Sun, 16 Jan 2005 04:48:03 +0000 (04:48 +0000)
committeradam <adam@megacz.com>
Sun, 16 Jan 2005 04:48:03 +0000 (04:48 +0000)
darcs-hash:20050116044803-5007d-f5e248f8cde4fd041795725961a8c06902867d2d.gz

src/org/ibex/js/JSFunction.java
src/org/ibex/js/JSRegexp.java

index a14bdec..fc5cb39 100644 (file)
@@ -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; }
 
index 25b890f..e7e35f7 100644 (file)
@@ -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));