mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03: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());
|
||||
unsafe {
|
||||
val.to_jsval(cx, v.handle_mut());
|
||||
self.resolve(cx, v.handle());
|
||||
}
|
||||
self.resolve(cx, v.handle());
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root, unsafe_code)]
|
||||
pub fn resolve(&self, cx: *mut JSContext, value: HandleValue) {
|
||||
unsafe {
|
||||
if !ResolvePromise(cx, self.promise_obj(), value) {
|
||||
JS_ClearPendingException(cx);
|
||||
}
|
||||
pub unsafe fn resolve(&self, cx: *mut JSContext, value: HandleValue) {
|
||||
if !ResolvePromise(cx, self.promise_obj(), value) {
|
||||
JS_ClearPendingException(cx);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue