From de2a8de393f13d1d7c61c8d1926100e7ad60abcb Mon Sep 17 00:00:00 2001 From: Ayoub Mabrouk Date: Mon, 29 Dec 2025 19:43:01 +0100 Subject: [PATCH] test_runner: replace native methods with primordials Replace native methods with primordials. --- lib/internal/test_runner/snapshot.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/test_runner/snapshot.js b/lib/internal/test_runner/snapshot.js index ff3e3c8d0e6ee6..158ec1d44216cd 100644 --- a/lib/internal/test_runner/snapshot.js +++ b/lib/internal/test_runner/snapshot.js @@ -9,6 +9,7 @@ const { SafeMap, String, StringPrototypeReplaceAll, + StringPrototypeSlice, } = primordials; const { codes: { @@ -291,7 +292,7 @@ function validateFunctionArray(fns, name) { } function escapeSnapshotKey(str) { - let result = JSONStringify(str, null, 2).slice(1, -1); + let result = StringPrototypeSlice(JSONStringify(str, null, 2), 1, -1); result = StringPrototypeReplaceAll(result, '`', '\\`'); result = StringPrototypeReplaceAll(result, '${', '\\${'); return result;