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

Unified Diff: src/parsing/preparser.cc

Issue 1439693002: [runtime] Support Proxy setPrototypeOf trap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@2015-11-09_new_Proxy_1417063011
Patch Set: merging with master Created 5 years, 1 month 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 | « src/parsing/preparser.h ('k') | src/parsing/rewriter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/preparser.cc
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc
index 25b5195284fa87f70814adf48c71bb3aa37340db..24d9586adaffb08eb77230bd81ef1bb945bb4a0e 100644
--- a/src/parsing/preparser.cc
+++ b/src/parsing/preparser.cc
@@ -39,8 +39,7 @@ void PreParserTraits::ReportMessageAt(int start_pos, int end_pos,
PreParserIdentifier PreParserTraits::GetSymbol(Scanner* scanner) {
if (scanner->current_token() == Token::FUTURE_RESERVED_WORD) {
return PreParserIdentifier::FutureReserved();
- } else if (scanner->current_token() ==
- Token::FUTURE_STRICT_RESERVED_WORD) {
+ } else if (scanner->current_token() == Token::FUTURE_STRICT_RESERVED_WORD) {
return PreParserIdentifier::FutureStrictReserved();
} else if (scanner->current_token() == Token::LET) {
return PreParserIdentifier::Let();
@@ -258,8 +257,8 @@ void PreParser::ParseStatementList(int end_token, bool* ok,
scope_->SetLanguageMode(
static_cast<LanguageMode>(scope_->language_mode() | STRICT));
} else if (use_strong_found) {
- scope_->SetLanguageMode(static_cast<LanguageMode>(
- scope_->language_mode() | STRONG));
+ scope_->SetLanguageMode(
+ static_cast<LanguageMode>(scope_->language_mode() | STRONG));
if (IsClassConstructor(function_state_->kind())) {
// "use strong" cannot occur in a class constructor body, to avoid
// unintuitive strong class object semantics.
@@ -305,7 +304,7 @@ void PreParser::ParseStatementList(int end_token, bool* ok,
#define CHECK_OK ok); \
- if (!*ok) return Statement::Default(); \
+ if (!*ok) return Statement::Default(); \
((void)0
#define DUMMY ) // to make indentation work
#undef DUMMY
@@ -443,8 +442,8 @@ PreParser::Statement PreParser::ParseFunctionDeclaration(bool* ok) {
int pos = position();
bool is_generator = Check(Token::MUL);
bool is_strict_reserved = false;
- Identifier name = ParseIdentifierOrStrictReservedWord(
- &is_strict_reserved, CHECK_OK);
+ Identifier name =
+ ParseIdentifierOrStrictReservedWord(&is_strict_reserved, CHECK_OK);
ParseFunctionLiteral(name, scanner()->location(),
is_strict_reserved ? kFunctionNameIsStrictReserved
: kFunctionNameValidityUnknown,
@@ -490,8 +489,7 @@ PreParser::Statement PreParser::ParseBlock(bool* ok) {
PreParser::Statement PreParser::ParseVariableStatement(
- VariableDeclarationContext var_context,
- bool* ok) {
+ VariableDeclarationContext var_context, bool* ok) {
// VariableStatement ::
// VariableDeclarations ';'
@@ -647,7 +645,7 @@ PreParser::Statement PreParser::ParseExpressionOrLabelledStatement(bool* ok) {
case Token::THIS:
if (!FLAG_strong_this) break;
- // Fall through.
+ // Fall through.
case Token::SUPER:
if (is_strong(language_mode()) &&
IsClassConstructor(function_state_->kind())) {
@@ -735,8 +733,9 @@ PreParser::Statement PreParser::ParseIfStatement(bool* ok) {
if (peek() == Token::ELSE) {
Next();
Statement else_stat = ParseSubStatement(CHECK_OK);
- stat = (stat.IsJumpStatement() && else_stat.IsJumpStatement()) ?
- Statement::Jump() : Statement::Default();
+ stat = (stat.IsJumpStatement() && else_stat.IsJumpStatement())
+ ? Statement::Jump()
+ : Statement::Default();
} else {
stat = Statement::Default();
}
@@ -750,10 +749,8 @@ PreParser::Statement PreParser::ParseContinueStatement(bool* ok) {
Expect(Token::CONTINUE, CHECK_OK);
Token::Value tok = peek();
- if (!scanner()->HasAnyLineTerminatorBeforeNext() &&
- tok != Token::SEMICOLON &&
- tok != Token::RBRACE &&
- tok != Token::EOS) {
+ if (!scanner()->HasAnyLineTerminatorBeforeNext() && tok != Token::SEMICOLON &&
+ tok != Token::RBRACE && tok != Token::EOS) {
// ECMA allows "eval" or "arguments" as labels even in strict mode.
ParseIdentifier(kAllowRestrictedIdentifiers, CHECK_OK);
}
@@ -768,10 +765,8 @@ PreParser::Statement PreParser::ParseBreakStatement(bool* ok) {
Expect(Token::BREAK, CHECK_OK);
Token::Value tok = peek();
- if (!scanner()->HasAnyLineTerminatorBeforeNext() &&
- tok != Token::SEMICOLON &&
- tok != Token::RBRACE &&
- tok != Token::EOS) {
+ if (!scanner()->HasAnyLineTerminatorBeforeNext() && tok != Token::SEMICOLON &&
+ tok != Token::RBRACE && tok != Token::EOS) {
// ECMA allows "eval" or "arguments" as labels even in strict mode.
ParseIdentifier(kAllowRestrictedIdentifiers, CHECK_OK);
}
@@ -796,10 +791,8 @@ PreParser::Statement PreParser::ParseReturnStatement(bool* ok) {
// This is not handled during preparsing.
Token::Value tok = peek();
- if (!scanner()->HasAnyLineTerminatorBeforeNext() &&
- tok != Token::SEMICOLON &&
- tok != Token::RBRACE &&
- tok != Token::EOS) {
+ if (!scanner()->HasAnyLineTerminatorBeforeNext() && tok != Token::SEMICOLON &&
+ tok != Token::RBRACE && tok != Token::EOS) {
if (is_strong(language_mode()) &&
IsClassConstructor(function_state_->kind())) {
int pos = peek_position();
@@ -856,8 +849,7 @@ PreParser::Statement PreParser::ParseSwitchStatement(bool* ok) {
Expect(Token::COLON, CHECK_OK);
token = peek();
Statement statement = Statement::Jump();
- while (token != Token::CASE &&
- token != Token::DEFAULT &&
+ while (token != Token::CASE && token != Token::DEFAULT &&
token != Token::RBRACE) {
statement = ParseStatementListItem(CHECK_OK);
token = peek();
@@ -1072,8 +1064,8 @@ PreParser::Statement PreParser::ParseDebuggerStatement(bool* ok) {
#undef CHECK_OK
-#define CHECK_OK ok); \
- if (!*ok) return Expression::Default(); \
+#define CHECK_OK ok); \
+ if (!*ok) return Expression::Default(); \
((void)0
#define DUMMY ) // to make indentation work
#undef DUMMY
@@ -1106,9 +1098,8 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
Expect(Token::RPAREN, CHECK_OK);
int formals_end_position = scanner()->location().end_pos;
- CheckArityRestrictions(formals.arity, arity_restriction,
- formals.has_rest, start_position,
- formals_end_position, CHECK_OK);
+ CheckArityRestrictions(formals.arity, arity_restriction, formals.has_rest,
+ start_position, formals_end_position, CHECK_OK);
// See Parser::ParseFunctionLiteral for more information about lazy parsing
// and lazy compilation.
« no previous file with comments | « src/parsing/preparser.h ('k') | src/parsing/rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698