mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibJS: Replace PropertyKey(char[]) with PropertyKey(FlyString)
...and deal with the fallout.
This commit is contained in:
parent
d7908dbff5
commit
53da8893ac
Notes:
github-actions[bot]
2025-03-24 22:28:43 +00:00
Author: https://github.com/awesomekling
Commit: 53da8893ac
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4067
Reviewed-by: https://github.com/trflynn89
55 changed files with 254 additions and 251 deletions
|
@ -112,7 +112,7 @@ GC::Ref<Promise> react_to_promise(Promise const& promise, GC::Ptr<ReactionSteps>
|
|||
};
|
||||
|
||||
// 2. Let onFulfilled be CreateBuiltinFunction(onFulfilledSteps, « »):
|
||||
auto on_fulfilled = JS::NativeFunction::create(realm, move(on_fulfilled_steps), 1, "");
|
||||
auto on_fulfilled = JS::NativeFunction::create(realm, move(on_fulfilled_steps), 1);
|
||||
|
||||
// 3. Let onRejectedSteps be the following steps given argument R:
|
||||
auto on_rejected_steps = [&realm, on_rejected_callback = move(on_rejected_callback)](JS::VM& vm) -> JS::ThrowCompletionOr<JS::Value> {
|
||||
|
@ -129,7 +129,7 @@ GC::Ref<Promise> react_to_promise(Promise const& promise, GC::Ptr<ReactionSteps>
|
|||
};
|
||||
|
||||
// 4. Let onRejected be CreateBuiltinFunction(onRejectedSteps, « »):
|
||||
auto on_rejected = JS::NativeFunction::create(realm, move(on_rejected_steps), 1, "");
|
||||
auto on_rejected = JS::NativeFunction::create(realm, move(on_rejected_steps), 1);
|
||||
|
||||
// 5. Let constructor be promise.[[Promise]].[[Realm]].[[Intrinsics]].[[%Promise%]].
|
||||
auto constructor = realm.intrinsics().promise_constructor();
|
||||
|
@ -232,7 +232,7 @@ void wait_for_all(JS::Realm& realm, Vector<GC::Ref<Promise>> const& promises, Fu
|
|||
};
|
||||
|
||||
// 4. Let rejectionHandler be CreateBuiltinFunction(rejectionHandlerSteps, « »):
|
||||
auto rejection_handler = JS::NativeFunction::create(realm, move(rejection_handler_steps), 1, "");
|
||||
auto rejection_handler = JS::NativeFunction::create(realm, move(rejection_handler_steps), 1);
|
||||
|
||||
// 5. Let total be promises’s size.
|
||||
auto total = promises.size();
|
||||
|
@ -280,7 +280,7 @@ void wait_for_all(JS::Realm& realm, Vector<GC::Ref<Promise>> const& promises, Fu
|
|||
};
|
||||
|
||||
// 3. Let fulfillmentHandler be CreateBuiltinFunction(fulfillmentHandler, « »):
|
||||
auto fulfillment_handler = JS::NativeFunction::create(realm, move(fulfillment_handler_steps), 1, "");
|
||||
auto fulfillment_handler = JS::NativeFunction::create(realm, move(fulfillment_handler_steps), 1);
|
||||
|
||||
// 4. Perform PerformPromiseThen(promise, fulfillmentHandler, rejectionHandler).
|
||||
static_cast<JS::Promise&>(*promise->promise()).perform_then(fulfillment_handler, rejection_handler, nullptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue