Namespace objects represent reflected namespaces. Here's the (short) draft spec.
Comments welcome. --larsTitle: The class "Namespace"
The class Namespace
FILE: spec/library/Namespace.html
DRAFT STATUS: DRAFT 1 - 2008-03-05
SOURCES: REFERENCES [1], [2]
REVIEWED AGAINST ES3: N/A
REVIEWED AGAINST ERRATA: N/A
REVIEWED AGAINST BASE DOC: YES
REVIEWED AGAINST PROPOSALS: N/A
REVIEWED AGAINST CODE: YES
IMPLEMENTATION STATUS: ES4 RI
OPEN ISSUES
* Namespace objects in ES4 are more opaque than the Namespace
objects in the base document and in E4X, both of which expose
"prefix" and "name" properties. ES4 is not supporting E4X, and
the base document was probably influenced by E4X, so this
may not be a big deal, but it should be discussed.
REFERENCES
[1] Section 4.2.10.4 of the base document: http://wiki.ecmascript.org/lib/exe/fetch.php?id=resources%3Aresources&cache=cache&media=resources:as3lang.doc
[2] builtins/Namespace.es in the ES4 RI
The class Namespace is a final, non-dynamic, direct subclass
of Object. It reflects a namespace as an opaque datum.
NOTE Namespaces are created as a result of the evaluation of the
namespace pragma, which defines a new namespace and creates a
binding for it. Namespaces are reflected as Namespace objects
when namespace bindings are referenced in expressions.
COMPATIBILITY NOTE The Namespace class is new in the 4th Edition of this Standard.
Synopsis
The class Namespace provides the following interface:
__ES4__ final class Namespace
{
intrinsic function toString(): string
}
The Namespace prototype object provides the following direct
properties:
toString: function ()
Methods on the Namespace class object
There are no methods on the Namespace class object. In
particular, the class Namespace does not have a publicly
accessible constructor.
Methods on Namespace instances
intrinsic::toString()
Description
The intrinsic toString method converts the Namespace
object to a string. If the Namespace object was created with an
explicit name then the string contains that name as a substring.
NOTE A Namespace object can be created with an explicit name by
providing the name as a string in the namespace pragma.
Returns
The toString method returns an implementation-defined string.
Implementation
The toString method is implementation-defined.
Methods on the Namespace prototype object
Description
The methods on the Namespace prototype object delegate to their
corresponding intrinsic methods.
Returns
The methods on the Namespace prototype object return what their
corresponding intrinsic methods return.
Implementation
prototype function toString(this:Namespace)
this.intrinsic::toString()
_______________________________________________ Es4-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es4-discuss
