mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Remove Untraceable from treewalker.rs
This commit is contained in:
parent
df8b8ab24f
commit
a8997e9638
2 changed files with 9 additions and 3 deletions
|
@ -254,3 +254,10 @@ impl<T> JSTraceable for Receiver<T> {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<A,B> JSTraceable for fn(A) -> B {
|
||||||
|
#[inline]
|
||||||
|
fn trace(&self, _: *mut JSTracer) {
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ use dom::bindings::codegen::Bindings::NodeFilterBinding::NodeFilter;
|
||||||
use dom::bindings::error::{ErrorResult, Fallible};
|
use dom::bindings::error::{ErrorResult, Fallible};
|
||||||
use dom::bindings::global::Window;
|
use dom::bindings::global::Window;
|
||||||
use dom::bindings::js::{JS, JSRef, OptionalRootable, Temporary};
|
use dom::bindings::js::{JS, JSRef, OptionalRootable, Temporary};
|
||||||
use dom::bindings::trace::Untraceable;
|
|
||||||
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
|
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
|
||||||
use dom::document::Document;
|
use dom::document::Document;
|
||||||
use dom::node::{Node, NodeHelpers};
|
use dom::node::{Node, NodeHelpers};
|
||||||
|
@ -334,7 +333,7 @@ impl<'a> PrivateTreeWalkerHelpers<'a> for JSRef<'a, TreeWalker> {
|
||||||
// "6. Return result."
|
// "6. Return result."
|
||||||
match self.filter {
|
match self.filter {
|
||||||
FilterNone => Ok(NodeFilterConstants::FILTER_ACCEPT),
|
FilterNone => Ok(NodeFilterConstants::FILTER_ACCEPT),
|
||||||
FilterNative(f) => Ok((*f)(node)),
|
FilterNative(f) => Ok((f)(node)),
|
||||||
FilterJS(callback) => callback.AcceptNode_(self, node, RethrowExceptions)
|
FilterJS(callback) => callback.AcceptNode_(self, node, RethrowExceptions)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -554,7 +553,7 @@ impl<'a> Iterator<JSRef<'a, Node>> for JSRef<'a, TreeWalker> {
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
pub enum Filter {
|
pub enum Filter {
|
||||||
FilterNone,
|
FilterNone,
|
||||||
FilterNative(Untraceable<fn (node: JSRef<Node>) -> u16>),
|
FilterNative(fn (node: JSRef<Node>) -> u16),
|
||||||
FilterJS(NodeFilter)
|
FilterJS(NodeFilter)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue