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

Unified Diff: test/mjsunit/harmony/typedarray-fill.js

Issue 1130413010: Test that TypedArray methods don't read length (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « no previous file | test/mjsunit/harmony/typedarray-find.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/typedarray-fill.js
diff --git a/test/mjsunit/harmony/typedarray-fill.js b/test/mjsunit/harmony/typedarray-fill.js
index 40605bbd515ea553bcaf9d6c45124020047def1a..4452bf64cdecf7ae3b4da70a2baaa14c18bb12c3 100644
--- a/test/mjsunit/harmony/typedarray-fill.js
+++ b/test/mjsunit/harmony/typedarray-fill.js
@@ -36,4 +36,12 @@ for (var constructor of typedArrayConstructors) {
assertThrows('constructor.prototype.fill.call(null)', TypeError);
assertThrows('constructor.prototype.fill.call(undefined)', TypeError);
assertThrows('constructor.prototype.fill.call([])', TypeError);
+
+ // Shadowing length doesn't affect fill, unlike Array.prototype.fill
+ var a = new constructor([2, 2]);
+ Object.defineProperty(a, 'length', {value: 1});
arv (Not doing code reviews) 2015/05/15 00:25:47 or get: function() { assertUnreachable(); }
dehrenberg 2015/05/15 01:40:41 well, later down I validate the test by making it
+ a.fill(3);
+ assertArrayEquals([a[0], a[1]], [3, 3]);
+ Array.prototype.fill.call(a, 4);
+ assertArrayEquals([a[0], a[1]], [4, 3]);
}
« no previous file with comments | « no previous file | test/mjsunit/harmony/typedarray-find.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698