diff --git a/test/parallel/test-webcrypto-prototype-pollution.mjs b/test/parallel/test-webcrypto-prototype-pollution.mjs index 8bb93cff0ae..8ca65ba376f 100644 --- a/test/parallel/test-webcrypto-prototype-pollution.mjs +++ b/test/parallel/test-webcrypto-prototype-pollution.mjs @@ -265,14 +265,15 @@ await withPoisoned( info: new Uint8Array(0), }, key, length); - // [EnforceRange] and [Clamp] are not set for a plain `unsigned long`, so - // 2 ** 32 wraps to 0 rather than throwing or clamping. + // deriveBits length is [EnforceRange], so 2 ** 32 must throw even when + // conversion option properties are inherited from Object.prototype. for (const attribute of ['enforceRange', 'clamp']) { await withPoisoned( inherited(attribute, true), - common.mustCall(async () => { - assert.strictEqual((await hkdf(2 ** 32)).byteLength, 0); - })); + common.mustCall(() => assert.rejects(hkdf(2 ** 32), { + code: 'ERR_OUT_OF_RANGE', + name: 'TypeError', + }))); } // [AllowResizable] is not set for BufferSource.