@@ -10,31 +10,30 @@ goog.setTestOnly();
1010goog . require ( 'goog.testing.stacktrace' ) ;
1111
1212
13- /**
14- * @param { string } comment A summary for the exception.
15- * @param {? string= } opt_message A description of the exception.
16- * @constructor
17- * @extends { Error }
18- * @final
19- */
20- goog . testing . JsUnitException = function ( comment , opt_message ) {
21- 'use strict' ;
22- this . isJsUnitException = true ;
23- this . message =
24- goog . testing . JsUnitException . generateMessage ( comment , opt_message ) ;
25- this . stackTrace = goog . testing . stacktrace . get ( ) ;
26- // These fields are for compatibility with jsUnitTestManager.
27- this . comment = comment || null ;
28- this . jsUnitMessage = opt_message || '' ;
29-
30- // Ensure there is a stack trace.
31- if ( Error . captureStackTrace ) {
32- Error . captureStackTrace ( this , goog . testing . JsUnitException ) ;
33- } else {
34- this . stack = new Error ( ) . stack || '' ;
13+ goog . testing . JsUnitException = class extends Error {
14+ /**
15+ * @param {string } comment A summary for the exception.
16+ * @param { ?string= } opt_message A description of the exception.
17+ */
18+ constructor ( comment , opt_message ) {
19+ 'use strict' ;
20+ super ( ) ;
21+ this . isJsUnitException = true ;
22+ this . message =
23+ goog . testing . JsUnitException . generateMessage ( comment , opt_message ) ;
24+ this . stackTrace = goog . testing . stacktrace . get ( ) ;
25+ // These fields are for compatibility with jsUnitTestManager.
26+ this . comment = comment || null ;
27+ this . jsUnitMessage = opt_message || '' ;
28+
29+ // Ensure there is a stack trace.
30+ if ( Error . captureStackTrace ) {
31+ Error . captureStackTrace ( this , goog . testing . JsUnitException ) ;
32+ } else {
33+ this . stack = new Error ( ) . stack || '' ;
34+ }
3535 }
3636} ;
37- goog . inherits ( goog . testing . JsUnitException , Error ) ;
3837
3938/**
4039 * @param {string } comment A summary for the exception.
0 commit comments