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:
igor%mir2.org 2003-11-03 18:06:49 +00:00
parent 2c30bb423d
commit bef3bd17c6
2 changed files with 4 additions and 5 deletions

View File

@ -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;

View File

@ -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()