aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/utils.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2023-05-30 10:32:33 -0400
committerJosh Matthews <josh@joshmatthews.net>2023-05-30 10:32:33 -0400
commit56a8237ef4b9cfcf6081c61349e2994a57d2093c (patch)
tree1b53b0b5b5f69bf6f805732834192befc0239fc8 /components/script/dom/bindings/utils.rs
parent43f5b4899bd15569bd9dfb4b3bd3f10307cb893c (diff)
downloadservo-56a8237ef4b9cfcf6081c61349e2994a57d2093c.tar.gz
servo-56a8237ef4b9cfcf6081c61349e2994a57d2093c.zip
Throw type error when calling DOM constructor without new.
Diffstat (limited to 'components/script/dom/bindings/utils.rs')
-rw-r--r--components/script/dom/bindings/utils.rs4
1 files changed, 4 insertions, 0 deletions
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()
+}