fix bug 442
[org.ibex.core.git] / src / org / ibex / Ibex.java
index bd337f1..3828b17 100644 (file)
@@ -169,6 +169,10 @@ public final class Ibex extends JS.Cloneable {
                         else if (url.startsWith("https://")) return new Stream.HTTP(url);
                         else if (url.startsWith("data:")) return new Stream.ByteArray(Base64.decode(url.substring(5)), null);
                         else if (url.startsWith("utf8:")) return new Stream.ByteArray(url.substring(5).getBytes(), null);
+                        else if (url.startsWith("file:")) {
+                            // FIXME
+                            Platform.fileDialog(url.substring(5), false);
+                        }
                         throw new JSExn("invalid resource specifier " + url);
                     }
                     case "thread.sleep": sleep(JS.toInt(a)); return null;
@@ -348,6 +352,7 @@ public final class Ibex extends JS.Cloneable {
             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);
+            if (nargs == 9999) return t;
             t.apply((Box)a);
             return a;
         }