File tree 2 files changed +14
-2
lines changed
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -814,7 +814,7 @@ jobs:
814
814
instance.test_EXPORTED_RUNTIME_METHODS
815
815
instance.test_ccall
816
816
instance.test_dylink_basics*
817
- instance.test_Module_dynamicLibraries
817
+ instance.test_Module_dynamicLibraries*
818
818
esm_integration.test_fs_js_api*
819
819
esm_integration.test_inlinejs3
820
820
esm_integration.test_embind_val_basics
Original file line number Diff line number Diff line change @@ -302,7 +302,14 @@ function preInit() {
302
302
#if MODULARIZE == 'instance'
303
303
// In MODULARIZE=instance mode we delay most of the initialization work until
304
304
// the `init` function is called.
305
+ #if ASSERTIONS
306
+ var initCalled = false ;
307
+ #endif
305
308
export default async function init ( moduleArg = { } ) {
309
+ #if ASSERTIONS
310
+ assert ( ! initCalled ) ;
311
+ initCalled = true ;
312
+ #endif
306
313
Object . assign ( Module , moduleArg ) ;
307
314
processModuleArgs ( ) ;
308
315
#if WASM_ESM_INTEGRATION
@@ -322,7 +329,12 @@ if (ENVIRONMENT_IS_PTHREAD) await init()
322
329
323
330
#if ENVIRONMENT_MAY_BE_NODE
324
331
// 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
+ {
326
338
const url = await import ( 'url' ) ;
327
339
const isMainModule = url . pathToFileURL ( process . argv [ 1 ] ) . href === import . meta. url ;
328
340
if ( isMainModule ) await init ( ) ;
You can’t perform that action at this time.
0 commit comments