mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Remove some usage of unsafe code in Promise
This commit is contained in:
parent
555fa75b2c
commit
51e22fbc26
4 changed files with 69 additions and 73 deletions
|
@ -201,7 +201,8 @@ unsafe extern "C" fn promise_rejection_tracker(
|
|||
// TODO: Step 2 - If script's muted errors is true, terminate these steps.
|
||||
|
||||
// Step 3.
|
||||
let global = GlobalScope::from_context(cx);
|
||||
let cx = JSContext::from_ptr(cx);
|
||||
let global = GlobalScope::from_context(*cx);
|
||||
|
||||
wrap_panic(
|
||||
AssertUnwindSafe(|| {
|
||||
|
@ -281,7 +282,7 @@ pub fn notify_about_rejected_promises(global: &GlobalScope) {
|
|||
.iter()
|
||||
.map(|promise| {
|
||||
let promise =
|
||||
Promise::new_with_js_promise(Handle::from_raw(promise.handle()), *cx);
|
||||
Promise::new_with_js_promise(Handle::from_raw(promise.handle()), cx);
|
||||
|
||||
TrustedPromise::new(promise)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue