Skip to content

Commit 06d364e

Browse files
committed
lib: replace native methods with primordials
Replace native methods with primordials.
1 parent 879b95e commit 06d364e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/internal/freelist.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

33
const {
4+
ArrayPrototypePop,
5+
ArrayPrototypePush,
46
ReflectApply,
57
} = primordials;
68

@@ -14,13 +16,13 @@ class FreeList {
1416

1517
alloc() {
1618
return this.list.length > 0 ?
17-
this.list.pop() :
19+
ArrayPrototypePop(this.list) :
1820
ReflectApply(this.ctor, this, arguments);
1921
}
2022

2123
free(obj) {
2224
if (this.list.length < this.max) {
23-
this.list.push(obj);
25+
ArrayPrototypePush(this.list, obj);
2426
return true;
2527
}
2628
return false;

0 commit comments

Comments
 (0)