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

Unified Diff: src/scanner.cc

Issue 383983002: Implement handling of arrow functions in the parser (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix int/unsigned comparison warning Created 6 years, 5 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
« no previous file with comments | « src/scanner.h ('k') | src/token.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner.cc
diff --git a/src/scanner.cc b/src/scanner.cc
index 3c682014fe81ddffb401f50be5f23beb98ec034c..e0858c78641de6ae5f9b5987744c7ac2fd85ff42 100644
--- a/src/scanner.cc
+++ b/src/scanner.cc
@@ -466,10 +466,12 @@ void Scanner::Scan() {
break;
case '=':
- // = == ===
+ // = == === =>
Advance();
if (c0_ == '=') {
token = Select('=', Token::EQ_STRICT, Token::EQ);
+ } else if (c0_ == '>') {
+ token = Select(Token::ARROW);
} else {
token = Token::ASSIGN;
}
@@ -1006,6 +1008,16 @@ 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_);
+}
+
+
Token::Value Scanner::ScanIdentifierOrKeyword() {
ASSERT(unicode_cache_->IsIdentifierStart(c0_));
LiteralScope literal(this);
« no previous file with comments | « src/scanner.h ('k') | src/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698