On Mar 20, 2012, at 8:55 AM, Andy Wingo wrote:

> On Tue 20 Mar 2012 16:45, Andy Wingo <[email protected]> writes:

Your original post doesn't seem to have made it to the discussion list. 

> 
>> Unifying the specifications of let and const in the latest draft means
>> that now, const statements can have no initializer.  Is that intended?
> 
> Of course, after sending this mail, I find:
> 
>    Static Semantics: Early Errors
>    LexicalBinding : BindingIdentifier
> 
>    It is a Syntax Error if the BindingIdentifier if IsConstantDeclaration of 
> the LexicalDeclaration containing
>    this production is true.

there is a typo in that.  "if the BindingIdentifier" should be deleted

> 
> Some of the const strangeness is still there though.  It's not
> necessarily the case that the value of the const is either nothing (in
> which case you get a TDZ error) or the result of the initializer --
> anything else that executes before the const could set it.

No, because 10.2.1.1.3 would throw on any attempt to assign to a immutable 
binding created for a const (see 10.5.3, 11.a.ii.1.

> 
> So a revised ignorant suggestion on my part:
> 
>> disallow assignment to const variables outside an initializer

they are, dynamically.  Not all variable references are statically resolvable.


Were there any other issues in the original post?

bugs.ecmasript.org is probably a better place for reporting these shorts of 
issues.

Allen


_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to