diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-02-09 16:31:26 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-02-26 23:18:21 +0000 |
commit | c3eb3efa315382d1073d6a126f4d888cf3e121ec (patch) | |
tree | d70cac1a8d1d984153fbfc5860132e42720e540d /test/parallel/test-fs-realpath-native.js | |
parent | e9f2cecf1a14285574f9b6104dd690ef92495d74 (diff) | |
download | android-node-v8-c3eb3efa315382d1073d6a126f4d888cf3e121ec.tar.gz android-node-v8-c3eb3efa315382d1073d6a126f4d888cf3e121ec.tar.bz2 android-node-v8-c3eb3efa315382d1073d6a126f4d888cf3e121ec.zip |
fs: fix functions executed in wrong context
The callback should run in the global scope and not in the FSReqWrap
context.
PR-URL: https://github.com/nodejs/node/pull/18668
Refs: https://github.com/nodejs/node/pull/12562
Refs: https://github.com/nodejs/node/pull/12976
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'test/parallel/test-fs-realpath-native.js')
-rw-r--r-- | test/parallel/test-fs-realpath-native.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/parallel/test-fs-realpath-native.js b/test/parallel/test-fs-realpath-native.js index 43d6b8ca80..93b5a278cf 100644 --- a/test/parallel/test-fs-realpath-native.js +++ b/test/parallel/test-fs-realpath-native.js @@ -6,7 +6,8 @@ const fs = require('fs'); if (!common.isOSX) common.skip('MacOS-only test.'); assert.strictEqual(fs.realpathSync.native('/users'), '/Users'); -fs.realpath.native('/users', common.mustCall((err, res) => { +fs.realpath.native('/users', common.mustCall(function(err, res) { assert.ifError(err); assert.strictEqual(res, '/Users'); + assert.strictEqual(this, undefined); })); |