diff --git a/test/parallel/test-v8-serdes.js b/test/parallel/test-v8-serdes.js index 1b6638ac1a90bd..296e076a9f760d 100644 --- a/test/parallel/test-v8-serdes.js +++ b/test/parallel/test-v8-serdes.js @@ -107,7 +107,6 @@ const hostObject = new (internalBinding('js_stream').JSStream)(); { const text = 'hostObjectTag'; const data = Buffer.from(text); - const arrayBufferViews = common.getArrayBufferViews(data); // `buf` is one of `TypedArray` or `DataView`. function testWriteRawBytes(buf) { @@ -138,9 +137,9 @@ const hostObject = new (internalBinding('js_stream').JSStream)(); assert.strictEqual(des.readValue().val, hostObject); } - arrayBufferViews.forEach((buf) => { + for (const buf of common.getArrayBufferViews(data)) { testWriteRawBytes(buf); - }); + } } {