Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 243e6b2

Browse filesBrowse files
Ayoub-Mabroukaduh95
authored andcommitted
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 3337b09 commit 243e6b2
Copy full SHA for 243e6b2

1 file changed

+2-1Lines changed: 2 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/test_runner/snapshot.js‎

Copy file name to clipboardExpand all lines: lib/internal/test_runner/snapshot.js
+2-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.