2017-07-14 17:37:24 +02:00
|
|
|
// 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 class
|
|
|
|
---*/
|
|
|
|
|
2017-04-13 16:37:32 +02:00
|
|
|
|
|
|
|
function Test262Error(message) {
|
|
|
|
this.message = message || "";
|
|
|
|
}
|
|
|
|
|
|
|
|
Test262Error.prototype.toString = function () {
|
|
|
|
return "Test262Error: " + this.message;
|
|
|
|
};
|
|
|
|
|
|
|
|
var $ERROR;
|
|
|
|
$ERROR = function $ERROR(message) {
|
|
|
|
throw new Test262Error(message);
|
|
|
|
};
|