473,396 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

(In Rhino) Why Context.newObject() looking for constructors only in TopLevelScope?

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)?

Jul 23 '05 #1
2 1834
k0t1k wrote:
This is "newObject" method from org.mozilla.javascript.Context class.

<snip>

Generally the point of ECMAScript is that the author does not need to
know anything about how implementations of the language work. And doing
cross-browser work makes the specific implementations less significant
as they are not the same in different browsers. So long as the resulting
behaviour corresponds with ECMA 262 the internal details are not
important.

A good group for asking questions related to the Spidermonkey and/or
Rhino implementations is - netscape.public.mozilla.jseng -, as there
they may get the attention of the authors of those implementations.

Richard.
Jul 23 '05 #2
Thanks Richard, I will repost it there.

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: John Benson | last post by:
Hi, I'm in a tightly-secured environment where I may not be allowed to use Python for some scripting work, and may have to fall back on what came with Windows 2K. I'm cracking "VBScript in a...
42
by: Edward Diener | last post by:
Coming from the C++ world I can not understand the reason why copy constructors are not used in the .NET framework. A copy constructor creates an object from a copy of another object of the same...
10
by: Brett Foster | last post by:
Perhpas somebody can give me a hand with this little problem. Given: var object; -- an object var func; -- a function call back Now, I want to know how to get the following effect: ...
4
by: Jamie B | last post by:
Is it possible to use System.Type, Activator or whatever to create a complete "blank", unitialized object of a given type, and then at a later time call a constructor on it. The only caveat is that...
10
by: John | last post by:
Trying to find out what is essential / optional, I made an extremely simple Class and Module combination to add two numbers. (see below) It appears that an empty constructor is needed n order to...
5
by: Anders Borum | last post by:
Hello! Whilst refactoring an application, I was looking at optimizing a ModelFactory with generics. Unfortunately, the business objects created by the ModelFactory doesn't provide public...
7
by: andrewfsears | last post by:
I have a question: I was wondering if it is possible to simulate the multiple constructors, like in Java (yes, I know that the languages are completely different)? Let's say that I have a class...
3
by: jackchang1 | last post by:
Hi I want to develop a Java application to check the syntax of Javascript code and I am thinking about using Rhino. But I don't know where to start and there is no document for this. Has anybody...
1
by: Kwang Yul Seo | last post by:
Hi all, I am looking for JavaScript libraries based on JavaScript Core Library (http://www.webreference.com/javascript/reference/core_ref/ contents.html) without using client-side JavaScript. Is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.