diff options
Diffstat (limited to 'components/script_bindings/trace.rs')
-rw-r--r-- | components/script_bindings/trace.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/components/script_bindings/trace.rs b/components/script_bindings/trace.rs new file mode 100644 index 00000000000..29317e7fda6 --- /dev/null +++ b/components/script_bindings/trace.rs @@ -0,0 +1,24 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +use crate::str::{DOMString, USVString}; + +/// For use on non-jsmanaged types +/// Use #[derive(JSTraceable)] on JS managed types +macro_rules! unsafe_no_jsmanaged_fields( + ($($ty:ty),+) => ( + $( + #[allow(unsafe_code)] + unsafe impl crate::JSTraceable for $ty { + #[inline] + unsafe fn trace(&self, _: *mut ::js::jsapi::JSTracer) { + // Do nothing + } + } + )+ + ); +); + +unsafe_no_jsmanaged_fields!(DOMString); +unsafe_no_jsmanaged_fields!(USVString); |