Commit 5ceb4fec authored by adamk's avatar adamk Committed by Commit bot

Remove always-on --harmony-rest-parameters flag

It shipped in Chrome 47.

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

Cr-Commit-Position: refs/heads/master@{#32816}
parent ebdd9014
......@@ -2102,7 +2102,6 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_array_includes)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy)
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_bind)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_destructuring_assignment)
......@@ -2633,7 +2632,6 @@ bool Genesis::InstallExperimentalNatives() {
static const char* harmony_sloppy_function_natives[] = {nullptr};
static const char* harmony_sloppy_let_natives[] = {nullptr};
static const char* harmony_unicode_regexps_natives[] = {nullptr};
static const char* harmony_rest_parameters_natives[] = {nullptr};
static const char* harmony_default_parameters_natives[] = {nullptr};
static const char* harmony_reflect_natives[] = {"native harmony-reflect.js",
nullptr};
......
......@@ -222,7 +222,6 @@ DEFINE_IMPLICATION(es_staging, harmony_destructuring_assignment)
V(harmony_array_includes, "harmony Array.prototype.includes") \
V(harmony_default_parameters, "harmony default parameters") \
V(harmony_destructuring_bind, "harmony destructuring bind") \
V(harmony_rest_parameters, "harmony rest parameters") \
V(harmony_concat_spreadable, "harmony isConcatSpreadable") \
V(harmony_tolength, "harmony ToLength") \
V(harmony_tostring, "harmony toString") \
......
......@@ -111,7 +111,6 @@ class ParserBase : public Traits {
allow_harmony_sloppy_(false),
allow_harmony_sloppy_function_(false),
allow_harmony_sloppy_let_(false),
allow_harmony_rest_parameters_(false),
allow_harmony_default_parameters_(false),
allow_harmony_destructuring_bind_(false),
allow_harmony_destructuring_assignment_(false),
......@@ -128,7 +127,6 @@ class ParserBase : public Traits {
ALLOW_ACCESSORS(harmony_sloppy);
ALLOW_ACCESSORS(harmony_sloppy_function);
ALLOW_ACCESSORS(harmony_sloppy_let);
ALLOW_ACCESSORS(harmony_rest_parameters);
ALLOW_ACCESSORS(harmony_default_parameters);
ALLOW_ACCESSORS(harmony_destructuring_bind);
ALLOW_ACCESSORS(harmony_destructuring_assignment);
......@@ -916,7 +914,6 @@ class ParserBase : public Traits {
bool allow_harmony_sloppy_;
bool allow_harmony_sloppy_function_;
bool allow_harmony_sloppy_let_;
bool allow_harmony_rest_parameters_;
bool allow_harmony_default_parameters_;
bool allow_harmony_destructuring_bind_;
bool allow_harmony_destructuring_assignment_;
......@@ -1329,7 +1326,7 @@ ParserBase<Traits>::ParsePrimaryExpression(ExpressionClassifier* classifier,
MessageTemplate::kUnexpectedToken,
Token::String(Token::RPAREN));
return factory()->NewEmptyParentheses(beg_pos);
} else if (allow_harmony_rest_parameters() && Check(Token::ELLIPSIS)) {
} else if (Check(Token::ELLIPSIS)) {
// (...x)=>x. The continuation that looks for the => is in
// ParseAssignmentExpression.
int ellipsis_pos = position();
......@@ -1464,7 +1461,7 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseExpression(
}
Consume(Token::COMMA);
bool is_rest = false;
if (allow_harmony_rest_parameters() && peek() == Token::ELLIPSIS) {
if (peek() == Token::ELLIPSIS) {
// 'x, y, ...z' in CoverParenthesizedExpressionAndArrowParameterList only
// as the formal parameters of'(x, y, ...z) => foo', and is not itself a
// valid expression or binding pattern.
......@@ -2930,8 +2927,7 @@ void ParserBase<Traits>::ParseFormalParameterList(
*ok = false;
return;
}
parameters->has_rest =
allow_harmony_rest_parameters() && Check(Token::ELLIPSIS);
parameters->has_rest = Check(Token::ELLIPSIS);
ParseFormalParameter(parameters, classifier, ok);
if (!*ok) return;
} while (!parameters->has_rest && Check(Token::COMMA));
......
......@@ -926,7 +926,6 @@ Parser::Parser(ParseInfo* info)
set_allow_harmony_sloppy(FLAG_harmony_sloppy);
set_allow_harmony_sloppy_function(FLAG_harmony_sloppy_function);
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_bind(FLAG_harmony_destructuring_bind);
set_allow_harmony_destructuring_assignment(
......@@ -4905,7 +4904,6 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser(
SET_ALLOW(natives);
SET_ALLOW(harmony_sloppy);
SET_ALLOW(harmony_sloppy_let);
SET_ALLOW(harmony_rest_parameters);
SET_ALLOW(harmony_default_parameters);
SET_ALLOW(harmony_destructuring_bind);
SET_ALLOW(strong_mode);
......
......@@ -1392,9 +1392,6 @@ void ParserTraits::AddFormalParameter(ParserFormalParameters* parameters,
bool is_rest) {
bool is_simple =
!is_rest && pattern->IsVariableProxy() && initializer == nullptr;
DCHECK(parser_->allow_harmony_destructuring_bind() ||
parser_->allow_harmony_rest_parameters() ||
parser_->allow_harmony_default_parameters() || is_simple);
const AstRawString* name = is_simple
? pattern->AsVariableProxy()->raw_name()
: parser_->ast_value_factory()->empty_string();
......
......@@ -35,7 +35,6 @@ TEST(ArgumentsUnmapped) {
TEST(ArgumentsRest) {
FLAG_harmony_rest_parameters = true;
FunctionTester T("(function(a, ...args) { return args; })");
Handle<Object> arguments;
......
......@@ -1504,7 +1504,6 @@ enum ParserFlag {
kAllowLazy,
kAllowNatives,
kAllowHarmonyDefaultParameters,
kAllowHarmonyRestParameters,
kAllowHarmonySloppy,
kAllowHarmonySloppyLet,
kAllowHarmonyDestructuring,
......@@ -1528,8 +1527,6 @@ void SetParserFlags(i::ParserBase<Traits>* parser,
parser->set_allow_natives(flags.Contains(kAllowNatives));
parser->set_allow_harmony_default_parameters(
flags.Contains(kAllowHarmonyDefaultParameters));
parser->set_allow_harmony_rest_parameters(
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_bind(
......@@ -3687,9 +3684,7 @@ TEST(ErrorsArrowFormalParameters) {
nullptr
};
static const ParserFlag always_flags[] = {kAllowHarmonyRestParameters};
RunParserSyncTest(context_data, assignment_expression_suffix_data, kError,
NULL, 0, always_flags, arraysize(always_flags));
RunParserSyncTest(context_data, assignment_expression_suffix_data, kError);
}
......@@ -3881,7 +3876,6 @@ TEST(NoErrorsArrowFunctions) {
};
static const ParserFlag always_flags[] = {kAllowHarmonyDefaultParameters,
kAllowHarmonyRestParameters,
kAllowHarmonyDestructuring};
RunParserSyncTest(context_data, statement_data, kSuccess, NULL, 0,
always_flags, arraysize(always_flags));
......@@ -3988,7 +3982,6 @@ TEST(ArrowFunctionsYieldParameterNameInGenerator) {
};
static const ParserFlag always_flags[] = { kAllowHarmonyDestructuring,
kAllowHarmonyRestParameters,
kAllowStrongMode};
RunParserSyncTest(sloppy_function_context_data, arrow_data, kSuccess, NULL, 0,
always_flags, arraysize(always_flags));
......@@ -5315,9 +5308,7 @@ TEST(ParseRestParameters) {
"...\t\n\t\t\n args",
"a, ... \n \n args",
NULL};
static const ParserFlag always_flags[] = {kAllowHarmonyRestParameters};
RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags,
arraysize(always_flags));
RunParserSyncTest(context_data, data, kSuccess);
}
......@@ -5347,9 +5338,7 @@ TEST(ParseRestParametersErrors) {
"a,\ra, ...args",
"a,\na, ...args",
NULL};
static const ParserFlag always_flags[] = {kAllowHarmonyRestParameters};
RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
arraysize(always_flags));
RunParserSyncTest(context_data, data, kError);
}
......@@ -5364,8 +5353,7 @@ TEST(RestParameterInSetterMethodError) {
{nullptr, nullptr}};
const char* data[] = {"...a", "...arguments", "...eval", nullptr};
static const ParserFlag always_flags[] = {kAllowHarmonyRestParameters,
kAllowHarmonySloppy};
static const ParserFlag always_flags[] = {kAllowHarmonySloppy};
RunParserSyncTest(context_data, data, kError, nullptr, 0, always_flags,
arraysize(always_flags));
}
......@@ -5388,15 +5376,11 @@ TEST(RestParametersEvalArguments) {
"arguments, ...args",
NULL};
static const ParserFlag always_flags[] = {kAllowHarmonyRestParameters};
// Fail in strict mode
RunParserSyncTest(strict_context_data, data, kError, NULL, 0, always_flags,
arraysize(always_flags));
RunParserSyncTest(strict_context_data, data, kError);
// OK in sloppy mode
RunParserSyncTest(sloppy_context_data, data, kSuccess, NULL, 0, always_flags,
arraysize(always_flags));
RunParserSyncTest(sloppy_context_data, data, kSuccess);
}
......@@ -5415,12 +5399,9 @@ TEST(RestParametersDuplicateEvalArguments) {
"arguments, arguments, ...args",
NULL};
static const ParserFlag always_flags[] = {kAllowHarmonyRestParameters};
// In strict mode, the error is using "eval" or "arguments" as parameter names
// In sloppy mode, the error is that eval / arguments are duplicated
RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
arraysize(always_flags));
RunParserSyncTest(context_data, data, kError);
}
......@@ -6254,8 +6235,7 @@ TEST(StrongConstructorDirective) {
"foo() { \"use strong\" } constructor() {}", NULL};
static const ParserFlag always_flags[] = {
kAllowHarmonyRestParameters, kAllowHarmonySloppy, kAllowHarmonySloppyLet,
kAllowStrongMode};
kAllowHarmonySloppy, kAllowHarmonySloppyLet, kAllowStrongMode};
RunParserSyncTest(context_data, error_data, kError, NULL, 0, always_flags,
arraysize(always_flags));
......@@ -7187,9 +7167,7 @@ TEST(DestructuringDisallowPatternsInSingleParamArrows) {
TEST(DestructuringDisallowPatternsInRestParams) {
i::FLAG_harmony_destructuring_bind = true;
i::FLAG_harmony_rest_parameters = true;
static const ParserFlag always_flags[] = {kAllowHarmonyRestParameters,
kAllowHarmonyDestructuring};
static const ParserFlag always_flags[] = {kAllowHarmonyDestructuring};
const char* context_data[][2] = {{"'use strict';", ""},
{"function outer() { 'use strict';", "}"},
{"", ""},
......@@ -7551,7 +7529,7 @@ TEST(LanguageModeDirectivesNonSimpleParameterListErrors) {
static const ParserFlag always_flags[] = {
kAllowHarmonyDefaultParameters, kAllowHarmonyDestructuring,
kAllowHarmonyRestParameters, kAllowHarmonySloppy, kAllowStrongMode};
kAllowHarmonySloppy, kAllowStrongMode};
RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
arraysize(always_flags));
}
......
......@@ -13,7 +13,6 @@
"path": ["RestParameters"],
"main": "run.js",
"resources": ["rest.js"],
"flags": ["--harmony-rest-parameters"],
"run_count": 5,
"units": "score",
"results_regexp": "^%s\\-RestParameters\\(Score\\): (.+)$",
......
......@@ -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-rest-parameters
//
...x => 10
......@@ -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-rest-parameters
//
function foo() { return(); }
......@@ -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-rest-parameters
//
(w, ...x, y) => 10
......@@ -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-rest-parameters
//
(...x, y) => 10
......@@ -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-rest-parameters
//
(w, ...x, ...y) => 10
......@@ -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-rest-parameters
//
function foo(...b, a) { return 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-rest-parameters
//
(x, ...y, z)
......@@ -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-rest-parameters
//
(x, ...y)
......@@ -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-rest-parameters
//
'use strict';
var _bad = "setting this should fail!";
......
......@@ -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-rest-parameters
//
var _bad = "this should fail!";
({
......
......@@ -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-rest-parameters
//
'use strict';
var _bad = "this should fail!";
......
......@@ -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-rest-parameters
// Flags: --min-preparse-length=0
(function testRestIndex() {
......
......@@ -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-rest-parameters
(function testRestIndex() {
assertEquals(5, ((...args) => args.length)(1,2,3,4,5));
assertEquals(4, ((a, ...args) => args.length)(1,2,3,4,5));
......
......@@ -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-bind --harmony-rest-parameters
// Flags: --harmony-reflect --harmony-destructuring-bind
(function TestClass() {
......
// 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-rest-parameters
assertThrows("()=>{}()", SyntaxError);
assertThrows("x=>{}()", SyntaxError);
......
......@@ -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-rest-parameters
// Flags: --allow-natives-syntax
var f = (a, b, ...c) => {
......
......@@ -2,6 +2,4 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-rest-parameters
(function(...a) { function f() { eval() } })();
......@@ -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-rest-parameters
// Flags: --min-preparse-length=0
function variadic(co, ...values) {
......
......@@ -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-rest-parameters
(function testRestIndex() {
assertEquals(5, (function(...args) { return args.length; })(1,2,3,4,5));
assertEquals(4, (function(a, ...args) { return args.length; })(1,2,3,4,5));
......
......@@ -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-rest-parameters
// Flags: --harmony-sloppy
(function testConstructClassStrict() {
......
......@@ -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-rest-parameters
// Flags: --harmony-sloppy
(function testCallSuperPropertyStrict() {
"use strict";
......
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Flags: --allow-natives-syntax
// Flags: --harmony-destructuring-bind --harmony-rest-parameters --harmony-sloppy
// Flags: --harmony-destructuring-bind --harmony-sloppy
(function TestSuperNamedLoads() {
function Base() { }
......
......@@ -4,7 +4,6 @@
// Flags: --no-legacy-const --harmony-sloppy --harmony-sloppy-let
// 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.
// http://www.ecma-international.org/ecma-262/6.0/#sec-block-level-function-declarations-web-legacy-compatibility-semantics
......
......@@ -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-rest-parameters
// Flags: --harmony-default-parameters
(function TestDefaults() {
......
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
//
// Flags: --harmony-destructuring-bind
// Flags: --harmony-default-parameters --harmony-rest-parameters
// Flags: --harmony-default-parameters
(function TestObjectLiteralPattern() {
var { x : x, y : y, get, set } = { x : 1, y : 2, get: 3, set: 4 };
......
......@@ -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: --strong-mode --harmony-rest-parameters
// Flags: --strong-mode
// Note that it's essential for these tests that the reference is inside dead
// code (because we already produce ReferenceErrors for run-time unresolved
......
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Flags: --strong-mode --harmony-reflect
// Flags: --harmony-rest-parameters --allow-natives-syntax
// Flags: --allow-natives-syntax
'use strict';
......
......@@ -3,7 +3,6 @@
// found in the LICENSE file.
// Flags: --strong-mode --allow-natives-syntax
// Flags: --harmony-rest-parameters
// 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