You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[esm-integration] Allow for module argument processing
This change delays module argument processing until the init function
is run. This means that at least some INCOMING_MODULE_JS_API properties
can be supported with ESM integration.
assert(typeofModule['memoryInitializerPrefixURL']=='undefined','Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead');
1112
+
assert(typeofModule['pthreadMainPrefixURL']=='undefined','Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead');
1113
+
assert(typeofModule['cdInitializerPrefixURL']=='undefined','Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead');
1114
+
assert(typeofModule['filePackagePrefixURL']=='undefined','Module.filePackagePrefixURL option was removed, use Module.locateFile instead');
1115
+
assert(typeofModule['read']=='undefined','Module.read option was removed');
1116
+
assert(typeofModule['readAsync']=='undefined','Module.readAsync option was removed (modify readAsync in JS)');
1117
+
assert(typeofModule['readBinary']=='undefined','Module.readBinary option was removed (modify readBinary in JS)');
1118
+
assert(typeofModule['setWindowTitle']=='undefined','Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)');
1119
+
assert(typeofModule['TOTAL_MEMORY']=='undefined','Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY');
1120
+
assert(typeofModule['ENVIRONMENT']=='undefined','Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');
1121
+
assert(typeofModule['STACK_SIZE']=='undefined','STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time')
1122
+
#if !IMPORTED_MEMORY
1123
+
// If memory is defined in wasm, the user can't provide it, or set INITIAL_MEMORY
1124
+
assert(typeofModule['wasmMemory']=='undefined','Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally');
1125
+
assert(typeofModule['INITIAL_MEMORY']=='undefined','Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically');
Copy file name to clipboardExpand all lines: src/shell.js
+3-41
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@
21
21
// before the code. Then that object will be used in the code, and you
22
22
// can continue to use Module afterwards as well.
23
23
#if WASM_ESM_INTEGRATION
24
-
varModule={};
24
+
varModule;
25
25
#elif MODULARIZE
26
26
varModule=moduleArg;
27
27
#elif USE_CLOSURE_COMPILER
@@ -403,47 +403,9 @@ if (ENVIRONMENT_IS_NODE) {
403
403
#endif
404
404
405
405
#if ASSERTIONS
406
-
checkIncomingModuleAPI();
407
-
#endif
408
-
409
-
// Emit code to handle expected values on the Module object. This applies Module.x
410
-
// to the proper local x. This has two benefits: first, we only emit it if it is
411
-
// expected to arrive, and second, by using a local everywhere else that can be
412
-
// minified.
413
-
{{{makeModuleReceive('arguments_','arguments')}}}
414
-
{{{makeModuleReceive('thisProgram')}}}
415
-
416
-
// perform assertions in shell.js after we set up out() and err(), as otherwise if an assertion fails it cannot print the message
417
-
#if ASSERTIONS
418
-
// Assertions on removed incoming Module JS APIs.
419
-
assert(typeofModule['memoryInitializerPrefixURL']=='undefined','Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead');
420
-
assert(typeofModule['pthreadMainPrefixURL']=='undefined','Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead');
421
-
assert(typeofModule['cdInitializerPrefixURL']=='undefined','Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead');
422
-
assert(typeofModule['filePackagePrefixURL']=='undefined','Module.filePackagePrefixURL option was removed, use Module.locateFile instead');
423
-
assert(typeofModule['read']=='undefined','Module.read option was removed');
424
-
assert(typeofModule['readAsync']=='undefined','Module.readAsync option was removed (modify readAsync in JS)');
425
-
assert(typeofModule['readBinary']=='undefined','Module.readBinary option was removed (modify readBinary in JS)');
426
-
assert(typeofModule['setWindowTitle']=='undefined','Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)');
427
-
assert(typeofModule['TOTAL_MEMORY']=='undefined','Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY');
428
-
assert(typeofModule['ENVIRONMENT']=='undefined','Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');
429
-
assert(typeofModule['STACK_SIZE']=='undefined','STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time')
0 commit comments