[WTF] Provide default constructors for HashMap iterators
Created attachment 90625 [details] patch
Comment on attachment 90625 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=90625&action=review > Source/JavaScriptCore/wtf/HashTable.h:1123 > + HashTableConstIteratorAdapter() {} Do we need to initialize m_impl to anything (like null) or does it do that itself?
+mjs for WTF foo.
(In reply to comment #2) > (From update of attachment 90625 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=90625&action=review > > > Source/JavaScriptCore/wtf/HashTable.h:1123 > > + HashTableConstIteratorAdapter() {} > > Do we need to initialize m_impl to anything (like null) or does it do that itself? Unlike the adapter it has a default constructor. So I don't think it should be initialized.
Why are these needed? What will they be used for?
(In reply to comment #5) > Why are these needed? What will they be used for? Right now you can't declare a variable or class field of type HashMap::iterator without immediately initializing it. This is inconsistent with wtf::Vector and STL iterators. My specific intended usage for them is to implement a lightweight iterator over EventTarget's listeners. EventTarget has a map of vectors. So the listener iterator simply combines a map iterator and an index. The problem is that the listener map is optional and the map iterator can't be initialized when it's NULL without using some dummy map.
I asked Vitaly to post this as a separate patch because the folks who would review this patch might not be the same folks who would be interested in reviewing the rest of his change.
Comment on attachment 90625 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=90625&action=review > Source/JavaScriptCore/ChangeLog:7 > + I would add some more explanation here about why you're making this change (i.e., that you plan to use it in another patch shortly).
M Source/JavaScriptCore/ChangeLog M Source/JavaScriptCore/wtf/HashTable.h Committed r84687