Skip to content

Commit e2fec2d

Browse files
committed
test_runner: use primordials in utils.js
Replace native array method (.push) with primordials (ArrayPrototypePush) in lib/internal/test_runner/utils.js for consistency and security. This improves protection against prototype pollution and aligns with the primordials pattern used throughout the codebase.
1 parent 879b95e commit e2fec2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/test_runner/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ function formatLinesToRanges(values) {
431431
if ((index > 0) && ((current - array[index - 1]) === 1)) {
432432
prev[prev.length - 1][1] = current;
433433
} else {
434-
prev.push([current]);
434+
ArrayPrototypePush(prev, [current]);
435435
}
436436
return prev;
437437
}, []), (range) => ArrayPrototypeJoin(range, '-'));

0 commit comments

Comments
 (0)