mirror of https://github.com/gorhill/uBlock.git
This commit is contained in:
parent
ed926036ee
commit
3c187c6278
|
@ -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(
|
||||||
|
|
Loading…
Reference in New Issue