function hoisting like var

Igor Bukanov igor at
Sun Jul 27 17:20:19 PDT 2008

2008/7/28 Ingvar von Schoultz <ingvar-v-s at>:
> If [...] is preceded by =, or enclosed in ( ), or in some other
> position where you can't have a block, it's a literal. If it's
> a literal it must contain a comma-separated list of values, so
> if the syntax doesn't match this, it's a block.

Such rules require an arbitrary look ahead in the parser so it can
distinguish that in cases like

  if (x) [arbitrary_expression;]

[] means a block while in

  if (x) [arbitrarily_expression];

[] would mean a literal.

This would require a mayor change in most if not all current ES parser
implementations. There were some proposals for ES4 syntax that would
require such look ahead, but they were rejected not only technical
grounds but also on the grounds that such look ahead poses
comprehension problem for a human brain! And here are we talking about
a minimalistic sugar for ES3.1.

Regards, Igor

More information about the Es4-discuss mailing list