Closed Bug 817368 Opened 12 years ago Closed 12 years ago

Map.prototype.{keys,values,entries}

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: jorendorff, Assigned: jorendorff)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, Whiteboard: [DocArea=JS])

Attachments

(1 file)

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.
Summary: Map.prototype.{keys,values,items} → Map.prototype.{keys,values,entries}
Attached 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
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Blocks: es6
Whiteboard: [DocArea=JS]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: