--- /dev/null
+// Copyright 2000-2005 the Contributors, as shown in the revision logs.
+// Licensed under the Apache Public Source License 2.0 ("the License").
+// You may not use this file except in compliance with the License.
+
+package org.ibex.xt;
+import org.ibex.js.*;
+import org.ibex.util.*;
+import org.ibex.io.*;
+import java.io.*;
+import java.net.*;
+import java.util.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+public class Scope extends JS.Obj {
+ private final JS parent;
+ private final Hash declared = new Hash();
+ public Scope(JS parent) { this.parent = parent; }
+ public JS get(JS key) throws JSExn { if (declared.get(key)!=null) return super.get(key); return parent.get(key); }
+ public void put(JS key, JS val) throws JSExn { if (declared.get(key)!=null) super.put(key,val); else parent.put(key,val); }
+ public void declare(JS key) { declared.put(key, Boolean.TRUE); }
+ public void declare(String key) { declare(JSU.S(key)); }
+ public void undeclare(JS key) { declared.remove(key); }
+ public void undeclare(String key) { undeclare(JSU.S(key)); }
+}