1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:07:35 +00:00

LibJS: Replace GlobalObject with VM in Iterator AOs [Part 7/19]

This commit is contained in:
Linus Groh 2022-08-21 15:56:27 +01:00
parent ae9e031f56
commit ccdfa2320c
30 changed files with 171 additions and 182 deletions

View file

@ -1361,7 +1361,7 @@ void IDL::ParameterizedType::generate_sequence_from_iterable(SourceGenerator& ge
// 5. Set i to i + 1.
sequence_generator.append(R"~~~(
auto iterator@recursion_depth@ = TRY(JS::get_iterator(global_object, @iterable_cpp_name@, JS::IteratorHint::Sync, @iterator_method_cpp_name@));
auto iterator@recursion_depth@ = TRY(JS::get_iterator(vm, @iterable_cpp_name@, JS::IteratorHint::Sync, @iterator_method_cpp_name@));
)~~~");
if (sequence_cpp_type.sequence_storage_type == SequenceStorageType::Vector) {
@ -1376,11 +1376,11 @@ void IDL::ParameterizedType::generate_sequence_from_iterable(SourceGenerator& ge
sequence_generator.append(R"~~~(
for (;;) {
auto* next@recursion_depth@ = TRY(JS::iterator_step(global_object, iterator@recursion_depth@));
auto* next@recursion_depth@ = TRY(JS::iterator_step(vm, iterator@recursion_depth@));
if (!next@recursion_depth@)
break;
auto next_item@recursion_depth@ = TRY(JS::iterator_value(global_object, *next@recursion_depth@));
auto next_item@recursion_depth@ = TRY(JS::iterator_value(vm, *next@recursion_depth@));
)~~~");
// FIXME: Sequences types should be TypeWithExtendedAttributes, which would allow us to get [LegacyNullToEmptyString] here.