summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/harness/assert-throws-native.js
blob: a386264fbc20533c5357dc21e287e48c090151fc (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
34
35
36
37
38
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
description: >
    Functions that throw instances of the specified native Error constructor
    satisfy the assertion.
---*/

assert.throws(Error, function() {
  throw new Error();
});

assert.throws(EvalError, function() {
  throw new EvalError();
});

assert.throws(RangeError, function() {
  throw new RangeError();
});

assert.throws(ReferenceError, function() {
  throw new ReferenceError();
});

assert.throws(SyntaxError, function() {
  throw new SyntaxError();
});

assert.throws(TypeError, function() {
  throw new TypeError();
});

assert.throws(URIError, function() {
  throw new URIError();
});

reportCompare(0, 0);