From 56a8237ef4b9cfcf6081c61349e2994a57d2093c Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 30 May 2023 10:32:33 -0400 Subject: Throw type error when calling DOM constructor without new. --- components/script/dom/bindings/utils.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'components/script/dom/bindings/utils.rs') diff --git a/components/script/dom/bindings/utils.rs b/components/script/dom/bindings/utils.rs index 87748da1ec4..7557f4a3fa8 100644 --- a/components/script/dom/bindings/utils.rs +++ b/components/script/dom/bindings/utils.rs @@ -637,3 +637,7 @@ impl AsCCharPtrPtr for [u8] { self as *const [u8] as *const c_char } } + +pub unsafe fn callargs_is_constructing(args: &CallArgs) -> bool { + (*args.argv_.offset(-1)).is_magic() +} -- cgit v1.2.3