| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d1331fc commit 4813a6a
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -318,8 +318,6 @@ class ModuleLoader { | |||
| 318 | 318 | * @returns {ModuleJobBase} | |
| 319 | 319 | */ | |
| 320 | 320 | getModuleJobForRequire(specifier, parentURL, importAttributes) { | |
| 321 | - assert(getOptionValue('--experimental-require-module')); | ||
| 322 | - | ||
| 323 | 321 | const parsed = URLParse(specifier); | |
| 324 | 322 | if (parsed != null) { | |
| 325 | 323 | const protocol = parsed.protocol; | |
@@ -338,6 +336,9 @@ class ModuleLoader { | |||
| 338 | 336 | } | |
| 339 | 337 | ||
| 340 | 338 | const { url, format } = resolveResult; | |
| 339 | + if (!getOptionValue('--experimental-require-module')) { | ||
| 340 | + throw new ERR_REQUIRE_ESM(url, true); | ||
| 341 | + } | ||
| 341 | 342 | const resolvedImportAttributes = resolveResult.importAttributes ?? importAttributes; | |
| 342 | 343 | let job = this.loadCache.get(url, resolvedImportAttributes.type); | |
| 343 | 344 | if (job !== undefined) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments