From 5a767a58377c540730f5be44621596406d36a0d1 Mon Sep 17 00:00:00 2001 From: megacz Date: Fri, 30 Jan 2004 07:02:05 +0000 Subject: [PATCH] 2003/06/18 08:00:40 darcs-hash:20040130070205-2ba56-d4396f725dd0285ccd499f6d116dc381cd9b1689.gz --- src/org/xwt/js/ScopeImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/org/xwt/js/ScopeImpl.java b/src/org/xwt/js/ScopeImpl.java index bf5acc9..52a74f5 100644 --- a/src/org/xwt/js/ScopeImpl.java +++ b/src/org/xwt/js/ScopeImpl.java @@ -8,7 +8,7 @@ import java.util.*; /** Implementation of a JavaScript Scope */ class ScopeImpl extends JS.Obj { private JS.Scope parentScope; - private static Object NULL = new Object(); + private static Object NULL_PLACEHOLDER = new Object(); public ScopeImpl(JS.Scope parentScope, boolean sealed) { super(sealed); if (parentScope == this) throw new Error("can't make a scope its own parent!"); @@ -19,16 +19,16 @@ class ScopeImpl extends JS.Obj { // we use _get instead of get solely to work around a GCJ bug public Object _get(Object key) { if (!has(key)) return parentScope == null ? null : parentScope.get(key); - Object ret = super.get(key); return ret == NULL ? null : ret; + Object ret = super.get(key); return ret == NULL_PLACEHOLDER ? null : ret; } // we use _put instead of put solely to work around a GCJ bug public void _put(Object key, Object val) { if (!has(key) && parentScope != null) parentScope.put(key, val); - else super.put(key, val == null ? NULL : val); + else super.put(key, val == null ? NULL_PLACEHOLDER : val); } public boolean isTransparent() { return false; } public void declare(String s) { if (isTransparent()) parentScope.declare(s); - else super.put(s, NULL); + else super.put(s, NULL_PLACEHOLDER); } } -- 1.7.10.4