1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00

Use WebAssembly object directly in index.js (#3843)

This commit is contained in:
Manish Jethani 2021-08-22 01:32:32 +05:30 committed by GitHub
parent cd2a03fb89
commit d6339ada62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,6 +19,8 @@
Home: https://github.com/gorhill/uBlock
*/
/* globals WebAssembly */
'use strict';
/******************************************************************************/
@ -57,7 +59,7 @@ async function enableWASM() {
const wasmModuleFetcher = function(path) {
const require = createRequire(import.meta.url); // jshint ignore:line
const wasm = new Uint8Array(require(`${path}.wasm.json`));
return globals.WebAssembly.compile(wasm);
return WebAssembly.compile(wasm);
};
try {
const results = await Promise.all([