From 6c5918b3c215c9b38ece2335ffbfd61ddd66e005 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 15 Dec 2006 02:57:13 +0000 Subject: [PATCH] Include stub versions of the Java->JavaScript bridge interface so that we compile properly and we'll link against the real deal at runtime. --- build.xml | 2 +- src/java/netscape/javascript/JSException.java | 8 +++++++ src/java/netscape/javascript/JSObject.java | 23 +++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/java/netscape/javascript/JSException.java create mode 100644 src/java/netscape/javascript/JSObject.java diff --git a/build.xml b/build.xml index 17cfda3..2e7f324 100644 --- a/build.xml +++ b/build.xml @@ -98,7 +98,7 @@ + basedir="${deploy.dir}/classes" excludes="**/netscape/**"/> diff --git a/src/java/netscape/javascript/JSException.java b/src/java/netscape/javascript/JSException.java new file mode 100644 index 0000000..49b2d46 --- /dev/null +++ b/src/java/netscape/javascript/JSException.java @@ -0,0 +1,8 @@ +package netscape.javascript; + +/** + * This just exists to compile against so that we don't have to link against plugin.jar + */ +public class JSException extends RuntimeException +{ +} diff --git a/src/java/netscape/javascript/JSObject.java b/src/java/netscape/javascript/JSObject.java new file mode 100644 index 0000000..a3b5353 --- /dev/null +++ b/src/java/netscape/javascript/JSObject.java @@ -0,0 +1,23 @@ +package netscape.javascript; + +import java.applet.Applet; + +/** + * This just exists to compile against so that we don't have to link against plugin.jar + */ +public abstract class JSObject +{ + public abstract Object call (String func, Object[] args) throws JSException; + public abstract Object eval (String code) throws JSException; + public abstract Object getMember (String name) throws JSException; + public abstract void setMember (String name, Object value) throws JSException; + public abstract void removeMember (String name) throws JSException; + public abstract Object getSlot (int slot) throws JSException; + public abstract void setSlot (int slot, Object value) throws JSException; + + public static JSObject getWindow (Applet applet) + throws JSException + { + return null; + } +}