Skip to content

Commit de2a8de

Browse files
committed
test_runner: replace native methods with primordials
Replace native methods with primordials.
1 parent 5c8ce91 commit de2a8de

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)