* Add argument checking to RhinoEngine.invoke().

This commit is contained in:
hns 2007-03-29 15:35:16 +00:00
parent 804b6b0075
commit 72487ca844

View file

@ -231,6 +231,12 @@ public class RhinoEngine implements ScriptingEngine {
*/ */
public Object invoke(Object thisObject, Object function, Object[] args, public Object invoke(Object thisObject, Object function, Object[] args,
int argsWrapMode, boolean resolve) throws ScriptingException { int argsWrapMode, boolean resolve) throws ScriptingException {
if (function == null) {
throw new IllegalArgumentException("Function argument must not be null");
}
if (args == null) {
throw new IllegalArgumentException("Arguments array must not be null");
}
try { try {
Scriptable obj = thisObject == null ? global : Context.toObject(thisObject, global); Scriptable obj = thisObject == null ? global : Context.toObject(thisObject, global);
Function func; Function func;