diff options
author | Linus Groh <mail@linusgroh.de> | 2022-12-06 22:17:27 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-12-07 16:43:06 +0000 |
commit | 525f22d018cb5f9c4c6ea0e2b5544fdcab8da483 (patch) | |
tree | 2488bac4fab4acec0d258c9bac2338bc95ee6398 /Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp | |
parent | 5db38d7ba1a8caa5138dd65cc06be0c0e5a568e4 (diff) | |
download | serenity-525f22d018cb5f9c4c6ea0e2b5544fdcab8da483.zip |
LibJS: Replace standalone js_string() with PrimitiveString::create()
Note that js_rope_string() has been folded into this, the old name was
misleading - it would not always create a rope string, only if both
sides are not empty strings. Use a three-argument create() overload
instead.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp index 9cb1fa540e..4a3b735c82 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp @@ -139,7 +139,7 @@ static ThrowCompletionOr<Value> perform_promise_all(VM& vm, Iterator& iterator_r // p. Set onFulfilled.[[Capability]] to resultCapability. // q. Set onFulfilled.[[RemainingElements]] to remainingElementsCount. auto* on_fulfilled = PromiseAllResolveElementFunction::create(realm, index, values, result_capability, remaining_elements_count); - on_fulfilled->define_direct_property(vm.names.name, js_string(vm, DeprecatedString::empty()), Attribute::Configurable); + on_fulfilled->define_direct_property(vm.names.name, PrimitiveString::create(vm, DeprecatedString::empty()), Attribute::Configurable); // s. Perform ? Invoke(nextPromise, "then", « onFulfilled, resultCapability.[[Reject]] »). return next_promise.invoke(vm, vm.names.then, on_fulfilled, result_capability.reject()); @@ -171,7 +171,7 @@ static ThrowCompletionOr<Value> perform_promise_all_settled(VM& vm, Iterator& it // q. Set onFulfilled.[[Capability]] to resultCapability. // r. Set onFulfilled.[[RemainingElements]] to remainingElementsCount. auto* on_fulfilled = PromiseAllSettledResolveElementFunction::create(realm, index, values, result_capability, remaining_elements_count); - on_fulfilled->define_direct_property(vm.names.name, js_string(vm, DeprecatedString::empty()), Attribute::Configurable); + on_fulfilled->define_direct_property(vm.names.name, PrimitiveString::create(vm, DeprecatedString::empty()), Attribute::Configurable); // s. Let stepsRejected be the algorithm steps defined in Promise.allSettled Reject Element Functions. // t. Let lengthRejected be the number of non-optional parameters of the function definition in Promise.allSettled Reject Element Functions. @@ -182,7 +182,7 @@ static ThrowCompletionOr<Value> perform_promise_all_settled(VM& vm, Iterator& it // y. Set onRejected.[[Capability]] to resultCapability. // z. Set onRejected.[[RemainingElements]] to remainingElementsCount. auto* on_rejected = PromiseAllSettledRejectElementFunction::create(realm, index, values, result_capability, remaining_elements_count); - on_rejected->define_direct_property(vm.names.name, js_string(vm, DeprecatedString::empty()), Attribute::Configurable); + on_rejected->define_direct_property(vm.names.name, PrimitiveString::create(vm, DeprecatedString::empty()), Attribute::Configurable); // ab. Perform ? Invoke(nextPromise, "then", « onFulfilled, onRejected »). return next_promise.invoke(vm, vm.names.then, on_fulfilled, on_rejected); @@ -217,7 +217,7 @@ static ThrowCompletionOr<Value> perform_promise_any(VM& vm, Iterator& iterator_r // p. Set onRejected.[[Capability]] to resultCapability. // q. Set onRejected.[[RemainingElements]] to remainingElementsCount. auto* on_rejected = PromiseAnyRejectElementFunction::create(realm, index, errors, result_capability, remaining_elements_count); - on_rejected->define_direct_property(vm.names.name, js_string(vm, DeprecatedString::empty()), Attribute::Configurable); + on_rejected->define_direct_property(vm.names.name, PrimitiveString::create(vm, DeprecatedString::empty()), Attribute::Configurable); // s. Perform ? Invoke(nextPromise, "then", « resultCapability.[[Resolve]], onRejected »). return next_promise.invoke(vm, vm.names.then, result_capability.resolve(), on_rejected); |