LibWeb: Make IDL-generated iterator prototype next() enumerable as well

https://webidl.spec.whatwg.org/#es-iterator-prototype-object

> An iterator prototype object must have a next data property with
> attributes { [[Writable]]: true, [[Enumerable]]: true,
> [[Configurable]]: true } and whose value is a built-in function object
> that behaves as follows:

This makes three more WPT tests pass here, and likely various others:
http://wpt.live/fetch/api/headers/headers-basic.any.html
This commit is contained in:
Linus Groh 2022-07-20 17:43:50 +01:00
parent 69d324d46a
commit dfd62437c4
Notes: sideshowbarker 2024-07-17 08:45:18 +09:00

View file

@ -3774,7 +3774,7 @@ void @prototype_class@::initialize(JS::GlobalObject& global_object)
auto& vm = this->vm();
Object::initialize(global_object);
define_native_function(vm.names.next, next, 0, JS::Attribute::Configurable | JS::Attribute::Writable);
define_native_function(vm.names.next, next, 0, JS::Attribute::Writable | JS::Attribute::Enumerable | JS::Attribute::Configurable);
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Iterator"), JS::Attribute::Configurable);
}