mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
bindings: Move string-related bindings code to script_bindings. (#35172)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
1188d2b2e7
commit
a6218b42ea
12 changed files with 688 additions and 601 deletions
24
components/script_bindings/trace.rs
Normal file
24
components/script_bindings/trace.rs
Normal file
|
@ -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);
|
Loading…
Add table
Add a link
Reference in a new issue