summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/harness/sta-override-error.js
blob: 513b2346b3f53f1c2064fff80b4d28b05c351563 (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
// Copyright (c) 2017 Rick Waldron.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
description: >
    Including sta.js will expose two functions:

        Test262Error
        $ERROR

    Assert that global $ERROR is overridable
---*/
function BaloneyError() {}

// Override $ERROR
$ERROR = function() {
  throw new BaloneyError();
};

assert.throws(BaloneyError, function() {
  $ERROR();
});

reportCompare(0, 0);