From 3cd6c401410f80eed26a837bbba5d990caaad942 Mon Sep 17 00:00:00 2001 From: Roberto Bianchi Date: Thu, 19 Mar 2026 10:26:19 +0100 Subject: [PATCH 1/2] fix(test): client wasm compatible with clang 22 Signed-off-by: Roberto Bianchi --- lib/web/fetch/index.js | 8 ++++---- test/client-wasm.js | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/web/fetch/index.js b/lib/web/fetch/index.js index 38bcfd3dfc2..adf974d6e4c 100644 --- a/lib/web/fetch/index.js +++ b/lib/web/fetch/index.js @@ -2169,10 +2169,10 @@ async function httpNetworkFetch ( headersList, body: decoders.length ? pipeline(this.body, ...decoders, (err) => { - if (err) { - this.onError(err) - } - }).on('error', onError) + if (err) { + this.onError(err) + } + }).on('error', onError) : this.body.on('error', onError) }) diff --git a/test/client-wasm.js b/test/client-wasm.js index 065729e26df..a7daeed7b9a 100644 --- a/test/client-wasm.js +++ b/test/client-wasm.js @@ -43,11 +43,8 @@ const { describe, test } = require('node:test') } }) - test('has the right amount of exports', async (t) => { - t = tspl(t, { plan: 2 }) - - t.ok(instance.exports, 'exports are present') - t.deepStrictEqual(Object.keys(instance.exports), [ + test('has the required exports', async (t) => { + const requiredExports = [ 'memory', '_initialize', '__indirect_function_table', @@ -88,7 +85,12 @@ const { describe, test } = require('node:test') 'llhttp_set_lenient_optional_cr_before_lf', 'llhttp_set_lenient_spaces_after_chunk_size', 'llhttp_message_needs_eof' - ]) + ] + t = tspl(t, { plan: requiredExports.length }) + + for (const key of requiredExports) { + t.ok(key in instance.exports, `${key} is exported`) + } await t.completed }) From ecefdb10a76ae64023fe2d0db4aefc72a7ec84d3 Mon Sep 17 00:00:00 2001 From: Roberto Bianchi Date: Thu, 19 Mar 2026 12:01:34 +0100 Subject: [PATCH 2/2] lint Signed-off-by: Roberto Bianchi --- lib/web/fetch/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/web/fetch/index.js b/lib/web/fetch/index.js index adf974d6e4c..38bcfd3dfc2 100644 --- a/lib/web/fetch/index.js +++ b/lib/web/fetch/index.js @@ -2169,10 +2169,10 @@ async function httpNetworkFetch ( headersList, body: decoders.length ? pipeline(this.body, ...decoders, (err) => { - if (err) { - this.onError(err) - } - }).on('error', onError) + if (err) { + this.onError(err) + } + }).on('error', onError) : this.body.on('error', onError) })