mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -101,13 +101,11 @@ pub(crate) trait ReadableStreamGenericReader {
|
|||
// Otherwise, set reader.[[closedPromise]] to a promise rejected with a TypeError exception.
|
||||
let cx = GlobalScope::get_cx();
|
||||
rooted!(in(*cx) let mut error = UndefinedValue());
|
||||
unsafe {
|
||||
Error::Type("Cannot release lock due to stream state.".to_owned()).to_jsval(
|
||||
*cx,
|
||||
&stream.global(),
|
||||
error.handle_mut(),
|
||||
)
|
||||
};
|
||||
Error::Type("Cannot release lock due to stream state.".to_owned()).to_jsval(
|
||||
cx,
|
||||
&stream.global(),
|
||||
error.handle_mut(),
|
||||
);
|
||||
|
||||
self.set_closed_promise(
|
||||
Promise::new_rejected(&stream.global(), cx, error.handle()).unwrap(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue