Hello,
sorry that I did not get it from the beginning.
You are right.
I am really concerned about use of boolean shortcuts in the context of
object initializer.
But François's examples scared me.
Especially the impossibility of `{ !window }.callFunc();` kind of
statements.
But in such case, early error should tell me I am in the wrong way and
people are accepting that this kind of construct need parentheses to
disambiguate (especially for the ({}).foo case).
So I would make the proposal alive again, but the thread got cluttered. :-/
Thanks again for showing me not to panic,
Herby
-----Pôvodná správa-----
From: Mike Samuel
Sent: Wednesday, January 04, 2012 6:29 PM
To: Herby Vojčík
Cc: François REMY ; es-discuss@mozilla.org
Subject: Re: Boolean shortcuts
2012/1/4 Herby Vojčík <he...@mailbox.sk>:
Curse that eval-uation of a code block! This prevents not only this, but a
lot of more possible enhancements/reforms!
I don't see the problem. You are proposing a change to the
ObjectInitialiser production. Francois's example just demonstrates
something we already know -- that there exist strings that will parse
as an ObjectInitialiser when you start in the Expression production
but parse as a Block when you start in the Program production.
eval('{ !window }') is and would remain a block, and eval('({ !window
})') with your proposal would be unambiguously an object initialiser,
and is a SyntaxError in ES5.
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss