Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(910)

Unified Diff: src/preparser.cc

Issue 652743009: Classes: static should still be treated as a strict reserved word (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use let and not eval. Add tests that covers this too Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/preparser.h ('K') | « src/preparser.h ('k') | src/scanner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.cc
diff --git a/src/preparser.cc b/src/preparser.cc
index 2978cdda987478361601409b2756c1168fa0dc3e..9fd6e23d3aa59cdd830aedf044641e675852a77c 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -50,6 +50,8 @@ PreParserIdentifier PreParserTraits::GetSymbol(Scanner* scanner) {
return PreParserIdentifier::FutureStrictReserved();
} else if (scanner->current_token() == Token::LET) {
return PreParserIdentifier::Let();
+ } else if (scanner->current_token() == Token::STATIC) {
+ return PreParserIdentifier::Static();
} else if (scanner->current_token() == Token::YIELD) {
return PreParserIdentifier::Yield();
}
@@ -491,8 +493,7 @@ PreParser::Statement PreParser::ParseExpressionOrLabelledStatement(bool* ok) {
// identifier.
DCHECK(!expr.AsIdentifier().IsFutureReserved());
DCHECK(strict_mode() == SLOPPY ||
- (!expr.AsIdentifier().IsFutureStrictReserved() &&
- !expr.AsIdentifier().IsYield()));
+ !IsFutureStrictReserved(expr.AsIdentifier()));
Consume(Token::COLON);
return ParseStatement(ok);
// Preparsing is disabled for extensions (because the extension details
« src/preparser.h ('K') | « src/preparser.h ('k') | src/scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698