X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjs%2FJSFunction.java;h=0bf580e42dae07564f9352f08411f5d0257bbd0f;hb=a6fb49b55117ea4cf330b412d2a2fff403fcd053;hp=a14bdec1fedaba22944a334f9e02db54190caa49;hpb=8309adefd009d469f3bfecfe94888d188052b5b9;p=org.ibex.js.git diff --git a/src/org/ibex/js/JSFunction.java b/src/org/ibex/js/JSFunction.java index a14bdec..0bf580e 100644 --- a/src/org/ibex/js/JSFunction.java +++ b/src/org/ibex/js/JSFunction.java @@ -26,7 +26,6 @@ class JSFunction extends JS.Immutable implements ByteCodes, Tokens, Pausable { // Public ////////////////////////////////////////////////////////////////////////////// - // FIXME: what needs to be syncrhonized (if anything)? private Interpreter runner = null; public Object run(Object o) throws JSExn { if (runner == null) runner = new Interpreter(this, true, emptyArgs); @@ -51,7 +50,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; }