| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 816ce75 commit 31afe95
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,6 +42,7 @@ const { | |||
| 42 | 42 | ERR_INVALID_MODULE_SPECIFIER, | |
| 43 | 43 | ERR_INVALID_PACKAGE_CONFIG, | |
| 44 | 44 | ERR_INVALID_PACKAGE_TARGET, | |
| 45 | + ERR_INVALID_URL, | ||
| 45 | 46 | ERR_MODULE_NOT_FOUND, | |
| 46 | 47 | ERR_PACKAGE_IMPORT_NOT_DEFINED, | |
| 47 | 48 | ERR_PACKAGE_PATH_NOT_EXPORTED, | |
@@ -847,12 +848,13 @@ function moduleResolve(specifier, base, conditions, preserveSymlinks) { | |||
| 847 | 848 | } else if (protocol === 'file:' && specifier[0] === '#') { | |
| 848 | 849 | resolved = packageImportsResolve(specifier, base, conditions); | |
| 849 | 850 | } else { | |
| 850 | - try { | ||
| 851 | - resolved = new URL(specifier); | ||
| 852 | - } catch (cause) { | ||
| 851 | + const url = URLParse(specifier); | ||
| 852 | + if (url !== null) { | ||
| 853 | + resolved = url; | ||
| 854 | + } else { | ||
| 853 | 855 | if (isData && !BuiltinModule.canBeRequiredWithoutScheme(specifier)) { | |
| 854 | 856 | const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base); | |
| 855 | - setOwnProperty(error, 'cause', cause); | ||
| 857 | + setOwnProperty(error, 'cause', new ERR_INVALID_URL(specifier)); | ||
| 856 | 858 | throw error; | |
| 857 | 859 | } | |
| 858 | 860 | resolved = packageResolve(specifier, base, conditions); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments