Comparing version 4.9.1 to 4.9.2
@@ -411,4 +411,2 @@ 'use strict' | ||
let llhttpPromise | ||
let llhttpInstance | ||
async function lazyllhttp () { | ||
@@ -431,3 +429,3 @@ const { resolve } = require('path') | ||
llhttpInstance = new WebAssembly.Instance(mod, { | ||
return await WebAssembly.instantiate(mod, { | ||
env: { | ||
@@ -480,6 +478,10 @@ /* eslint-disable camelcase */ | ||
}) | ||
return llhttpInstance | ||
} | ||
let llhttpInstance = null | ||
let llhttpPromise = lazyllhttp() | ||
.catch(() => { | ||
// TODO: Emit warning? | ||
}) | ||
let currentParser = null | ||
@@ -1144,11 +1146,2 @@ let currentBufferRef = null | ||
try { | ||
if (!llhttpInstance) { | ||
if (!llhttpPromise) { | ||
llhttpPromise = lazyllhttp() | ||
} | ||
await llhttpPromise | ||
assert(llhttpInstance) | ||
llhttpPromise = null | ||
} | ||
const socket = await new Promise((resolve, reject) => { | ||
@@ -1170,2 +1163,7 @@ client[kConnector]({ | ||
if (!llhttpInstance) { | ||
llhttpInstance = await llhttpPromise | ||
llhttpPromise = null | ||
} | ||
client[kConnecting] = false | ||
@@ -1172,0 +1170,0 @@ |
{ | ||
"name": "undici", | ||
"version": "4.9.1", | ||
"version": "4.9.2", | ||
"description": "An HTTP/1.1 client, written from scratch for Node.js", | ||
@@ -5,0 +5,0 @@ "homepage": "https://undici.nodejs.org", |
632164
9938