sta.js 592 B

1234567891011121314151617181920212223
  1. // Copyright (c) 2012 Ecma International. All rights reserved.
  2. // This code is governed by the BSD license found in the LICENSE file.
  3. /*---
  4. description: |
  5. Provides both:
  6. - An error class to avoid false positives when testing for thrown exceptions
  7. - A function to explicitly throw an exception using the Test262Error class
  8. ---*/
  9. function Test262Error(message) {
  10. this.message = message || "";
  11. }
  12. Test262Error.prototype.toString = function () {
  13. return "Test262Error: " + this.message;
  14. };
  15. var $ERROR;
  16. $ERROR = function $ERROR(message) {
  17. throw new Test262Error(message);
  18. };