summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/harness/testTypedArray-conversions-call-error.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/harness/testTypedArray-conversions-call-error.js')
-rw-r--r--js/src/tests/test262/harness/testTypedArray-conversions-call-error.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/js/src/tests/test262/harness/testTypedArray-conversions-call-error.js b/js/src/tests/test262/harness/testTypedArray-conversions-call-error.js
new file mode 100644
index 0000000000..6d22f1460c
--- /dev/null
+++ b/js/src/tests/test262/harness/testTypedArray-conversions-call-error.js
@@ -0,0 +1,32 @@
+// Copyright (c) 2017 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Including testTypedArray.js will expose:
+
+ testTypedArrayConversions()
+
+includes: [testTypedArray.js]
+features: [TypedArray]
+---*/
+var threw = false;
+
+try {
+ testTypedArrayConversions({}, () => {});
+} catch(err) {
+ threw = true;
+ if (err.constructor !== TypeError) {
+ throw new Error(
+ 'Expected a TypeError, but a "' + err.constructor.name +
+ '" was thrown.'
+ );
+ }
+}
+
+if (threw === false) {
+ throw new Error('Expected a TypeError, but no error was thrown.');
+}
+
+
+
+reportCompare(0, 0);