Skip to content

Commit 3fd1f0d

Browse files
Handle wasm streaming compile failure when initializing WasmOffsetConverter asynchronously (#12407)
Avoids an unhandled promise rejection error. Fixes #12395
1 parent 1c33ce7 commit 3fd1f0d

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,3 +510,4 @@ a license to everyone to use it as detailed in LICENSE.)
510510
* Benjamin Lee <[email protected]>
511511
* Attila Oláh <[email protected]> (copyright owned by Google, LLC)
512512
* Marat Dukhan <[email protected]> (copyright owned by Google, LLC)
513+
* Stephan Reiter <[email protected]> (copyright owned by Google, LLC)

src/preamble.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,8 @@ function createWasm() {
991991
Promise.all([response.clone().arrayBuffer(), result]).then(function (results) {
992992
wasmOffsetConverter = new WasmOffsetConverter(new Uint8Array(results[0]), results[1].module);
993993
{{{ runOnMainThread("removeRunDependency('offset-converter');") }}}
994+
}, function(reason) {
995+
err('failed to initialize offset-converter: ' + reason);
994996
});
995997
#endif
996998
return result.then(receiveInstantiatedSource, function(reason) {

0 commit comments

Comments
 (0)