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, |