Call for opinions: attribute defaults and renaming "flexible"

Mark S. Miller erights at google.com
Sun Aug 24 12:06:41 PDT 2008


If I'm reading the general sense of the list correctly,
[[Configurable]] is generally preferred to [[Flexible]], so I'll use
that below.

We need to distinguish between
* attributes of a property, such as [[Writable]] and [[Configurable]]
* internal properties of an object, such as [[Prototype]] and [[Extensible]]
* predicates over an object's semantic state such as "sealed" and "frozen".

I think the spec language may be causing confusion by saying by using
terms like "sealed" to describe property states as well as object
states. (I think I may have introduced this confusion -- apologies if
so.) I will avoid such multiple use of terms below.

So only properties are configurable or not. Only objects are extensible or not.

If a property is _configurable_, it may be deleted, its enumerability
may be changed, it may be changed between being a data property (with
[[Value]] and [[Writable]]) and an accessor property (with [[Getter]]
and [[Setter]]), and it may be made non-configurable, at which point
none of these changes remain possible. As an unfortunate implication
of legacy issues, a non-configurable writable data property may be
made non-writable. If it weren't for this special case, we'd have to
split deletable from configurable.

If an object is _extensible_, new own properties may be added to it,
and it can be made non-extensible.

If an object is non-extensible and all of its own properties are
non-configurable, then it is _sealed_.

If an object is sealed and all of its own data properties are
non-writable, then it is _frozen_.

-- 
    Cheers,
    --MarkM


More information about the Es-discuss mailing list