Remove unneeded argument from Parser::GetSymbol

Parser::GetSymbol can't actually fail, so no need for the bool* ok
argument or the CHECK_OK in callers.

BUG=
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/15421007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14727 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
wingo@igalia.com 2013-05-21 10:45:58 +00:00
parent a83fc72562
commit 467b16fd3a
2 changed files with 11 additions and 11 deletions

View File

@ -794,7 +794,7 @@ FunctionLiteral* Parser::ParseLazy(Utf16CharacterStream* source,
} }
Handle<String> Parser::GetSymbol(bool* ok) { Handle<String> Parser::GetSymbol() {
int symbol_id = -1; int symbol_id = -1;
if (pre_parse_data() != NULL) { if (pre_parse_data() != NULL) {
symbol_id = pre_parse_data()->GetSymbolIdentifier(); symbol_id = pre_parse_data()->GetSymbolIdentifier();
@ -1341,7 +1341,7 @@ Module* Parser::ParseModuleUrl(bool* ok) {
// String // String
Expect(Token::STRING, CHECK_OK); Expect(Token::STRING, CHECK_OK);
Handle<String> symbol = GetSymbol(CHECK_OK); Handle<String> symbol = GetSymbol();
// TODO(ES6): Request JS resource from environment... // TODO(ES6): Request JS resource from environment...
@ -3692,7 +3692,7 @@ Expression* Parser::ParsePrimaryExpression(bool* ok) {
case Token::STRING: { case Token::STRING: {
Consume(Token::STRING); Consume(Token::STRING);
Handle<String> symbol = GetSymbol(CHECK_OK); Handle<String> symbol = GetSymbol();
result = factory()->NewLiteral(symbol); result = factory()->NewLiteral(symbol);
if (fni_ != NULL) fni_->PushLiteralName(symbol); if (fni_ != NULL) fni_->PushLiteralName(symbol);
break; break;
@ -4047,7 +4047,7 @@ ObjectLiteral::Property* Parser::ParseObjectLiteralGetSet(bool is_getter,
if (is_keyword) { if (is_keyword) {
name = isolate_->factory()->InternalizeUtf8String(Token::String(next)); name = isolate_->factory()->InternalizeUtf8String(Token::String(next));
} else { } else {
name = GetSymbol(CHECK_OK); name = GetSymbol();
} }
FunctionLiteral* value = FunctionLiteral* value =
ParseFunctionLiteral(name, ParseFunctionLiteral(name,
@ -4128,7 +4128,7 @@ Expression* Parser::ParseObjectLiteral(bool* ok) {
} }
case Token::STRING: { case Token::STRING: {
Consume(Token::STRING); Consume(Token::STRING);
Handle<String> string = GetSymbol(CHECK_OK); Handle<String> string = GetSymbol();
if (fni_ != NULL) fni_->PushLiteralName(string); if (fni_ != NULL) fni_->PushLiteralName(string);
uint32_t index; uint32_t index;
if (!string.is_null() && string->AsArrayIndex(&index)) { if (!string.is_null() && string->AsArrayIndex(&index)) {
@ -4150,7 +4150,7 @@ Expression* Parser::ParseObjectLiteral(bool* ok) {
default: default:
if (Token::IsKeyword(next)) { if (Token::IsKeyword(next)) {
Consume(next); Consume(next);
Handle<String> string = GetSymbol(CHECK_OK); Handle<String> string = GetSymbol();
key = factory()->NewLiteral(string); key = factory()->NewLiteral(string);
} else { } else {
// Unexpected token. // Unexpected token.
@ -4823,7 +4823,7 @@ void Parser::ExpectSemicolon(bool* ok) {
void Parser::ExpectContextualKeyword(const char* keyword, bool* ok) { void Parser::ExpectContextualKeyword(const char* keyword, bool* ok) {
Expect(Token::IDENTIFIER, ok); Expect(Token::IDENTIFIER, ok);
if (!*ok) return; if (!*ok) return;
Handle<String> symbol = GetSymbol(ok); Handle<String> symbol = GetSymbol();
if (!*ok) return; if (!*ok) return;
if (!symbol->IsUtf8EqualTo(CStrVector(keyword))) { if (!symbol->IsUtf8EqualTo(CStrVector(keyword))) {
*ok = false; *ok = false;
@ -4850,7 +4850,7 @@ Handle<String> Parser::ParseIdentifier(bool* ok) {
(top_scope_->is_classic_mode() && (top_scope_->is_classic_mode() &&
(next == Token::FUTURE_STRICT_RESERVED_WORD || (next == Token::FUTURE_STRICT_RESERVED_WORD ||
(next == Token::YIELD && !is_generator())))) { (next == Token::YIELD && !is_generator())))) {
return GetSymbol(ok); return GetSymbol();
} else { } else {
ReportUnexpectedToken(next); ReportUnexpectedToken(next);
*ok = false; *ok = false;
@ -4874,7 +4874,7 @@ Handle<String> Parser::ParseIdentifierOrStrictReservedWord(
*ok = false; *ok = false;
return Handle<String>(); return Handle<String>();
} }
return GetSymbol(ok); return GetSymbol();
} }
@ -4888,7 +4888,7 @@ Handle<String> Parser::ParseIdentifierName(bool* ok) {
*ok = false; *ok = false;
return Handle<String>(); return Handle<String>();
} }
return GetSymbol(ok); return GetSymbol();
} }

View File

@ -767,7 +767,7 @@ class Parser BASE_EMBEDDED {
} }
} }
Handle<String> GetSymbol(bool* ok); Handle<String> GetSymbol();
// Get odd-ball literals. // Get odd-ball literals.
Literal* GetLiteralUndefined(); Literal* GetLiteralUndefined();