test_runner: replace native methods with primordials

Replace native methods with primordials.

PR-URL: https://github.com/nodejs/node/pull/61219
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
This commit is contained in:
Ayoub Mabrouk authored and Antoine du Hamel committed 2026-04-10 14:52:12 +02:00
1 parent 8d0c22ea20
commit b1199c7bb4
1 file changed
+2 -1
+2 -1
View File
@@ -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;