diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index 837dec61f5a..e29e64a3e23 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -33,7 +33,9 @@ use js::jsapi::{JSObject, JSTracer, JS_CallTracer, JSTRACE_OBJECT}; use js::jsval::JSVal; use libc; +use url::Url; use std::mem; +use std::num; use std::cell::{Cell, RefCell}; use serialize::{Encodable, Encoder}; diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs index c9d7550b7ea..dba18808c65 100644 --- a/components/script/dom/macros.rs +++ b/components/script/dom/macros.rs @@ -42,3 +42,19 @@ macro_rules! make_uint_getter( } ); ) + + +/// For use on non-jsmanaged types +/// Use #[jstraceable] on JS managed types +macro_rules! untraceable( + ($($ty:ident),+) => ( + $( + impl JSTraceable for $ty { + #[inline] + fn trace(&self, _: *mut JSTracer) { + // Do nothing + } + } + )+ + ); +) \ No newline at end of file diff --git a/components/script/lib.rs b/components/script/lib.rs index 667bfb0e413..ab31bd5858e 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -45,7 +45,11 @@ extern crate uuid; pub mod cors; /// The implementation of the DOM. +#[macro_escape] pub mod dom { + #[macro_escape] + pub mod macros; + /// The code to expose the DOM to JavaScript through IDL bindings. pub mod bindings { pub mod global; @@ -72,7 +76,6 @@ pub mod dom { #[path="bindings/codegen/InterfaceTypes.rs"] pub mod types; - pub mod macros; pub mod attr; pub mod blob;