diff options
author | marmeladema <xademax@gmail.com> | 2019-07-27 15:20:51 +0100 |
---|---|---|
committer | marmeladema <xademax@gmail.com> | 2019-08-09 00:02:07 +0100 |
commit | 51e22fbc2617dc0b8ccc98cc2b19c95c83daa652 (patch) | |
tree | e8a009fe6f24a80765c8842a4e1137a77f99c1f5 /components/script/script_runtime.rs | |
parent | 555fa75b2c7f4faa0818e86296a4ea3d5b8e4d42 (diff) | |
download | servo-51e22fbc2617dc0b8ccc98cc2b19c95c83daa652.tar.gz servo-51e22fbc2617dc0b8ccc98cc2b19c95c83daa652.zip |
Remove some usage of unsafe code in Promise
Diffstat (limited to 'components/script/script_runtime.rs')
-rw-r--r-- | components/script/script_runtime.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs index fb94d30fafd..2303b59e4ab 100644 --- a/components/script/script_runtime.rs +++ b/components/script/script_runtime.rs @@ -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) }) |