Subj : (In Rhino) Why Context.newObject() looking for constructors only in TopLevelScope? To : netscape.public.mozilla.jseng From : k0t1k@mac.com Date : Mon Jun 27 2005 08:50 pm This is "newObject" method from org.mozilla.javascript.Context class. ..... 01 : public final Scriptable newObject(Scriptable scope, String constructorName, Object[] args) 02 : { 03 : scope = ScriptableObject.getTopLevelScope(scope); 04 : Function ctor = ScriptRuntime.getExistingCtor(this, scope, 05 : constructorName); 06 : if (args == null) { args = ScriptRuntime.emptyArgs; } 07 : return ctor.construct(this, scope, args); 08 : } ..... Why scope gets reset to point to TopLevelScope (line 03)? .