mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Restoring ScriptRuntime.call: BSF uses it!
This commit is contained in:
parent
9b72dd5b6f
commit
0cf7fb3e59
@ -839,6 +839,23 @@ public class ScriptRuntime {
|
|||||||
return toObject(cx, scope, val);
|
return toObject(cx, scope, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Object call(Context cx, Object fun, Object thisArg,
|
||||||
|
Object[] args, Scriptable scope)
|
||||||
|
throws JavaScriptException
|
||||||
|
{
|
||||||
|
if (!(fun instanceof Function)) {
|
||||||
|
throw notFunctionError(toString(fun));
|
||||||
|
}
|
||||||
|
Function function = (Function)fun;
|
||||||
|
Scriptable thisObj;
|
||||||
|
if (thisArg instanceof Scriptable || thisArg == null) {
|
||||||
|
thisObj = (Scriptable) thisArg;
|
||||||
|
} else {
|
||||||
|
thisObj = ScriptRuntime.toObject(cx, scope, thisArg);
|
||||||
|
}
|
||||||
|
return function.call(cx, scope, thisObj, args);
|
||||||
|
}
|
||||||
|
|
||||||
public static Scriptable newObject(Context cx, Scriptable scope,
|
public static Scriptable newObject(Context cx, Scriptable scope,
|
||||||
String constructorName, Object[] args)
|
String constructorName, Object[] args)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user