mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Make Promise::resolve unsafe
This commit is contained in:
parent
5994e40070
commit
2400731bfc
1 changed files with 4 additions and 6 deletions
|
@ -148,16 +148,14 @@ impl Promise {
|
||||||
rooted!(in(cx) let mut v = UndefinedValue());
|
rooted!(in(cx) let mut v = UndefinedValue());
|
||||||
unsafe {
|
unsafe {
|
||||||
val.to_jsval(cx, v.handle_mut());
|
val.to_jsval(cx, v.handle_mut());
|
||||||
|
self.resolve(cx, v.handle());
|
||||||
}
|
}
|
||||||
self.resolve(cx, v.handle());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root, unsafe_code)]
|
#[allow(unrooted_must_root, unsafe_code)]
|
||||||
pub fn resolve(&self, cx: *mut JSContext, value: HandleValue) {
|
pub unsafe fn resolve(&self, cx: *mut JSContext, value: HandleValue) {
|
||||||
unsafe {
|
if !ResolvePromise(cx, self.promise_obj(), value) {
|
||||||
if !ResolvePromise(cx, self.promise_obj(), value) {
|
JS_ClearPendingException(cx);
|
||||||
JS_ClearPendingException(cx);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue