2004/01/07 20:37:33
[org.ibex.core.git] / src / org / xwt / js / JSScope.java
index 3e797f3..2f35de6 100644 (file)
@@ -27,6 +27,12 @@ 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);