mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
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:
1 parent
8d0c22ea20
commit
b1199c7bb4
1 file changed
+2
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user