Skip to content

Commit 2dd2ec3

Browse 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

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,
@@ -191,13 +193,14 @@ const arrayBufferViewTypeToIndex = new SafeMap();
191193

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

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

202205
classDefaultSerializerextendsSerializer{
203206
constructor(){

0 commit comments

Comments
 (0)