Skip to content

Commit 14aaf4e

Browse files
test_runner: replace native methods with primordials
Replace native methods with primordials. PR-URL: #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>
1 parent 84d1e6c commit 14aaf4e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/test_runner/snapshot.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const {
99
SafeMap,
1010
String,
1111
StringPrototypeReplaceAll,
12+
StringPrototypeSlice,
1213
} = primordials;
1314
const {
1415
codes: {
@@ -291,7 +292,7 @@ function validateFunctionArray(fns, name) {
291292
}
292293

293294
function escapeSnapshotKey(str) {
294-
let result = JSONStringify(str, null, 2).slice(1, -1);
295+
let result = StringPrototypeSlice(JSONStringify(str, null, 2), 1, -1);
295296
result = StringPrototypeReplaceAll(result, '`', '\\`');
296297
result = StringPrototypeReplaceAll(result, '${', '\\${');
297298
return result;

0 commit comments

Comments
 (0)