Raymond Hill 2018-08-29 08:20:31 -04:00
parent ed926036ee
commit 3c187c6278
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 7 additions and 6 deletions

View File

@ -123,16 +123,17 @@ context.LZ4BlockWASM.prototype = {
flavor: 'wasm', flavor: 'wasm',
init: function() { init: function() {
if ( this.lz4wasmInstance instanceof WebAssembly.Instance ) {
return Promise.resolve(this.lz4wasmInstance);
}
if ( if (
this.lz4wasmInstance === null || typeof WebAssembly !== 'object' ||
WebAssembly instanceof Object === false ||
typeof WebAssembly.instantiateStreaming !== 'function' typeof WebAssembly.instantiateStreaming !== 'function'
) { ) {
this.lz4wasmInstance = null; this.lz4wasmInstance = null;
return Promise.resolve(null); }
if ( this.lz4wasmInstance === null ) {
return Promise.reject();
}
if ( this.lz4wasmInstance instanceof WebAssembly.Instance ) {
return Promise.resolve(this.lz4wasmInstance);
} }
if ( this.lz4wasmInstance === undefined ) { if ( this.lz4wasmInstance === undefined ) {
this.lz4wasmInstance = WebAssembly.instantiateStreaming( this.lz4wasmInstance = WebAssembly.instantiateStreaming(