mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
script: make Error::to_jsval safe (#35411)
Signed-off-by: Stephen Muss <stephenmuss@gmail.com>
This commit is contained in:
parent
8486e585f5
commit
cb588bab6a
8 changed files with 41 additions and 64 deletions
|
@ -219,14 +219,11 @@ impl Promise {
|
|||
self.reject(cx, v.handle());
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
pub(crate) fn reject_error(&self, error: Error) {
|
||||
let cx = GlobalScope::get_cx();
|
||||
let _ac = enter_realm(self);
|
||||
rooted!(in(*cx) let mut v = UndefinedValue());
|
||||
unsafe {
|
||||
error.to_jsval(*cx, &self.global(), v.handle_mut());
|
||||
}
|
||||
error.to_jsval(cx, &self.global(), v.handle_mut());
|
||||
self.reject(cx, v.handle());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue