Commit a4689fc2 authored by adamk's avatar adamk Committed by Commit bot

Remove flags for spread calls and arrays

These features shipped in M46 without issue.

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

Cr-Commit-Position: refs/heads/master@{#31635}
parent 161a0462
......@@ -231,6 +231,7 @@ action("js2c") {
"src/js/templates.js",
"src/js/harmony-array.js",
"src/js/harmony-typedarray.js",
"src/js/spread.js",
"src/debug/mirrors.js",
"src/debug/debug.js",
"src/debug/liveedit.js",
......@@ -312,7 +313,6 @@ action("js2c_experimental") {
"src/js/harmony-tostring.js",
"src/js/harmony-regexp.js",
"src/js/harmony-reflect.js",
"src/js/harmony-spread.js",
"src/js/harmony-object-observe.js",
"src/js/harmony-sharedarraybuffer.js",
"src/js/harmony-simd.js"
......
......@@ -2155,10 +2155,8 @@ 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_spread_calls)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_destructuring)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_observe)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spread_arrays)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_new_target)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_concat_spreadable)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexps)
......@@ -2629,12 +2627,9 @@ 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_spread_calls_natives[] = {
"native harmony-spread.js", nullptr};
static const char* harmony_destructuring_natives[] = {nullptr};
static const char* harmony_object_observe_natives[] = {
"native harmony-object-observe.js", nullptr};
static const char* harmony_spread_arrays_natives[] = {nullptr};
static const char* harmony_sharedarraybuffer_natives[] = {
"native harmony-sharedarraybuffer.js", "native harmony-atomics.js", NULL};
static const char* harmony_new_target_natives[] = {nullptr};
......
......@@ -216,8 +216,6 @@ DEFINE_NEG_IMPLICATION(es_staging, legacy_const)
V(harmony_new_target, "harmony new.target") \
V(harmony_object_observe, "harmony Object.observe") \
V(harmony_rest_parameters, "harmony rest parameters") \
V(harmony_spread_calls, "harmony spread-calls") \
V(harmony_spread_arrays, "harmony spread in array literals") \
V(harmony_concat_spreadable, "harmony isConcatSpreadable") \
V(harmony_completion, "harmony completion value semantics")
......
......@@ -920,9 +920,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_spread_calls(FLAG_harmony_spread_calls);
set_allow_harmony_destructuring(FLAG_harmony_destructuring);
set_allow_harmony_spread_arrays(FLAG_harmony_spread_arrays);
set_allow_harmony_new_target(FLAG_harmony_new_target);
set_allow_strong_mode(FLAG_strong_mode);
set_allow_legacy_const(FLAG_legacy_const);
......@@ -4812,9 +4810,7 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser(
SET_ALLOW(harmony_sloppy_let);
SET_ALLOW(harmony_rest_parameters);
SET_ALLOW(harmony_default_parameters);
SET_ALLOW(harmony_spread_calls);
SET_ALLOW(harmony_destructuring);
SET_ALLOW(harmony_spread_arrays);
SET_ALLOW(harmony_new_target);
SET_ALLOW(strong_mode);
SET_ALLOW(harmony_do_expressions);
......
......@@ -113,9 +113,7 @@ class ParserBase : public Traits {
allow_harmony_sloppy_let_(false),
allow_harmony_rest_parameters_(false),
allow_harmony_default_parameters_(false),
allow_harmony_spread_calls_(false),
allow_harmony_destructuring_(false),
allow_harmony_spread_arrays_(false),
allow_harmony_new_target_(false),
allow_strong_mode_(false),
allow_legacy_const_(true),
......@@ -132,9 +130,7 @@ class ParserBase : public Traits {
ALLOW_ACCESSORS(harmony_sloppy_let);
ALLOW_ACCESSORS(harmony_rest_parameters);
ALLOW_ACCESSORS(harmony_default_parameters);
ALLOW_ACCESSORS(harmony_spread_calls);
ALLOW_ACCESSORS(harmony_destructuring);
ALLOW_ACCESSORS(harmony_spread_arrays);
ALLOW_ACCESSORS(harmony_new_target);
ALLOW_ACCESSORS(strong_mode);
ALLOW_ACCESSORS(legacy_const);
......@@ -841,9 +837,7 @@ class ParserBase : public Traits {
bool allow_harmony_sloppy_let_;
bool allow_harmony_rest_parameters_;
bool allow_harmony_default_parameters_;
bool allow_harmony_spread_calls_;
bool allow_harmony_destructuring_;
bool allow_harmony_spread_arrays_;
bool allow_harmony_new_target_;
bool allow_strong_mode_;
bool allow_legacy_const_;
......@@ -2523,9 +2517,6 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseArrayLiteral(
}
elem = this->GetLiteralTheHole(peek_position(), factory());
} else if (peek() == Token::ELLIPSIS) {
if (!allow_harmony_spread_arrays()) {
ExpressionUnexpectedToken(classifier);
}
int start_pos = peek_position();
Consume(Token::ELLIPSIS);
ExpressionT argument =
......@@ -2869,10 +2860,8 @@ typename Traits::Type::ExpressionList ParserBase<Traits>::ParseArguments(
bool was_unspread = false;
int unspread_sequences_count = 0;
while (!done) {
bool is_spread =
allow_harmony_spread_calls() && (peek() == Token::ELLIPSIS);
int start_pos = peek_position();
if (is_spread) Consume(Token::ELLIPSIS);
bool is_spread = Check(Token::ELLIPSIS);
ExpressionT argument = this->ParseAssignmentExpression(
true, classifier, CHECK_OK_CUSTOM(NullExpressionList));
......
......@@ -1498,9 +1498,7 @@ enum ParserFlag {
kAllowHarmonyRestParameters,
kAllowHarmonySloppy,
kAllowHarmonySloppyLet,
kAllowHarmonySpreadCalls,
kAllowHarmonyDestructuring,
kAllowHarmonySpreadArrays,
kAllowHarmonyNewTarget,
kAllowStrongMode,
kNoLegacyConst
......@@ -1522,14 +1520,10 @@ void SetParserFlags(i::ParserBase<Traits>* parser,
flags.Contains(kAllowHarmonyDefaultParameters));
parser->set_allow_harmony_rest_parameters(
flags.Contains(kAllowHarmonyRestParameters));
parser->set_allow_harmony_spread_calls(
flags.Contains(kAllowHarmonySpreadCalls));
parser->set_allow_harmony_sloppy(flags.Contains(kAllowHarmonySloppy));
parser->set_allow_harmony_sloppy_let(flags.Contains(kAllowHarmonySloppyLet));
parser->set_allow_harmony_destructuring(
flags.Contains(kAllowHarmonyDestructuring));
parser->set_allow_harmony_spread_arrays(
flags.Contains(kAllowHarmonySpreadArrays));
parser->set_allow_harmony_new_target(flags.Contains(kAllowHarmonyNewTarget));
parser->set_allow_strong_mode(flags.Contains(kAllowStrongMode));
parser->set_allow_legacy_const(!flags.Contains(kNoLegacyConst));
......@@ -5358,10 +5352,7 @@ TEST(SpreadCall) {
"...[0, 1, 2], 3, 4, 5, 6, ...'7', 8, 9",
"...[0, 1, 2], 3, 4, 5, 6, ...'7', 8, 9, ...[10]", NULL};
static const ParserFlag always_flags[] = {kAllowHarmonySpreadCalls};
RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags,
arraysize(always_flags));
RunParserSyncTest(context_data, data, kSuccess);
}
......@@ -5372,10 +5363,7 @@ TEST(SpreadCallErrors) {
const char* data[] = {"(...[1, 2, 3])", "......[1,2,3]", NULL};
static const ParserFlag always_flags[] = {kAllowHarmonySpreadCalls};
RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
arraysize(always_flags));
RunParserSyncTest(context_data, data, kError);
}
......@@ -6931,8 +6919,6 @@ TEST(DefaultParametersYieldInInitializers) {
TEST(SpreadArray) {
i::FLAG_harmony_spread_arrays = true;
const char* context_data[][2] = {
{"'use strict';", ""}, {"", ""}, {NULL, NULL}};
......@@ -6950,15 +6936,11 @@ TEST(SpreadArray) {
"[, , ...a]",
NULL};
// clang-format on
static const ParserFlag always_flags[] = {kAllowHarmonySpreadArrays};
RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags,
arraysize(always_flags));
RunParserSyncTest(context_data, data, kSuccess);
}
TEST(SpreadArrayError) {
i::FLAG_harmony_spread_arrays = true;
const char* context_data[][2] = {
{"'use strict';", ""}, {"", ""}, {NULL, NULL}};
......@@ -6971,9 +6953,7 @@ TEST(SpreadArrayError) {
"[ (...a)]",
NULL};
// clang-format on
static const ParserFlag always_flags[] = {kAllowHarmonySpreadArrays};
RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
arraysize(always_flags));
RunParserSyncTest(context_data, data, kError);
}
......
......@@ -26,7 +26,6 @@
"path": ["SpreadCalls"],
"main": "run.js",
"resources": ["spreadcalls.js"],
"flags": ["--harmony-spread_calls"],
"run_count": 5,
"units": "score",
"results_regexp": "^%s\\-SpreadCalls\\(Score\\): (.+)$",
......
// Copyright 2015 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.
//
// Flags: --harmony-spread-arrays
var arr = [1, 2, ...[3]];
assertEquals([1, 2, 3], arr);
// Copyright 2015 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.
//
// Flags: --harmony-spread-arrays
var arr = [1, 2, 3];
assertEquals({arr: [1, 2, 3]}, {arr: [...arr]});
......
......@@ -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-spread-arrays --allow-natives-syntax
// Flags: --allow-natives-syntax
(function TestBasics() {
var a = [1, 2];
......
......@@ -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-spread-calls --harmony-sloppy --harmony-rest-parameters
// Flags: --harmony-sloppy --harmony-rest-parameters
(function testConstructClassStrict() {
......
......@@ -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-spread-calls
(function testNonConstructorStrict() {
"use strict";
assertThrows(function() {
......
......@@ -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-spread-calls --harmony-sloppy --harmony-rest-parameters
// Flags: --harmony-sloppy --harmony-rest-parameters
(function testCallSuperPropertyStrict() {
"use strict";
......
......@@ -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-spread-calls
(function testSpreadCallsStrict() {
"use strict"
function countArgs() { return arguments.length; }
......
......@@ -3,8 +3,7 @@
// found in the LICENSE file.
// Flags: --allow-natives-syntax
// Flags: --harmony-spread-calls --harmony-destructuring
// Flags: --harmony-rest-parameters --harmony-sloppy
// Flags: --harmony-destructuring --harmony-rest-parameters --harmony-sloppy
(function TestSuperNamedLoads() {
function Base() { }
......
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Flags: --strong-mode --harmony-reflect
// Flags: --harmony-spread-calls --harmony-rest-parameters --allow-natives-syntax
// Flags: --harmony-rest-parameters --allow-natives-syntax
'use strict';
......
......@@ -4,7 +4,7 @@
// Flags: --strong-mode --allow-natives-syntax
// Flags: --harmony-rest-parameters
// Flags: --harmony-destructuring --harmony-spread-arrays
// Flags: --harmony-destructuring
'use strict';
......
......@@ -1848,6 +1848,7 @@
'../../src/js/array-iterator.js',
'../../src/js/string-iterator.js',
'../../src/js/templates.js',
'../../src/js/spread.js',
'../../src/js/harmony-array.js',
'../../src/js/harmony-typedarray.js',
'../../src/debug/mirrors.js',
......@@ -1865,7 +1866,6 @@
'../../src/js/harmony-tostring.js',
'../../src/js/harmony-regexp.js',
'../../src/js/harmony-reflect.js',
'../../src/js/harmony-spread.js',
'../../src/js/harmony-object-observe.js',
'../../src/js/harmony-sharedarraybuffer.js',
'../../src/js/harmony-simd.js',
......
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