File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -814,7 +814,7 @@ jobs:
814814 instance.test_EXPORTED_RUNTIME_METHODS
815815 instance.test_ccall
816816 instance.test_dylink_basics*
817- instance.test_Module_dynamicLibraries
817+ instance.test_Module_dynamicLibraries*
818818 esm_integration.test_fs_js_api*
819819 esm_integration.test_inlinejs3
820820 esm_integration.test_embind_val_basics
Original file line number Diff line number Diff line change @@ -302,7 +302,14 @@ function preInit() {
302302#if MODULARIZE == 'instance'
303303// In MODULARIZE=instance mode we delay most of the initialization work until
304304// the `init` function is called.
305+ #if ASSERTIONS
306+ var initCalled = false ;
307+ #endif
305308export default async function init ( moduleArg = { } ) {
309+ #if ASSERTIONS
310+ assert ( ! initCalled ) ;
311+ initCalled = true ;
312+ #endif
306313 Object . assign ( Module , moduleArg ) ;
307314 processModuleArgs ( ) ;
308315#if WASM_ESM_INTEGRATION
@@ -322,7 +329,12 @@ if (ENVIRONMENT_IS_PTHREAD) await init()
322329
323330#if ENVIRONMENT_MAY_BE_NODE
324331// When run as the main script under node we run `init` immediately.
325- if ( ENVIRONMENT_IS_NODE ) {
332+ if ( ENVIRONMENT_IS_NODE
333+ #if PTHREADS || WASM_WORKERS
334+ && ! { { { ENVIRONMENT_IS_WORKER_THREAD ( ) } } }
335+ #endif
336+ )
337+ {
326338 const url = await import ( 'url' ) ;
327339 const isMainModule = url . pathToFileURL ( process . argv [ 1 ] ) . href === import . meta. url ;
328340 if ( isMainModule ) await init ( ) ;
You can’t perform that action at this time.
0 commit comments