diff --git a/mozilla/js/rhino/src/org/mozilla/javascript/NativeJavaClass.java b/mozilla/js/rhino/src/org/mozilla/javascript/NativeJavaClass.java index 4942649e87f..1f01592f73e 100644 --- a/mozilla/js/rhino/src/org/mozilla/javascript/NativeJavaClass.java +++ b/mozilla/js/rhino/src/org/mozilla/javascript/NativeJavaClass.java @@ -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; diff --git a/mozilla/js/rhino/src/org/mozilla/javascript/NativeJavaConstructor.java b/mozilla/js/rhino/src/org/mozilla/javascript/NativeJavaConstructor.java index 55c94a2c8df..0b7265f8bc7 100644 --- a/mozilla/js/rhino/src/org/mozilla/javascript/NativeJavaConstructor.java +++ b/mozilla/js/rhino/src/org/mozilla/javascript/NativeJavaConstructor.java @@ -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()