| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 12d731e commit 6f0458d
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -300,17 +300,16 @@ class BuiltinModule { | |||
| 300 | 300 | } | |
| 301 | 301 | ||
| 302 | 302 | static normalizeRequirableId(id) { | |
| 303 | - let normalizedId = id; | ||
| 304 | 303 | if (StringPrototypeStartsWith(id, 'node:')) { | |
| 305 | - normalizedId = StringPrototypeSlice(id, 5); | ||
| 306 | - } | ||
| 307 | - | ||
| 308 | - if (!BuiltinModule.canBeRequiredByUsers(normalizedId) || | ||
| 309 | - (id === normalizedId && !BuiltinModule.canBeRequiredWithoutScheme(normalizedId))) { | ||
| 310 | - return undefined; | ||
| 304 | + const normalizedId = StringPrototypeSlice(id, 5); | ||
| 305 | + if (BuiltinModule.canBeRequiredByUsers(normalizedId)) { | ||
| 306 | + return normalizedId; | ||
| 307 | + } | ||
| 308 | + } else if (BuiltinModule.canBeRequiredWithoutScheme(id)) { | ||
| 309 | + return id; | ||
| 311 | 310 | } | |
| 312 | 311 | ||
| 313 | - return normalizedId; | ||
| 312 | + return undefined; | ||
| 314 | 313 | } | |
| 315 | 314 | ||
| 316 | 315 | static getSchemeOnlyModuleNames() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -782,12 +782,7 @@ if (isWindows) { | |||
| 782 | 782 | } | |
| 783 | 783 | ||
| 784 | 784 | Module._resolveLookupPaths = function(request, parent) { | |
| 785 | - if (( | ||
| 786 | - StringPrototypeStartsWith(request, 'node:') && | ||
| 787 | - BuiltinModule.canBeRequiredByUsers(StringPrototypeSlice(request, 5)) | ||
| 788 | - ) || ( | ||
| 789 | - BuiltinModule.canBeRequiredWithoutScheme(request) | ||
| 790 | - )) { | ||
| 785 | + if (BuiltinModule.normalizeRequirableId(request)) { | ||
| 791 | 786 | debug('looking for %j in []', request); | |
| 792 | 787 | return null; | |
| 793 | 788 | } | |
@@ -979,14 +974,7 @@ Module._load = function(request, parent, isMain) { | |||
| 979 | 974 | }; | |
| 980 | 975 | ||
| 981 | 976 | Module._resolveFilename = function(request, parent, isMain, options) { | |
| 982 | - if ( | ||
| 983 | - ( | ||
| 984 | - StringPrototypeStartsWith(request, 'node:') && | ||
| 985 | - BuiltinModule.canBeRequiredByUsers(StringPrototypeSlice(request, 5)) | ||
| 986 | - ) || ( | ||
| 987 | - BuiltinModule.canBeRequiredWithoutScheme(request) | ||
| 988 | - ) | ||
| 989 | - ) { | ||
| 977 | + if (BuiltinModule.normalizeRequirableId(request)) { | ||
| 990 | 978 | return request; | |
| 991 | 979 | } | |
| 992 | 980 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,10 +4,10 @@ throw new Error('Should include grayed stack trace') | |||
| 4 | 4 | ||
| 5 | 5 | Error: Should include grayed stack trace | |
| 6 | 6 | at Object.<anonymous> [90m(/[39mtest*force_colors.js:1:7[90m)[39m | |
| 7 | - [90m at Module._compile (node:internal*modules*cjs*loader:1257:14)[39m | ||
| 8 | - [90m at Module._extensions..js (node:internal*modules*cjs*loader:1311:10)[39m | ||
| 9 | - [90m at Module.load (node:internal*modules*cjs*loader:1115:32)[39m | ||
| 10 | - [90m at Module._load (node:internal*modules*cjs*loader:955:12)[39m | ||
| 7 | + [90m at Module._compile (node:internal*modules*cjs*loader:1245:14)[39m | ||
| 8 | + [90m at Module._extensions..js (node:internal*modules*cjs*loader:1299:10)[39m | ||
| 9 | + [90m at Module.load (node:internal*modules*cjs*loader:1103:32)[39m | ||
| 10 | + [90m at Module._load (node:internal*modules*cjs*loader:950:12)[39m | ||
| 11 | 11 | [90m at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:88:12)[39m | |
| 12 | 12 | [90m at node:internal*main*run_main_module:23:47[39m | |
| 13 | 13 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments