Reviewers: Dan Ehrenberg,

Description:
[es6] Array.prototype[Symbol.iterator].name should be 'values'

[email protected]
BUG=v8:4311
LOG=n

Please review this at https://codereview.chromium.org/1242623002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+7, -0 lines):
  M src/array-iterator.js
  M test/mjsunit/es6/array-iterator.js


Index: src/array-iterator.js
diff --git a/src/array-iterator.js b/src/array-iterator.js
index 8efabe50e325140cb39f3c43879803554462926d..965e672f0d67aaa92dd44265dcce2a0b09340acd 100644
--- a/src/array-iterator.js
+++ b/src/array-iterator.js
@@ -138,6 +138,10 @@ utils.InstallFunctions(GlobalArray.prototype, DONT_ENUM, [
   'keys', ArrayKeys
 ]);

+// TODO(adam): Remove this call once 'values' is in the above
+// InstallFunctions block, as it'll be redundant.
+utils.SetFunctionName(ArrayValues, 'values');
+
 %AddNamedProperty(GlobalArray.prototype, symbolIterator, ArrayValues,
                   DONT_ENUM);

Index: test/mjsunit/es6/array-iterator.js
diff --git a/test/mjsunit/es6/array-iterator.js b/test/mjsunit/es6/array-iterator.js index 767991eafed33f913e2725da6baa46a7939450b1..5fab0fbf8654a7112358c0eeddc82955cf7e04c0 100644
--- a/test/mjsunit/es6/array-iterator.js
+++ b/test/mjsunit/es6/array-iterator.js
@@ -47,6 +47,9 @@ function TestArrayPrototype() {
   assertHasOwnProperty(Array.prototype, 'entries', DONT_ENUM);
   assertHasOwnProperty(Array.prototype, 'keys', DONT_ENUM);
   assertHasOwnProperty(Array.prototype, Symbol.iterator, DONT_ENUM);
+  assertEquals('entries', Array.prototype.entries.name);
+  assertEquals('keys', Array.prototype.keys.name);
+  assertEquals('values', Array.prototype[Symbol.iterator].name);
 }
 TestArrayPrototype();



--
--
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.

Reply via email to