|
| 1 | +// This file is included after the automatically-generated JS library code |
| 2 | +// but before the wasm module is created. |
| 3 | + |
| 4 | +#if WASM_ESM_INTEGRATION |
| 5 | +function processModuleArgs() |
| 6 | +#endif |
| 7 | +{ |
| 8 | + <<< ATMODULES >>> |
| 9 | + |
| 10 | +#if ASSERTIONS |
| 11 | + checkIncomingModuleAPI(); |
| 12 | +#endif |
| 13 | + |
| 14 | + {{{ makeModuleReceive('arguments_', 'arguments') }}} |
| 15 | + {{{ makeModuleReceive('thisProgram') }}} |
| 16 | + |
| 17 | +#if ASSERTIONS |
| 18 | + // Assertions on removed incoming Module JS APIs. |
| 19 | + assert(typeof Module['memoryInitializerPrefixURL'] == 'undefined', 'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead'); |
| 20 | + assert(typeof Module['pthreadMainPrefixURL'] == 'undefined', 'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead'); |
| 21 | + assert(typeof Module['cdInitializerPrefixURL'] == 'undefined', 'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead'); |
| 22 | + assert(typeof Module['filePackagePrefixURL'] == 'undefined', 'Module.filePackagePrefixURL option was removed, use Module.locateFile instead'); |
| 23 | + assert(typeof Module['read'] == 'undefined', 'Module.read option was removed'); |
| 24 | + assert(typeof Module['readAsync'] == 'undefined', 'Module.readAsync option was removed (modify readAsync in JS)'); |
| 25 | + assert(typeof Module['readBinary'] == 'undefined', 'Module.readBinary option was removed (modify readBinary in JS)'); |
| 26 | + assert(typeof Module['setWindowTitle'] == 'undefined', 'Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)'); |
| 27 | + assert(typeof Module['TOTAL_MEMORY'] == 'undefined', 'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY'); |
| 28 | + assert(typeof Module['ENVIRONMENT'] == 'undefined', 'Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)'); |
| 29 | + assert(typeof Module['STACK_SIZE'] == 'undefined', 'STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time') |
| 30 | +#if !IMPORTED_MEMORY |
| 31 | + // If memory is defined in wasm, the user can't provide it, or set INITIAL_MEMORY |
| 32 | + assert(typeof Module['wasmMemory'] == 'undefined', 'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally'); |
| 33 | + assert(typeof Module['INITIAL_MEMORY'] == 'undefined', 'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically'); |
| 34 | +#endif |
| 35 | +#endif // ASSERTIONS |
| 36 | + |
| 37 | + {{{ exportJSSymbols() }}} |
| 38 | +} |
0 commit comments