mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 16:22:29 +00:00

This commit consists of two changes: * Avoids returning request/id *just* for the debug() output * Returns `null` instead of an empty array for the list of paths PR-URL: https://github.com/nodejs/node/pull/10789 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
16 lines
540 B
JavaScript
16 lines
540 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const _module = require('module'); // avoid collision with global.module
|
|
const lookupResults = _module._resolveLookupPaths('./lodash');
|
|
let paths = lookupResults[1];
|
|
|
|
assert.strictEqual(paths[0], '.',
|
|
'Current directory gets highest priority for local modules');
|
|
|
|
paths = _module._resolveLookupPaths('./lodash', null, true);
|
|
|
|
assert.strictEqual(paths && paths[0], '.',
|
|
'Current directory gets highest priority for local modules');
|