Closed
Bug 1365654
Opened 7 years ago
Closed 7 years ago
Hash table Enum objects cannot be returned from a function
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
Details
Attachments
(1 file)
2.29 KB,
patch
|
luke
:
review+
|
Details | Diff | Splinter Review |
Hash table Enum objects have a deleted copy constructor and hence a deleted move constructor, so you can't do this: using Map = js::HashMap<int, int, js::DefaultHasher<int>, js::SystemAllocPolicy>; Map::Enum enumerateSuff() { return Map::Enum(map); } We should give Enum a move constructor to allow this reasonable behaviour.
Assignee | ||
Comment 1•7 years ago
|
||
Add a move constructor to HashTable::Enum.
Assignee: nobody → jcoppeard
Attachment #8868998 -
Flags: review?(luke)
Comment 2•7 years ago
|
||
Comment on attachment 8868998 [details] [diff] [review] bug1365654-enum-move Review of attachment 8868998 [details] [diff] [review]: ----------------------------------------------------------------- Makes sense ::: js/src/jsapi-tests/testHashTable.cpp @@ +388,5 @@ > > END_TEST(testHashMapLookupWithDefaultOOM) > #endif // defined(DEBUG) > + > +BEGIN_TEST(testHashTableMovableEnum) Could you add a test that creates an Enum e1, removes an element or two, move-constructs an Enum e2, and then removes a few more elements?
Attachment #8868998 -
Flags: review?(luke) → review+
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/2996f5f166a2 Add a move constructor to HashTable::Enum r=luke
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/e6f10f6af43d Fix style bustage r=me
Comment 5•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2996f5f166a2 https://hg.mozilla.org/mozilla-central/rev/e6f10f6af43d
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•