diff --git a/lib/internal/streams/compose.js b/lib/internal/streams/compose.js index 1b04a0f70a1e62..276ae6276071f6 100644 --- a/lib/internal/streams/compose.js +++ b/lib/internal/streams/compose.js @@ -1,5 +1,9 @@ 'use strict'; +const { + ArrayPrototypeSlice, +} = primordials; + const { pipeline } = require('internal/streams/pipeline'); const Duplex = require('internal/streams/duplex'); const { destroyer } = require('internal/streams/destroy'); @@ -30,7 +34,7 @@ module.exports = function compose(...streams) { return Duplex.from(streams[0]); } - const orgStreams = [...streams]; + const orgStreams = ArrayPrototypeSlice(streams); if (typeof streams[0] === 'function') { streams[0] = Duplex.from(streams[0]);