Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ const {
HTTPParserError
} = require('./core/errors')
const buildConnector = require('./core/connect')
const llhttpWasmData = require('./llhttp/llhttp.wasm.js')
const llhttpSimdWasmData = require('./llhttp/llhttp_simd.wasm.js')

const {
kUrl,
kReset,
Expand Down Expand Up @@ -413,15 +410,15 @@ const EMPTY_BUF = Buffer.alloc(0)
async function lazyllhttp () {
let mod
try {
mod = await WebAssembly.compile(Buffer.from(llhttpWasmData, 'base64'))
mod = await WebAssembly.compile(Buffer.from(require('./llhttp/llhttp_simd.wasm.js'), 'base64'))
} catch (e) {
/* istanbul ignore next */

// We could check if the error was caused by the simd option not
// being enabled, but the occurring of this other error
// * https://github.com/emscripten-core/emscripten/issues/11495
// got me to remove that check to avoid breaking Node 12.
mod = await WebAssembly.compile(Buffer.from(llhttpSimdWasmData, 'base64'))
mod = await WebAssembly.compile(Buffer.from(require('./llhttp/llhttp.wasm.js'), 'base64'))
}

return await WebAssembly.instantiate(mod, {
Expand Down