@@ -167,10 +167,10 @@ internals.addMethod = function (names, fn) {
167
167
internals . addMethod ( word , method ) ;
168
168
} ) ;
169
169
170
- internals . addMethod ( 'error' , function ( /*type, message*/ ) {
170
+ internals . addMethod ( 'error' , function ( ... args /*type, message*/ ) {
171
171
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 ] ;
174
174
const message = typeof lastArg === 'string' || lastArg instanceof RegExp ? lastArg : null ;
175
175
const err = this . _ref ;
176
176
@@ -366,13 +366,13 @@ internals.satisfy = function (validator) {
366
366
internals . addMethod ( [ 'satisfy' , 'satisfies' ] , internals . satisfy ) ;
367
367
368
368
369
- internals . throw = function ( /* type, message */ ) {
369
+ internals . throw = function ( ... args /* type, message */ ) {
370
370
371
371
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' ) ;
373
373
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 ] ;
376
376
const message = typeof lastArg === 'string' || lastArg instanceof RegExp ? lastArg : null ;
377
377
378
378
let thrown = false ;
@@ -402,13 +402,13 @@ internals.throw = function (/* type, message */) {
402
402
internals . addMethod ( [ 'throw' , 'throws' ] , internals . throw ) ;
403
403
404
404
405
- internals . reject = async function ( /* type, message */ ) {
405
+ internals . reject = async function ( ... args /* type, message */ ) {
406
406
407
407
try {
408
408
internals . assert ( this , internals . isPromise ( this . _ref ) , 'Can only assert reject on promises' ) ;
409
409
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 ] ;
412
412
const message = typeof lastArg === 'string' || lastArg instanceof RegExp ? lastArg : null ;
413
413
414
414
let thrown = null ;
0 commit comments