With the __parent__ property in Netscape, you can explicitly initialize the scope chain in your own custom functions.
Using this facility is somewhat inelegant, and since it is not portable its use is likely to be fairly restricted.
It is unclear whether this property will be added to the ECMA standard. For now it is only available in Netscape.
// Create an object var myObject = { aaa:"Some text" }; // A fragment of script to place that object into the scope chain myObject.__parent__ = this.__parent__; this.__parent__ = myObject;
See also: | __proto__, Lexical scoping, Scope, Scope chain |
Prev | Home | Next |
_ (Underscore) | Up | __proto__ |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |