Commit c1332e0
Bartek Wrona
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 d648fff commit c1332e0
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 | |
|---|---|---|---|
| |||
5823 | 5823 | | |
5824 | 5824 | | |
5825 | 5825 | | |
| 5826 | + | |
| 5827 | + | |
5826 | 5828 | | |
5827 | 5829 | | |
5828 | 5830 | | |
| |||
5846 | 5848 | | |
5847 | 5849 | | |
5848 | 5850 | | |
| 5851 | + | |
5849 | 5852 | | |
5850 | 5853 | | |
5851 | 5854 | | |
| |||
8656 | 8659 | | |
8657 | 8660 | | |
8658 | 8661 | | |
8659 | | - | |
8660 | | - | |
| 8662 | + | |
| 8663 | + | |
| 8664 | + | |
| 8665 | + | |
8661 | 8666 | | |
8662 | 8667 | | |
8663 | 8668 | | |
| |||
0 commit comments