mirror of
https://github.com/nodejs/node.git
synced 2025-05-09 13:05:07 +00:00

`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>
14 lines
385 B
JavaScript
14 lines
385 B
JavaScript
// 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);
|