diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-21 15:35:04 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-21 15:35:04 +0200 |
commit | 658dc8a5013973ceff3c91291d5536043b2e8e58 (patch) | |
tree | c9406958210d0848914239d4b23add124b416c61 /components/script/dom/promise.rs | |
parent | 581f0bf09a8ec35dadd5de207777f79138255e1a (diff) | |
download | servo-658dc8a5013973ceff3c91291d5536043b2e8e58.tar.gz servo-658dc8a5013973ceff3c91291d5536043b2e8e58.zip |
Rename a couple of Promise methods
Diffstat (limited to 'components/script/dom/promise.rs')
-rw-r--r-- | components/script/dom/promise.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/components/script/dom/promise.rs b/components/script/dom/promise.rs index 5595e999c9d..f850ef10172 100644 --- a/components/script/dom/promise.rs +++ b/components/script/dom/promise.rs @@ -114,9 +114,11 @@ impl Promise { } #[allow(unrooted_must_root, unsafe_code)] - pub fn Resolve(global: &GlobalScope, - cx: *mut JSContext, - value: HandleValue) -> Fallible<Rc<Promise>> { + pub 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) }); assert!(!p.handle().is_null()); @@ -126,9 +128,11 @@ impl Promise { } #[allow(unrooted_must_root, unsafe_code)] - pub fn Reject(global: &GlobalScope, - cx: *mut JSContext, - value: HandleValue) -> Fallible<Rc<Promise>> { + pub fn new_rejected( + 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 { CallOriginalPromiseReject(cx, value) }); assert!(!p.handle().is_null()); |