8.10 Property Descriptor and Identifier

2010-04-19

The Property Descriptor contains name value pairs for the attributes of a property.

There are two different kinds of descriptors: data property descriptors and accessor property descriptors. A descriptor is a data property descriptor if it contains either [[Value]] or [[Writable]]. An accessor would need to contain [[Get]] or [[Set]]. A Property Descriptor may not be both a data and accessor property at the same time. But it may be neither. A generic property descriptor is neither. A fully populated property is either a data descriptor or an accessor descriptor and contains all fields that type of the descriptor could have.

The Property Identifier is used to identify a Property Descriptor by name. It's a (name, descriptor) pair.

In the specification the operations on Property Descriptors look like regular objects, creating as well as accessing. So you can have PD = {[[Writable]]: false, [[Enumerable]]: true}; and PD.[[Writable]] to access. This will be used in the abstract ecma script code for algorithms as well.