From 472ff7a6d44b4d32679af00927824e7f9d6bdf93 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Mon, 18 Apr 2022 00:24:02 +0200 Subject: [PATCH] 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. :^) --- Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp index a3ea6729ab..5fbc84e34b 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp @@ -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); } }