Skip to content

Commit 16fd730

Browse files
aduh95targos
authored andcommitted
deps: V8: cherry-pick a0fd3209dda8
Original commit message: [import-attributes] Implement import attributes, with `assert` fallback In the past six months, the old import assertions proposal has been renamed to "import attributes" with the follwing major changes: 1. the keyword is now `with` instead of `assert` 2. unknown assertions cause an error rather than being ignored To preserve backward compatibility with existing applications that use `assert`, implementations _can_ keep it around as a fallback for both the static and dynamic forms. Additionally, the proposal has some minor changes that came up during the stage 3 reviews: 3. dynamic import first reads all the attributes, and then verifies that they are all strings 4. there is no need for a `[no LineTerminator here]` restriction before the `with` keyword 5. static import syntax allows any `LiteralPropertyName` as attribute keys, to align with every other syntax using key-value pairs The new syntax is enabled by a new `--harmony-import-attributes` flag, disabled by default. However, the new behavioral changes also apply to the old syntax that is under the `--harmony-import-assertions` flag. This patch does implements (1), (3), (4) and (5). Handling of unknown import assertions was not implemented directly in V8, but delegated to embedders. As such, it will be implemented separately in d8 and Chromium. To simplify the review, this patch doesn't migrate usage of the term "assertions" to "attributes". There are many variables and internal functions that could be easily renamed as soon as this patch landes. There is one usage in the public API (`ModuleRequest::GetImportAssertions`) that will probably need to be aliased and then removed following the same process as for other API breaking changes. Bug: v8:13856 Change-Id: I78b167348d898887332c5ca7468bc5d58cd9b1ca Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4632799 Commit-Queue: Shu-yu Guo <syg@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Cr-Commit-Position: refs/heads/main@{#89110} Refs: v8/v8@159c82c Refs: v8/v8@a0fd320 PR-URL: #50183 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
1 parent 27e957c commit 16fd730

29 files changed

Lines changed: 698 additions & 107 deletions

‎common.gypi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.17',
39+
'v8_embedder_string': '-node.18',
4040

4141
##### V8 defaults for Node.js #####
4242

‎deps/v8/include/v8-script.h‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,9 @@ class V8_EXPORT ModuleRequest : public Data {
142142
*
143143
* All assertions present in the module request will be supplied in this
144144
* list, regardless of whether they are supported by the host. Per
145-
* https://tc39.es/proposal-import-assertions/#sec-hostgetsupportedimportassertions,
146-
* hosts are expected to ignore assertions that they do not support (as
147-
* opposed to, for example, triggering an error if an unsupported assertion is
148-
* present).
145+
* https://tc39.es/proposal-import-attributes/#sec-hostgetsupportedimportattributes,
146+
* hosts are expected to throw for assertions that they do not support (as
147+
* opposed to, for example, ignoring them).
149148
*/
150149
Local<FixedArray> GetImportAssertions() const;
151150

‎deps/v8/src/execution/isolate.cc‎

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5156,7 +5156,8 @@ MaybeHandle<FixedArray> Isolate::GetImportAssertionsFromArgument(
51565156

51575157
// The parser shouldn't have allowed the second argument to import() if
51585158
// the flag wasn't enabled.
5159-
DCHECK(v8_flags.harmony_import_assertions);
5159+
DCHECK(v8_flags.harmony_import_assertions ||
5160+
v8_flags.harmony_import_attributes);
51605161

51615162
if (!import_assertions_argument->IsJSReceiver()) {
51625163
this->Throw(
@@ -5166,18 +5167,35 @@ MaybeHandle<FixedArray> Isolate::GetImportAssertionsFromArgument(
51665167

51675168
Handle<JSReceiver> import_assertions_argument_receiver =
51685169
Handle<JSReceiver>::cast(import_assertions_argument);
5169-
Handle<Name> key = factory()->assert_string();
51705170

51715171
Handle<Object> import_assertions_object;
5172-
if (!JSReceiver::GetProperty(this, import_assertions_argument_receiver, key)
5173-
.ToHandle(&import_assertions_object)) {
5174-
// This can happen if the property has a getter function that throws
5175-
// an error.
5176-
return MaybeHandle<FixedArray>();
5172+
5173+
if (v8_flags.harmony_import_attributes) {
5174+
Handle<Name> with_key = factory()->with_string();
5175+
if (!JSReceiver::GetProperty(this, import_assertions_argument_receiver,
5176+
with_key)
5177+
.ToHandle(&import_assertions_object)) {
5178+
// This can happen if the property has a getter function that throws
5179+
// an error.
5180+
return MaybeHandle<FixedArray>();
5181+
}
51775182
}
51785183

5179-
// If there is no 'assert' option in the options bag, it's not an error. Just
5180-
// do the import() as if no assertions were provided.
5184+
if (v8_flags.harmony_import_assertions &&
5185+
(!v8_flags.harmony_import_attributes ||
5186+
import_assertions_object->IsUndefined())) {
5187+
Handle<Name> assert_key = factory()->assert_string();
5188+
if (!JSReceiver::GetProperty(this, import_assertions_argument_receiver,
5189+
assert_key)
5190+
.ToHandle(&import_assertions_object)) {
5191+
// This can happen if the property has a getter function that throws
5192+
// an error.
5193+
return MaybeHandle<FixedArray>();
5194+
}
5195+
}
5196+
5197+
// If there is no 'with' or 'assert' option in the options bag, it's not an
5198+
// error. Just do the import() as if no assertions were provided.
51815199
if (import_assertions_object->IsUndefined()) return import_assertions_array;
51825200

51835201
if (!import_assertions_object->IsJSReceiver()) {
@@ -5199,6 +5217,8 @@ MaybeHandle<FixedArray> Isolate::GetImportAssertionsFromArgument(
51995217
return MaybeHandle<FixedArray>();
52005218
}
52015219

5220+
bool has_non_string_attribute = false;
5221+
52025222
// The assertions will be passed to the host in the form: [key1,
52035223
// value1, key2, value2, ...].
52045224
constexprsize_tkAssertionEntrySizeForDynamicImport = 2;
@@ -5216,9 +5236,7 @@ MaybeHandle<FixedArray> Isolate::GetImportAssertionsFromArgument(
52165236
}
52175237

52185238
if (!assertion_value->IsString()) {
5219-
this->Throw(*factory()->NewTypeError(
5220-
MessageTemplate::kNonStringImportAssertionValue));
5221-
return MaybeHandle<FixedArray>();
5239+
has_non_string_attribute = true;
52225240
}
52235241

52245242
import_assertions_array->set((i * kAssertionEntrySizeForDynamicImport),
@@ -5227,6 +5245,12 @@ MaybeHandle<FixedArray> Isolate::GetImportAssertionsFromArgument(
52275245
*assertion_value);
52285246
}
52295247

5248+
if (has_non_string_attribute) {
5249+
this->Throw(*factory()->NewTypeError(
5250+
MessageTemplate::kNonStringImportAssertionValue));
5251+
return MaybeHandle<FixedArray>();
5252+
}
5253+
52305254
return import_assertions_array;
52315255
}
52325256

‎deps/v8/src/flags/flag-definitions.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features")
235235

236236
// Features that are still work in progress (behind individual flags).
237237
#defineHARMONY_INPROGRESS_BASE(V) \
238+
V(harmony_import_attributes, "harmony import attributes") \
238239
V(harmony_weak_refs_with_cleanup_some, \
239240
"harmony weak references with FinalizationRegistry.prototype.cleanupSome") \
240241
V(harmony_temporal, "Temporal") \

‎deps/v8/src/init/bootstrapper.cc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4523,6 +4523,7 @@ void Genesis::InitializeConsole(Handle<JSObject> extras_binding) {
45234523
void Genesis::InitializeGlobal_##id() {}
45244524

45254525
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_import_assertions)
4526+
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_import_attributes)
45264527
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_symbol_as_weakmap_key)
45274528
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rab_gsab_transfer)
45284529

‎deps/v8/src/init/heap-symbols.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@
462462
V(_, week_string, "week") \
463463
V(_, weeks_string, "weeks") \
464464
V(_, weekOfYear_string, "weekOfYear") \
465+
V(_, with_string, "with") \
465466
V(_, word_string, "word") \
466467
V(_, yearMonthFromFields_string, "yearMonthFromFields") \
467468
V(_, year_string, "year") \

‎deps/v8/src/parsing/parser-base.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3774,7 +3774,9 @@ ParserBase<Impl>::ParseImportExpressions() {
37743774
AcceptINScope scope(this, true);
37753775
ExpressionT specifier = ParseAssignmentExpressionCoverGrammar();
37763776

3777-
if (v8_flags.harmony_import_assertions && Check(Token::COMMA)) {
3777+
if ((v8_flags.harmony_import_assertions ||
3778+
v8_flags.harmony_import_attributes) &&
3779+
Check(Token::COMMA)) {
37783780
if (Check(Token::RPAREN)) {
37793781
// A trailing comma allowed after the specifier.
37803782
returnfactory()->NewImportCallExpression(specifier, pos);

‎deps/v8/src/parsing/parser.cc‎

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,36 +1344,41 @@ ZonePtrList<const Parser::NamedImport>* Parser::ParseNamedImports(int pos) {
13441344
}
13451345

13461346
ImportAssertions* Parser::ParseImportAssertClause() {
1347-
//AssertClause :
1348-
//assert '{' '}'
1349-
//assert '{' AssertEntries '}'
1347+
//WithClause :
1348+
//with '{' '}'
1349+
//with '{' WithEntries ','? '}'
13501350

1351-
//AssertEntries :
1352-
//IdentifierName: AssertionKey
1353-
//IdentifierName: AssertionKey , AssertEntries
1351+
//WithEntries :
1352+
//LiteralPropertyName
1353+
//LiteralPropertyName ':' StringLiteral , WithEntries
13541354

1355-
// AssertionKey :
1356-
// IdentifierName
1357-
// StringLiteral
1355+
// (DEPRECATED)
1356+
// AssertClause :
1357+
// assert '{' '}'
1358+
// assert '{' WithEntries ','? '}'
13581359

13591360
auto import_assertions = zone()->New<ImportAssertions>(zone());
13601361

1361-
if (!v8_flags.harmony_import_assertions) {
1362-
return import_assertions;
1363-
}
1364-
1365-
// Assert clause is optional, and cannot be preceded by a LineTerminator.
1366-
if (scanner()->HasLineTerminatorBeforeNext() ||
1367-
!CheckContextualKeyword(ast_value_factory()->assert_string())) {
1362+
if (v8_flags.harmony_import_attributes && Check(Token::WITH)) {
1363+
// 'with' keyword consumed
1364+
}elseif (v8_flags.harmony_import_assertions &&
1365+
!scanner()->HasLineTerminatorBeforeNext() &&
1366+
CheckContextualKeyword(ast_value_factory()->assert_string())) {
1367+
// 'assert' keyword consumed
1368+
} else {
13681369
return import_assertions;
13691370
}
13701371

13711372
Expect(Token::LBRACE);
13721373

13731374
while (peek() != Token::RBRACE) {
13741375
const AstRawString* attribute_key = nullptr;
1375-
if (Check(Token::STRING)) {
1376+
if (Check(Token::STRING) || Check(Token::SMI)) {
13761377
attribute_key = GetSymbol();
1378+
} elseif (Check(Token::NUMBER)) {
1379+
attribute_key = GetNumberAsSymbol();
1380+
} elseif (Check(Token::BIGINT)) {
1381+
attribute_key = GetBigIntAsSymbol();
13771382
} else {
13781383
attribute_key = ParsePropertyName();
13791384
}

‎deps/v8/src/roots/static-roots.h‎

Lines changed: 74 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -693,82 +693,83 @@ struct StaticReadOnlyRoot {
693693
staticconstexpr Tagged_t kweek_string = 0x5a55;
694694
staticconstexpr Tagged_t kweeks_string = 0x5a65;
695695
staticconstexpr Tagged_t kweekOfYear_string = 0x5a79;
696-
staticconstexpr Tagged_t kword_string = 0x5a91;
697-
staticconstexpr Tagged_t kyearMonthFromFields_string = 0x5aa1;
698-
staticconstexpr Tagged_t kyear_string = 0x5ac1;
699-
staticconstexpr Tagged_t kyears_string = 0x5ad1;
700-
staticconstexpr Tagged_t kUninitializedValue = 0x5af5;
701-
staticconstexpr Tagged_t kArgumentsMarker = 0x5b2d;
702-
staticconstexpr Tagged_t kTerminationException = 0x5b65;
703-
staticconstexpr Tagged_t kException = 0x5ba5;
704-
staticconstexpr Tagged_t kOptimizedOut = 0x5bc1;
705-
staticconstexpr Tagged_t kStaleRegister = 0x5bf9;
706-
staticconstexpr Tagged_t kSelfReferenceMarker = 0x5c31;
707-
staticconstexpr Tagged_t kBasicBlockCountersMarker = 0x5c71;
708-
staticconstexpr Tagged_t karray_buffer_wasm_memory_symbol = 0x5cb5;
709-
staticconstexpr Tagged_t kcall_site_info_symbol = 0x5cc5;
710-
staticconstexpr Tagged_t kconsole_context_id_symbol = 0x5cd5;
711-
staticconstexpr Tagged_t kconsole_context_name_symbol = 0x5ce5;
712-
staticconstexpr Tagged_t kclass_fields_symbol = 0x5cf5;
713-
staticconstexpr Tagged_t kclass_positions_symbol = 0x5d05;
714-
staticconstexpr Tagged_t kerror_end_pos_symbol = 0x5d15;
715-
staticconstexpr Tagged_t kerror_script_symbol = 0x5d25;
716-
staticconstexpr Tagged_t kerror_stack_symbol = 0x5d35;
717-
staticconstexpr Tagged_t kerror_start_pos_symbol = 0x5d45;
718-
staticconstexpr Tagged_t kfrozen_symbol = 0x5d55;
719-
staticconstexpr Tagged_t kinterpreter_trampoline_symbol = 0x5d65;
720-
staticconstexpr Tagged_t knative_context_index_symbol = 0x5d75;
721-
staticconstexpr Tagged_t knonextensible_symbol = 0x5d85;
722-
staticconstexpr Tagged_t kpromise_debug_marker_symbol = 0x5d95;
723-
staticconstexpr Tagged_t kpromise_debug_message_symbol = 0x5da5;
724-
staticconstexpr Tagged_t kpromise_forwarding_handler_symbol = 0x5db5;
725-
staticconstexpr Tagged_t kpromise_handled_by_symbol = 0x5dc5;
726-
staticconstexpr Tagged_t kpromise_awaited_by_symbol = 0x5dd5;
727-
staticconstexpr Tagged_t kregexp_result_names_symbol = 0x5de5;
728-
staticconstexpr Tagged_t kregexp_result_regexp_input_symbol = 0x5df5;
729-
staticconstexpr Tagged_t kregexp_result_regexp_last_index_symbol = 0x5e05;
730-
staticconstexpr Tagged_t ksealed_symbol = 0x5e15;
731-
staticconstexpr Tagged_t kstrict_function_transition_symbol = 0x5e25;
696+
staticconstexpr Tagged_t kwith_string = 0x5a91;
697+
staticconstexpr Tagged_t kword_string = 0x5aa1;
698+
staticconstexpr Tagged_t kyearMonthFromFields_string = 0x5ab1;
699+
staticconstexpr Tagged_t kyear_string = 0x5ad1;
700+
staticconstexpr Tagged_t kyears_string = 0x5ae1;
701+
staticconstexpr Tagged_t kUninitializedValue = 0x5b05;
702+
staticconstexpr Tagged_t kArgumentsMarker = 0x5b3d;
703+
staticconstexpr Tagged_t kTerminationException = 0x5b75;
704+
staticconstexpr Tagged_t kException = 0x5bb5;
705+
staticconstexpr Tagged_t kOptimizedOut = 0x5bd1;
706+
staticconstexpr Tagged_t kStaleRegister = 0x5c09;
707+
staticconstexpr Tagged_t kSelfReferenceMarker = 0x5c41;
708+
staticconstexpr Tagged_t kBasicBlockCountersMarker = 0x5c81;
709+
staticconstexpr Tagged_t karray_buffer_wasm_memory_symbol = 0x5cc5;
710+
staticconstexpr Tagged_t kcall_site_info_symbol = 0x5cd5;
711+
staticconstexpr Tagged_t kconsole_context_id_symbol = 0x5ce5;
712+
staticconstexpr Tagged_t kconsole_context_name_symbol = 0x5cf5;
713+
staticconstexpr Tagged_t kclass_fields_symbol = 0x5d05;
714+
staticconstexpr Tagged_t kclass_positions_symbol = 0x5d15;
715+
staticconstexpr Tagged_t kerror_end_pos_symbol = 0x5d25;
716+
staticconstexpr Tagged_t kerror_script_symbol = 0x5d35;
717+
staticconstexpr Tagged_t kerror_stack_symbol = 0x5d45;
718+
staticconstexpr Tagged_t kerror_start_pos_symbol = 0x5d55;
719+
staticconstexpr Tagged_t kfrozen_symbol = 0x5d65;
720+
staticconstexpr Tagged_t kinterpreter_trampoline_symbol = 0x5d75;
721+
staticconstexpr Tagged_t knative_context_index_symbol = 0x5d85;
722+
staticconstexpr Tagged_t knonextensible_symbol = 0x5d95;
723+
staticconstexpr Tagged_t kpromise_debug_marker_symbol = 0x5da5;
724+
staticconstexpr Tagged_t kpromise_debug_message_symbol = 0x5db5;
725+
staticconstexpr Tagged_t kpromise_forwarding_handler_symbol = 0x5dc5;
726+
staticconstexpr Tagged_t kpromise_handled_by_symbol = 0x5dd5;
727+
staticconstexpr Tagged_t kpromise_awaited_by_symbol = 0x5de5;
728+
staticconstexpr Tagged_t kregexp_result_names_symbol = 0x5df5;
729+
staticconstexpr Tagged_t kregexp_result_regexp_input_symbol = 0x5e05;
730+
staticconstexpr Tagged_t kregexp_result_regexp_last_index_symbol = 0x5e15;
731+
staticconstexpr Tagged_t ksealed_symbol = 0x5e25;
732+
staticconstexpr Tagged_t kstrict_function_transition_symbol = 0x5e35;
732733
staticconstexpr Tagged_t ktemplate_literal_function_literal_id_symbol =
733-
0x5e35;
734-
staticconstexpr Tagged_t ktemplate_literal_slot_id_symbol = 0x5e45;
735-
staticconstexpr Tagged_t kwasm_exception_tag_symbol = 0x5e55;
736-
staticconstexpr Tagged_t kwasm_exception_values_symbol = 0x5e65;
737-
staticconstexpr Tagged_t kwasm_uncatchable_symbol = 0x5e75;
738-
staticconstexpr Tagged_t kwasm_wrapped_object_symbol = 0x5e85;
739-
staticconstexpr Tagged_t kwasm_debug_proxy_cache_symbol = 0x5e95;
740-
staticconstexpr Tagged_t kwasm_debug_proxy_names_symbol = 0x5ea5;
741-
staticconstexpr Tagged_t kasync_iterator_symbol = 0x5eb5;
742-
staticconstexpr Tagged_t kintl_fallback_symbol = 0x5ee5;
743-
staticconstexpr Tagged_t kmatch_all_symbol = 0x5f1d;
744-
staticconstexpr Tagged_t kmatch_symbol = 0x5f49;
745-
staticconstexpr Tagged_t ksearch_symbol = 0x5f71;
746-
staticconstexpr Tagged_t ksplit_symbol = 0x5f9d;
747-
staticconstexpr Tagged_t kto_primitive_symbol = 0x5fc5;
748-
staticconstexpr Tagged_t kunscopables_symbol = 0x5ff5;
749-
staticconstexpr Tagged_t khas_instance_symbol = 0x6025;
750-
staticconstexpr Tagged_t kto_string_tag_symbol = 0x6055;
751-
staticconstexpr Tagged_t kconstructor_string = 0x60ad;
752-
staticconstexpr Tagged_t knext_string = 0x60c5;
753-
staticconstexpr Tagged_t kresolve_string = 0x60d5;
754-
staticconstexpr Tagged_t kthen_string = 0x60e9;
755-
staticconstexpr Tagged_t kiterator_symbol = 0x60f9;
756-
staticconstexpr Tagged_t kreplace_symbol = 0x6109;
757-
staticconstexpr Tagged_t kspecies_symbol = 0x6119;
758-
staticconstexpr Tagged_t kis_concat_spreadable_symbol = 0x6129;
759-
staticconstexpr Tagged_t kEmptySlowElementDictionary = 0x6139;
760-
staticconstexpr Tagged_t kEmptySymbolTable = 0x615d;
761-
staticconstexpr Tagged_t kEmptyOrderedHashMap = 0x6179;
762-
staticconstexpr Tagged_t kEmptyOrderedHashSet = 0x618d;
763-
staticconstexpr Tagged_t kEmptyFeedbackMetadata = 0x61a1;
764-
staticconstexpr Tagged_t kGlobalThisBindingScopeInfo = 0x61ad;
765-
staticconstexpr Tagged_t kEmptyFunctionScopeInfo = 0x61cd;
766-
staticconstexpr Tagged_t kNativeScopeInfo = 0x61f1;
767-
staticconstexpr Tagged_t kShadowRealmScopeInfo = 0x6209;
734+
0x5e45;
735+
staticconstexpr Tagged_t ktemplate_literal_slot_id_symbol = 0x5e55;
736+
staticconstexpr Tagged_t kwasm_exception_tag_symbol = 0x5e65;
737+
staticconstexpr Tagged_t kwasm_exception_values_symbol = 0x5e75;
738+
staticconstexpr Tagged_t kwasm_uncatchable_symbol = 0x5e85;
739+
staticconstexpr Tagged_t kwasm_wrapped_object_symbol = 0x5e95;
740+
staticconstexpr Tagged_t kwasm_debug_proxy_cache_symbol = 0x5ea5;
741+
staticconstexpr Tagged_t kwasm_debug_proxy_names_symbol = 0x5eb5;
742+
staticconstexpr Tagged_t kasync_iterator_symbol = 0x5ec5;
743+
staticconstexpr Tagged_t kintl_fallback_symbol = 0x5ef5;
744+
staticconstexpr Tagged_t kmatch_all_symbol = 0x5f2d;
745+
staticconstexpr Tagged_t kmatch_symbol = 0x5f59;
746+
staticconstexpr Tagged_t ksearch_symbol = 0x5f81;
747+
staticconstexpr Tagged_t ksplit_symbol = 0x5fad;
748+
staticconstexpr Tagged_t kto_primitive_symbol = 0x5fd5;
749+
staticconstexpr Tagged_t kunscopables_symbol = 0x6005;
750+
staticconstexpr Tagged_t khas_instance_symbol = 0x6035;
751+
staticconstexpr Tagged_t kto_string_tag_symbol = 0x6065;
752+
staticconstexpr Tagged_t kconstructor_string = 0x60bd;
753+
staticconstexpr Tagged_t knext_string = 0x60d5;
754+
staticconstexpr Tagged_t kresolve_string = 0x60e5;
755+
staticconstexpr Tagged_t kthen_string = 0x60f9;
756+
staticconstexpr Tagged_t kiterator_symbol = 0x6109;
757+
staticconstexpr Tagged_t kreplace_symbol = 0x6119;
758+
staticconstexpr Tagged_t kspecies_symbol = 0x6129;
759+
staticconstexpr Tagged_t kis_concat_spreadable_symbol = 0x6139;
760+
staticconstexpr Tagged_t kEmptySlowElementDictionary = 0x6149;
761+
staticconstexpr Tagged_t kEmptySymbolTable = 0x616d;
762+
staticconstexpr Tagged_t kEmptyOrderedHashMap = 0x6189;
763+
staticconstexpr Tagged_t kEmptyOrderedHashSet = 0x619d;
764+
staticconstexpr Tagged_t kEmptyFeedbackMetadata = 0x61b1;
765+
staticconstexpr Tagged_t kGlobalThisBindingScopeInfo = 0x61bd;
766+
staticconstexpr Tagged_t kEmptyFunctionScopeInfo = 0x61dd;
767+
staticconstexpr Tagged_t kNativeScopeInfo = 0x6201;
768+
staticconstexpr Tagged_t kShadowRealmScopeInfo = 0x6219;
768769
staticconstexpr Tagged_t kWasmNull = 0xfffd;
769770
};
770771

771-
staticconstexpr std::array<Tagged_t, 738> StaticReadOnlyRootsPointerTable = {
772+
staticconstexpr std::array<Tagged_t, 739> StaticReadOnlyRootsPointerTable = {
772773
StaticReadOnlyRoot::kFreeSpaceMap,
773774
StaticReadOnlyRoot::kOnePointerFillerMap,
774775
StaticReadOnlyRoot::kTwoPointerFillerMap,
@@ -1365,6 +1366,7 @@ static constexpr std::array<Tagged_t, 738> StaticReadOnlyRootsPointerTable = {
13651366
StaticReadOnlyRoot::kweek_string,
13661367
StaticReadOnlyRoot::kweeks_string,
13671368
StaticReadOnlyRoot::kweekOfYear_string,
1369+
StaticReadOnlyRoot::kwith_string,
13681370
StaticReadOnlyRoot::kword_string,
13691371
StaticReadOnlyRoot::kyearMonthFromFields_string,
13701372
StaticReadOnlyRoot::kyear_string,
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright 2021 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// Flags: --harmony-import-attributes
6+
7+
import{life}from'modules-skip-1.mjs'with{};
8+
9+
assertEquals(42,life());

0 commit comments

Comments
 (0)