@@ -255,14 +255,14 @@ if (process.platform === 'win32') {
255
255
// path for dirver root like 'C:\node_modules' and don't need to
256
256
// parse driver name.
257
257
if ( code === 92 /*\*/ || code === 47 /*/*/ || code === 58 /*:*/ ||
258
- ( adjacentNodeModules && code === 46 /*. */) ) {
258
+ ( adjacentNodeModules && code === 43 /*+ */) ) {
259
259
if ( p !== nmLen ) {
260
260
var parent = from . slice ( 0 , last ) ;
261
261
paths . push ( parent + '\\node_modules' ) ;
262
262
263
263
if ( adjacentNodeModules ) {
264
264
paths . push ( parent + '+node_modules' ) ;
265
- if ( code === 46 /*. */) {
265
+ if ( code === 43 /*+ */) {
266
266
while ( i > 1 ) {
267
267
const code = from . charCodeAt ( -- i ) ;
268
268
if ( code === 92 /*\*/ || code === 47 /*/*/ || code === 58 /*:*/ ) {
@@ -306,14 +306,14 @@ if (process.platform === 'win32') {
306
306
var last = from . length ;
307
307
for ( var i = from . length - 1 ; i >= 0 ; -- i ) {
308
308
const code = from . charCodeAt ( i ) ;
309
- if ( code === 47 /*/*/ || ( adjacentNodeModules && code === 46 /*. */) ) {
309
+ if ( code === 47 /*/*/ || ( adjacentNodeModules && code === 43 /*+ */) ) {
310
310
if ( p !== nmLen ) {
311
311
var parent = from . slice ( 0 , last ) ;
312
312
paths . push ( parent + '/node_modules' ) ;
313
313
314
314
if ( adjacentNodeModules ) {
315
315
paths . push ( parent + '+node_modules' ) ;
316
- if ( code === 46 /*. */) {
316
+ if ( code === 43 /*+ */) {
317
317
while ( i > 1 ) {
318
318
if ( from . charCodeAt ( -- i ) === 47 /*/*/ ) {
319
319
break ;
@@ -434,8 +434,7 @@ Module._resolveLookupPaths = function(request, parent) {
434
434
return [ id , [ path . dirname ( parent . filename ) ] ] ;
435
435
} ;
436
436
437
- // when preserving symlinks, if the main file is both a file symlink AND
438
- // has execute permission (on windows, its extension is in PATHEXT), then
437
+ // when preserving symlinks, if the main file is a file symlink then
439
438
// its target is simply read and resolved, potentially relative to the
440
439
// symlink's dirname. in all other cases the original path is preserved.
441
440
Module . _resolveMainRequest = function ( request ) {
@@ -448,23 +447,6 @@ Module._resolveMainRequest = function(request) {
448
447
return request ;
449
448
}
450
449
451
- let isExecutable = false ;
452
- if ( process . platform === 'win32' ) {
453
- const execExts = ( process . env . PATHEXT || '' ) . split ( path . delimiter ) ;
454
- const requestExt = path . extname ( request ) . toLowerCase ( ) ;
455
- isExecutable =
456
- execExts . some ( ( execExt ) => requestExt === execExt . trim ( ) . toLowerCase ( ) ) ;
457
- } else {
458
- try {
459
- fs . accessSync ( request , fs . constants . X_OK ) ;
460
- isExecutable = true ;
461
- } catch ( e ) { }
462
- }
463
-
464
- if ( ! isExecutable ) {
465
- return request ;
466
- }
467
-
468
450
const targetPath = fs . readlinkSync ( request ) ;
469
451
return path . isAbsolute ( targetPath )
470
452
? targetPath
0 commit comments