X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fjs%2FJSScope.java;fp=src%2Forg%2Fxwt%2Fjs%2FJSScope.java;h=3e797f3d4e3808923c0969c964b517e5d52f0819;hb=a374e033525b9c872cf47b10c066afbb532bf7c4;hp=971d550c10a6eb0cf1b5f277383fed23f69c3333;hpb=a060cc5025b58e8d3e319aefa6ae44fe7c6182ad;p=org.ibex.core.git diff --git a/src/org/xwt/js/JSScope.java b/src/org/xwt/js/JSScope.java index 971d550..3e797f3 100644 --- a/src/org/xwt/js/JSScope.java +++ b/src/org/xwt/js/JSScope.java @@ -13,17 +13,17 @@ public class JSScope extends JS { private static final Object NULL_PLACEHOLDER = new Object(); public JSScope(JSScope parentScope) { this.parentScope = parentScope; } - public void declare(String s) { super.put(s, NULL_PLACEHOLDER); } + public void declare(String s) throws JSExn { super.put(s, NULL_PLACEHOLDER); } public JSScope getParentScope() { return parentScope; } - public Object get(Object key) { + public Object get(Object key) throws JSExn { Object o = super.get(key); if (o != null) return o == NULL_PLACEHOLDER ? null : o; else return parentScope == null ? null : parentScope.get(key); } - public boolean has(Object key) { return super.get(key) != null; } - public void put(Object key, Object val) { + public boolean has(Object key) throws JSExn { return super.get(key) != null; } + public void put(Object key, Object val) throws JSExn { if (parentScope != null && !has(key)) parentScope.put(key, val); else super.put(key, val == null ? NULL_PLACEHOLDER : val); } @@ -33,7 +33,7 @@ public class JSScope extends JS { private final static Double POSITIVE_INFINITY = new Double(Double.POSITIVE_INFINITY); public Global() { super(null); } - public Object get(Object key) { + public Object get(Object key) throws JSExn { //#switch(key) case "NaN": return NaN; case "Infinity": return POSITIVE_INFINITY; @@ -53,7 +53,7 @@ public class JSScope extends JS { return super.get(key); } - public Object callMethod(Object method, Object a0, Object a1, Object a2, Object[] rest, int nargs) { + public Object callMethod(Object method, Object a0, Object a1, Object a2, Object[] rest, int nargs) throws JSExn { switch(nargs) { case 0: { //#switch(method)