mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 15:28:55 +00:00
LibJS: Convert Promise::create() to NonnullGCPtr
This commit is contained in:
parent
ddc6e139a6
commit
a4d85cd522
Notes:
sideshowbarker
2024-07-17 10:31:19 +09:00
Author: https://github.com/linusg
Commit: a4d85cd522
Pull-request: https://github.com/SerenityOS/serenity/pull/16479
Reviewed-by: https://github.com/davidot ✅
16 changed files with 26 additions and 26 deletions
|
@ -112,7 +112,7 @@ JS::Promise* JavaScriptModuleScript::run(PreventErrorReporting)
|
|||
|
||||
// 2. Check if we can run script with settings. If this returns "do not run", then return a promise resolved with undefined.
|
||||
if (settings.can_run_script() == RunScriptDecision::DoNotRun) {
|
||||
auto* promise = JS::Promise::create(settings.realm());
|
||||
auto promise = JS::Promise::create(settings.realm());
|
||||
promise->fulfill(JS::js_undefined());
|
||||
return promise;
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ JS::Promise* JavaScriptModuleScript::run(PreventErrorReporting)
|
|||
// If Evaluate fails to complete as a result of the user agent aborting the running script,
|
||||
// then set evaluationPromise to a promise rejected with a new "QuotaExceededError" DOMException.
|
||||
if (elevation_promise_or_error.is_error()) {
|
||||
auto* promise = JS::Promise::create(settings_object().realm());
|
||||
auto promise = JS::Promise::create(settings_object().realm());
|
||||
promise->reject(WebIDL::QuotaExceededError::create(settings_object().realm(), "Failed to evaluate module script").ptr());
|
||||
|
||||
evaluation_promise = promise;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue