/** Implementation of a JavaScript Scope */
class ScopeImpl extends JS.Obj {
private JS.Scope parentScope;
/** Implementation of a JavaScript Scope */
class ScopeImpl extends JS.Obj {
private JS.Scope parentScope;
public ScopeImpl(JS.Scope parentScope, boolean sealed) {
super(sealed);
if (parentScope == this) throw new Error("can't make a scope its own parent!");
public ScopeImpl(JS.Scope parentScope, boolean sealed) {
super(sealed);
if (parentScope == this) throw new Error("can't make a scope its own parent!");
// we use _get instead of get solely to work around a GCJ bug
public Object _get(Object key) {
if (!has(key)) return parentScope == null ? null : parentScope.get(key);
// we use _get instead of get solely to work around a GCJ bug
public Object _get(Object key) {
if (!has(key)) return parentScope == null ? null : parentScope.get(key);
}
// we use _put instead of put solely to work around a GCJ bug
public void _put(Object key, Object val) {
if (!has(key) && parentScope != null) parentScope.put(key, val);
}
// we use _put instead of put solely to work around a GCJ bug
public void _put(Object key, Object val) {
if (!has(key) && parentScope != null) parentScope.put(key, val);
}
public boolean isTransparent() { return false; }
public void declare(String s) {
if (isTransparent()) parentScope.declare(s);
}
public boolean isTransparent() { return false; }
public void declare(String s) {
if (isTransparent()) parentScope.declare(s);