From c3dbd0c1e4eb49b4cf3107b79bab8d36239e4cf8 Mon Sep 17 00:00:00 2001 From: DaisyDogs07 <74784459+DaisyDogs07@users.noreply.github.com> Date: Sat, 15 Jul 2023 10:16:25 -0400 Subject: [PATCH] util: use `primordials.ArrayPrototypeIndexOf` instead of mutable method PR-URL: https://github.com/nodejs/node/pull/48586 Reviewed-By: Antoine du Hamel --- lib/internal/util/inspect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index 5bb671e6ad6a35..2e3e1b60be871c 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -1215,7 +1215,7 @@ function getFunctionBase(value, constructor, tag) { function identicalSequenceRange(a, b) { for (let i = 0; i < a.length - 3; i++) { // Find the first entry of b that matches the current entry of a. - const pos = b.indexOf(a[i]); + const pos = ArrayPrototypeIndexOf(b, a[i]); if (pos !== -1) { const rest = b.length - pos; if (rest > 3) {