8.2.4 The Reference Specification Type

Allen Wirfs-Brock allen at wirfs-brock.com
Tue Dec 18 11:39:22 PST 2012

On Dec 18, 2012, at 10:42 AM, John J Barton wrote:

> I'm trying to decode section 8.2.4
> The Reference Specification Type
> I believe that it is trying to say 
>   obj.prop = ...
> obj is reference base
> prop is reference name
> But base can also be Boolean, String, Number and env. record. I can't figure out what a reference name means in these cases. I guess the |name| is only relevant for Object, in which case the spec would be clearer if we called it a |property key|, as in 
>   GetReferencedPropertyKey(V). Returns the referenced property key component of the reference V.

I'r all in and (GetValue/SetValue).

Consider  an expression like:

This evaluates to a Reference value {base: 0, referenced name: "toFixed", strict: false}
(or strict is true if in strict code)

GetValue/SetValue explicitly coerces primitive base values to Objects in order to do property lookup.

In general, within the ES6 spec, the introduction of symbols as property keys introduces some confusion about the implications of the work "name".  I'm slowly migrating some uses of "name" to "key".  However, symbols doesn't seem to be the source of your problem here.  


More information about the es-discuss mailing list