Unwrap native java objects gotten as properties.
This commit is contained in:
parent
534bba3d69
commit
67f38dceb8
1 changed files with 5 additions and 3 deletions
|
@ -394,15 +394,17 @@ public final class RhinoEngine implements ScriptingEngine {
|
||||||
try {
|
try {
|
||||||
Object prop = so.get(propname, so);
|
Object prop = so.get(propname, so);
|
||||||
|
|
||||||
if (prop != Undefined.instance) {
|
if ((prop == null) || (prop == Undefined.instance)) {
|
||||||
|
return null;
|
||||||
|
} else if (prop instanceof NativeJavaObject) {
|
||||||
|
return ((NativeJavaObject) prop).unwrap();
|
||||||
|
} else {
|
||||||
return prop;
|
return prop;
|
||||||
}
|
}
|
||||||
} catch (Exception esx) {
|
} catch (Exception esx) {
|
||||||
// System.err.println ("Error in getProperty: "+esx);
|
// System.err.println ("Error in getProperty: "+esx);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue