diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-22 14:08:25 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-22 14:18:32 +0200 |
commit | 386973efeb574ebf99cd8a4f75d0b2856be63bf7 (patch) | |
tree | f544ad83b706b2e767db75d1e92363e7260ef454 | |
parent | a69c5da2083bdb6e80ad5f89ff44a4288b6a7024 (diff) | |
download | servo-386973efeb574ebf99cd8a4f75d0b2856be63bf7.tar.gz servo-386973efeb574ebf99cd8a4f75d0b2856be63bf7.zip |
Make Promise::new_resolved unsafe
-rw-r--r-- | components/script/dom/promise.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/components/script/dom/promise.rs b/components/script/dom/promise.rs index 45aff52f8fe..51b7c1763af 100644 --- a/components/script/dom/promise.rs +++ b/components/script/dom/promise.rs @@ -112,17 +112,15 @@ impl Promise { } #[allow(unrooted_must_root, unsafe_code)] - pub fn new_resolved( + pub unsafe fn new_resolved( global: &GlobalScope, cx: *mut JSContext, value: HandleValue, ) -> Fallible<Rc<Promise>> { let _ac = JSAutoCompartment::new(cx, global.reflector().get_jsobject().get()); - rooted!(in(cx) let p = unsafe { CallOriginalPromiseResolve(cx, value) }); + rooted!(in(cx) let p = CallOriginalPromiseResolve(cx, value)); assert!(!p.handle().is_null()); - unsafe { - Ok(Promise::new_with_js_promise(p.handle(), cx)) - } + Ok(Promise::new_with_js_promise(p.handle(), cx)) } #[allow(unrooted_must_root, unsafe_code)] |