mirror of
https://github.com/servo/servo.git
synced 2025-08-02 12:10:29 +01:00
make report_pending_exception safe and adjust callers (#35351)
Signed-off-by: Nolen Scaife <nolen@scaife.org>
This commit is contained in:
parent
827012fc08
commit
df73d02932
8 changed files with 42 additions and 44 deletions
|
@ -278,12 +278,12 @@ impl Drop for CallSetup {
|
|||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
LeaveRealm(*self.cx, self.old_realm);
|
||||
if self.handling == ExceptionHandling::Report {
|
||||
let ar = enter_realm(&*self.exception_global);
|
||||
report_pending_exception(*self.cx, true, InRealm::Entered(&ar), CanGc::note());
|
||||
}
|
||||
drop(self.incumbent_script.take());
|
||||
drop(self.entry_script.take().unwrap());
|
||||
}
|
||||
if self.handling == ExceptionHandling::Report {
|
||||
let ar = enter_realm(&*self.exception_global);
|
||||
report_pending_exception(self.cx, true, InRealm::Entered(&ar), CanGc::note());
|
||||
}
|
||||
drop(self.incumbent_script.take());
|
||||
drop(self.entry_script.take().unwrap());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue