diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2017-07-08 13:06:02 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2017-07-24 16:56:31 +0200 |
commit | c83d9bbffbe879f9d67f72c14213139616ec4302 (patch) | |
tree | 778f866885a0bf17967fcc26bd25eb284ffb2964 /test/parallel/test-module-children.js | |
parent | 355523fcfb3314f1ebc7e57342fb7b22c506f3fd (diff) | |
download | android-node-v8-c83d9bbffbe879f9d67f72c14213139616ec4302.tar.gz android-node-v8-c83d9bbffbe879f9d67f72c14213139616ec4302.tar.bz2 android-node-v8-c83d9bbffbe879f9d67f72c14213139616ec4302.zip |
lib: include cached modules in module.children
`module.children` is supposed to be the list of modules included by this
module but lib/module.js failed to update the list when the included
module was retrieved from `Module._cache`.
Fixes: https://github.com/nodejs/node/issues/7131
PR-URL: https://github.com/nodejs/node/pull/14132
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'test/parallel/test-module-children.js')
-rw-r--r-- | test/parallel/test-module-children.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/parallel/test-module-children.js b/test/parallel/test-module-children.js new file mode 100644 index 0000000000..9eec14fda6 --- /dev/null +++ b/test/parallel/test-module-children.js @@ -0,0 +1,13 @@ +// Flags: --no-deprecation +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); + +const dir = path.join(common.fixturesDir, 'GH-7131'); +const b = require(path.join(dir, 'b')); +const a = require(path.join(dir, 'a')); + +assert.strictEqual(a.length, 1); +assert.strictEqual(b.length, 0); +assert.deepStrictEqual(a[0].exports, b); |