diff --git a/lib/internal/v8_prof_polyfill.js b/lib/internal/v8_prof_polyfill.js index 5f5922c5386543..f266849628fbe8 100644 --- a/lib/internal/v8_prof_polyfill.js +++ b/lib/internal/v8_prof_polyfill.js @@ -120,8 +120,8 @@ function versionCheck(firstLine, expected) { // "v8-version,$major,$minor,$build,$patch[,$embedder],$candidate" // whereas process.versions.v8 is either "$major.$minor.$build-$embedder" or // "$major.$minor.$build.$patch-$embedder". - firstLine = firstLine.split(','); - const curVer = expected.split(/[.\-]/); + firstLine = StringPrototypeSplit(firstLine, ','); + const curVer = StringPrototypeSplit(expected, /[.\-]/); if (firstLine.length !== 6 && firstLine.length !== 7 || firstLine[0] !== 'v8-version') { return 'Unable to read v8-version from log file.'; diff --git a/lib/v8.js b/lib/v8.js index 2ecb4c06a1931e..4d26ddb85e1c4e 100644 --- a/lib/v8.js +++ b/lib/v8.js @@ -17,6 +17,8 @@ const { Array, ArrayBuffer, + ArrayPrototypeForEach, + ArrayPrototypePush, DataView, Error, Float32Array, @@ -198,13 +200,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() {