aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/trace.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/bindings/trace.rs')
-rw-r--r--components/script/dom/bindings/trace.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs
index 4fecf083737..ae1a9e6e3b4 100644
--- a/components/script/dom/bindings/trace.rs
+++ b/components/script/dom/bindings/trace.rs
@@ -61,6 +61,7 @@ use html5ever::{LocalName, Namespace, Prefix, QualName};
use http::header::HeaderMap;
use hyper::Method;
use hyper::StatusCode;
+use indexmap::IndexMap;
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use js::glue::{CallObjectTracer, CallValueTracer};
use js::jsapi::{GCTraceKindToAscii, Heap, JSObject, JSTracer, TraceKind};
@@ -356,6 +357,21 @@ unsafe impl<K: Ord + JSTraceable, V: JSTraceable> JSTraceable for BTreeMap<K, V>
}
}
+unsafe impl<K, V, S> JSTraceable for IndexMap<K, V, S>
+where
+ K: Hash + Eq + JSTraceable,
+ V: JSTraceable,
+ S: BuildHasher,
+{
+ #[inline]
+ unsafe fn trace(&self, trc: *mut JSTracer) {
+ for (k, v) in &*self {
+ k.trace(trc);
+ v.trace(trc);
+ }
+ }
+}
+
unsafe impl<A: JSTraceable, B: JSTraceable> JSTraceable for (A, B) {
#[inline]
unsafe fn trace(&self, trc: *mut JSTracer) {