make report_pending_exception safe and adjust callers (#35351)

Signed-off-by: Nolen Scaife <nolen@scaife.org>
This commit is contained in:
Nolen Scaife 2025-02-08 15:22:44 -07:00 committed by GitHub
parent 827012fc08
commit df73d02932
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 42 additions and 44 deletions

View file

@ -187,11 +187,10 @@ fn create_html_element(
// Substep 1. Report exception for definitions constructors corresponding
// JavaScript objects associated realms global object.
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);
// Substep 2. Set result to a new element that implements the HTMLUnknownElement interface,
// with no attributes, namespace set to the HTML namespace, namespace prefix set to prefix,