I like this change; my only concern is our behavior in sloppy mode when the
flag
is turned off when we see const. What were const's semantics before legacy
const
was introduced? Was it treated like a variable name, like let? It looks like
that's what this code does. But it looks to me like we should throw a "not
implemented" error. We won't ship this flag as off until sloppy const is
implemented, so that error should be unreachable (right?). I don't want
people
on the web to accidentally start using const as a variable name.
https://codereview.chromium.org/1218803006/diff/1/src/parser.cc
File src/parser.cc (right):
https://codereview.chromium.org/1218803006/diff/1/src/parser.cc#newcode1385
src/parser.cc:1385: }
Do we want to interpret const as a variable (like let) if it is not
allowed? I think it should be an error if we encounter const but we
don't have a reading to interpret it (legacy or ES6).
https://codereview.chromium.org/1218803006/diff/1/src/parser.cc#newcode2435
src/parser.cc:2435: } else if (peek() == Token::CONST && allow_const())
{
How do we interpret the const token if const is not allowed?
https://codereview.chromium.org/1218803006/diff/1/src/preparser.cc
File src/preparser.cc (right):
https://codereview.chromium.org/1218803006/diff/1/src/preparser.cc#newcode197
src/preparser.cc:197: }
Error if allow_const is false?
https://codereview.chromium.org/1218803006/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.