diff options
author | Alex Pry <opterione@gmail.com> | 2019-05-26 17:38:13 +0300 |
---|---|---|
committer | Ujjwal Sharma <usharma1998@gmail.com> | 2019-05-30 15:02:11 +0530 |
commit | 490c7e060644a8d0d1d0c92bbe6f0e8922a08093 (patch) | |
tree | bd85c63461f0a1dfd9489956eea59ecd5f708170 /lib | |
parent | ff4a71ccc34ab122a0a78ac7bc1c5c57b7d14867 (diff) | |
download | android-node-v8-490c7e060644a8d0d1d0c92bbe6f0e8922a08093.tar.gz android-node-v8-490c7e060644a8d0d1d0c92bbe6f0e8922a08093.tar.bz2 android-node-v8-490c7e060644a8d0d1d0c92bbe6f0e8922a08093.zip |
lib: removed unnecessary fs.realpath `options` arg check + tests
Removed duplicated check for options argument of fs.realpath.
Added some tests which covering the cases for passing options arg
as null.
PR-URL: https://github.com/nodejs/node/pull/27909
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fs.js | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -1533,11 +1533,9 @@ realpathSync.native = (path, options) => { function realpath(p, options, callback) { callback = typeof options === 'function' ? options : maybeCallback(callback); - if (!options) - options = emptyObj; - else - options = getOptions(options, emptyObj); + options = getOptions(options, {}); p = toPathIfFileURL(p); + if (typeof p !== 'string') { p += ''; } |