mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
LibJS: Convert NativeFunction::create() to NonnullGCPtr
This commit is contained in:
parent
9846d23c79
commit
b42e293ddd
Notes:
sideshowbarker
2024-07-17 03:18:29 +09:00
Author: https://github.com/linusg
Commit: b42e293ddd
Pull-request: https://github.com/SerenityOS/serenity/pull/16479
Reviewed-by: https://github.com/davidot ✅
13 changed files with 23 additions and 23 deletions
|
@ -62,7 +62,7 @@ ThrowCompletionOr<Value> await(VM& vm, Value value)
|
|||
};
|
||||
|
||||
// 4. Let onFulfilled be CreateBuiltinFunction(fulfilledClosure, 1, "", « »).
|
||||
auto* on_fulfilled = NativeFunction::create(realm, move(fulfilled_closure), 1, "");
|
||||
auto on_fulfilled = NativeFunction::create(realm, move(fulfilled_closure), 1, "");
|
||||
|
||||
// 5. Let rejectedClosure be a new Abstract Closure with parameters (reason) that captures asyncContext and performs the following steps when called:
|
||||
auto rejected_closure = [&success, &result](VM& vm) -> ThrowCompletionOr<Value> {
|
||||
|
@ -86,7 +86,7 @@ ThrowCompletionOr<Value> await(VM& vm, Value value)
|
|||
};
|
||||
|
||||
// 6. Let onRejected be CreateBuiltinFunction(rejectedClosure, 1, "", « »).
|
||||
auto* on_rejected = NativeFunction::create(realm, move(rejected_closure), 1, "");
|
||||
auto on_rejected = NativeFunction::create(realm, move(rejected_closure), 1, "");
|
||||
|
||||
// 7. Perform PerformPromiseThen(promise, onFulfilled, onRejected).
|
||||
auto* promise = verify_cast<Promise>(promise_object);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue