mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Rename a couple of Promise methods
This commit is contained in:
parent
581f0bf09a
commit
658dc8a501
3 changed files with 13 additions and 9 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue