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

Unified Diff: src/scanner.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
Index: src/scanner.cc
diff --git a/src/scanner.cc b/src/scanner.cc
index 0709939dbac8b142a3ad81a2ea948fa681179b34..67d8fa0f49a33667d0904c0843f7b61537ba1e23 100644
--- a/src/scanner.cc
+++ b/src/scanner.cc
@@ -1018,11 +1018,15 @@ static Token::Value KeywordOrIdentifierToken(const uint8_t* input,
bool Scanner::IdentifierIsFutureStrictReserved(
const AstRawString* string) const {
// Keywords are always 1-byte strings.
- return string->is_one_byte() &&
- Token::FUTURE_STRICT_RESERVED_WORD ==
- KeywordOrIdentifierToken(string->raw_data(), string->length(),
- harmony_scoping_, harmony_modules_,
- harmony_classes_);
+ if (!string->is_one_byte()) return false;
+ if (string->IsOneByteEqualTo("let") || string->IsOneByteEqualTo("static") ||
+ string->IsOneByteEqualTo("yield")) {
+ return true;
+ }
+ return Token::FUTURE_STRICT_RESERVED_WORD ==
+ KeywordOrIdentifierToken(string->raw_data(), string->length(),
+ harmony_scoping_, harmony_modules_,
+ harmony_classes_);
}
« src/preparser.h ('K') | « src/preparser.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698