v8: refactor to use more primordials

PR-URL: https://github.com/nodejs/node/pull/36527
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
This commit is contained in:
Antoine du Hamel authored and Danielle Adams committed 2021-01-12 07:07:53 -05:00
1 parent 7134d49e56
commit 2dd2ec3836
1 file changed
+6 -3
+6 -3
View File
@@ -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() {