LibJS: Don't coerce this value in %IteratorPrototype%[@@iterator]

Another day, another mistake that's been there for a long time but
would've been immediately obvious when adding spec comments. :^)
This commit is contained in:
Linus Groh 2022-04-18 00:24:02 +02:00
parent ee1379520a
commit 472ff7a6d4

View file

@ -27,7 +27,8 @@ void IteratorPrototype::initialize(GlobalObject& global_object)
// 27.1.2.1 %IteratorPrototype% [ @@iterator ] ( ), https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
JS_DEFINE_NATIVE_FUNCTION(IteratorPrototype::symbol_iterator)
{
return TRY(vm.this_value(global_object).to_object(global_object));
// 1. Return the this value.
return vm.this_value(global_object);
}
}