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

Unified Diff: src/parsing/parser-base.h

Issue 1532873004: [es6] enable destructuring rest parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update test262 expectations Created 4 years, 11 months 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/parser.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index caf07ae5e420b703d444b000047402eb832cfb3b..2e66c0f7fb10297bdda0ae1ac26e3c9aebd2f3b7 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -1336,18 +1336,8 @@ ParserBase<Traits>::ParsePrimaryExpression(ExpressionClassifier* classifier,
MessageTemplate::kUnexpectedToken,
Token::String(Token::ELLIPSIS));
classifier->RecordNonSimpleParameter();
- Scanner::Location expr_loc = scanner()->peek_location();
- Token::Value tok = peek();
ExpressionT expr =
this->ParseAssignmentExpression(true, classifier, CHECK_OK);
- // Patterns are not allowed as rest parameters. There is no way we can
- // succeed so go ahead and use the convenient ReportUnexpectedToken
- // interface.
- if (!Traits::IsIdentifier(expr)) {
- ReportUnexpectedTokenAt(expr_loc, tok);
- *ok = false;
- return this->EmptyExpression();
- }
if (peek() == Token::COMMA) {
ReportMessageAt(scanner()->peek_location(),
MessageTemplate::kParamAfterRest);
@@ -2869,7 +2859,7 @@ void ParserBase<Traits>::ParseFormalParameter(
if (!*ok) return;
if (!Traits::IsIdentifier(pattern)) {
- if (is_rest || !allow_harmony_destructuring_bind()) {
+ if (!allow_harmony_destructuring_bind()) {
ReportUnexpectedToken(next);
*ok = false;
return;
« no previous file with comments | « src/parsing/parser.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698