8.7 Reference Specification Type

2010-04-18

A Reference is used to explain the behaviour of operators like delete, typeof and the assignment operators. For example, the left-hand operand of an assignment is expected to produce a reference.

No built-in functions will return a Reference type, but host objects may and could.

A Reference is a resolved name binding.

It has three components; the base value, the referenced name string and the boolean strict reference. The base value is either undefined, an Object, a Boolean, a String, a Number or an environment record. A base value of undefined indicates that the reference could not be resolved to a binding.

The following abstract operations are used to access these components:

mixed GetBase(R)
Get the base value of R.

String GetReferencedName(R)
Get the referenced name of R.

Boolean IsStrictReferen(R)
Return the strict value.

Boolean HasPrimitiveBase(R)
Returns true if the base is of type Boolean, String or Number

Boolean IsPropertyReference(R)
Returns true if base is an Object, Boolean, String or Number. (Okay, the spec explicitly says "or HasPrijmitive(R) is true", which comes down to this, but observable side effects may occur if that operation would change)

Boolean IsUnresolvableReference(R)
Returns true only if the base is undefined and false otherwise.