Commit 581bbaa
Add require() polyfill for EM_ASM tests in ESM modes
Instead of skipping EM_ASM tests that use CJS require() in ESM modes,
add a createRequire-based polyfill (available since Node 12.2.0) that
makes require() available in ESM output. The polyfill is only included
when the build targets ESM (EXPORT_ES6, MODULARIZE=instance, or
WASM_ESM_INTEGRATION).
- Add test/require_polyfill.js using createRequire from 'module'
- Add is_esm() and add_require_polyfill() helpers to test/common.py
- Remove @no_modularize_instance skips from test_fs_nodefs_rw and
test_fs_nodefs_home, enabling them in ESM test modes1 parent 145c961 commit 581bbaa
3 files changed
+23
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
629 | 637 | | |
630 | 638 | | |
631 | 639 | | |
632 | 640 | | |
633 | 641 | | |
634 | 642 | | |
| 643 | + | |
635 | 644 | | |
636 | 645 | | |
637 | 646 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5825 | 5825 | | |
5826 | 5826 | | |
5827 | 5827 | | |
| 5828 | + | |
| 5829 | + | |
5828 | 5830 | | |
5829 | 5831 | | |
5830 | 5832 | | |
| |||
5848 | 5850 | | |
5849 | 5851 | | |
5850 | 5852 | | |
| 5853 | + | |
5851 | 5854 | | |
5852 | 5855 | | |
5853 | 5856 | | |
| |||
8662 | 8665 | | |
8663 | 8666 | | |
8664 | 8667 | | |
8665 | | - | |
8666 | | - | |
| 8668 | + | |
| 8669 | + | |
| 8670 | + | |
| 8671 | + | |
8667 | 8672 | | |
8668 | 8673 | | |
8669 | 8674 | | |
| |||
0 commit comments