diff options
author | Rohan Prinja <rohan.prinja@gmail.com> | 2015-10-21 01:40:19 +0900 |
---|---|---|
committer | Rohan Prinja <rohan.prinja@gmail.com> | 2015-10-21 01:40:19 +0900 |
commit | ab70c8c9421f09df9f705628d405de3109dcefd3 (patch) | |
tree | deb9ccf639cddf61a73a5d0b0522e5d36d592404 /components/script/dom/bindings/js.rs | |
parent | 36d5c0b2fbe94065b068c6aad72ad7797a157926 (diff) | |
download | servo-ab70c8c9421f09df9f705628d405de3109dcefd3.tar.gz servo-ab70c8c9421f09df9f705628d405de3109dcefd3.zip |
implement PartialEq for MutHeap<JS<T>> and MutNullableHeap<JS<T>>
Diffstat (limited to 'components/script/dom/bindings/js.rs')
-rw-r--r-- | components/script/dom/bindings/js.rs | 12 |
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 |