diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/tests/non262/TypedArray/constructor-not-callable.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/js/src/tests/non262/TypedArray/constructor-not-callable.js b/js/src/tests/non262/TypedArray/constructor-not-callable.js new file mode 100644 index 0000000000..a3a2f8d1d5 --- /dev/null +++ b/js/src/tests/non262/TypedArray/constructor-not-callable.js @@ -0,0 +1,10 @@ +for (var constructor of anyTypedArrayConstructors) { + assertThrowsInstanceOf(() => constructor(), TypeError); + assertThrowsInstanceOf(() => constructor(1), TypeError); + assertThrowsInstanceOf(() => constructor.call(null), TypeError); + assertThrowsInstanceOf(() => constructor.apply(null, []), TypeError); + assertThrowsInstanceOf(() => Reflect.apply(constructor, null, []), TypeError); +} + +if (typeof reportCompare === "function") + reportCompare(true, true); |