File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,16 +123,17 @@ context.LZ4BlockWASM.prototype = {
123123 flavor : 'wasm' ,
124124
125125 init : function ( ) {
126- if ( this . lz4wasmInstance instanceof WebAssembly . Instance ) {
127- return Promise . resolve ( this . lz4wasmInstance ) ;
128- }
129126 if (
130- this . lz4wasmInstance === null ||
131- WebAssembly instanceof Object === false ||
127+ typeof WebAssembly !== 'object' ||
132128 typeof WebAssembly . instantiateStreaming !== 'function'
133129 ) {
134130 this . lz4wasmInstance = null ;
135- return Promise . resolve ( null ) ;
131+ }
132+ if ( this . lz4wasmInstance === null ) {
133+ return Promise . reject ( ) ;
134+ }
135+ if ( this . lz4wasmInstance instanceof WebAssembly . Instance ) {
136+ return Promise . resolve ( this . lz4wasmInstance ) ;
136137 }
137138 if ( this . lz4wasmInstance === undefined ) {
138139 this . lz4wasmInstance = WebAssembly . instantiateStreaming (
You can’t perform that action at this time.
0 commit comments