2222
2323const { isDeepEqual, isDeepStrictEqual } =
2424 require ( 'internal/util/comparisons' ) ;
25- const errors = require ( 'internal/errors' ) ;
25+ const { AssertionError , TypeError } = require ( 'internal/errors' ) ;
2626const { inspect } = require ( 'util' ) ;
2727
2828const ERR_DIFF_DEACTIVATED = 0 ;
@@ -46,7 +46,7 @@ const NO_EXCEPTION_SENTINEL = {};
4646function innerFail ( obj ) {
4747 if ( obj . message instanceof Error ) throw obj . message ;
4848
49- throw new errors . AssertionError ( obj ) ;
49+ throw new AssertionError ( obj ) ;
5050}
5151
5252function fail ( actual , expected , message , operator , stackStartFn ) {
@@ -76,7 +76,7 @@ assert.fail = fail;
7676// new assert.AssertionError({ message: message,
7777// actual: actual,
7878// expected: expected });
79- assert . AssertionError = errors . AssertionError ;
79+ assert . AssertionError = AssertionError ;
8080
8181
8282// Pure assertion tests whether a value is truthy, as determined
@@ -220,8 +220,8 @@ function expectedException(actual, expected, msg) {
220220 return expected . test ( actual ) ;
221221 // assert.doesNotThrow does not accept objects.
222222 if ( arguments . length === 2 ) {
223- throw new errors . TypeError ( 'ERR_INVALID_ARG_TYPE' , 'expected' ,
224- [ 'Function' , 'RegExp' ] , expected ) ;
223+ throw new TypeError ( 'ERR_INVALID_ARG_TYPE' , 'expected' ,
224+ [ 'Function' , 'RegExp' ] , expected ) ;
225225 }
226226 // The name and message could be non enumerable. Therefore test them
227227 // explicitly.
@@ -258,8 +258,8 @@ function expectedException(actual, expected, msg) {
258258
259259function getActual ( block ) {
260260 if ( typeof block !== 'function' ) {
261- throw new errors . TypeError ( 'ERR_INVALID_ARG_TYPE' , 'block' , 'Function' ,
262- block ) ;
261+ throw new TypeError ( 'ERR_INVALID_ARG_TYPE' , 'block' , 'Function' ,
262+ block ) ;
263263 }
264264 try {
265265 block ( ) ;
@@ -275,10 +275,10 @@ assert.throws = function throws(block, error, message) {
275275
276276 if ( typeof error === 'string' ) {
277277 if ( arguments . length === 3 )
278- throw new errors . TypeError ( 'ERR_INVALID_ARG_TYPE' ,
279- 'error' ,
280- [ 'Function' , 'RegExp' ] ,
281- error ) ;
278+ throw new TypeError ( 'ERR_INVALID_ARG_TYPE' ,
279+ 'error' ,
280+ [ 'Function' , 'RegExp' ] ,
281+ error ) ;
282282
283283 message = error ;
284284 error = null ;
0 commit comments