mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 23:06:49 +01:00
Update bootstrap-node.js to check for Array.isArray (#165289)
* Update bootstrap-node.js to check for Array.isArray * Update
This commit is contained in:
11
src/bootstrap-node.js
vendored
11
src/bootstrap-node.js
vendored
@@ -78,11 +78,14 @@ exports.removeGlobalNodeModuleLookupPaths = function () {
|
||||
// @ts-ignore
|
||||
Module._resolveLookupPaths = function (moduleName, parent) {
|
||||
const paths = originalResolveLookupPaths(moduleName, parent);
|
||||
let commonSuffixLength = 0;
|
||||
while (commonSuffixLength < paths.length && paths[paths.length - 1 - commonSuffixLength] === globalPaths[globalPaths.length - 1 - commonSuffixLength]) {
|
||||
commonSuffixLength++;
|
||||
if (Array.isArray(paths)) {
|
||||
let commonSuffixLength = 0;
|
||||
while (commonSuffixLength < paths.length && paths[paths.length - 1 - commonSuffixLength] === globalPaths[globalPaths.length - 1 - commonSuffixLength]) {
|
||||
commonSuffixLength++;
|
||||
}
|
||||
return paths.slice(0, paths.length - commonSuffixLength);
|
||||
}
|
||||
return paths.slice(0, paths.length - commonSuffixLength);
|
||||
return paths;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user