Skip to content

Commit aa81785

Browse files
jasnelltargos
authored andcommitted
lib: fixup more incorrect ERR_INVALID_ARG_VALUE uses
PR-URL: #57177 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent e08d7d4 commit aa81785

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎lib/internal/fs/recursive_watch.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class FSWatcher extends EventEmitter {
6868
if(encoding!=null){
6969
// This is required since on macOS and Windows it throws ERR_INVALID_ARG_VALUE
7070
if(typeofencoding!=='string'){
71-
thrownewERR_INVALID_ARG_VALUE(encoding,'options.encoding');
71+
thrownewERR_INVALID_ARG_VALUE('options.encoding',encoding);
7272
}
7373
}
7474

‎lib/internal/fs/watchers.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ async function* watch(filename, options = kEmptyObject) {
318318

319319
if(encoding&&!isEncoding(encoding)){
320320
constreason='is invalid encoding';
321-
thrownewERR_INVALID_ARG_VALUE(encoding,'encoding',reason);
321+
thrownewERR_INVALID_ARG_VALUE('encoding',encoding,reason);
322322
}
323323

324324
if(signal?.aborted)

‎lib/internal/quic/quic.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2069,7 +2069,7 @@ function processSessionOptions(options, forServer = false) {
20692069
if(cc!==undefined){
20702070
validateString(cc,'options.cc');
20712071
if(cc!=='reno'||cc!=='bbr'||cc!=='cubic'){
2072-
thrownewERR_INVALID_ARG_VALUE(cc,'options.cc');
2072+
thrownewERR_INVALID_ARG_VALUE('options.cc',cc);
20732073
}
20742074
}
20752075

‎lib/internal/webstreams/adapters.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ function newStreamReadableFromReadableStream(readableStream, options = kEmptyObj
529529
}=options;
530530

531531
if(encoding!==undefined&&!Buffer.isEncoding(encoding))
532-
thrownewERR_INVALID_ARG_VALUE(encoding,'options.encoding');
532+
thrownewERR_INVALID_ARG_VALUE('options.encoding',encoding);
533533
validateBoolean(objectMode,'options.objectMode');
534534

535535
constreader=readableStream.getReader();
@@ -686,7 +686,7 @@ function newStreamDuplexFromReadableWritablePair(pair = kEmptyObject, options =
686686

687687
validateBoolean(objectMode,'options.objectMode');
688688
if(encoding!==undefined&&!Buffer.isEncoding(encoding))
689-
thrownewERR_INVALID_ARG_VALUE(encoding,'options.encoding');
689+
thrownewERR_INVALID_ARG_VALUE('options.encoding',encoding);
690690

691691
constwriter=writableStream.getWriter();
692692
constreader=readableStream.getReader();

0 commit comments

Comments
 (0)