-// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL]
+// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
package org.xwt.js;
import org.xwt.util.*;
import java.io.*;
import java.util.*;
+// FIXME: should allow parentScope to be a JS, not a JSScope
/** Implementation of a JavaScript Scope */
public class JSScope extends JS {
if (parentScope != null && !has(key)) parentScope.put(key, val);
else super.put(key, val == null ? NULL_PLACEHOLDER : val);
}
+
+ public JSScope top() {
+ JSScope s = this;
+ while(s.parentScope != null) s = s.parentScope;
+ return s;
+ }
public static class Global extends JSScope {
private final static Double NaN = new Double(Double.NaN);