Skip to content

Commit

Permalink
Remove ref to goog.inherit which will be removed. (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkdn authored Jan 20, 2025
1 parent 78003ba commit 1367f8e
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions closure/testing/library/jsunitexception.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,30 @@ goog.setTestOnly();
goog.require('goog.testing.stacktrace');


/**
* @param {string} comment A summary for the exception.
* @param {?string=} opt_message A description of the exception.
* @constructor
* @extends {Error}
* @final
*/
goog.testing.JsUnitException = function(comment, opt_message) {
'use strict';
this.isJsUnitException = true;
this.message =
goog.testing.JsUnitException.generateMessage(comment, opt_message);
this.stackTrace = goog.testing.stacktrace.get();
// These fields are for compatibility with jsUnitTestManager.
this.comment = comment || null;
this.jsUnitMessage = opt_message || '';

// Ensure there is a stack trace.
if (Error.captureStackTrace) {
Error.captureStackTrace(this, goog.testing.JsUnitException);
} else {
this.stack = new Error().stack || '';
goog.testing.JsUnitException = class extends Error {
/**
* @param {string} comment A summary for the exception.
* @param {?string=} opt_message A description of the exception.
*/
constructor(comment, opt_message) {
'use strict';
super();
this.isJsUnitException = true;
this.message =
goog.testing.JsUnitException.generateMessage(comment, opt_message);
this.stackTrace = goog.testing.stacktrace.get();
// These fields are for compatibility with jsUnitTestManager.
this.comment = comment || null;
this.jsUnitMessage = opt_message || '';

// Ensure there is a stack trace.
if (Error.captureStackTrace) {
Error.captureStackTrace(this, goog.testing.JsUnitException);
} else {
this.stack = new Error().stack || '';
}
}
};
goog.inherits(goog.testing.JsUnitException, Error);

/**
* @param {string} comment A summary for the exception.
Expand Down

0 comments on commit 1367f8e

Please sign in to comment.