2003/06/13 05:25:56
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:01:07 +0000 (07:01 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:01:07 +0000 (07:01 +0000)
darcs-hash:20040130070107-2ba56-b2bc9d7bbbd119d3880f312ac4c561cf64c0e78a.gz

src/org/xwt/js/CompiledFunction.java
src/org/xwt/js/JS.java

index 76f2bf9..23b3f95 100644 (file)
@@ -234,6 +234,7 @@ public final class CompiledFunction extends JS.Callable implements ByteCodes, To
                }
                Object ret = null;
                if (o == null) throw je("tried to get property \"" + v + "\" from the null value");
+               if (v == null) throw je("tried to get the null key from " + v);
                if (o instanceof String) {
                    ret = getFromString((String)o, v);
                } else if (o instanceof Boolean) {
index 85189b4..72c9e2a 100644 (file)
@@ -72,7 +72,11 @@ public abstract class JS {
        private Scope parentScope;
        private static Object NULL = new Object();
        public Scope(Scope parentScope) { this(parentScope, false); }
-       public Scope(Scope parentScope, boolean sealed) { super(sealed); this.parentScope = parentScope; }
+       public Scope(Scope parentScope, boolean sealed) {
+           super(sealed);
+           if (parentScope == this) throw new Error("can't make a scope its own parent!");
+           this.parentScope = parentScope;
+       }
        public Scope getParentScope() { return parentScope; }
 
        // transparent scopes are not returned by THIS