Map.prototype.{keys,values,entries}

RESOLVED FIXED in mozilla20

Status

()

RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: jorendorff, Assigned: jorendorff)

Tracking

(Blocks: 1 bug, {dev-doc-complete})

Other Branch
mozilla20
dev-doc-complete
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [DocArea=JS])

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
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.
(Assignee)

Updated

6 years ago
Summary: Map.prototype.{keys,values,items} → Map.prototype.{keys,values,entries}
(Assignee)

Comment 1

6 years ago
Posted patch v1Splinter Review
Assignee: general → jorendorff
Attachment #689856 - Flags: review?(luke)
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.
Attachment #689856 - Flags: review?(luke) → review+
Keywords: dev-doc-needed
https://hg.mozilla.org/mozilla-central/rev/8541aa1783c7
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Whiteboard: [DocArea=JS]
You need to log in before you can comment on or make changes to this bug.