diff options
author | Josh Matthews <josh@joshmatthews.net> | 2023-05-30 10:32:33 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2023-05-30 10:32:33 -0400 |
commit | 56a8237ef4b9cfcf6081c61349e2994a57d2093c (patch) | |
tree | 1b53b0b5b5f69bf6f805732834192befc0239fc8 /components/script/dom/bindings/utils.rs | |
parent | 43f5b4899bd15569bd9dfb4b3bd3f10307cb893c (diff) | |
download | servo-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.rs | 4 |
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() +} |