diff options
author | Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> | 2022-01-24 19:39:16 +0330 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2022-02-05 08:36:48 -0800 |
commit | 8c4b8b201ada6b76d5306c9c7f352e45087fb4a9 (patch) | |
tree | 0f3159d3dd6aad1159292956f1fe1550fb41d06a /lib/fs.js | |
parent | 217acb9036f39ea6088cee75f70f11602997e15f (diff) | |
download | node-new-8c4b8b201ada6b76d5306c9c7f352e45087fb4a9.tar.gz |
lib: replace validator and error
Refs: https://github.com/nodejs/node/pull/41660
PR-URL: https://github.com/nodejs/node/pull/41678
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/fs.js')
-rw-r--r-- | lib/fs.js | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -132,7 +132,6 @@ const { parseFileMode, validateBoolean, validateBuffer, - validateCallback, validateEncoding, validateFunction, validateInteger, @@ -174,7 +173,7 @@ function showTruncateDeprecation() { } function maybeCallback(cb) { - validateCallback(cb); + validateFunction(cb, 'cb'); return cb; } @@ -183,7 +182,7 @@ function maybeCallback(cb) { // for callbacks that are passed to the binding layer, callbacks that are // invoked from JS already run in the proper scope. function makeCallback(cb) { - validateCallback(cb); + validateFunction(cb, 'cb'); return (...args) => ReflectApply(cb, this, args); } @@ -192,7 +191,7 @@ function makeCallback(cb) { // an optimization, since the data passed back to the callback needs to be // transformed anyway. function makeStatsCallback(cb) { - validateCallback(cb); + validateFunction(cb, 'cb'); return (err, stats) => { if (err) return cb(err); |