* If a script function returns an instance of org.mozilla.javascript.Wrapper
always unwrap it before processing/returning. * If a script function returns null or undefined, return null even when invoke() was called in XML-RPC mode.
This commit is contained in:
parent
b85b9f206b
commit
ae1aa70fdf
1 changed files with 7 additions and 5 deletions
|
@ -262,12 +262,14 @@ public class RhinoEngine implements ScriptingEngine {
|
||||||
|
|
||||||
Object retval = ((Function) f).call(context, global, eso, args);
|
Object retval = ((Function) f).call(context, global, eso, args);
|
||||||
|
|
||||||
if (xmlrpc) {
|
if (retval instanceof Wrapper) {
|
||||||
return core.processXmlRpcResponse (retval);
|
retval = ((Wrapper) retval).unwrap();
|
||||||
} else if ((retval == null) || (retval == Undefined.instance)) {
|
}
|
||||||
|
|
||||||
|
if ((retval == null) || (retval == Undefined.instance)) {
|
||||||
return null;
|
return null;
|
||||||
} else if (retval instanceof Wrapper) {
|
} else if (xmlrpc) {
|
||||||
return ((Wrapper) retval).unwrap();
|
return core.processXmlRpcResponse (retval);
|
||||||
} else {
|
} else {
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue