Skip to content

Commit c2c7ac7

Browse files
authored
Fix WASM_WORKERS + EXPORT_ES6 (#24923)
Fixes: #17664
1 parent ffd34cf commit c2c7ac7

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/lib/libwasm_worker.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
#endif
4040
`;
4141
const wasmWorkerOptions = `{
42+
#if EXPORT_ES6
43+
'type': 'module',
44+
#endif
4245
#if ENVIRONMENT_MAY_BE_NODE
4346
// This is the way that we signal to the node worker that it is hosting
4447
// a wasm worker.

test/test_browser.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5095,6 +5095,9 @@ def test_system(self):
50955095
def test_wasm_worker_hello(self):
50965096
self.btest_exit('wasm_worker/hello_wasm_worker.c', cflags=['-sWASM_WORKERS', '-sENVIRONMENT=web'])
50975097

5098+
def test_wasm_worker_hello_export_es6(self):
5099+
self.btest_exit('wasm_worker/hello_wasm_worker.c', cflags=['-sWASM_WORKERS', '-sENVIRONMENT=web', '-sEXPORT_ES6'])
5100+
50985101
def test_wasm_worker_hello_minimal_runtime_2(self):
50995102
self.btest_exit('wasm_worker/hello_wasm_worker.c', cflags=['-sWASM_WORKERS', '-sMINIMAL_RUNTIME=2'])
51005103

test/test_other.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14873,6 +14873,12 @@ def test_debug_opt_warning(self, should_fail, args):
1487314873
def test_wasm_worker_trusted_types(self):
1487414874
self.do_run_in_out_file_test('wasm_worker/hello_wasm_worker.c', cflags=['-sWASM_WORKERS', '-sTRUSTED_TYPES'])
1487514875

14876+
def test_wasm_worker_export_es6(self):
14877+
self.do_run_in_out_file_test('wasm_worker/hello_wasm_worker.c', cflags=['-sWASM_WORKERS',
14878+
'-sEXPORT_ES6',
14879+
'--extern-post-js',
14880+
test_file('modularize_post_js.js')])
14881+
1487614882
def test_wasm_worker_terminate(self):
1487714883
self.do_runf('wasm_worker/terminate_wasm_worker.c', cflags=['-sWASM_WORKERS'])
1487814884

0 commit comments

Comments
 (0)