summaryrefslogtreecommitdiffstats
path: root/dom/bindings/Record.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/bindings/Record.h')
-rw-r--r--dom/bindings/Record.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/dom/bindings/Record.h b/dom/bindings/Record.h
index 277f40f..c3827af 100644
--- a/dom/bindings/Record.h
+++ b/dom/bindings/Record.h
@@ -35,6 +35,21 @@ class RecordEntry {
ValueType mValue;
};
+// Specialize for a JSObject* ValueType and initialize it on construction, so we
+// don't need to worry about un-initialized JSObject* floating around.
+template <typename KeyType>
+class RecordEntry<KeyType, JSObject*> {
+ public:
+ RecordEntry() : mValue(nullptr) {}
+
+ // Move constructor so we can do Records of Records.
+ RecordEntry(RecordEntry<KeyType, JSObject*>&& aOther)
+ : mKey(std::move(aOther.mKey)), mValue(std::move(aOther.mValue)) {}
+
+ KeyType mKey;
+ JSObject* mValue;
+};
+
} // namespace binding_detail
template <typename KeyType, typename ValueType>