test: replace forEach in whatwg-encoding-custom-interop

PR-URL: https://github.com/nodejs/node/pull/50607
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Honza Machala 2023-11-19 21:29:56 +01:00 committed by GitHub
parent 48f32d71a5
commit 96890f6f33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,9 +56,9 @@ assert(TextEncoder);
encodingGetter.call(instance); encodingGetter.call(instance);
const invalidThisArgs = [{}, [], true, 1, '', new TextDecoder()]; const invalidThisArgs = [{}, [], true, 1, '', new TextDecoder()];
invalidThisArgs.forEach((i) => { for (const i of invalidThisArgs) {
assert.throws(() => inspectFn.call(i, Infinity, {}), expectedError); assert.throws(() => inspectFn.call(i, Infinity, {}), expectedError);
assert.throws(() => encodeFn.call(i), expectedError); assert.throws(() => encodeFn.call(i), expectedError);
assert.throws(() => encodingGetter.call(i), expectedError); assert.throws(() => encodingGetter.call(i), expectedError);
}); }
} }