Revision: 14727
Author: [email protected]
Date: Tue May 21 03:45:58 2013
Log: 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=
[email protected]
Review URL: https://codereview.chromium.org/15421007
http://code.google.com/p/v8/source/detail?r=14727
Modified:
/branches/bleeding_edge/src/parser.cc
/branches/bleeding_edge/src/parser.h
=======================================
--- /branches/bleeding_edge/src/parser.cc Tue May 14 09:26:56 2013
+++ /branches/bleeding_edge/src/parser.cc Tue May 21 03:45:58 2013
@@ -794,7 +794,7 @@
}
-Handle<String> Parser::GetSymbol(bool* ok) {
+Handle<String> Parser::GetSymbol() {
int symbol_id = -1;
if (pre_parse_data() != NULL) {
symbol_id = pre_parse_data()->GetSymbolIdentifier();
@@ -1341,7 +1341,7 @@
// String
Expect(Token::STRING, CHECK_OK);
- Handle<String> symbol = GetSymbol(CHECK_OK);
+ Handle<String> symbol = GetSymbol();
// TODO(ES6): Request JS resource from environment...
@@ -3692,7 +3692,7 @@
case Token::STRING: {
Consume(Token::STRING);
- Handle<String> symbol = GetSymbol(CHECK_OK);
+ Handle<String> symbol = GetSymbol();
result = factory()->NewLiteral(symbol);
if (fni_ != NULL) fni_->PushLiteralName(symbol);
break;
@@ -4047,7 +4047,7 @@
if (is_keyword) {
name =
isolate_->factory()->InternalizeUtf8String(Token::String(next));
} else {
- name = GetSymbol(CHECK_OK);
+ name = GetSymbol();
}
FunctionLiteral* value =
ParseFunctionLiteral(name,
@@ -4128,7 +4128,7 @@
}
case Token::STRING: {
Consume(Token::STRING);
- Handle<String> string = GetSymbol(CHECK_OK);
+ Handle<String> string = GetSymbol();
if (fni_ != NULL) fni_->PushLiteralName(string);
uint32_t index;
if (!string.is_null() && string->AsArrayIndex(&index)) {
@@ -4150,7 +4150,7 @@
default:
if (Token::IsKeyword(next)) {
Consume(next);
- Handle<String> string = GetSymbol(CHECK_OK);
+ Handle<String> string = GetSymbol();
key = factory()->NewLiteral(string);
} else {
// Unexpected token.
@@ -4823,7 +4823,7 @@
void Parser::ExpectContextualKeyword(const char* keyword, bool* ok) {
Expect(Token::IDENTIFIER, ok);
if (!*ok) return;
- Handle<String> symbol = GetSymbol(ok);
+ Handle<String> symbol = GetSymbol();
if (!*ok) return;
if (!symbol->IsUtf8EqualTo(CStrVector(keyword))) {
*ok = false;
@@ -4850,7 +4850,7 @@
(top_scope_->is_classic_mode() &&
(next == Token::FUTURE_STRICT_RESERVED_WORD ||
(next == Token::YIELD && !is_generator())))) {
- return GetSymbol(ok);
+ return GetSymbol();
} else {
ReportUnexpectedToken(next);
*ok = false;
@@ -4874,7 +4874,7 @@
*ok = false;
return Handle<String>();
}
- return GetSymbol(ok);
+ return GetSymbol();
}
@@ -4888,7 +4888,7 @@
*ok = false;
return Handle<String>();
}
- return GetSymbol(ok);
+ return GetSymbol();
}
=======================================
--- /branches/bleeding_edge/src/parser.h Wed May 8 08:02:08 2013
+++ /branches/bleeding_edge/src/parser.h Tue May 21 03:45:58 2013
@@ -767,7 +767,7 @@
}
}
- Handle<String> GetSymbol(bool* ok);
+ Handle<String> GetSymbol();
// Get odd-ball literals.
Literal* GetLiteralUndefined();
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.