From 06d364e1d00d89618ef09e5b062108968c6cf133 Mon Sep 17 00:00:00 2001 From: Ayoub Mabrouk Date: Mon, 29 Dec 2025 17:10:05 +0100 Subject: [PATCH] lib: replace native methods with primordials Replace native methods with primordials. --- lib/internal/freelist.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/internal/freelist.js b/lib/internal/freelist.js index ac2b12c4d45a54..6366bc8f9d2002 100644 --- a/lib/internal/freelist.js +++ b/lib/internal/freelist.js @@ -1,6 +1,8 @@ 'use strict'; const { + ArrayPrototypePop, + ArrayPrototypePush, ReflectApply, } = primordials; @@ -14,13 +16,13 @@ class FreeList { alloc() { return this.list.length > 0 ? - this.list.pop() : + ArrayPrototypePop(this.list) : ReflectApply(this.ctor, this, arguments); } free(obj) { if (this.list.length < this.max) { - this.list.push(obj); + ArrayPrototypePush(this.list, obj); return true; } return false;