aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/create.rs
diff options
context:
space:
mode:
authorNolen Scaife <nolen@scaife.org>2025-02-08 15:22:44 -0700
committerGitHub <noreply@github.com>2025-02-08 22:22:44 +0000
commitdf73d0293234a1b3cc037ca13b1538a9f83b8d0a (patch)
treea7c5dcd85a4c38a7ae8d81068d4d9ff20fb6ca5f /components/script/dom/create.rs
parent827012fc08a178fbf812d7641fd396c56420c4a1 (diff)
downloadservo-df73d0293234a1b3cc037ca13b1538a9f83b8d0a.tar.gz
servo-df73d0293234a1b3cc037ca13b1538a9f83b8d0a.zip
make report_pending_exception safe and adjust callers (#35351)
Signed-off-by: Nolen Scaife <nolen@scaife.org>
Diffstat (limited to 'components/script/dom/create.rs')
-rw-r--r--components/script/dom/create.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/components/script/dom/create.rs b/components/script/dom/create.rs
index 5a9377985e4..cece344207d 100644
--- a/components/script/dom/create.rs
+++ b/components/script/dom/create.rs
@@ -187,11 +187,10 @@ fn create_html_element(
// Substep 1. Report exception for definition’s constructor’s corresponding
// JavaScript object’s associated realm’s 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,