diff --git a/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp b/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp index d216b7e5d6..dfb4fffdbb 100644 --- a/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp @@ -21,7 +21,10 @@ void MapConstructor::initialize(GlobalObject& global_object) { auto& vm = this->vm(); NativeFunction::initialize(global_object); + + // 24.1.2.1 Map.prototype, https://tc39.es/ecma262/#sec-map.prototype define_property(vm.names.prototype, global_object.map_prototype(), 0); + define_property(vm.names.length, Value(0), Attribute::Configurable); define_native_accessor(vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); @@ -31,6 +34,7 @@ MapConstructor::~MapConstructor() { } +// 24.1.1.1 Map ( [ iterable ] ), https://tc39.es/ecma262/#sec-map-iterable Value MapConstructor::call() { auto& vm = this->vm(); diff --git a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp index 274c0f3751..927b3de61a 100644 --- a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp @@ -31,6 +31,7 @@ MapIteratorPrototype::~MapIteratorPrototype() { } +// 24.1.5.2.1 %MapIteratorPrototype%.next ( ), https://tc39.es/ecma262/#sec-%mapiteratorprototype%.next JS_DEFINE_NATIVE_FUNCTION(MapIteratorPrototype::next) { auto this_value = vm.this_value(global_object);