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

Unified Diff: src/parsing/preparser.h

Issue 1537683002: Partial revert of rest parameter desugaring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test failures. Created 5 years 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-base.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/preparser.h
diff --git a/src/parsing/preparser.h b/src/parsing/preparser.h
index ab8c4b947baac59107520386f3b8b3cb6b334da7..f6126f1104f0dd452debed1b4d43a6878860fa85 100644
--- a/src/parsing/preparser.h
+++ b/src/parsing/preparser.h
@@ -119,10 +119,7 @@ class PreParserExpression {
static PreParserExpression BinaryOperation(PreParserExpression left,
Token::Value op,
PreParserExpression right) {
- return PreParserExpression(
- TypeField::encode(kBinaryOperationExpression) |
- HasRestField::encode(op == Token::COMMA &&
- right->IsSpreadExpression()));
+ return PreParserExpression(TypeField::encode(kBinaryOperationExpression));
}
static PreParserExpression Assignment() {
@@ -265,14 +262,6 @@ class PreParserExpression {
return TypeField::decode(code_) == kSpreadExpression;
}
- bool IsArrowFunctionFormalParametersWithRestParameter() const {
- // Iff the expression classifier has determined that this expression is a
- // valid arrow fformal parameter list, return true if the formal parameter
- // list ends with a rest parameter.
- return IsSpreadExpression() ||
- (IsBinaryOperation() && HasRestField::decode(code_));
- }
-
PreParserExpression AsFunctionLiteral() { return *this; }
bool IsBinaryOperation() const {
@@ -324,7 +313,6 @@ class PreParserExpression {
typedef BitField<bool, IsUseStrictField::kNext, 1> IsUseStrongField;
typedef BitField<PreParserIdentifier::Type, TypeField::kNext, 10>
IdentifierTypeField;
- typedef BitField<bool, TypeField::kNext, 1> HasRestField;
typedef BitField<bool, TypeField::kNext, 1> HasCoverInitializedNameField;
uint32_t code_;
@@ -1108,12 +1096,6 @@ void PreParserTraits::ParseArrowFunctionFormalParameterList(
Scanner::Location* duplicate_loc, bool* ok) {
// TODO(wingo): Detect duplicated identifiers in paramlists. Detect parameter
// lists that are too long.
-
- // Accomodate array literal for rest parameter.
- if (params.IsArrowFunctionFormalParametersWithRestParameter()) {
- ++parameters->materialized_literals_count;
- pre_parser_->function_state_->NextMaterializedLiteralIndex();
- }
}
« no previous file with comments | « src/parsing/parser-base.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698