+ public static class JSImmutable extends JS {
+ private final JS wrapped;
+ public JSImmutable(JS toWrap) { wrapped = toWrap; }
+
+ public Collection keys() throws JSExn {
+ return Collections.unmodifiableCollection(wrapped.keys()); }
+ public Object get(Object key) throws JSExn { return wrapped.get(key); }
+ public boolean containsKey(Object key) { return wrapped.containsKey(key); }
+ public Object call(Object a0, Object a1, Object a2, Object[] r, int n)
+ throws JSExn { return wrapped.call(a0, a1, a2, r, n); }
+
+ public Object callMethod(Object m, Object a0, Object a1, Object a2, Object[] r, int n)
+ throws JSExn { throw new JSExn("immutable JS"); }
+ public Object put(Object k, Object v) throws JSExn {
+ throw new JSExn("immutable JS"); }
+ public Object remove(Object k) throws JSExn {
+ throw new JSExn("immutable JS"); }
+ public void putAndTriggerTraps(Object k, Object v) throws JSExn {
+ throw new JSExn("immutable JS"); }
+ public Object getAndTriggerTraps(Object k) throws JSExn {
+ throw new JSExn("immutable JS"); }
+ protected boolean isTrappable(Object n, boolean i) { return false; }
+ }
+