mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-04 01:59:38 +02:00
Remove stray async
This commit is contained in:
parent
98fc66bb1b
commit
076a088371
@ -81,14 +81,16 @@ function applyList(name, raw) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function enableWASM() {
|
async function enableWASM() {
|
||||||
const wasmModuleFetcher = async function(path) {
|
const wasmModuleFetcher = function(path) {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const require = createRequire(import.meta.url); // jshint ignore:line
|
const require = createRequire(import.meta.url); // jshint ignore:line
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
fs.readFile(`${path}.wasm`, null, (err, data) => {
|
fs.readFile(`${path}.wasm`, null, (err, data) => {
|
||||||
if ( err ) { return reject(err); }
|
if ( err ) { return reject(err); }
|
||||||
return globals.WebAssembly.compile(data).then(module => {
|
return globals.WebAssembly.compile(data).then(module => {
|
||||||
resolve(module);
|
resolve(module);
|
||||||
|
}).catch(reason => {
|
||||||
|
reject(reason);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -344,7 +344,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( µb.hiddenSettings.disableWebAssembly !== true ) {
|
if ( µb.hiddenSettings.disableWebAssembly !== true ) {
|
||||||
const wasmModuleFetcher = async function(path) {
|
const wasmModuleFetcher = function(path) {
|
||||||
return fetch(`${path}.wasm`, { mode: 'same-origin' }).then(
|
return fetch(`${path}.wasm`, { mode: 'same-origin' }).then(
|
||||||
globals.WebAssembly.compileStreaming
|
globals.WebAssembly.compileStreaming
|
||||||
).catch(reason => {
|
).catch(reason => {
|
||||||
|
Loading…
Reference in New Issue
Block a user