mirror of
https://github.com/RGBCube/serenity
synced 2025-06-29 01:42:11 +00:00
LibJS: Rename JS::Iterator to JS::IteratorRecord
This is in preparation for an upcoming implementation of the Iterator Helpers proposal. That proposal will require a JS::Object type named "Iterator", so this rename is to avoid conflicts.
This commit is contained in:
parent
cd2a6767bc
commit
4977000fa0
12 changed files with 36 additions and 36 deletions
|
@ -263,7 +263,7 @@ void ImportCall::replace_references_impl(Register from, Register to)
|
|||
|
||||
// FIXME: Since the accumulator is a Value, we store an object there and have to convert back and forth between that an Iterator records. Not great.
|
||||
// Make sure to put this into the accumulator before the iterator object disappears from the stack to prevent the members from being GC'd.
|
||||
static Object* iterator_to_object(VM& vm, Iterator iterator)
|
||||
static Object* iterator_to_object(VM& vm, IteratorRecord iterator)
|
||||
{
|
||||
auto& realm = *vm.current_realm();
|
||||
auto object = Object::create(realm, nullptr);
|
||||
|
@ -273,9 +273,9 @@ static Object* iterator_to_object(VM& vm, Iterator iterator)
|
|||
return object;
|
||||
}
|
||||
|
||||
static Iterator object_to_iterator(VM& vm, Object& object)
|
||||
static IteratorRecord object_to_iterator(VM& vm, Object& object)
|
||||
{
|
||||
return Iterator {
|
||||
return IteratorRecord {
|
||||
.iterator = &MUST(object.get(vm.names.iterator)).as_object(),
|
||||
.next_method = MUST(object.get(vm.names.next)),
|
||||
.done = MUST(object.get(vm.names.done)).as_bool()
|
||||
|
@ -1052,7 +1052,7 @@ ThrowCompletionOr<void> GetObjectPropertyIterator::execute_impl(Bytecode::Interp
|
|||
properties.set(TRY(PropertyKey::from_value(vm, key)));
|
||||
}
|
||||
}
|
||||
Iterator iterator {
|
||||
IteratorRecord iterator {
|
||||
.iterator = object,
|
||||
.next_method = NativeFunction::create(
|
||||
interpreter.realm(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue