Ensure that WASM module was actually loaded

This commit is contained in:
Raymond Hill 2019-02-01 09:09:51 -05:00
parent 81e4cb81e3
commit fc03782985
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 3 additions and 0 deletions

View File

@ -497,6 +497,9 @@ HNTrieContainer.prototype = {
},
initWASM: function(module) {
if ( module instanceof WebAssembly.Module === false ) {
return Promise.resolve(null);
}
if ( this.wasmInstancePromise === null ) {
const memory = new WebAssembly.Memory({ initial: 2 });
this.wasmInstancePromise = WebAssembly.instantiate(