Made the change and added tests to cover the currently implemented strict
mode
checks.
http://codereview.chromium.org/6144005/diff/20001/src/parser.cc
File src/parser.cc (right):
http://codereview.chromium.org/6144005/diff/20001/src/parser.cc#newcode1076
src/parser.cc:1076: if (directive_prologue && peek() == Token::STRING) {
We still need to keep track of the token location but other than that,
this does work. Made the change.
On 2011/01/17 10:23:41, Lasse Reichstein wrote:
So I guess this could just be
if (directive_prologue && peek() != Token::STRING) {
directive_prologue = false;
}
Statement* stat = parseStatement(NULL, CHECK_OK);
if (directive_prologue) {
// if not String only ExpressionStatement, directive_prologue =
false;
// else if is "use strict" ExpressionStatement, set strict mode.
}
...
http://codereview.chromium.org/6144005/
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev