X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjs%2FJS.java;h=68fac37bb6120839c23b8de0f8b9a722e1fd6270;hp=04d7eddd7617111c93ffa0442451a378ff0b3a4b;hb=e1a626a6cccf4846b90c98821f597429bf095d71;hpb=bdd64ac9ba7f6802ec27561374e8c9aea0577d2c diff --git a/src/org/ibex/js/JS.java b/src/org/ibex/js/JS.java index 04d7edd..68fac37 100644 --- a/src/org/ibex/js/JS.java +++ b/src/org/ibex/js/JS.java @@ -18,12 +18,16 @@ public abstract class JS { public Enumeration keys() throws JSExn { throw new JSExn("you can't enumerate the keys of this object (class=" + getClass().getName() +")"); } public JS get(JS key) throws JSExn { return null; } public void put(JS key, JS val) throws JSExn { throw new JSExn("" + key + " is read only (class=" + getClass().getName() +")"); } + + public InputStream getInputStream() throws IOException { + throw new IOException("this object doesn't have a stream associated with it " + getClass().getName() + ")"); + } public final boolean hasTrap(JS key) { return getTrap(key) != null; } public JS callMethod(JS method, JS a0, JS a1, JS a2, JS[] rest, int nargs) throws JSExn { throw new JSExn("method not found (" + JS.debugToString(method) + ")"); - } + } // FIXME: JSArgs objects, pointers into stack frame public JS call(JS a0, JS a1, JS a2, JS[] rest, int nargs) throws JSExn { @@ -87,7 +91,7 @@ public abstract class JS { JS _unclone() { return clonee.unclone(); } public JS getClonee() { return clonee; } public Clone(JS clonee) throws JSExn { - if(!(clonee instanceof Cloneable)) throw new JSExn("" + getClass().getName() + " isn't cloneable"); + if(!(clonee instanceof Cloneable)) throw new JSExn("" + clonee.getClass().getName() + " isn't cloneable"); this.clonee = clonee; } public boolean jsequals(JS o) { return unclone().jsequals(o.unclone()); } @@ -100,6 +104,7 @@ public abstract class JS { public JS call(JS a0, JS a1, JS a2, JS[] rest, int nargs) throws JSExn { return clonee.call(a0, a1, a2, rest, nargs); } + public InputStream getInputStream() throws IOException { return clonee.getInputStream(); } } // Static Interpreter Control Methods ///////////////////////////////////////////////////////////////