diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index a2ec90033ba..9a4f17b426a 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -35,6 +35,7 @@ use layout_interface::TrustedNodeAddress; use script_task::STACK_ROOTS; use std::cell::UnsafeCell; use std::default::Default; +use std::hash::{Hash, Hasher}; use std::mem; use std::ops::Deref; use std::ptr; @@ -147,12 +148,24 @@ impl PartialEq for JS { } } +impl Eq for JS {} + impl PartialEq for LayoutJS { fn eq(&self, other: &LayoutJS) -> bool { self.ptr == other.ptr } } +impl Eq for LayoutJS {} + +impl Hash for JS { + fn hash(&self, state: &mut H) { self.ptr.hash(state) } +} + +impl Hash for LayoutJS { + fn hash(&self, state: &mut H) { self.ptr.hash(state) } +} + impl Clone for JS { #[inline] #[allow(unrooted_must_root)]