| Summary: | Map#entries and Map#keys error for non-Maps is swapped | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Jordan Harband <ljharb> | ||||
| Component: | JavaScriptCore | Assignee: | Jordan Harband <ljharb> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | commit-queue, joepeck | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
Created attachment 251729 [details]
Patch
Good fix. Can we have a test for these?
var nonMapObject = {};
Map.prototype.entries.call(nonMapObject);
(In reply to comment #2) > Good fix. Can we have a test for these? > > var nonMapObject = {}; > Map.prototype.entries.call(nonMapObject); Sure, I'll do that in a followup. Where would you recommend I create them? It looks like `Source/JavaScriptCore/tests/stress/iterators-other-receivers` might be a good filename? Comment on attachment 251729 [details] Patch Clearing flags on attachment: 251729 Committed r183402: <http://trac.webkit.org/changeset/183402> All reviewed patches have been landed. Closing bug. (In reply to comment #3) > (In reply to comment #2) > > Good fix. Can we have a test for these? > > > > var nonMapObject = {}; > > Map.prototype.entries.call(nonMapObject); > > Sure, I'll do that in a followup. Where would you recommend I create them? > It looks like `Source/JavaScriptCore/tests/stress/iterators-other-receivers` > might be a good filename? Yeah, that sounds fine. Feel free to CC me! |
Map.prototype.entries.call({}) gives an error about a "key iterator", and Map.prototype.keys.call({}) gives an error about an "entry iterator".