function chunkedPush(list, right) {
  /** @type {number} */
  let chunkStart = 0

  if (right.length < constants.v8MaxSafeChunkSize) {
    list.push(...right)
  } else {
    while (chunkStart < right.length) {
      list.push(
        ...right.slice(chunkStart, chunkStart + constants.v8MaxSafeChunkSize)
      )
      chunkStart += constants.v8MaxSafeChunkSize
    }
  }
}
Avoid stack overflow by pushing items onto the stack in segments

@template T
  Item type.
@param {Array<T>} list
  List to inject into.
@param {ReadonlyArray<T>} right
  Items to inject.
@return {undefined}
  Nothing.