Commit 1db210a
module: check --experimental-require-module separately from detection
Previously we assumed if `--experimental-detect-module` is true, then
`--experimental-require-module` is true, which isn't the case, as
the two can be enabled/disabled separately. This patch fixes the
checks so `--no-experimental-require-module` is still effective when
`--experimental-detect-module` is enabled.
Drive-by: make the assertion messages more informative and remove
obsolete TODO about allowing TLA in entrypoints handled by
require(esm).
PR-URL: #55250
Backport-PR-URL: #56927
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Refs: #526971 parent ececd22 commit 1db210aCopy full SHA for 1db210a
File tree
Expand file treeCollapse file tree
3 files changed
+34
-5
lines changedOpen diff view settings
Filter options
- lib/internal/modules/cjs
- test
- es-module
- fixtures/es-modules
Expand file treeCollapse file tree
3 files changed
+34
-5
lines changedOpen diff view settings
Collapse file
lib/internal/modules/cjs/loader.js
Copy file name to clipboardExpand all lines: lib/internal/modules/cjs/loader.js+12-4Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1404 | 1404 | |
1405 | 1405 | |
1406 | 1406 | |
1407 | | - |
| 1407 | + |
1408 | 1408 | |
1409 | 1409 | |
1410 | 1410 | |
| ||
1434 | 1434 | |
1435 | 1435 | |
1436 | 1436 | |
1437 | | - |
| 1437 | + |
| 1438 | + |
| 1439 | + |
| 1440 | + |
| 1441 | + |
| 1442 | + |
| 1443 | + |
| 1444 | + |
| 1445 | + |
| 1446 | + |
| 1447 | + |
1438 | 1448 | |
1439 | 1449 | |
1440 | 1450 | |
| ||
1471 | 1481 | |
1472 | 1482 | |
1473 | 1483 | |
1474 | | - |
1475 | | - |
1476 | 1484 | |
1477 | 1485 | |
1478 | 1486 | |
|
Collapse file
test/es-module/test-disable-require-module-with-detection.js
Copy file name to clipboard+19Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
Collapse file
test/fixtures/es-modules/loose.js
Copy file name to clipboard+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | | - |
| 1 | + |
| 2 | + |
| 3 | + |
2 | 4 | |
3 | 5 | |
0 commit comments