| Index: src/preparser.cc
|
| diff --git a/src/preparser.cc b/src/preparser.cc
|
| index 157fbea554728a801d5f2e879e581f5a07d7aed5..e05f903772e6147fad2da97ef808b06d80335787 100644
|
| --- a/src/preparser.cc
|
| +++ b/src/preparser.cc
|
| @@ -950,13 +950,17 @@ PreParser::Expression PreParser::ParseObjectLiteral(bool* ok) {
|
| ParseIdentifierOrGetOrSet(&is_getter, &is_setter, CHECK_OK);
|
| if ((is_getter || is_setter) && peek() != i::Token::COLON) {
|
| i::Token::Value name = Next();
|
| + bool is_keyword = i::Token::IsKeyword(name);
|
| if (name != i::Token::IDENTIFIER &&
|
| name != i::Token::NUMBER &&
|
| name != i::Token::STRING &&
|
| - !i::Token::IsKeyword(name)) {
|
| + !is_keyword) {
|
| *ok = false;
|
| return kUnknownExpression;
|
| }
|
| + if (!is_keyword) {
|
| + LogSymbol();
|
| + }
|
| ParseFunctionLiteral(CHECK_OK);
|
| if (peek() != i::Token::RBRACE) {
|
| Expect(i::Token::COMMA, CHECK_OK);
|
| @@ -1120,24 +1124,24 @@ void PreParser::ExpectSemicolon(bool* ok) {
|
| }
|
|
|
|
|
| -PreParser::Identifier PreParser::GetIdentifierSymbol() {
|
| +void PreParser::LogSymbol() {
|
| int identifier_pos = scanner_->location().beg_pos;
|
| if (scanner_->is_literal_ascii()) {
|
| log_->LogAsciiSymbol(identifier_pos, scanner_->literal_ascii_string());
|
| } else {
|
| log_->LogUC16Symbol(identifier_pos, scanner_->literal_uc16_string());
|
| }
|
| +}
|
| +
|
| +
|
| +PreParser::Identifier PreParser::GetIdentifierSymbol() {
|
| + LogSymbol();
|
| return kUnknownIdentifier;
|
| }
|
|
|
|
|
| PreParser::Expression PreParser::GetStringSymbol() {
|
| - int identifier_pos = scanner_->location().beg_pos;
|
| - if (scanner_->is_literal_ascii()) {
|
| - log_->LogAsciiSymbol(identifier_pos, scanner_->literal_ascii_string());
|
| - } else {
|
| - log_->LogUC16Symbol(identifier_pos, scanner_->literal_uc16_string());
|
| - }
|
| + LogSymbol();
|
| return kUnknownExpression;
|
| }
|
|
|
|
|