Commit a5e33a57 authored by Shu-yu Guo's avatar Shu-yu Guo Committed by Commit Bot

[flags] Remove --harmony-import-meta

It's shipped since M64.

Bug: v8:6693
Change-Id: Ifc547c0036dd7e5f7bab9bcb169abee0157f73b3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2509943
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70954}
parent 49dc0e31
......@@ -282,7 +282,6 @@ DEFINE_IMPLICATION(harmony_weak_refs_with_cleanup_some, harmony_weak_refs)
"harmony namespace exports (export * as foo from 'bar')") \
V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \
V(harmony_atomics, "harmony atomics") \
V(harmony_import_meta, "harmony import.meta property") \
V(harmony_promise_all_settled, "harmony Promise.allSettled") \
V(harmony_promise_any, "harmony Promise.any") \
V(harmony_private_methods, "harmony private methods in class literals") \
......
......@@ -4128,7 +4128,6 @@ void Genesis::InitializeCallSiteBuiltins() {
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_namespace_exports)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_private_methods)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_import_meta)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_sequence)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_top_level_await)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_logical_assignment)
......
......@@ -32,7 +32,6 @@ UnoptimizedCompileFlags::UnoptimizedCompileFlags(Isolate* isolate,
set_might_always_opt(FLAG_always_opt || FLAG_prepare_always_opt);
set_allow_natives_syntax(FLAG_allow_natives_syntax);
set_allow_lazy_compile(FLAG_lazy);
set_allow_harmony_import_meta(FLAG_harmony_import_meta);
set_allow_harmony_private_methods(FLAG_harmony_private_methods);
set_collect_source_positions(!FLAG_enable_lazy_source_positions ||
isolate->NeedsDetailedOptimizedCodeLineInfo());
......
......@@ -60,7 +60,6 @@ class Zone;
V(might_always_opt, bool, 1, _) \
V(allow_natives_syntax, bool, 1, _) \
V(allow_lazy_compile, bool, 1, _) \
V(allow_harmony_import_meta, bool, 1, _) \
V(allow_harmony_private_methods, bool, 1, _) \
V(is_oneshot_iife, bool, 1, _) \
V(collect_source_positions, bool, 1, _) \
......
......@@ -3438,8 +3438,7 @@ ParserBase<Impl>::ParseMemberWithPresentNewPrefixesExpression() {
if (peek() == Token::SUPER) {
const bool is_new = true;
result = ParseSuperExpression(is_new);
} else if (peek() == Token::IMPORT && (!flags().allow_harmony_import_meta() ||
PeekAhead() == Token::LPAREN)) {
} else if (peek() == Token::IMPORT && PeekAhead() == Token::LPAREN) {
impl()->ReportMessageAt(scanner()->peek_location(),
MessageTemplate::kImportCallNotNewExpression);
return impl()->FailureExpression();
......@@ -3539,7 +3538,7 @@ typename ParserBase<Impl>::ExpressionT
ParserBase<Impl>::ParseImportExpressions() {
Consume(Token::IMPORT);
int pos = position();
if (flags().allow_harmony_import_meta() && Check(Token::PERIOD)) {
if (Check(Token::PERIOD)) {
ExpectContextualKeyword(ast_value_factory()->meta_string(), "import.meta",
pos);
if (!flags().is_module()) {
......
......@@ -1034,8 +1034,7 @@ Statement* Parser::ParseModuleItem() {
// We must be careful not to parse a dynamic import expression as an import
// declaration. Same for import.meta expressions.
Token::Value peek_ahead = PeekAhead();
if (peek_ahead != Token::LPAREN &&
(!flags().allow_harmony_import_meta() || peek_ahead != Token::PERIOD)) {
if (peek_ahead != Token::LPAREN && peek_ahead != Token::PERIOD) {
ParseImportDeclaration();
return factory()->EmptyStatement();
}
......
......@@ -26070,7 +26070,6 @@ void HostInitializeImportMetaObjectCallbackStatic(Local<Context> context,
}
TEST(ImportMeta) {
i::FLAG_harmony_import_meta = true;
LocalContext context;
v8::Isolate* isolate = context->GetIsolate();
v8::HandleScope scope(isolate);
......@@ -26121,7 +26120,6 @@ void HostInitializeImportMetaObjectCallbackThrow(Local<Context> context,
}
TEST(ImportMetaThrowUnhandled) {
i::FLAG_harmony_import_meta = true;
LocalContext context;
v8::Isolate* isolate = context->GetIsolate();
v8::HandleScope scope(isolate);
......@@ -26161,7 +26159,6 @@ TEST(ImportMetaThrowUnhandled) {
}
TEST(ImportMetaThrowHandled) {
i::FLAG_harmony_import_meta = true;
LocalContext context;
v8::Isolate* isolate = context->GetIsolate();
v8::HandleScope scope(isolate);
......@@ -1620,7 +1620,6 @@ enum ParserFlag {
kAllowLazy,
kAllowNatives,
kAllowHarmonyPrivateMethods,
kAllowHarmonyImportMeta,
kAllowHarmonyLogicalAssignment,
};
......@@ -1633,7 +1632,6 @@ enum ParserSyncTestResult {
void SetGlobalFlags(base::EnumSet<ParserFlag> flags) {
i::FLAG_allow_natives_syntax = flags.contains(kAllowNatives);
i::FLAG_harmony_private_methods = flags.contains(kAllowHarmonyPrivateMethods);
i::FLAG_harmony_import_meta = flags.contains(kAllowHarmonyImportMeta);
i::FLAG_harmony_logical_assignment =
flags.contains(kAllowHarmonyLogicalAssignment);
}
......@@ -1643,8 +1641,6 @@ void SetParserFlags(i::UnoptimizedCompileFlags* compile_flags,
compile_flags->set_allow_natives_syntax(flags.contains(kAllowNatives));
compile_flags->set_allow_harmony_private_methods(
flags.contains(kAllowHarmonyPrivateMethods));
compile_flags->set_allow_harmony_import_meta(
flags.contains(kAllowHarmonyImportMeta));
compile_flags->set_allow_harmony_logical_assignment(
flags.contains(kAllowHarmonyLogicalAssignment));
}
......@@ -9539,21 +9535,12 @@ TEST(ImportMetaSuccess) {
// clang-format on
// Making sure the same *wouldn't* parse without the flags
RunModuleParserSyncTest(context_data, data, kError, nullptr, 0, nullptr, 0,
nullptr, 0, true, true);
static const ParserFlag flags[] = {kAllowHarmonyImportMeta};
// 2.1.1 Static Semantics: Early Errors
// ImportMeta
// * It is an early Syntax Error if Module is not the syntactic goal symbol.
RunParserSyncTest(context_data, data, kError, nullptr, 0, flags,
arraysize(flags));
// Making sure the same wouldn't parse without the flags either
RunParserSyncTest(context_data, data, kError);
RunModuleParserSyncTest(context_data, data, kSuccess, nullptr, 0, flags,
arraysize(flags));
RunModuleParserSyncTest(context_data, data, kSuccess);
}
TEST(ImportMetaFailure) {
......@@ -9579,16 +9566,8 @@ TEST(ImportMetaFailure) {
// clang-format on
static const ParserFlag flags[] = {kAllowHarmonyImportMeta};
RunParserSyncTest(context_data, data, kError, nullptr, 0, flags,
arraysize(flags));
RunModuleParserSyncTest(context_data, data, kError, nullptr, 0, flags,
arraysize(flags));
RunModuleParserSyncTest(context_data, data, kError, nullptr, 0, nullptr, 0,
nullptr, 0, true, true);
RunParserSyncTest(context_data, data, kError);
RunModuleParserSyncTest(context_data, data, kError);
}
TEST(ConstSloppy) {
......
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