Map.prototype.{keys,values,entries}

RESOLVED FIXED in mozilla20

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
3 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

5 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

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

Comment 1

5 years ago
Created attachment 689856 [details] [diff] [review]
v1
Assignee: general → jorendorff
Attachment #689856 - Flags: review?(luke)

Comment 2

5 years ago
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: 5 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla20

Updated

5 years ago
Blocks: 694100
Whiteboard: [DocArea=JS]
Developer release notes:
https://developer.mozilla.org/en-US/Firefox/Releases/20#JavaScript

Reference docs:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/keys
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/values

As always, feel free to review and improve these docs in the MDN wiki. Much appreciated.
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.