Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2dd2ec3

Browse filesBrowse files
aduh95danielleadams
authored andcommitted
v8: refactor to use more primordials
PR-URL: #36527 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
1 parent 7134d49 commit 2dd2ec3
Copy full SHA for 2dd2ec3

File tree

Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed
Open diff view settings
Collapse file

‎lib/v8.js‎

Copy file name to clipboardExpand all lines: lib/v8.js
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
const {
1818
Array,
1919
ArrayBuffer,
20+
ArrayPrototypeForEach,
21+
ArrayPrototypePush,
2022
DataView,
2123
Error,
2224
Float32Array,
@@ -191,13 +193,14 @@ const arrayBufferViewTypeToIndex = new SafeMap();
191193

192194
{
193195
const dummy = new ArrayBuffer();
194-
for (const [i, ctor] of arrayBufferViewTypes.entries()) {
196+
ArrayPrototypeForEach(arrayBufferViewTypes, (ctor, i) => {
195197
const tag = ObjectPrototypeToString(new ctor(dummy));
196198
arrayBufferViewTypeToIndex.set(tag, i);
197-
}
199+
});
198200
}
199201

200-
const bufferConstructorIndex = arrayBufferViewTypes.push(FastBuffer) - 1;
202+
const bufferConstructorIndex =
203+
ArrayPrototypePush(arrayBufferViewTypes, FastBuffer) - 1;
201204

202205
class DefaultSerializer extends Serializer {
203206
constructor() {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.