Commit 0a237ffe authored by Mathias Bynens's avatar Mathias Bynens Committed by Commit Bot

Remove always-true --harmony-optional-catch-binding runtime flag

It was shipped in Chrome 66.

Bug: v8:6889
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I6333ee20ab913b281674b911d525d2851f4694c9
Reviewed-on: https://chromium-review.googlesource.com/1086928Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53527}
parent eca6c5bb
...@@ -4275,7 +4275,6 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_static_fields) ...@@ -4275,7 +4275,6 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_static_fields)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_class_fields) EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_class_fields)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_dynamic_import) EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_dynamic_import)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_import_meta) EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_import_meta)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_optional_catch_binding)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_numeric_separator) EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_numeric_separator)
#undef EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE #undef EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE
......
...@@ -233,7 +233,6 @@ DEFINE_IMPLICATION(harmony_class_fields, harmony_private_fields) ...@@ -233,7 +233,6 @@ DEFINE_IMPLICATION(harmony_class_fields, harmony_private_fields)
V(harmony_string_trimming, "harmony String.prototype.trim{Start,End}") \ V(harmony_string_trimming, "harmony String.prototype.trim{Start,End}") \
V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \ V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \
V(harmony_function_tostring, "harmony Function.prototype.toString") \ V(harmony_function_tostring, "harmony Function.prototype.toString") \
V(harmony_optional_catch_binding, "allow omitting binding in catch blocks") \
V(harmony_import_meta, "harmony import.meta property") \ V(harmony_import_meta, "harmony import.meta property") \
V(harmony_bigint, "harmony arbitrary precision integers") \ V(harmony_bigint, "harmony arbitrary precision integers") \
V(harmony_dynamic_import, "harmony dynamic import") \ V(harmony_dynamic_import, "harmony dynamic import") \
......
...@@ -282,7 +282,6 @@ class ParserBase { ...@@ -282,7 +282,6 @@ class ParserBase {
allow_harmony_static_fields_(false), allow_harmony_static_fields_(false),
allow_harmony_dynamic_import_(false), allow_harmony_dynamic_import_(false),
allow_harmony_import_meta_(false), allow_harmony_import_meta_(false),
allow_harmony_optional_catch_binding_(false),
allow_harmony_private_fields_(false), allow_harmony_private_fields_(false),
allow_eval_cache_(true) {} allow_eval_cache_(true) {}
...@@ -296,7 +295,6 @@ class ParserBase { ...@@ -296,7 +295,6 @@ class ParserBase {
ALLOW_ACCESSORS(harmony_static_fields); ALLOW_ACCESSORS(harmony_static_fields);
ALLOW_ACCESSORS(harmony_dynamic_import); ALLOW_ACCESSORS(harmony_dynamic_import);
ALLOW_ACCESSORS(harmony_import_meta); ALLOW_ACCESSORS(harmony_import_meta);
ALLOW_ACCESSORS(harmony_optional_catch_binding);
ALLOW_ACCESSORS(eval_cache); ALLOW_ACCESSORS(eval_cache);
#undef ALLOW_ACCESSORS #undef ALLOW_ACCESSORS
...@@ -1562,7 +1560,6 @@ class ParserBase { ...@@ -1562,7 +1560,6 @@ class ParserBase {
bool allow_harmony_static_fields_; bool allow_harmony_static_fields_;
bool allow_harmony_dynamic_import_; bool allow_harmony_dynamic_import_;
bool allow_harmony_import_meta_; bool allow_harmony_import_meta_;
bool allow_harmony_optional_catch_binding_;
bool allow_harmony_private_fields_; bool allow_harmony_private_fields_;
bool allow_eval_cache_; bool allow_eval_cache_;
...@@ -5613,12 +5610,7 @@ typename ParserBase<Impl>::StatementT ParserBase<Impl>::ParseTryStatement( ...@@ -5613,12 +5610,7 @@ typename ParserBase<Impl>::StatementT ParserBase<Impl>::ParseTryStatement(
SourceRangeScope catch_range_scope(scanner(), &catch_range); SourceRangeScope catch_range_scope(scanner(), &catch_range);
if (Check(Token::CATCH)) { if (Check(Token::CATCH)) {
bool has_binding; bool has_binding;
if (allow_harmony_optional_catch_binding()) { has_binding = Check(Token::LPAREN);
has_binding = Check(Token::LPAREN);
} else {
has_binding = true;
Expect(Token::LPAREN, CHECK_OK);
}
if (has_binding) { if (has_binding) {
catch_info.scope = NewScope(CATCH_SCOPE); catch_info.scope = NewScope(CATCH_SCOPE);
......
...@@ -449,7 +449,6 @@ Parser::Parser(ParseInfo* info) ...@@ -449,7 +449,6 @@ Parser::Parser(ParseInfo* info)
set_allow_harmony_import_meta(FLAG_harmony_import_meta); set_allow_harmony_import_meta(FLAG_harmony_import_meta);
set_allow_harmony_bigint(FLAG_harmony_bigint); set_allow_harmony_bigint(FLAG_harmony_bigint);
set_allow_harmony_numeric_separator(FLAG_harmony_numeric_separator); set_allow_harmony_numeric_separator(FLAG_harmony_numeric_separator);
set_allow_harmony_optional_catch_binding(FLAG_harmony_optional_catch_binding);
set_allow_harmony_private_fields(FLAG_harmony_private_fields); set_allow_harmony_private_fields(FLAG_harmony_private_fields);
for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount; for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount;
++feature) { ++feature) {
......
...@@ -247,7 +247,6 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) { ...@@ -247,7 +247,6 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
SET_ALLOW(harmony_dynamic_import); SET_ALLOW(harmony_dynamic_import);
SET_ALLOW(harmony_import_meta); SET_ALLOW(harmony_import_meta);
SET_ALLOW(harmony_bigint); SET_ALLOW(harmony_bigint);
SET_ALLOW(harmony_optional_catch_binding);
SET_ALLOW(harmony_private_fields); SET_ALLOW(harmony_private_fields);
SET_ALLOW(eval_cache); SET_ALLOW(eval_cache);
#undef SET_ALLOW #undef SET_ALLOW
......
...@@ -1121,7 +1121,6 @@ enum ParserFlag { ...@@ -1121,7 +1121,6 @@ enum ParserFlag {
kAllowHarmonyDynamicImport, kAllowHarmonyDynamicImport,
kAllowHarmonyImportMeta, kAllowHarmonyImportMeta,
kAllowHarmonyDoExpressions, kAllowHarmonyDoExpressions,
kAllowHarmonyOptionalCatchBinding,
kAllowHarmonyNumericSeparator kAllowHarmonyNumericSeparator
}; };
...@@ -1139,8 +1138,6 @@ void SetGlobalFlags(i::EnumSet<ParserFlag> flags) { ...@@ -1139,8 +1138,6 @@ void SetGlobalFlags(i::EnumSet<ParserFlag> flags) {
i::FLAG_harmony_dynamic_import = flags.Contains(kAllowHarmonyDynamicImport); i::FLAG_harmony_dynamic_import = flags.Contains(kAllowHarmonyDynamicImport);
i::FLAG_harmony_import_meta = flags.Contains(kAllowHarmonyImportMeta); i::FLAG_harmony_import_meta = flags.Contains(kAllowHarmonyImportMeta);
i::FLAG_harmony_do_expressions = flags.Contains(kAllowHarmonyDoExpressions); i::FLAG_harmony_do_expressions = flags.Contains(kAllowHarmonyDoExpressions);
i::FLAG_harmony_optional_catch_binding =
flags.Contains(kAllowHarmonyOptionalCatchBinding);
i::FLAG_harmony_numeric_separator = i::FLAG_harmony_numeric_separator =
flags.Contains(kAllowHarmonyNumericSeparator); flags.Contains(kAllowHarmonyNumericSeparator);
} }
...@@ -1159,8 +1156,6 @@ void SetParserFlags(i::PreParser* parser, i::EnumSet<ParserFlag> flags) { ...@@ -1159,8 +1156,6 @@ void SetParserFlags(i::PreParser* parser, i::EnumSet<ParserFlag> flags) {
flags.Contains(kAllowHarmonyImportMeta)); flags.Contains(kAllowHarmonyImportMeta));
parser->set_allow_harmony_do_expressions( parser->set_allow_harmony_do_expressions(
flags.Contains(kAllowHarmonyDoExpressions)); flags.Contains(kAllowHarmonyDoExpressions));
parser->set_allow_harmony_optional_catch_binding(
flags.Contains(kAllowHarmonyOptionalCatchBinding));
parser->set_allow_harmony_numeric_separator( parser->set_allow_harmony_numeric_separator(
flags.Contains(kAllowHarmonyNumericSeparator)); flags.Contains(kAllowHarmonyNumericSeparator));
} }
...@@ -2259,9 +2254,9 @@ TEST(FunctionDeclaresItselfStrict) { ...@@ -2259,9 +2254,9 @@ TEST(FunctionDeclaresItselfStrict) {
TEST(ErrorsTryWithoutCatchOrFinally) { TEST(ErrorsTryWithoutCatchOrFinally) {
const char* context_data[][2] = {{"", ""}, {nullptr, nullptr}}; const char* context_data[][2] = {{"", ""}, {nullptr, nullptr}};
const char* statement_data[] = { const char* statement_data[] = {"try { }", "try { } foo();",
"try { }", "try { } foo();", "try { } catch (e) foo();", "try { } catch (e) foo();",
"try { } catch { }", "try { } finally foo();", nullptr}; "try { } finally foo();", nullptr};
RunParserSyncTest(context_data, statement_data, kError); RunParserSyncTest(context_data, statement_data, kError);
} }
...@@ -2299,13 +2294,7 @@ TEST(OptionalCatchBinding) { ...@@ -2299,13 +2294,7 @@ TEST(OptionalCatchBinding) {
}; };
// clang-format on // clang-format on
// No error with flag RunParserSyncTest(context_data, statement_data, kSuccess);
static const ParserFlag flags[] = {kAllowHarmonyOptionalCatchBinding};
RunParserSyncTest(context_data, statement_data, kSuccess, NULL, 0, flags,
arraysize(flags));
// Still an error without flag
RunParserSyncTest(context_data, statement_data, kError);
} }
TEST(OptionalCatchBindingInDoExpression) { TEST(OptionalCatchBindingInDoExpression) {
...@@ -2326,16 +2315,9 @@ TEST(OptionalCatchBindingInDoExpression) { ...@@ -2326,16 +2315,9 @@ TEST(OptionalCatchBindingInDoExpression) {
}; };
// clang-format on // clang-format on
// No error with flag static const ParserFlag do_and_catch_flags[] = {kAllowHarmonyDoExpressions};
static const ParserFlag do_and_catch_flags[] = {
kAllowHarmonyDoExpressions, kAllowHarmonyOptionalCatchBinding};
RunParserSyncTest(context_data, statement_data, kSuccess, NULL, 0, RunParserSyncTest(context_data, statement_data, kSuccess, NULL, 0,
do_and_catch_flags, arraysize(do_and_catch_flags)); do_and_catch_flags, arraysize(do_and_catch_flags));
// Still an error without flag
static const ParserFlag do_flag[] = {kAllowHarmonyDoExpressions};
RunParserSyncTest(context_data, statement_data, kError, NULL, 0, do_flag,
arraysize(do_flag));
} }
TEST(ErrorsRegexpLiteral) { TEST(ErrorsRegexpLiteral) {
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --harmony-optional-catch-binding
let state = 'initial'; let state = 'initial';
x: try { x: try {
throw new Error('caught'); throw new Error('caught');
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --harmony-optional-catch-binding
let state = 'initial'; let state = 'initial';
try { try {
throw new Error('caught'); throw new Error('caught');
......
...@@ -44,7 +44,6 @@ from testrunner.outproc import test262 ...@@ -44,7 +44,6 @@ from testrunner.outproc import test262
FEATURE_FLAGS = { FEATURE_FLAGS = {
'BigInt': '--harmony-bigint', 'BigInt': '--harmony-bigint',
'class-fields-public': '--harmony-public-fields', 'class-fields-public': '--harmony-public-fields',
'optional-catch-binding': '--harmony-optional-catch-binding',
'class-fields-private': '--harmony-private-fields', 'class-fields-private': '--harmony-private-fields',
'Array.prototype.flat': '--harmony-array-flat', 'Array.prototype.flat': '--harmony-array-flat',
'Array.prototype.flatMap': '--harmony-array-flat', 'Array.prototype.flatMap': '--harmony-array-flat',
......
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