mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make Promise::reject_error sound
This commit is contained in:
parent
15acd1525e
commit
af2e83f378
19 changed files with 110 additions and 94 deletions
|
@ -173,7 +173,9 @@ impl Promise {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
pub fn reject_error(&self, cx: *mut JSContext, error: Error) {
|
||||
pub fn reject_error(&self, error: Error) {
|
||||
let cx = self.global().get_cx();
|
||||
let _ac = JSAutoCompartment::new(cx, self.reflector().get_jsobject().get());
|
||||
rooted!(in(cx) let mut v = UndefinedValue());
|
||||
unsafe {
|
||||
error.to_jsval(cx, &self.global(), v.handle_mut());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue