Index: test/mjsunit/es6/typedarray-fill.js |
diff --git a/test/mjsunit/es6/typedarray-fill.js b/test/mjsunit/es6/typedarray-fill.js |
index 2c612016f6187e43fa91a0c31554e71ed51fad7b..42eb6fc30c8606a3038dff9546599cdde702b50e 100644 |
--- a/test/mjsunit/es6/typedarray-fill.js |
+++ b/test/mjsunit/es6/typedarray-fill.js |
@@ -30,6 +30,11 @@ for (var constructor of typedArrayConstructors) { |
assertArrayEquals(new constructor([0, 0, 0, 0, 0]).fill(8, -1, -3), [0, 0, 0, 0, 0]); |
assertArrayEquals(new constructor([0, 0, 0, 0, 0]).fill(8, 0, 4), [8, 8, 8, 8, 0]); |
+ assertArrayEquals(new constructor([0, 0, 0, 0, 0]).fill(8, Infinity), [0, 0, 0, 0, 0]); |
+ assertArrayEquals(new constructor([0, 0, 0, 0, 0]).fill(8, -Infinity), [8, 8, 8, 8, 8]); |
+ assertArrayEquals(new constructor([0, 0, 0, 0, 0]).fill(8, 0, Infinity), [8, 8, 8, 8, 8]); |
+ assertArrayEquals(new constructor([0, 0, 0, 0, 0]).fill(8, 0, -Infinity), [0, 0, 0, 0, 0]); |
Camillo Bruni
2017/03/13 09:02:30
Please add my Proxy test case as well, to ensure w
|
+ |
// Test exceptions |
assertThrows('constructor.prototype.fill.call(null)', TypeError); |
assertThrows('constructor.prototype.fill.call(undefined)', TypeError); |
@@ -43,3 +48,7 @@ for (var constructor of typedArrayConstructors) { |
Array.prototype.fill.call(a, 4); |
assertArrayEquals([a[0], a[1]], [4, 3]); |
} |
+ |
+// Clamping |
+assertArrayEquals(new Uint8ClampedArray([0, 0, 0, 0, 0]).fill(-10), [0, 0, 0, 0, 0]); |
+assertArrayEquals(new Uint8ClampedArray([0, 0, 0, 0, 0]).fill(1000), [255, 255, 255, 255, 255]); |