Bug 144253

Summary: Map#entries and Map#keys error for non-Maps is swapped
Product: WebKit Reporter: Jordan Harband <ljharb>
Component: JavaScriptCoreAssignee: Jordan Harband <ljharb>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, joepeck
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Jordan Harband 2015-04-27 01:56:28 PDT
Map.prototype.entries.call({}) gives an error about a "key iterator", and Map.prototype.keys.call({}) gives an error about an "entry iterator".
Comment 1 Jordan Harband 2015-04-27 01:59:56 PDT
Created attachment 251729 [details]
Patch
Comment 2 Joseph Pecoraro 2015-04-27 11:01:33 PDT
Good fix. Can we have a test for these?

  var nonMapObject = {};
  Map.prototype.entries.call(nonMapObject);
Comment 3 Jordan Harband 2015-04-27 11:07:00 PDT
(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 4 WebKit Commit Bot 2015-04-27 11:37:42 PDT
Comment on attachment 251729 [details]
Patch

Clearing flags on attachment: 251729

Committed r183402: <http://trac.webkit.org/changeset/183402>
Comment 5 WebKit Commit Bot 2015-04-27 11:38:33 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Joseph Pecoraro 2015-04-27 14:52:07 PDT
(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!