mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-08 12:22:34 +00:00
In NativeJavaClass.constructSpecific use passed scope, not function pointer as scope source so shared system scope with custom top scope and custom wrap factory would work.
This commit is contained in:
parent
2c30bb423d
commit
bef3bd17c6
@ -181,7 +181,7 @@ public class NativeJavaClass extends NativeJavaObject implements Function {
|
||||
}
|
||||
|
||||
// Found the constructor, so try invoking it.
|
||||
return constructSpecific(cx, scope, this, args, ctors[index]);
|
||||
return constructSpecific(cx, scope, args, ctors[index]);
|
||||
} else {
|
||||
Scriptable topLevel = ScriptableObject.getTopLevelScope(this);
|
||||
String msg = "";
|
||||
@ -208,11 +208,10 @@ public class NativeJavaClass extends NativeJavaObject implements Function {
|
||||
}
|
||||
|
||||
static Scriptable constructSpecific(Context cx, Scriptable scope,
|
||||
Scriptable thisObj, Object[] args,
|
||||
MemberBox ctor)
|
||||
Object[] args, MemberBox ctor)
|
||||
throws JavaScriptException
|
||||
{
|
||||
Scriptable topLevel = ScriptableObject.getTopLevelScope(thisObj);
|
||||
Scriptable topLevel = ScriptableObject.getTopLevelScope(scope);
|
||||
Class classObject = ctor.getDeclaringClass();
|
||||
Class[] argTypes = ctor.argTypes;
|
||||
|
||||
|
@ -67,7 +67,7 @@ public class NativeJavaConstructor extends BaseFunction
|
||||
Object[] args)
|
||||
throws JavaScriptException
|
||||
{
|
||||
return NativeJavaClass.constructSpecific(cx, scope, this, args, ctor);
|
||||
return NativeJavaClass.constructSpecific(cx, scope, args, ctor);
|
||||
}
|
||||
|
||||
public String toString()
|
||||
|
Loading…
Reference in New Issue
Block a user