Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1117)

Unified Diff: test/mjsunit/es6/array-iterator.js

Issue 647703003: Don't expose Array.prototype.values as it breaks webcompat (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix tests Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/es6/arguments-iterator.js ('k') | test/mjsunit/es6/typed-array-iterator.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/array-iterator.js
diff --git a/test/mjsunit/es6/array-iterator.js b/test/mjsunit/es6/array-iterator.js
index b24ee5712fb71c595014189b2258a776e80381a7..96122cd9999941155e457a6b664c917389512c13 100644
--- a/test/mjsunit/es6/array-iterator.js
+++ b/test/mjsunit/es6/array-iterator.js
@@ -45,11 +45,8 @@ function assertHasOwnProperty(object, name, attrs) {
function TestArrayPrototype() {
assertHasOwnProperty(Array.prototype, 'entries', DONT_ENUM);
- assertHasOwnProperty(Array.prototype, 'values', DONT_ENUM);
assertHasOwnProperty(Array.prototype, 'keys', DONT_ENUM);
assertHasOwnProperty(Array.prototype, Symbol.iterator, DONT_ENUM);
-
- assertEquals(Array.prototype.values, Array.prototype[Symbol.iterator]);
}
TestArrayPrototype();
@@ -61,7 +58,7 @@ function assertIteratorResult(value, done, result) {
function TestValues() {
var array = ['a', 'b', 'c'];
- var iterator = array.values();
+ var iterator = array[Symbol.iterator]();
assertIteratorResult('a', false, iterator.next());
assertIteratorResult('b', false, iterator.next());
assertIteratorResult('c', false, iterator.next());
@@ -75,7 +72,7 @@ TestValues();
function TestValuesMutate() {
var array = ['a', 'b', 'c'];
- var iterator = array.values();
+ var iterator = array[Symbol.iterator]();
assertIteratorResult('a', false, iterator.next());
assertIteratorResult('b', false, iterator.next());
assertIteratorResult('c', false, iterator.next());
@@ -142,17 +139,17 @@ TestEntriesMutate();
function TestArrayIteratorPrototype() {
var array = [];
- var iterator = array.values();
+ var iterator = array.keys();
var ArrayIteratorPrototype = iterator.__proto__;
- assertEquals(ArrayIteratorPrototype, array.values().__proto__);
+ assertEquals(ArrayIteratorPrototype, array[Symbol.iterator]().__proto__);
assertEquals(ArrayIteratorPrototype, array.keys().__proto__);
assertEquals(ArrayIteratorPrototype, array.entries().__proto__);
assertEquals(Object.prototype, ArrayIteratorPrototype.__proto__);
- assertEquals('Array Iterator', %_ClassOf(array.values()));
+ assertEquals('Array Iterator', %_ClassOf(array[Symbol.iterator]()));
assertEquals('Array Iterator', %_ClassOf(array.keys()));
assertEquals('Array Iterator', %_ClassOf(array.entries()));
@@ -169,7 +166,7 @@ function TestForArrayValues() {
var buffer = [];
var array = [0, 'a', true, false, null, /* hole */, undefined, NaN];
var i = 0;
- for (var value of array.values()) {
+ for (var value of array[Symbol.iterator]()) {
buffer[i++] = value;
}
@@ -239,7 +236,7 @@ TestForArrayValues();
function TestNonOwnSlots() {
var array = [0];
- var iterator = array.values();
+ var iterator = array[Symbol.iterator]();
var object = {__proto__: iterator};
assertThrows(function() {
« no previous file with comments | « test/mjsunit/es6/arguments-iterator.js ('k') | test/mjsunit/es6/typed-array-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698