Sep 27 meeting notes
brendan at mozilla.com
Thu Sep 29 10:02:30 PDT 2011
On Sep 29, 2011, at 5:41 PM, Allen Wirfs-Brock wrote:
> Presumably the job of the constructor is to establish invariants of the constructed instances. Some of those invariants may involve complex relationships among property values and between the new object and other objects. There are many ways that an object can escape from a constructor before these invariants are fully established. Why is the "const" invariant any more important than other invariants that we aren't attempting to guarantee?
Perhaps it shouldn't be, but then (we've agreed) such invariants as temporal dead zone error on read before initialization *are* important for const bindings.
So if these const-ish property definitions in classes have different invariants, they ought not use the 'const' keyword. But as we discussed, this takes a toll too. Now users have to learn the new keyword or punctuator, and how it differs from 'const'.
More information about the es-discuss