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

Unified Diff: test/mjsunit/es6/typedarray-every.js

Issue 2775203002: [builtins] Implement %TypedArray%.prototype.{some,every} in the CSA (Closed)
Patch Set: addressed comments Created 3 years, 9 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 | « src/code-stub-assembler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/typedarray-every.js
diff --git a/test/mjsunit/es6/typedarray-every.js b/test/mjsunit/es6/typedarray-every.js
index 22132f32b16b54fdc6959849c907c5d4c9f92925..4ceee5f3aa578eb42c779b0b5b54a49eefd5461b 100644
--- a/test/mjsunit/es6/typedarray-every.js
+++ b/test/mjsunit/es6/typedarray-every.js
@@ -98,6 +98,20 @@ function TestTypedArrayForEach(constructor) {
CheckTypedArrayIsNeutered(a);
assertEquals(undefined, a[0]);
+ // Calling array.buffer midway can change the backing store.
+ a = new constructor(5);
+ a[0] = 42;
+ result = a.every(function (n, index, array) {
+ assertSame(a, array);
+ if (index == 2) {
+ (new constructor(array.buffer))[(index + 1) % 5] = 42;
+ } else {
+ a[(index+1)%5] = 42
+ }
+ return n == 42;
+ });
+ assertEquals(true, result);
+
// The method must work for typed arrays created from ArrayBuffer.
// The length of the ArrayBuffer is chosen so it is a multiple of
// all lengths of the typed array items.
« no previous file with comments | « src/code-stub-assembler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698