mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -786,7 +786,6 @@ impl CustomElementDefinition {
|
|||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#concept-upgrade-an-element>
|
||||
#[allow(unsafe_code)]
|
||||
pub(crate) fn upgrade_element(
|
||||
definition: Rc<CustomElementDefinition>,
|
||||
element: &Element,
|
||||
|
@ -848,11 +847,9 @@ pub(crate) fn upgrade_element(
|
|||
// Step 8.exception.3
|
||||
let global = GlobalScope::current().expect("No current global");
|
||||
let cx = GlobalScope::get_cx();
|
||||
unsafe {
|
||||
let ar = enter_realm(&*global);
|
||||
throw_dom_exception(cx, &global, error);
|
||||
report_pending_exception(*cx, true, InRealm::Entered(&ar), can_gc);
|
||||
}
|
||||
let ar = enter_realm(&*global);
|
||||
throw_dom_exception(cx, &global, error);
|
||||
report_pending_exception(cx, true, InRealm::Entered(&ar), can_gc);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue