As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact
Last Comment Bug 817368 - Map.prototype.{keys,values,entries}
: Map.prototype.{keys,values,entries}
: 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
: Jason Orendorff [:jorendorff]
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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

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

Description User image 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 User image Jason Orendorff [:jorendorff] 2012-12-07 12:45:43 PST
Created attachment 689856 [details] [diff] [review]
Comment 2 User image Luke Wagner [:luke] 2012-12-09 21:34:06 PST
Comment on attachment 689856 [details] [diff] [review]

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


::: 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 User image Ryan VanderMeulen [:RyanVM] 2012-12-15 13:29:41 PST

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