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:
parent
b25185451f
commit
d8236fb3b5
1 changed files with 4 additions and 12 deletions
|
@ -752,14 +752,14 @@ public final class RhinoCore {
|
||||||
return getNodeWrapper((INode) obj);
|
return getNodeWrapper((INode) obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj != null && app.getPrototypeName(obj) != null) {
|
|
||||||
return getElementWrapper(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (obj instanceof SystemMap || obj instanceof WrappedMap) {
|
if (obj instanceof SystemMap || obj instanceof WrappedMap) {
|
||||||
return new MapWrapper((Map) obj, RhinoCore.this);
|
return new MapWrapper((Map) obj, RhinoCore.this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (obj != null && app.getPrototypeName(obj) != null) {
|
||||||
|
return getElementWrapper(obj);
|
||||||
|
}
|
||||||
|
|
||||||
if (obj instanceof String) {
|
if (obj instanceof String) {
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
@ -767,14 +767,6 @@ public final class RhinoCore {
|
||||||
return super.wrap(cx, scope, obj, staticType);
|
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) {
|
public Scriptable wrapNewObject(Context cx, Scriptable scope, Object obj) {
|
||||||
// System.err.println ("N-Wrapping: "+obj);
|
// System.err.println ("N-Wrapping: "+obj);
|
||||||
if (obj instanceof INode) {
|
if (obj instanceof INode) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue