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);
}
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;
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)