From a8997e9638db836d7a759870b1adaed1b941c578 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Mon, 29 Sep 2014 05:11:00 +0530 Subject: [PATCH] Remove Untraceable from treewalker.rs --- components/script/dom/bindings/trace.rs | 7 +++++++ components/script/dom/treewalker.rs | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index fc5f8b6d4a6..e404f17588d 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -254,3 +254,10 @@ impl JSTraceable for Receiver { // Do nothing } } + +impl JSTraceable for fn(A) -> B { + #[inline] + fn trace(&self, _: *mut JSTracer) { + // Do nothing + } +} diff --git a/components/script/dom/treewalker.rs b/components/script/dom/treewalker.rs index 26124170289..7bdb4403b1a 100644 --- a/components/script/dom/treewalker.rs +++ b/components/script/dom/treewalker.rs @@ -14,7 +14,6 @@ use dom::bindings::codegen::Bindings::NodeFilterBinding::NodeFilter; use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::global::Window; use dom::bindings::js::{JS, JSRef, OptionalRootable, Temporary}; -use dom::bindings::trace::Untraceable; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::document::Document; use dom::node::{Node, NodeHelpers}; @@ -334,7 +333,7 @@ impl<'a> PrivateTreeWalkerHelpers<'a> for JSRef<'a, TreeWalker> { // "6. Return result." match self.filter { FilterNone => Ok(NodeFilterConstants::FILTER_ACCEPT), - FilterNative(f) => Ok((*f)(node)), + FilterNative(f) => Ok((f)(node)), FilterJS(callback) => callback.AcceptNode_(self, node, RethrowExceptions) } } @@ -554,7 +553,7 @@ impl<'a> Iterator> for JSRef<'a, TreeWalker> { #[jstraceable] pub enum Filter { FilterNone, - FilterNative(Untraceable) -> u16>), + FilterNative(fn (node: JSRef) -> u16), FilterJS(NodeFilter) }