ActionScript 3 Language Specification |
|||
| ActionScript 3.0 Language Specification > 5 Names > 5.3 Name lookup > 5.3.1 Object references | |||
Object references result from expressions involving the dot or bracket operators. They may be qualified or unqualified. The following table shows various forms of object references.
|
Literal |
Expression |
|
|
Unqualified |
o.id
|
o[expr]
|
|
Qualified |
o.q::id
|
o.q::[expr]
|
We use the expression form of references to describe the name lookup semantics. However, every literal name can be rewritten as an expression name through the following steps:
o.id with a bracket operations of the form o['id']o.q::['id']The unqualified expression o[expr] is a reference to a property of the value of the expression o that has a name that matches one of the names of the set of names (multiname) composed in the following way:
id be the string value of the expression exprm be an empty set of namesq in the set of open namespaces: n be a name with the qualifier q and the identifier idn to the set of names mmThe single name of a multiname reference r is determined by the following steps:
t be the least derived type of x that contains at least one of the names in the multiname set m of the reference rm' be the intersection of the set of names m and the property names in tn be the set of names in the most derived type of x and in m'n is empty, return the name in m that is qualified by the public namespacen contains one name, then return that nameThe base object of this reference is the value of the expression o.
o.q::[expr]
This is a reference to a property inside the value of o that matches a single name. Because the qualifier is explicit, the qualified name is straightforward to compute:
ns be the value of the expression qid be the string value of the expression exprns and the identifier idThe base object of this reference is the value of the expression o.
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/specs/actionscript/3/as3_specification48.html