From 0a022c496dd23206a7fa69ed5a560082f775ce7a 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 da71e4513d99a3..bc5ea4b31a2ad5 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -1216,7 +1216,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) {