summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/harness/testTypedArray-conversions-call-error.js
blob: 03e00213bdbc8a21793068f2fd26293a44db93f9 (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
31
32
33
// |reftest| shell-option(--enable-float16array)
// 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);