summaryrefslogtreecommitdiff
path: root/test/harness/testTypedArray-conversions-call-error.js
blob: 479d48f195daca96728fa9df1dda9eea578478a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// 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) {
  $ERROR('Expected a TypeError, but no error was thrown.');
}