diff options
author | Michaƫl Zasso <targos@protonmail.com> | 2017-03-25 16:48:55 +0300 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2017-03-29 23:30:55 +0300 |
commit | 8dfc710a063be563a476a28523d571166d9a99ef (patch) | |
tree | 17b34f416bca036b9ca53a0bd8e6f2b7a4c5f4f6 | |
parent | 52bdb8f2465cfb83a4b9e393ae6173e209750505 (diff) |
deps: cherry-pick b9f682b from upstream V8
Original commit message:
Fix bug with illegal spread as single arrow parameter
R=adamk@chromium.org
BUG=chromium:621496
LOG=N
Review-Url: https://codereview.chromium.org/2084703005
Cr-Commit-Position: refs/heads/master@{#37196}
Fixes: https://github.com/nodejs/node/issues/12017
PR-URL: https://github.com/nodejs/node/pull/12037
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
-rw-r--r-- | deps/v8/include/v8-version.h | 2 | ||||
-rw-r--r-- | deps/v8/src/parsing/parser-base.h | 7 | ||||
-rw-r--r-- | deps/v8/test/mjsunit/harmony/regress/regress-crbug-621496.js | 7 |
3 files changed, 13 insertions, 3 deletions
diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index d6df3c2e934..d281773473a 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -11,7 +11,7 @@ #define V8_MAJOR_VERSION 5 #define V8_MINOR_VERSION 1 #define V8_BUILD_NUMBER 281 -#define V8_PATCH_LEVEL 96 +#define V8_PATCH_LEVEL 97 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/src/parsing/parser-base.h b/deps/v8/src/parsing/parser-base.h index d4cc3994578..e0e12edbd73 100644 --- a/deps/v8/src/parsing/parser-base.h +++ b/deps/v8/src/parsing/parser-base.h @@ -1307,8 +1307,11 @@ ParserBase<Traits>::ParsePrimaryExpression(ExpressionClassifier* classifier, MessageTemplate::kUnexpectedToken, Token::String(Token::ELLIPSIS)); classifier->RecordNonSimpleParameter(); - ExpressionT expr = - this->ParseAssignmentExpression(true, classifier, CHECK_OK); + ExpressionClassifier binding_classifier(this); + ExpressionT expr = this->ParseAssignmentExpression( + true, &binding_classifier, CHECK_OK); + classifier->Accumulate(&binding_classifier, + ExpressionClassifier::AllProductions); if (!this->IsIdentifier(expr) && !IsValidPattern(expr)) { classifier->RecordArrowFormalParametersError( Scanner::Location(ellipsis_pos, scanner()->location().end_pos), diff --git a/deps/v8/test/mjsunit/harmony/regress/regress-crbug-621496.js b/deps/v8/test/mjsunit/harmony/regress/regress-crbug-621496.js new file mode 100644 index 00000000000..4db7a950394 --- /dev/null +++ b/deps/v8/test/mjsunit/harmony/regress/regress-crbug-621496.js @@ -0,0 +1,7 @@ +// Copyright 2016 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +(function testIllegalSpreadAsSingleArrowParameter() { + assertThrows("(...[42]) => 42)", SyntaxError) // will core dump, if not fixed +})(); |