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

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

Issue 22715004: Version 3.20.15 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Add TypedArray API and correctness patches r16033 and r16084 Created 7 years, 4 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/harmony/array-findindex.js ('k') | test/mjsunit/harmony/object-observe.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/array-iterator.js
diff --git a/test/mjsunit/harmony/array-iterator.js b/test/mjsunit/harmony/array-iterator.js
index 6a402e739394a67e8fdba3ad15d35dc55a628721..f3a2627b5740f3bd7654004efba4670c0df942b3 100644
--- a/test/mjsunit/harmony/array-iterator.js
+++ b/test/mjsunit/harmony/array-iterator.js
@@ -39,7 +39,7 @@ function TestArrayPrototype() {
TestArrayPrototype();
function assertIteratorResult(value, done, result) {
- assertEquals({value: value, done: done}, result);
+ assertEquals({ value: value, done: done}, result);
}
function TestValues() {
@@ -70,9 +70,9 @@ TestValuesMutate();
function TestKeys() {
var array = ['a', 'b', 'c'];
var iterator = array.keys();
- assertIteratorResult(0, false, iterator.next());
- assertIteratorResult(1, false, iterator.next());
- assertIteratorResult(2, false, iterator.next());
+ assertIteratorResult('0', false, iterator.next());
+ assertIteratorResult('1', false, iterator.next());
+ assertIteratorResult('2', false, iterator.next());
assertIteratorResult(void 0, true, iterator.next());
array.push('d');
@@ -83,11 +83,11 @@ TestKeys();
function TestKeysMutate() {
var array = ['a', 'b', 'c'];
var iterator = array.keys();
- assertIteratorResult(0, false, iterator.next());
- assertIteratorResult(1, false, iterator.next());
- assertIteratorResult(2, false, iterator.next());
+ assertIteratorResult('0', false, iterator.next());
+ assertIteratorResult('1', false, iterator.next());
+ assertIteratorResult('2', false, iterator.next());
array.push('d');
- assertIteratorResult(3, false, iterator.next());
+ assertIteratorResult('3', false, iterator.next());
assertIteratorResult(void 0, true, iterator.next());
}
TestKeysMutate();
@@ -95,9 +95,9 @@ TestKeysMutate();
function TestEntries() {
var array = ['a', 'b', 'c'];
var iterator = array.entries();
- assertIteratorResult([0, 'a'], false, iterator.next());
- assertIteratorResult([1, 'b'], false, iterator.next());
- assertIteratorResult([2, 'c'], false, iterator.next());
+ assertIteratorResult(['0', 'a'], false, iterator.next());
+ assertIteratorResult(['1', 'b'], false, iterator.next());
+ assertIteratorResult(['2', 'c'], false, iterator.next());
assertIteratorResult(void 0, true, iterator.next());
array.push('d');
@@ -108,11 +108,11 @@ TestEntries();
function TestEntriesMutate() {
var array = ['a', 'b', 'c'];
var iterator = array.entries();
- assertIteratorResult([0, 'a'], false, iterator.next());
- assertIteratorResult([1, 'b'], false, iterator.next());
- assertIteratorResult([2, 'c'], false, iterator.next());
+ assertIteratorResult(['0', 'a'], false, iterator.next());
+ assertIteratorResult(['1', 'b'], false, iterator.next());
+ assertIteratorResult(['2', 'c'], false, iterator.next());
array.push('d');
- assertIteratorResult([3, 'd'], false, iterator.next());
+ assertIteratorResult(['3', 'd'], false, iterator.next());
assertIteratorResult(void 0, true, iterator.next());
}
TestEntriesMutate();
@@ -168,7 +168,7 @@ function TestForArrayKeys() {
assertEquals(8, buffer.length);
for (var i = 0; i < buffer.length; i++) {
- assertEquals(i, buffer[i]);
+ assertEquals(String(i), buffer[i]);
}
}
TestForArrayKeys();
@@ -189,7 +189,7 @@ function TestForArrayEntries() {
assertTrue(isNaN(buffer[buffer.length - 1][1]));
for (var i = 0; i < buffer.length; i++) {
- assertEquals(i, buffer[i][0]);
+ assertEquals(String(i), buffer[i][0]);
}
}
TestForArrayEntries();
« no previous file with comments | « test/mjsunit/harmony/array-findindex.js ('k') | test/mjsunit/harmony/object-observe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698