mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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:
1 parent
7134d49e56
commit
2dd2ec3836
1 file changed
+6
-3
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user