@@ -444,7 +444,7 @@ E('ERR_NO_CRYPTO', 'Node.js is not compiled with OpenSSL crypto support');
444
444
E ( 'ERR_NO_ICU' , '%s is not supported on Node.js compiled without ICU' ) ;
445
445
E ( 'ERR_NO_LONGER_SUPPORTED' , '%s is no longer supported' ) ;
446
446
E ( 'ERR_OUTOFMEMORY' , 'Out of memory' ) ;
447
- E ( 'ERR_OUT_OF_RANGE' , 'The "%s" argument is out of range' ) ;
447
+ E ( 'ERR_OUT_OF_RANGE' , outOfRange ) ;
448
448
E ( 'ERR_PARSE_HISTORY_DATA' , 'Could not parse history data in %s' ) ;
449
449
E ( 'ERR_REQUIRE_ESM' , 'Must use import to load ES Module: %s' ) ;
450
450
E ( 'ERR_SCRIPT_EXECUTION_INTERRUPTED' ,
@@ -505,9 +505,6 @@ E('ERR_V8BREAKITERATOR', 'Full ICU data not installed. ' +
505
505
'See https://github.com/nodejs/node/wiki/Intl' ) ;
506
506
E ( 'ERR_VALID_PERFORMANCE_ENTRY_TYPE' ,
507
507
'At least one valid performance entry type is required' ) ;
508
- E ( 'ERR_VALUE_OUT_OF_RANGE' , ( start , end , value ) => {
509
- return `The value of "${ start } " must be ${ end } . Received "${ value } "` ;
510
- } ) ;
511
508
E ( 'ERR_ZLIB_BINDING_CLOSED' , 'zlib binding closed' ) ;
512
509
E ( 'ERR_ZLIB_INITIALIZATION_FAILED' , 'Initialization failed' ) ;
513
510
@@ -620,3 +617,10 @@ function invalidChar(name, field) {
620
617
}
621
618
return msg ;
622
619
}
620
+
621
+ function outOfRange ( name , range , value ) {
622
+ let msg = `The value of "${ name } " is out of range.` ;
623
+ if ( range ) msg += ` It must be ${ range } .` ;
624
+ if ( value !== undefined ) msg += ` Received ${ value } ` ;
625
+ return msg ;
626
+ }
0 commit comments