Commit 750e48ea authored by Caitlin Potter's avatar Caitlin Potter Committed by Commit Bot

Remove always-enabled --harmony-hashbang flag

It was a good flag, but it's time to say goodbye. Let us take a moment
to remember the good times we've had during its short time on earth.

It shipped in Chrome 74.

BUG=v8:8523
R=adamk@chromium.org, mathias@chromium.org, gsathya@chromium.org

Change-Id: I37e58360614c0bb3582b8bbfac795d5ed3e5a149
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1641205
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: 's avatarMathias Bynens <mathias@chromium.org>
Auto-Submit: Caitlin Potter <caitp@igalia.com>
Cr-Commit-Position: refs/heads/master@{#62099}
parent b5362403
......@@ -242,7 +242,6 @@ DEFINE_IMPLICATION(harmony_import_meta, harmony_dynamic_import)
V(harmony_dynamic_import, "harmony dynamic import") \
V(harmony_global, "harmony global") \
V(harmony_object_from_entries, "harmony Object.fromEntries()") \
V(harmony_hashbang, "harmony hashbang syntax") \
V(harmony_numeric_separator, "harmony numeric separator between digits") \
V(harmony_promise_all_settled, "harmony Promise.allSettled")
......
......@@ -4231,7 +4231,6 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_dynamic_import)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_import_meta)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_numeric_separator)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_sequence)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_hashbang)
#ifdef V8_INTL_SUPPORT
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_intl_add_calendar_numbering_system)
......
......@@ -501,9 +501,7 @@ FunctionLiteral* Parser::ParseProgram(Isolate* isolate, ParseInfo* info) {
Scope::DeserializationMode::kIncludingVariables);
scanner_.Initialize();
if (FLAG_harmony_hashbang) {
scanner_.SkipHashBang();
}
scanner_.SkipHashBang();
FunctionLiteral* result = DoParseProgram(isolate, info);
MaybeResetCharacterStream(info, result);
MaybeProcessSourceRanges(info, result, stack_limit_);
......
......@@ -74,11 +74,9 @@ PreParser::PreParseResult PreParser::PreParseProgram() {
scope->set_is_being_lazily_parsed(true);
#endif
if (FLAG_harmony_hashbang) {
// Note: We should only skip the hashbang in non-Eval scripts
// (currently, Eval is not handled by the PreParser).
scanner()->SkipHashBang();
}
// Note: We should only skip the hashbang in non-Eval scripts
// (currently, Eval is not handled by the PreParser).
scanner()->SkipHashBang();
// ModuleDeclarationInstantiation for Source Text Module Records creates a
// new Module Environment Record whose outer lexical environment record is
......
......@@ -11319,15 +11319,9 @@ TEST(HashbangSyntax) {
const char* data[] = {"function\nFN\n(\n)\n {\n}\nFN();", nullptr};
i::FLAG_harmony_hashbang = true;
RunParserSyncTest(context_data, data, kSuccess);
RunParserSyncTest(context_data, data, kSuccess, nullptr, 0, nullptr, 0,
nullptr, 0, true);
i::FLAG_harmony_hashbang = false;
RunParserSyncTest(context_data, data, kError);
RunParserSyncTest(context_data, data, kError, nullptr, 0, nullptr, 0, nullptr,
0, true);
}
TEST(HashbangSyntaxErrors) {
......@@ -11370,12 +11364,6 @@ TEST(HashbangSyntaxErrors) {
const char* hashbang_data[] = {"#!\n", "#!---IGNORED---\n", nullptr};
auto SyntaxErrorTest = [](const char* context_data[][2], const char* data[]) {
i::FLAG_harmony_hashbang = true;
RunParserSyncTest(context_data, data, kError);
RunParserSyncTest(context_data, data, kError, nullptr, 0, nullptr, 0,
nullptr, 0, true);
i::FLAG_harmony_hashbang = false;
RunParserSyncTest(context_data, data, kError);
RunParserSyncTest(context_data, data, kError, nullptr, 0, nullptr, 0,
nullptr, 0, true);
......
......@@ -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-hashbang
// Hashbang syntax is allowed in eval.
assertEquals(eval("#!"), undefined);
assertEquals(eval("#!\n"), undefined);
......
......@@ -53,7 +53,6 @@ FEATURE_FLAGS = {
'globalThis': '--harmony-global',
'export-star-as-namespace-from-module': '--harmony-namespace-exports',
'Object.fromEntries': '--harmony-object-from-entries',
'hashbang': '--harmony-hashbang',
'BigInt': '--harmony-intl-bigint',
'Promise.allSettled': '--harmony-promise-all-settled',
}
......
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