Reviewers: adamk, rossberg,
Description:
ES6: Add missing Set.prototype.keys function
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-set.prototype.keys
The value of the keys property is just the initial value of the values
function.
BUG=v8:3411
LOG=Y
Please review this at https://codereview.chromium.org/353293003/
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+6, -0 lines):
M src/collection-iterator.js
M test/mjsunit/harmony/collection-iterator.js
Index: src/collection-iterator.js
diff --git a/src/collection-iterator.js b/src/collection-iterator.js
index
b8b304eb97364ca8a6d9bfc5f9b6a237423b0e0e..096e30dcab56812ccf631773654d7076ede82df2
100644
--- a/src/collection-iterator.js
+++ b/src/collection-iterator.js
@@ -87,6 +87,7 @@ function ExtendSetPrototype() {
InstallFunctions($Set.prototype, DONT_ENUM, $Array(
'entries', SetEntries,
+ 'keys', SetValues,
'values', SetValues
));
Index: test/mjsunit/harmony/collection-iterator.js
diff --git a/test/mjsunit/harmony/collection-iterator.js
b/test/mjsunit/harmony/collection-iterator.js
index
a3a950af3ce72ea7dce7bb95e381d3ba3d9e0701..93113f609205f0fecaafee744b82430eea52dd78
100644
--- a/test/mjsunit/harmony/collection-iterator.js
+++ b/test/mjsunit/harmony/collection-iterator.js
@@ -37,6 +37,11 @@
})();
+(function TestSetIteratorKeys() {
+ assertEquals(Set.prototype.keys, Set.prototype.values);
+})();
+
+
(function TestSetIteratorEntries() {
var s = new Set;
s.add(1);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.