Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v8: refactor to use more primordials #36527

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/v8.js
Expand Up @@ -17,6 +17,8 @@
const {
Array,
ArrayBuffer,
ArrayPrototypeForEach,
ArrayPrototypePush,
DataView,
Error,
Float32Array,
Expand Down Expand Up @@ -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() {
Expand Down