mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibJS: Make Completion.[[Value]] non-optional
Instead, just use js_undefined() whenever the [[Value]] field is unused. This avoids a whole bunch of presence checks.
This commit is contained in:
parent
c0600c4353
commit
de424d6879
Notes:
github-actions[bot]
2025-04-05 09:21:48 +00:00
Author: https://github.com/awesomekling
Commit: de424d6879
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4232
65 changed files with 225 additions and 250 deletions
|
@ -282,7 +282,7 @@ ThrowCompletionOr<GC::Ref<Object>> PromiseConstructor::construct(FunctionObject&
|
|||
// 10. If completion is an abrupt completion, then
|
||||
if (completion.is_error()) {
|
||||
// a. Perform ? Call(resolvingFunctions.[[Reject]], undefined, « completion.[[Value]] »).
|
||||
TRY(JS::call(vm, *reject_function, js_undefined(), *completion.release_error().value()));
|
||||
TRY(JS::call(vm, *reject_function, js_undefined(), completion.release_error().value()));
|
||||
}
|
||||
|
||||
// 11. Return promise.
|
||||
|
@ -484,7 +484,7 @@ JS_DEFINE_NATIVE_FUNCTION(PromiseConstructor::try_)
|
|||
// 5. If status is an abrupt completion, then
|
||||
if (status.is_throw_completion()) {
|
||||
// a. Perform ? Call(promiseCapability.[[Reject]], undefined, « status.[[Value]] »).
|
||||
TRY(JS::call(vm, *promise_capability->reject(), js_undefined(), *status.throw_completion().value()));
|
||||
TRY(JS::call(vm, *promise_capability->reject(), js_undefined(), status.throw_completion().value()));
|
||||
}
|
||||
// 6. Else,
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue