X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Forg%2Fibex%2FIbex.java;h=bd337f178a46c8aca326ede1e50bdb678f8a21a8;hb=5142290a9cfc3385caee67a58179e2332571b50a;hp=9431f1fcd3cc7baf9f01baaf856f0a0555f2ff9e;hpb=3591b88b94a6bb378af3d4abe6eb5233ce583104;p=org.ibex.core.git diff --git a/src/org/ibex/Ibex.java b/src/org/ibex/Ibex.java index 9431f1f..bd337f1 100644 --- a/src/org/ibex/Ibex.java +++ b/src/org/ibex/Ibex.java @@ -213,7 +213,6 @@ public final class Ibex extends JS.Cloneable { public static void sleep(final int i) throws JSExn { try { final JS.UnpauseCallback callback = JS.pause(); - final long currentTime = System.currentTimeMillis(); // FEATURE use a single sleeper thread new Thread() { public void run() { try { Thread.sleep(i); } catch (InterruptedException e) { } @@ -336,7 +335,8 @@ public final class Ibex extends JS.Cloneable { public JSScope getStatic() { try { // FIXME background? - if (t == null) t = Template.buildTemplate(Stream.getInputStream(parent.get(parentkey + ".ixt")), ibex); + if (t == null) + t = Template.buildTemplate(parentkey + ".t", Stream.getInputStream(parent.get(parentkey + ".t")), ibex); return t.staticScope; } catch (Exception e) { Log.error(this, e); @@ -345,9 +345,9 @@ public final class Ibex extends JS.Cloneable { } public Object call(Object a, Object b, Object c, Object[] rest, int nargs) throws JSExn { // GROSS hack - if (nargs == 9999) return t; - if (nargs != 1) throw new JSExn("FIXME can only call with one arg"); + if (nargs != 1 && nargs != 9999) throw new JSExn("FIXME can only call with one arg"); getStatic(); + if (t == null) throw new JSExn("No such template " + parentkey); t.apply((Box)a); return a; }