Skip to content

Commit 1551b40

Browse files
aduh95targos
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 e12dbc8 commit 1551b40

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎lib/v8.js‎

Lines 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,
@@ -185,13 +187,14 @@ const arrayBufferViewTypeToIndex = new SafeMap();
185187

186188
{
187189
constdummy=newArrayBuffer();
188-
for(const[i,ctor]ofarrayBufferViewTypes.entries()){
190+
ArrayPrototypeForEach(arrayBufferViewTypes,(ctor,i)=>{
189191
consttag=ObjectPrototypeToString(newctor(dummy));
190192
arrayBufferViewTypeToIndex.set(tag,i);
191-
}
193+
});
192194
}
193195

194-
constbufferConstructorIndex=arrayBufferViewTypes.push(FastBuffer)-1;
196+
constbufferConstructorIndex=
197+
ArrayPrototypePush(arrayBufferViewTypes,FastBuffer)-1;
195198

196199
classDefaultSerializerextendsSerializer{
197200
constructor(){

0 commit comments

Comments
 (0)