Commit e6d57a9f authored by Adam Klein's avatar Adam Klein Committed by Commit Bot

[esnext] Remove --harmony-object-rest-spread flag

This flag has been on by default since Chrome 61.

Bug: v8:5549
Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: I81c34d1d3a7dbd219acce2cdf0cf4917eb484002
Reviewed-on: https://chromium-review.googlesource.com/738312Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48945}
parent 9daf3e20
......@@ -4255,7 +4255,6 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_property)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_function_sent)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_function_tostring)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_class_fields)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_rest_spread)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_dynamic_import)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_import_meta)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_template_escapes)
......
......@@ -223,7 +223,6 @@ DEFINE_IMPLICATION(harmony_import_meta, harmony_dynamic_import)
#define HARMONY_SHIPPING_BASE(V) \
V(harmony_strict_legacy_accessor_builtins, \
"treat __defineGetter__ and related functions as strict") \
V(harmony_object_rest_spread, "harmony object rest spread properties") \
V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \
V(harmony_regexp_dotall, "harmony regexp dotAll flag") \
V(harmony_regexp_lookbehind, "harmony regexp lookbehind") \
......
......@@ -275,7 +275,6 @@ class ParserBase {
allow_harmony_do_expressions_(false),
allow_harmony_function_sent_(false),
allow_harmony_class_fields_(false),
allow_harmony_object_rest_spread_(false),
allow_harmony_dynamic_import_(false),
allow_harmony_import_meta_(false),
allow_harmony_async_iteration_(false),
......@@ -289,7 +288,6 @@ class ParserBase {
ALLOW_ACCESSORS(harmony_do_expressions);
ALLOW_ACCESSORS(harmony_function_sent);
ALLOW_ACCESSORS(harmony_class_fields);
ALLOW_ACCESSORS(harmony_object_rest_spread);
ALLOW_ACCESSORS(harmony_dynamic_import);
ALLOW_ACCESSORS(harmony_import_meta);
ALLOW_ACCESSORS(harmony_async_iteration);
......@@ -1519,7 +1517,6 @@ class ParserBase {
bool allow_harmony_do_expressions_;
bool allow_harmony_function_sent_;
bool allow_harmony_class_fields_;
bool allow_harmony_object_rest_spread_;
bool allow_harmony_dynamic_import_;
bool allow_harmony_import_meta_;
bool allow_harmony_async_iteration_;
......@@ -2190,8 +2187,7 @@ typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParsePropertyName(
}
case Token::ELLIPSIS:
if (allow_harmony_object_rest_spread() && !*is_generator && !*is_async &&
!*is_get && !*is_set) {
if (!*is_generator && !*is_async && !*is_get && !*is_set) {
*name = impl()->NullIdentifier();
Consume(Token::ELLIPSIS);
expression = ParseAssignmentExpression(true, CHECK_OK);
......@@ -2476,7 +2472,6 @@ ParserBase<Impl>::ParseObjectPropertyDefinition(ObjectLiteralChecker* checker,
switch (kind) {
case PropertyKind::kSpreadProperty:
DCHECK(allow_harmony_object_rest_spread());
DCHECK(!is_get && !is_set && !is_generator && !is_async &&
!*is_computed_name);
DCHECK(name_token == Token::ELLIPSIS);
......
......@@ -541,7 +541,6 @@ Parser::Parser(ParseInfo* info)
set_allow_harmony_do_expressions(FLAG_harmony_do_expressions);
set_allow_harmony_function_sent(FLAG_harmony_function_sent);
set_allow_harmony_class_fields(FLAG_harmony_class_fields);
set_allow_harmony_object_rest_spread(FLAG_harmony_object_rest_spread);
set_allow_harmony_dynamic_import(FLAG_harmony_dynamic_import);
set_allow_harmony_import_meta(FLAG_harmony_import_meta);
set_allow_harmony_async_iteration(FLAG_harmony_async_iteration);
......
......@@ -291,7 +291,6 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
SET_ALLOW(harmony_do_expressions);
SET_ALLOW(harmony_function_sent);
SET_ALLOW(harmony_class_fields);
SET_ALLOW(harmony_object_rest_spread);
SET_ALLOW(harmony_dynamic_import);
SET_ALLOW(harmony_import_meta);
SET_ALLOW(harmony_async_iteration);
......
......@@ -1312,7 +1312,6 @@ enum ParserFlag {
kAllowNatives,
kAllowHarmonyFunctionSent,
kAllowHarmonyClassFields,
kAllowHarmonyObjectRestSpread,
kAllowHarmonyDynamicImport,
kAllowHarmonyAsyncIteration,
kAllowHarmonyTemplateEscapes,
......@@ -1329,8 +1328,6 @@ void SetGlobalFlags(i::EnumSet<ParserFlag> flags) {
i::FLAG_allow_natives_syntax = flags.Contains(kAllowNatives);
i::FLAG_harmony_function_sent = flags.Contains(kAllowHarmonyFunctionSent);
i::FLAG_harmony_class_fields = flags.Contains(kAllowHarmonyClassFields);
i::FLAG_harmony_object_rest_spread =
flags.Contains(kAllowHarmonyObjectRestSpread);
i::FLAG_harmony_dynamic_import = flags.Contains(kAllowHarmonyDynamicImport);
i::FLAG_harmony_import_meta = flags.Contains(kAllowHarmonyImportMeta);
i::FLAG_harmony_async_iteration = flags.Contains(kAllowHarmonyAsyncIteration);
......@@ -1344,8 +1341,6 @@ void SetParserFlags(i::PreParser* parser, i::EnumSet<ParserFlag> flags) {
flags.Contains(kAllowHarmonyFunctionSent));
parser->set_allow_harmony_class_fields(
flags.Contains(kAllowHarmonyClassFields));
parser->set_allow_harmony_object_rest_spread(
flags.Contains(kAllowHarmonyObjectRestSpread));
parser->set_allow_harmony_dynamic_import(
flags.Contains(kAllowHarmonyDynamicImport));
parser->set_allow_harmony_import_meta(
......@@ -5714,7 +5709,6 @@ TEST(BadRestSpread) {
"var ...x = [1,2,3];",
"var [...x,] = [1,2,3];",
"var [...x, y] = [1,2,3];",
"var {...x} = [1,2,3];",
"var { x } = {x: ...[1,2,3]}",
nullptr};
RunParserSyncTest(context_data, data, kError);
......@@ -6554,9 +6548,7 @@ TEST(ObjectSpreadPositiveTests) {
nullptr};
// clang-format on
static const ParserFlag flags[] = {kAllowHarmonyObjectRestSpread};
RunParserSyncTest(context_data, data, kSuccess, nullptr, 0, flags,
arraysize(flags));
RunParserSyncTest(context_data, data, kSuccess);
}
TEST(ObjectSpreadNegativeTests) {
......@@ -6574,9 +6566,7 @@ TEST(ObjectSpreadNegativeTests) {
"{async ...foo}",
nullptr};
static const ParserFlag flags[] = {kAllowHarmonyObjectRestSpread};
RunParserSyncTest(context_data, data, kError, nullptr, 0, flags,
arraysize(flags));
RunParserSyncTest(context_data, data, kError);
}
TEST(TemplateEscapesPositiveTests) {
......@@ -6796,9 +6786,6 @@ TEST(DestructuringPositiveTests) {
"{ __proto__: x, __proto__: y}",
"{arguments: x}",
"{eval: x}",
nullptr};
const char* rest_data[] = {
"{ x : y, ...z }",
"{ x : y = 1, ...z }",
"{ x : x, y : y, ...z }",
......@@ -6817,17 +6804,11 @@ TEST(DestructuringPositiveTests) {
"{[1+1] : z, ...x}",
"{arguments: x, ...z}",
"{ __proto__: x, __proto__: y, ...z}",
nullptr};
nullptr
};
// clang-format on
RunParserSyncTest(context_data, data, kSuccess);
RunParserSyncTest(context_data, rest_data, kError);
static const ParserFlag flags[] = {kAllowHarmonyObjectRestSpread};
RunParserSyncTest(context_data, data, kSuccess, nullptr, 0, flags,
arraysize(flags));
RunParserSyncTest(context_data, rest_data, kSuccess, nullptr, 0, flags,
arraysize(flags));
// v8:5201
{
......@@ -6842,12 +6823,6 @@ TEST(DestructuringPositiveTests) {
{nullptr, nullptr}
};
const char* rest_data[] = {
"{...arguments}",
"{...eval}",
nullptr
};
const char* data[] = {
"{arguments}",
"{eval}",
......@@ -6855,16 +6830,12 @@ TEST(DestructuringPositiveTests) {
"{x: eval}",
"{arguments = false}",
"{eval = false}",
"{...arguments}",
"{...eval}",
nullptr
};
// clang-format on
RunParserSyncTest(sloppy_context_data, data, kSuccess);
RunParserSyncTest(sloppy_context_data, rest_data, kError);
static const ParserFlag flags[] = {kAllowHarmonyObjectRestSpread};
RunParserSyncTest(sloppy_context_data, data, kSuccess, nullptr, 0, flags,
arraysize(flags));
RunParserSyncTest(sloppy_context_data, rest_data, kSuccess, nullptr, 0,
flags, arraysize(flags));
}
}
......@@ -6957,9 +6928,6 @@ TEST(DestructuringNegativeTests) {
"{ set a() {} }",
"{ method() {} }",
"{ *method() {} }",
nullptr};
const char* rest_data[] = {
"...a++",
"...++a",
"...typeof a",
......@@ -6995,12 +6963,6 @@ TEST(DestructuringNegativeTests) {
// clang-format on
RunParserSyncTest(context_data, data, kError);
RunParserSyncTest(context_data, rest_data, kError);
static const ParserFlag flags[] = {kAllowHarmonyObjectRestSpread};
RunParserSyncTest(context_data, data, kError, nullptr, 0, flags,
arraysize(flags));
RunParserSyncTest(context_data, rest_data, kError, nullptr, 0, flags,
arraysize(flags));
static const ParserFlag async_gen_flags[] = {kAllowHarmonyAsyncIteration};
RunParserSyncTest(context_data, async_gen_data, kError, nullptr, 0,
async_gen_flags, arraysize(async_gen_flags));
......@@ -7045,21 +7007,12 @@ TEST(DestructuringNegativeTests) {
"{ eval }",
"{ arguments = false }"
"{ eval = false }",
nullptr};
const char* rest_data[] = {
"{ ...eval }",
"{ ...arguments }",
nullptr};
// clang-format on
RunParserSyncTest(context_data, data, kError);
RunParserSyncTest(context_data, rest_data, kError);
static const ParserFlag flags[] = {kAllowHarmonyObjectRestSpread};
RunParserSyncTest(context_data, data, kError, nullptr, 0, flags,
arraysize(flags));
RunParserSyncTest(context_data, rest_data, kError, nullptr, 0, flags,
arraysize(flags));
}
{ // 'yield' in generators.
......@@ -7098,18 +7051,11 @@ TEST(DestructuringNegativeTests) {
const char* data[] = {
"{ a }",
"[ a ]",
nullptr};
const char* rest_data[] = {
"{ ...a }",
nullptr};
nullptr
};
// clang-format on
RunParserSyncTest(context_data, data, kError);
RunParserSyncTest(context_data, rest_data, kError);
static const ParserFlag flags[] = {kAllowHarmonyObjectRestSpread};
RunParserSyncTest(context_data, data, kError, nullptr, 0, flags,
arraysize(flags));
RunParserSyncTest(context_data, rest_data, kError, nullptr, 0, flags,
arraysize(flags));
}
}
......@@ -7134,7 +7080,7 @@ TEST(ObjectRestNegativeTestSlow) {
// clang-format on
// The test is quite slow, so run it with a reduced set of flags.
static const ParserFlag flags[] = {kAllowLazy, kAllowHarmonyObjectRestSpread};
static const ParserFlag flags[] = {kAllowLazy};
RunParserSyncTest(context_data, statement_data, kError, nullptr, 0, flags,
arraysize(flags));
}
......@@ -7313,12 +7259,9 @@ TEST(DestructuringAssignmentPositiveTests) {
nullptr};
// clang-format on
static const ParserFlag flags[] = {kAllowHarmonyObjectRestSpread};
RunParserSyncTest(context_data, data, kSuccess, nullptr, 0, flags,
arraysize(flags));
RunParserSyncTest(context_data, data, kSuccess);
RunParserSyncTest(mixed_assignments_context_data, data, kSuccess, nullptr, 0,
flags, arraysize(flags));
RunParserSyncTest(mixed_assignments_context_data, data, kSuccess);
const char* empty_context_data[][2] = {
{"'use strict';", ""}, {"", ""}, {nullptr, nullptr}};
......@@ -7359,7 +7302,6 @@ TEST(DestructuringAssignmentNegativeTests) {
const char* data[] = {
"{ x : ++y }",
"{ x : y * 2 }",
"{ ...x }",
"{ get x() {} }",
"{ set x() {} }",
"{ x: y() }",
......@@ -7811,7 +7753,6 @@ TEST(ImportMetaSuccess) {
static const ParserFlag flags[] = {
kAllowHarmonyImportMeta, kAllowHarmonyDynamicImport,
kAllowHarmonyObjectRestSpread,
};
// 2.1.1 Static Semantics: Early Errors
// ImportMeta
......@@ -7848,7 +7789,6 @@ TEST(ImportMetaFailure) {
static const ParserFlag flags[] = {
kAllowHarmonyImportMeta, kAllowHarmonyDynamicImport,
kAllowHarmonyObjectRestSpread,
};
RunParserSyncTest(context_data, data, kError, nullptr, 0, flags,
......
......@@ -2,7 +2,6 @@
// // Use of this source code is governed by a BSD-style license that can be
// // found in the LICENSE file.
// Flags: --harmony-object-rest-spread
var { ...x } = { a: 1 };
assertEquals({ a: 1 }, x);
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-object-rest-spread
var x = {a: 1};
var y = { ...x};
assertEquals(x, y);
......
......@@ -41,8 +41,6 @@ from testrunner.objects import testcase
# TODO(littledan): move the flag mapping into the status file
FEATURE_FLAGS = {
'object-rest': '--harmony-object-rest-spread',
'object-spread': '--harmony-object-rest-spread',
'async-iteration': '--harmony-async-iteration',
'regexp-named-groups': '--harmony-regexp-named-captures',
'regexp-unicode-property-escapes': '--harmony-regexp-property',
......
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