diff --git a/src/helma/scripting/rhino/JavaObject.java b/src/helma/scripting/rhino/JavaObject.java index eb3a8401..48619507 100644 --- a/src/helma/scripting/rhino/JavaObject.java +++ b/src/helma/scripting/rhino/JavaObject.java @@ -31,7 +31,6 @@ import java.io.IOException; public class JavaObject extends NativeJavaObject { RhinoCore core; - Scriptable prototype; String protoName; static HashMap overload; @@ -56,13 +55,12 @@ public class JavaObject extends NativeJavaObject { this.parent = scope; this.javaObject = obj; this.protoName = protoName; - this.prototype = prototype; this.core = core; staticType = obj.getClass(); + setPrototype(prototype); initMembers(); } - /** * * @@ -162,13 +160,20 @@ public class JavaObject extends NativeJavaObject { return core.postProcessHref(javaObject, protoName, basicHref); } + /** + * Checks whether the given property is defined in this object. + */ public boolean has(String name, Scriptable start) { // System.err.println ("HAS: "+name); - if (prototype.has(name, start)) + if (overload.containsKey(name)) { return true; + } return super.has(name, start); } + /** + * Get a named property from this object. + */ public Object get(String name, Scriptable start) { // System.err.println ("GET: "+name); Object obj = overload.get(name); @@ -176,11 +181,6 @@ public class JavaObject extends NativeJavaObject { return new FunctionObject(name, (Method) obj, this); } - obj = prototype.get(name, start); - if (obj != null && obj != NOT_FOUND) { - return obj; - } - return super.get(name, start); }