aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/dom/bindings/js.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs
index 1ef1d93a86d..7c44555924d 100644
--- a/components/script/dom/bindings/js.rs
+++ b/components/script/dom/bindings/js.rs
@@ -260,6 +260,12 @@ impl<T: HeapGCValue> HeapSizeOf for MutHeap<T> {
}
}
+impl<T: Reflectable> PartialEq for MutHeap<JS<T>> {
+ fn eq(&self, other: &MutHeap<JS<T>>) -> bool {
+ self.get().eq(&other.get())
+ }
+}
+
/// A holder that provides interior mutability for GC-managed values such as
/// `JS<T>`, with nullability represented by an enclosing Option wrapper.
/// Essentially a `Cell<Option<JS<T>>>`, but safer.
@@ -337,6 +343,12 @@ impl<T: HeapGCValue> HeapSizeOf for MutNullableHeap<T> {
}
}
+impl<T: Reflectable> PartialEq for MutNullableHeap<JS<T>> {
+ fn eq(&self, other: &MutNullableHeap<JS<T>>) -> bool {
+ self.get().eq(&other.get())
+ }
+}
+
impl<T: Reflectable> LayoutJS<T> {
/// Returns an unsafe pointer to the interior of this JS object. This is
/// the only method that be safely accessed from layout. (The fact that