diff --git a/src/components/script/dom/bindings/js.rs b/src/components/script/dom/bindings/js.rs index 805adcf1ff3..89898a35ba0 100644 --- a/src/components/script/dom/bindings/js.rs +++ b/src/components/script/dom/bindings/js.rs @@ -166,6 +166,14 @@ impl JS { } } +impl, U: Reflectable> JS { + pub fn from_rooted(root: T) -> JS { + unsafe { + root.get_js() + } + } +} + //XXXjdm This is disappointing. This only gets called from trace hooks, in theory, // so it's safe to assume that self is rooted and thereby safe to access. impl Reflectable for JS {