deno.land / std@0.224.0 / jsonc / testdata / test262 / sta.js

View Documentation
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
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.// Ported from test262// https://github.com/tc39/test262/blob/488eb365db7c613d52e72a9f5b8726684906e540/harness/sta.js// Copyright (c) 2012 Ecma International. All rights reserved.// This code is governed by the BSD license found in the LICENSE file./*---description: | Provides both: - An error class to avoid false positives when testing for thrown exceptions - A function to explicitly throw an exception using the Test262Error classdefines: [Test262Error, $ERROR, $DONOTEVALUATE]---*/

function Test262Error(message) { this.message = message || "";}
Test262Error.prototype.toString = function () { return "Test262Error: " + this.message;};
Test262Error.thrower = (message) => { throw new Test262Error(message);};// TODO: Remove when $ERROR migration is completedvar $ERROR = Test262Error.thrower;
function $DONOTEVALUATE() { throw "Test262: This statement should not be evaluated.";}
std

Version Info

Tagged at
6 months ago