Commit 7d1d9786 authored by adamk's avatar adamk Committed by Commit bot

Rename destructuring flag to "--harmony-destructuring-bind"

This is in preparation for the addition of --harmony-destructuring-assignment.

BUG=v8:811
LOG=n

Review URL: https://codereview.chromium.org/1450193002

Cr-Commit-Position: refs/heads/master@{#32098}
parent 973377e5
......@@ -2042,7 +2042,7 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy_function)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy_let)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_default_parameters)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_destructuring)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_destructuring_bind)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_observe)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexps)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode_regexps)
......@@ -2552,7 +2552,7 @@ bool Genesis::InstallExperimentalNatives() {
static const char* harmony_default_parameters_natives[] = {nullptr};
static const char* harmony_reflect_natives[] = {"native harmony-reflect.js",
nullptr};
static const char* harmony_destructuring_natives[] = {nullptr};
static const char* harmony_destructuring_bind_natives[] = {nullptr};
static const char* harmony_object_observe_natives[] = {
"native harmony-object-observe.js", nullptr};
static const char* harmony_sharedarraybuffer_natives[] = {
......
......@@ -190,7 +190,7 @@ DEFINE_BOOL(legacy_const, true, "legacy semantics for const in sloppy mode")
DEFINE_NEG_IMPLICATION(harmony, legacy_const)
// Activate on ClusterFuzz.
DEFINE_IMPLICATION(es_staging, harmony_destructuring)
DEFINE_IMPLICATION(es_staging, harmony_destructuring_bind)
// Features that are still work in progress (behind individual flags).
#define HARMONY_INPROGRESS(V) \
......@@ -207,7 +207,7 @@ DEFINE_IMPLICATION(es_staging, harmony_destructuring)
// Features that are complete (but still behind --harmony/es-staging flag).
#define HARMONY_STAGED(V) \
V(harmony_destructuring, "harmony destructuring") \
V(harmony_destructuring_bind, "harmony destructuring") \
V(harmony_regexps, "harmony regular expression extensions") \
V(harmony_sloppy, "harmony features in sloppy mode") \
V(harmony_sloppy_let, "harmony let in sloppy mode")
......@@ -253,7 +253,7 @@ DEFINE_IMPLICATION(harmony_sloppy_function, harmony_sloppy)
// Destructuring shares too much parsing architecture with default parameters
// to be enabled on its own.
DEFINE_IMPLICATION(harmony_destructuring, harmony_default_parameters)
DEFINE_IMPLICATION(harmony_destructuring_bind, harmony_default_parameters)
// Flags for experimental implementation features.
DEFINE_BOOL(compiled_keyed_generic_loads, false,
......
......@@ -919,7 +919,7 @@ Parser::Parser(ParseInfo* info)
set_allow_harmony_sloppy_let(FLAG_harmony_sloppy_let);
set_allow_harmony_rest_parameters(FLAG_harmony_rest_parameters);
set_allow_harmony_default_parameters(FLAG_harmony_default_parameters);
set_allow_harmony_destructuring(FLAG_harmony_destructuring);
set_allow_harmony_destructuring_bind(FLAG_harmony_destructuring_bind);
set_allow_strong_mode(FLAG_strong_mode);
set_allow_legacy_const(FLAG_legacy_const);
set_allow_harmony_do_expressions(FLAG_harmony_do_expressions);
......@@ -1075,7 +1075,7 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) {
InsertSloppyBlockFunctionVarBindings(scope, &ok);
}
if (ok && (is_strict(language_mode()) || allow_harmony_sloppy() ||
allow_harmony_destructuring())) {
allow_harmony_destructuring_bind())) {
CheckConflictingVarDeclarations(scope_, &ok);
}
......@@ -2515,7 +2515,7 @@ void Parser::ParseVariableDeclarations(VariableDeclarationContext var_context,
ValidateLetPattern(&pattern_classifier, ok);
if (!*ok) return;
}
if (!allow_harmony_destructuring() && !pattern->IsVariableProxy()) {
if (!allow_harmony_destructuring_bind() && !pattern->IsVariableProxy()) {
ReportUnexpectedToken(next);
*ok = false;
return;
......@@ -4401,7 +4401,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
InsertSloppyBlockFunctionVarBindings(scope, CHECK_OK);
}
if (is_strict(language_mode) || allow_harmony_sloppy() ||
allow_harmony_destructuring()) {
allow_harmony_destructuring_bind()) {
CheckConflictingVarDeclarations(scope, CHECK_OK);
}
}
......@@ -4821,7 +4821,7 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser(
SET_ALLOW(harmony_sloppy_let);
SET_ALLOW(harmony_rest_parameters);
SET_ALLOW(harmony_default_parameters);
SET_ALLOW(harmony_destructuring);
SET_ALLOW(harmony_destructuring_bind);
SET_ALLOW(strong_mode);
SET_ALLOW(harmony_do_expressions);
#undef SET_ALLOW
......
......@@ -1343,7 +1343,7 @@ void ParserTraits::AddFormalParameter(
Expression* pattern, Expression* initializer, bool is_rest) {
bool is_simple =
!is_rest && pattern->IsVariableProxy() && initializer == nullptr;
DCHECK(parser_->allow_harmony_destructuring() ||
DCHECK(parser_->allow_harmony_destructuring_bind() ||
parser_->allow_harmony_rest_parameters() ||
parser_->allow_harmony_default_parameters() || is_simple);
const AstRawString* name = is_simple
......
......@@ -582,7 +582,7 @@ PreParser::Statement PreParser::ParseVariableDeclarations(
ValidateLetPattern(&pattern_classifier, CHECK_OK);
}
if (!allow_harmony_destructuring() && !pattern.IsIdentifier()) {
if (!allow_harmony_destructuring_bind() && !pattern.IsIdentifier()) {
ReportUnexpectedToken(next);
*ok = false;
return Statement::Default();
......
......@@ -113,7 +113,7 @@ class ParserBase : public Traits {
allow_harmony_sloppy_let_(false),
allow_harmony_rest_parameters_(false),
allow_harmony_default_parameters_(false),
allow_harmony_destructuring_(false),
allow_harmony_destructuring_bind_(false),
allow_strong_mode_(false),
allow_legacy_const_(true),
allow_harmony_do_expressions_(false) {}
......@@ -129,7 +129,7 @@ class ParserBase : public Traits {
ALLOW_ACCESSORS(harmony_sloppy_let);
ALLOW_ACCESSORS(harmony_rest_parameters);
ALLOW_ACCESSORS(harmony_default_parameters);
ALLOW_ACCESSORS(harmony_destructuring);
ALLOW_ACCESSORS(harmony_destructuring_bind);
ALLOW_ACCESSORS(strong_mode);
ALLOW_ACCESSORS(legacy_const);
ALLOW_ACCESSORS(harmony_do_expressions);
......@@ -835,7 +835,7 @@ class ParserBase : public Traits {
bool allow_harmony_sloppy_let_;
bool allow_harmony_rest_parameters_;
bool allow_harmony_default_parameters_;
bool allow_harmony_destructuring_;
bool allow_harmony_destructuring_bind_;
bool allow_strong_mode_;
bool allow_legacy_const_;
bool allow_harmony_do_expressions_;
......@@ -2319,13 +2319,13 @@ ParserBase<Traits>::ParsePrimaryExpression(ExpressionClassifier* classifier,
return this->ParseRegExpLiteral(false, classifier, ok);
case Token::LBRACK:
if (!allow_harmony_destructuring()) {
if (!allow_harmony_destructuring_bind()) {
BindingPatternUnexpectedToken(classifier);
}
return this->ParseArrayLiteral(classifier, ok);
case Token::LBRACE:
if (!allow_harmony_destructuring()) {
if (!allow_harmony_destructuring_bind()) {
BindingPatternUnexpectedToken(classifier);
}
return this->ParseObjectLiteral(classifier, ok);
......@@ -3017,7 +3017,8 @@ ParserBase<Traits>::ParseAssignmentExpression(bool accept_IN,
return expression;
}
if (!(allow_harmony_destructuring() || allow_harmony_default_parameters())) {
if (!(allow_harmony_destructuring_bind() ||
allow_harmony_default_parameters())) {
BindingPatternUnexpectedToken(classifier);
}
......@@ -3797,7 +3798,7 @@ void ParserBase<Traits>::ParseFormalParameter(
if (!*ok) return;
if (!Traits::IsIdentifier(pattern)) {
if (is_rest || !allow_harmony_destructuring()) {
if (is_rest || !allow_harmony_destructuring_bind()) {
ReportUnexpectedToken(next);
*ok = false;
return;
......
......@@ -1523,7 +1523,7 @@ void SetParserFlags(i::ParserBase<Traits>* parser,
flags.Contains(kAllowHarmonyRestParameters));
parser->set_allow_harmony_sloppy(flags.Contains(kAllowHarmonySloppy));
parser->set_allow_harmony_sloppy_let(flags.Contains(kAllowHarmonySloppyLet));
parser->set_allow_harmony_destructuring(
parser->set_allow_harmony_destructuring_bind(
flags.Contains(kAllowHarmonyDestructuring));
parser->set_allow_strong_mode(flags.Contains(kAllowStrongMode));
parser->set_allow_legacy_const(!flags.Contains(kNoLegacyConst));
......@@ -6564,7 +6564,7 @@ TEST(StrongModeFreeVariablesNotDeclared) {
TEST(DestructuringPositiveTests) {
i::FLAG_harmony_destructuring = true;
i::FLAG_harmony_destructuring_bind = true;
const char* context_data[][2] = {{"'use strict'; let ", " = {};"},
{"var ", " = {};"},
......@@ -6623,7 +6623,7 @@ TEST(DestructuringPositiveTests) {
TEST(DestructuringNegativeTests) {
i::FLAG_harmony_destructuring = true;
i::FLAG_harmony_destructuring_bind = true;
static const ParserFlag always_flags[] = {kAllowHarmonyDestructuring};
{ // All modes.
......@@ -6794,7 +6794,7 @@ TEST(DestructuringNegativeTests) {
TEST(DestructuringDisallowPatternsInForVarIn) {
i::FLAG_harmony_destructuring = true;
i::FLAG_harmony_destructuring_bind = true;
static const ParserFlag always_flags[] = {kAllowHarmonyDestructuring};
const char* context_data[][2] = {
{"", ""}, {"function f() {", "}"}, {NULL, NULL}};
......@@ -6818,7 +6818,7 @@ TEST(DestructuringDisallowPatternsInForVarIn) {
TEST(DestructuringDuplicateParams) {
i::FLAG_harmony_destructuring = true;
i::FLAG_harmony_destructuring_bind = true;
static const ParserFlag always_flags[] = {kAllowHarmonyDestructuring};
const char* context_data[][2] = {{"'use strict';", ""},
{"function outer() { 'use strict';", "}"},
......@@ -6844,7 +6844,7 @@ TEST(DestructuringDuplicateParams) {
TEST(DestructuringDuplicateParamsSloppy) {
i::FLAG_harmony_destructuring = true;
i::FLAG_harmony_destructuring_bind = true;
static const ParserFlag always_flags[] = {kAllowHarmonyDestructuring};
const char* context_data[][2] = {
{"", ""}, {"function outer() {", "}"}, {nullptr, nullptr}};
......@@ -6865,7 +6865,7 @@ TEST(DestructuringDuplicateParamsSloppy) {
TEST(DestructuringDisallowPatternsInSingleParamArrows) {
i::FLAG_harmony_destructuring = true;
i::FLAG_harmony_destructuring_bind = true;
static const ParserFlag always_flags[] = {kAllowHarmonyDestructuring};
const char* context_data[][2] = {{"'use strict';", ""},
{"function outer() { 'use strict';", "}"},
......@@ -6885,7 +6885,7 @@ TEST(DestructuringDisallowPatternsInSingleParamArrows) {
TEST(DestructuringDisallowPatternsInRestParams) {
i::FLAG_harmony_destructuring = true;
i::FLAG_harmony_destructuring_bind = true;
i::FLAG_harmony_rest_parameters = true;
static const ParserFlag always_flags[] = {kAllowHarmonyRestParameters,
kAllowHarmonyDestructuring};
......
......@@ -2,6 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-destructuring
// Flags: --harmony-destructuring-bind
var [ a, b, c ];
......@@ -2,6 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-destructuring
// Flags: --harmony-destructuring-bind
for (var [ a ]; a; ) {}
......@@ -2,6 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-destructuring
// Flags: --harmony-destructuring-bind
var { a, b, c };
......@@ -2,6 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-destructuring
// Flags: --harmony-destructuring-bind
for (var { a, b, c }; a && b && c; ) {}
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-destructuring
// Flags: --harmony-destructuring-bind
'use strict';
const { x : x, y : y } = { x : 1, y : 2 };
......
......@@ -2,6 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-sloppy --harmony-sloppy-let --harmony-destructuring
// Flags: --harmony-sloppy --harmony-sloppy-let --harmony-destructuring-bind
let [let];
......@@ -2,6 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-sloppy --harmony-sloppy-let --harmony-destructuring
// Flags: --harmony-sloppy --harmony-sloppy-let --harmony-destructuring-bind
let {let};
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-destructuring
// Flags: --harmony-destructuring-bind
"use strict";
try {
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-destructuring
// Flags: --harmony-destructuring-bind
try {
} catch ({x}) {
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-reflect --harmony-destructuring --harmony-rest-parameters
// Flags: --harmony-reflect --harmony-destructuring-bind --harmony-rest-parameters
(function TestClass() {
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-destructuring
// Flags: --harmony-destructuring-bind
function f({}) {
for (var v in []);
......
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Flags: --allow-natives-syntax
// Flags: --harmony-destructuring --harmony-rest-parameters --harmony-sloppy
// Flags: --harmony-destructuring-bind --harmony-rest-parameters --harmony-sloppy
(function TestSuperNamedLoads() {
function Base() { }
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-sloppy --harmony-sloppy-let --harmony-destructuring
// Flags: --harmony-sloppy --harmony-sloppy-let --harmony-destructuring-bind
// let is usable as a variable with var or legacy const, not let or ES6 const
......
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Flags: --no-legacy-const --harmony-sloppy --harmony-sloppy-let
// Flags: --harmony-sloppy-function --harmony-destructuring
// Flags: --harmony-sloppy-function --harmony-destructuring-bind
// Flags: --harmony-rest-parameters
// Test Annex B 3.3 semantics for functions declared in blocks in sloppy mode.
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-default-parameters --harmony-destructuring
// Flags: --harmony-default-parameters --harmony-destructuring-bind
(function TestSloppyEvalScoping() {
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-destructuring
// Flags: --harmony-destructuring-bind
// Flags: --no-lazy --allow-natives-syntax
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-destructuring
// Flags: --harmony-destructuring-bind
// Flags: --allow-natives-syntax
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-destructuring
// Flags: --harmony-destructuring-bind
// Flags: --harmony-default-parameters --harmony-rest-parameters
(function TestObjectLiteralPattern() {
......
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Flags: --harmony-do-expressions --harmony-sloppy-let --allow-natives-syntax
// Flags: --harmony-default-parameters --harmony-destructuring
// Flags: --harmony-default-parameters --harmony-destructuring-bind
// Flags: --harmony-completion
function returnValue(v) { return v; }
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-default-parameters --harmony-destructuring
// Flags: --harmony-default-parameters --harmony-destructuring-bind
((x, y = eval('x')) => assertEquals(42, y))(42);
((x, {y = eval('x')}) => assertEquals(42, y))(42, {});
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-destructuring --harmony-default-parameters
// Flags: --harmony-destructuring-bind --harmony-default-parameters
(function testExpressionTypes() {
"use strict";
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-destructuring
// Flags: --harmony-destructuring-bind
function f({x = ""}) { eval(x) }
f({})
......@@ -2,6 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-destructuring --allow-natives-syntax
// Flags: --harmony-destructuring-bind --allow-natives-syntax
assertThrows('var %OptimizeFunctionOnNextCall()', SyntaxError);
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-destructuring
// Flags: --harmony-destructuring-bind
// Flags: --strong-mode --allow-natives-syntax
(function() {
......
......@@ -4,7 +4,7 @@
// Flags: --strong-mode --allow-natives-syntax
// Flags: --harmony-rest-parameters
// Flags: --harmony-destructuring
// Flags: --harmony-destructuring-bind
'use strict';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment