diff --git a/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp b/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp index 9c2f1e93c2..69a31d6477 100644 --- a/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp @@ -105,7 +105,7 @@ JS_DEFINE_NATIVE_FUNCTION(PromisePrototype::finally) }); return promise->invoke(vm.names.then.as_string(), value_thunk); }); - then_finally_function->define_property(vm.names.length, Value(1)); + then_finally_function->define_property(vm.names.length, Value(1), Attribute::Configurable); // 27.2.5.3.2 Catch Finally Functions, https://tc39.es/ecma262/#sec-catchfinallyfunctions auto* catch_finally_function = NativeFunction::create(global_object, "", [constructor_handle = make_handle(constructor), on_finally_handle = make_handle(&on_finally.as_function())](auto& vm, auto& global_object) -> Value { @@ -124,7 +124,7 @@ JS_DEFINE_NATIVE_FUNCTION(PromisePrototype::finally) }); return promise->invoke(vm.names.then.as_string(), thrower); }); - catch_finally_function->define_property(vm.names.length, Value(1)); + catch_finally_function->define_property(vm.names.length, Value(1), Attribute::Configurable); then_finally = Value(then_finally_function); catch_finally = Value(catch_finally_function); diff --git a/Userland/Libraries/LibJS/Runtime/PromiseReaction.cpp b/Userland/Libraries/LibJS/Runtime/PromiseReaction.cpp index 36f2efc64e..1105291875 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseReaction.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseReaction.cpp @@ -25,6 +25,7 @@ PromiseCapability new_promise_capability(GlobalObject& global_object, Value cons Value reject { js_undefined() }; } promise_capability_functions; + // 27.2.1.5.1 GetCapabilitiesExecutor Functions, https://tc39.es/ecma262/#sec-getcapabilitiesexecutor-functions auto* executor = NativeFunction::create(global_object, "", [&promise_capability_functions](auto& vm, auto& global_object) -> Value { auto resolve = vm.argument(0); auto reject = vm.argument(1); @@ -41,7 +42,7 @@ PromiseCapability new_promise_capability(GlobalObject& global_object, Value cons promise_capability_functions.reject = reject; return js_undefined(); }); - executor->define_property(vm.names.length, Value(2)); + executor->define_property(vm.names.length, Value(2), Attribute::Configurable); MarkedValueList arguments(vm.heap()); arguments.append(executor); diff --git a/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.cpp b/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.cpp index 9337d8ff11..13c9a18357 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.cpp @@ -27,7 +27,7 @@ PromiseResolvingFunction::PromiseResolvingFunction(Promise& promise, AlreadyReso void PromiseResolvingFunction::initialize(GlobalObject& global_object) { Base::initialize(global_object); - define_property(vm().names.length, Value(1)); + define_property(vm().names.length, Value(1), Attribute::Configurable); } Value PromiseResolvingFunction::call() diff --git a/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp index d948ed5bbf..4f580bb834 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp @@ -79,7 +79,7 @@ JS_DEFINE_NATIVE_FUNCTION(ProxyConstructor::revocable) proxy.revoke(); return js_undefined(); }); - revoker->define_property(vm.names.length, Value(0)); + revoker->define_property(vm.names.length, Value(0), Attribute::Configurable); auto* result = Object::create(global_object, global_object.object_prototype()); result->define_property(vm.names.proxy, proxy);