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

Unified Diff: test/mjsunit/harmony/typedarrays-foreach.js

Issue 1133503003: Factor out core of Array.forEach and .every, for use in TypedArrays (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 7 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/typedarrays-every.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/typedarrays-foreach.js
diff --git a/test/mjsunit/harmony/typedarrays-foreach.js b/test/mjsunit/harmony/typedarrays-foreach.js
index 4bfa655449363e50e6817fe0fb38bc3656035a71..0d34c78efb20f87ddd016c509d8a65dd5aecf592 100644
--- a/test/mjsunit/harmony/typedarrays-foreach.js
+++ b/test/mjsunit/harmony/typedarrays-foreach.js
@@ -85,8 +85,13 @@ function TestTypedArrayForEach(constructor) {
assertEquals(42, a[1]);
// Neutering the buffer backing the typed array mid-way should
- // still make .forEach() finish, and the array should keep being
- // empty after neutering it.
+ // still make .forEach() finish, but exiting early due to the missing
+ // elements, and the array should keep being empty after detaching it.
+ // TODO(dehrenberg): According to the ES6 spec, accessing or testing
+ // for members on a detached TypedArray should throw, so really this
+ // should throw in the third iteration. However, this behavior matches
+ // the Khronos spec.
+ a = new constructor(3);
count = 0;
a.forEach(function (n, index, array) {
if (count > 0) %ArrayBufferNeuter(array.buffer);
« no previous file with comments | « test/mjsunit/harmony/typedarrays-every.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698