diff --git a/lib/v8.js b/lib/v8.js index 0ca1103cee9c0e..f1c624bc10add0 100644 --- a/lib/v8.js +++ b/lib/v8.js @@ -17,6 +17,8 @@ const { Array, ArrayBuffer, + ArrayPrototypeForEach, + ArrayPrototypePush, DataView, Error, Float32Array, @@ -191,13 +193,14 @@ const arrayBufferViewTypeToIndex = new SafeMap(); { const dummy = new ArrayBuffer(); - for (const [i, ctor] of arrayBufferViewTypes.entries()) { + ArrayPrototypeForEach(arrayBufferViewTypes, (ctor, i) => { const tag = ObjectPrototypeToString(new ctor(dummy)); arrayBufferViewTypeToIndex.set(tag, i); - } + }); } -const bufferConstructorIndex = arrayBufferViewTypes.push(FastBuffer) - 1; +const bufferConstructorIndex = + ArrayPrototypePush(arrayBufferViewTypes, FastBuffer) - 1; class DefaultSerializer extends Serializer { constructor() {