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

Unified Diff: src/parser.cc

Issue 5985010: Fix compile-problem in (currently) unused stand-alone preparser function. (Closed)
Patch Set: Created 9 years, 12 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 | « no previous file | src/preparser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 03819eea0192d1fa3ec207c27a5bbebd2e9e0be3..a3948f0d56692dd5a2d0a14580463bf5c89cd244 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -2996,8 +2996,15 @@ ObjectLiteral::Property* Parser::ParseObjectLiteralGetSet(bool is_getter,
// We have already read the "get" or "set" keyword.
Token::Value next = Next();
// TODO(820): Allow NUMBER and STRING as well (and handle array indices).
fschneider 2011/01/04 12:01:38 This TODO does not apply anymore?
- if (next == Token::IDENTIFIER || Token::IsKeyword(next)) {
- Handle<String> name = GetSymbol(CHECK_OK);
+ bool is_keyword = Token::IsKeyword(next);
+ if (next == Token::IDENTIFIER || next == Token::NUMBER ||
+ next == Token::STRING || is_keyword) {
+ Handle<String> name;
+ if (is_keyword) {
+ name = Factory::LookupAsciiSymbol(Token::String(next));
+ } else {
+ name = GetSymbol(CHECK_OK);
+ }
FunctionLiteral* value =
ParseFunctionLiteral(name,
RelocInfo::kNoPosition,
« no previous file with comments | « no previous file | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698