Do not override wrapAsJavaObject() in WrapFactory since it is only called

after we already did our checks in wrap() or wrapNewObject().
This commit is contained in:
hns 2003-08-08 12:19:00 +00:00
parent b25185451f
commit d8236fb3b5

View file

@ -752,14 +752,14 @@ public final class RhinoCore {
return getNodeWrapper((INode) obj);
}
if (obj != null && app.getPrototypeName(obj) != null) {
return getElementWrapper(obj);
}
if (obj instanceof SystemMap || obj instanceof WrappedMap) {
return new MapWrapper((Map) obj, RhinoCore.this);
}
if (obj != null && app.getPrototypeName(obj) != null) {
return getElementWrapper(obj);
}
if (obj instanceof String) {
return obj;
}
@ -767,14 +767,6 @@ public final class RhinoCore {
return super.wrap(cx, scope, obj, staticType);
}
public Scriptable wrapAsJavaObject(Context cx, Scriptable scope, Object javaObject) {
if (javaObject != null && app.getPrototypeName(javaObject) != null) {
return getElementWrapper(javaObject);
}
return super.wrapAsJavaObject(cx, scope, javaObject);
}
public Scriptable wrapNewObject(Context cx, Scriptable scope, Object obj) {
// System.err.println ("N-Wrapping: "+obj);
if (obj instanceof INode) {