X-Git-Url: http://git.megacz.com/?p=org.ibex.js.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjs%2FJS.java;h=a7270482ea2ed6e323f2abf7ab18ae9d48dc23c2;hp=a338311f7930cc0e270a68e21f03566c89586dc8;hb=aaf060ff38871512d80f1bbf04a6596648b284c7;hpb=ae38bda49e6a8953a1443aab777c98d18adb5328 diff --git a/src/org/ibex/js/JS.java b/src/org/ibex/js/JS.java index a338311..a727048 100644 --- a/src/org/ibex/js/JS.java +++ b/src/org/ibex/js/JS.java @@ -93,10 +93,11 @@ public interface JS extends Pausable { "object cannot be called, class ["+ getClass().getName() +"]"); } public void pause() { throw new NotPausableException(); } - public JS call(JS[] args) throws JSExn { throw new JSExn( - "object cannot be called, class ["+ getClass().getName() +"]"); } - public JS call(JS method, JS[] args) throws JSExn { throw new JSExn( - "method not found: " + JSU.str(method)); } + public JS call(JS[] args) throws JSExn { throw new JSExn( "object cannot be called, class ["+ getClass().getName() +"]"); } + public JS call(JS method, JS[] args) throws JSExn { + if (method == null) return call(args); + throw new JSExn("method not found: " + JSU.str(method) + " class="+this.getClass().getName()); + } public String[] getFormalArgs() { return emptystr; } public void declare(JS key) throws JSExn { throw new JSExn(