diff --git a/lib/internal/child_process/serialization.js b/lib/internal/child_process/serialization.js index df645d9a05c2d8..c5ac2cbae8c5f8 100644 --- a/lib/internal/child_process/serialization.js +++ b/lib/internal/child_process/serialization.js @@ -71,7 +71,12 @@ const advanced = { while (messageBufferHead.length >= 4) { // We call `readUInt32BE` manually here, because this is faster than first converting // it to a buffer and using `readUInt32BE` on that. - const fullMessageSize = ReflectApply(readUInt32BE, messageBufferHead, [0]) + 4; + const fullMessageSize = ( + messageBufferHead[0] << 24 | + messageBufferHead[1] << 16 | + messageBufferHead[2] << 8 | + messageBufferHead[3] + ) + 4; if (channel[kMessageBufferSize] < fullMessageSize) break;