(file)
| 454 | } |
| 455 | |
| 456 | function getBinarySync(file) { |
| 457 | #if SINGLE_FILE && SINGLE_FILE_BINARY_ENCODE |
| 458 | return file; |
| 459 | #else |
| 460 | #if SINGLE_FILE |
| 461 | if (ArrayBuffer.isView(file)) { |
| 462 | return file; |
| 463 | } |
| 464 | #endif |
| 465 | #if expectToReceiveOnModule('wasmBinary') || WASM2JS |
| 466 | if (file == wasmBinaryFile && wasmBinary) { |
| 467 | return new Uint8Array(wasmBinary); |
| 468 | } |
| 469 | #endif |
| 470 | if (readBinary) { |
| 471 | return readBinary(file); |
| 472 | } |
| 473 | // Throwing a plain string here, even though it not normally advisable since |
| 474 | // this gets turning into an `abort` in instantiateArrayBuffer. |
| 475 | #if WASM_ASYNC_COMPILATION |
| 476 | throw 'both async and sync fetching of the wasm failed'; |
| 477 | #else |
| 478 | throw 'sync fetching of the wasm failed: you can preload it to Module["wasmBinary"] manually, or emcc.py will do that for you when generating HTML (but not JS)'; |
| 479 | #endif |
| 480 | #endif |
| 481 | } |
| 482 | |
| 483 | async function getWasmBinary(binaryFile) { |
| 484 | #if !SINGLE_FILE |
no test coverage detected