@@ -167,10 +167,10 @@ internals.addMethod = function (names, fn) {
167167 internals . addMethod ( word , method ) ;
168168} ) ;
169169
170- internals . addMethod ( 'error' , function ( /*type, message*/ ) {
170+ internals . addMethod ( 'error' , function ( ... args /*type, message*/ ) {
171171
172- const type = arguments . length && typeof arguments [ 0 ] !== 'string' && ! ( arguments [ 0 ] instanceof RegExp ) ? arguments [ 0 ] : Error ;
173- const lastArg = arguments [ 1 ] || arguments [ 0 ] ;
172+ const type = args . length && typeof args [ 0 ] !== 'string' && ! ( args [ 0 ] instanceof RegExp ) ? args [ 0 ] : Error ;
173+ const lastArg = args [ 1 ] || args [ 0 ] ;
174174 const message = typeof lastArg === 'string' || lastArg instanceof RegExp ? lastArg : null ;
175175 const err = this . _ref ;
176176
@@ -366,13 +366,13 @@ internals.satisfy = function (validator) {
366366internals . addMethod ( [ 'satisfy' , 'satisfies' ] , internals . satisfy ) ;
367367
368368
369- internals . throw = function ( /* type, message */ ) {
369+ internals . throw = function ( ... args /* type, message */ ) {
370370
371371 internals . assert ( this , typeof this . _ref === 'function' , 'Can only assert throw on functions' ) ;
372- internals . assert ( this , ! this . _flags . not || ! arguments . length , 'Cannot specify arguments when expecting not to throw' ) ;
372+ internals . assert ( this , ! this . _flags . not || ! args . length , 'Cannot specify arguments when expecting not to throw' ) ;
373373
374- const type = arguments . length && typeof arguments [ 0 ] !== 'string' && ! ( arguments [ 0 ] instanceof RegExp ) ? arguments [ 0 ] : null ;
375- const lastArg = arguments [ 1 ] || arguments [ 0 ] ;
374+ const type = args . length && typeof args [ 0 ] !== 'string' && ! ( args [ 0 ] instanceof RegExp ) ? args [ 0 ] : null ;
375+ const lastArg = args [ 1 ] || args [ 0 ] ;
376376 const message = typeof lastArg === 'string' || lastArg instanceof RegExp ? lastArg : null ;
377377
378378 let thrown = false ;
@@ -402,13 +402,13 @@ internals.throw = function (/* type, message */) {
402402internals . addMethod ( [ 'throw' , 'throws' ] , internals . throw ) ;
403403
404404
405- internals . reject = async function ( /* type, message */ ) {
405+ internals . reject = async function ( ... args /* type, message */ ) {
406406
407407 try {
408408 internals . assert ( this , internals . isPromise ( this . _ref ) , 'Can only assert reject on promises' ) ;
409409
410- const type = arguments . length && typeof arguments [ 0 ] !== 'string' && ! ( arguments [ 0 ] instanceof RegExp ) ? arguments [ 0 ] : null ;
411- const lastArg = arguments [ 1 ] || arguments [ 0 ] ;
410+ const type = args . length && typeof args [ 0 ] !== 'string' && ! ( args [ 0 ] instanceof RegExp ) ? args [ 0 ] : null ;
411+ const lastArg = args [ 1 ] || args [ 0 ] ;
412412 const message = typeof lastArg === 'string' || lastArg instanceof RegExp ? lastArg : null ;
413413
414414 let thrown = null ;
0 commit comments