Last Comment Bug 817368 - Map.prototype.{keys,values,entries}
: Map.prototype.{keys,values,entries}
Status: RESOLVED FIXED
[DocArea=JS]
: dev-doc-complete
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Other Branch
: All All
: -- normal (vote)
: mozilla20
Assigned To: Jason Orendorff [:jorendorff]
: general
Mentors:
Depends on:
Blocks: es6
  Show dependency treegraph
 
Reported: 2012-12-02 00:54 PST by Jason Orendorff [:jorendorff]
Modified: 2014-02-24 11:05 PST (History)
3 users (show)
ryanvm: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1 (13.63 KB, patch)
2012-12-07 12:45 PST, Jason Orendorff [:jorendorff]
luke: review+
Details | Diff | Splinter Review

Description Jason Orendorff [:jorendorff] 2012-12-02 00:54:07 PST
The latest draft specifies these methods.

I'm told "items" might be renamed to "entries"; I'll get details on Monday when the latest TC39 meeting notes are posted.
Comment 1 Jason Orendorff [:jorendorff] 2012-12-07 12:45:43 PST
Created attachment 689856 [details] [diff] [review]
v1
Comment 2 Luke Wagner [:luke] 2012-12-09 21:34:06 PST
Comment on attachment 689856 [details] [diff] [review]
v1

Review of attachment 689856 [details] [diff] [review]:
-----------------------------------------------------------------

Nice.

::: js/src/builtin/MapObject.cpp
@@ +912,5 @@
>          return js_ThrowStopIteration(cx);
>      }
>  
> +    MapObject::IteratorKind kind = thisobj.kind();
> +    if (kind == MapObject::Keys) {

Any reason not to use a switch?  If you avoid 'default', you get the nice warning if you are missing an enumerator.
Comment 3 Ryan VanderMeulen [:RyanVM] 2012-12-15 13:29:41 PST
https://hg.mozilla.org/mozilla-central/rev/8541aa1783c7

Note You need to log in before you can comment on or make changes to this bug.