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 c308862

Browse filesBrowse files
aduh95targos
authored andcommitted
test_runner: avoid spread operator on arrays
PR-URL: #55143 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent cc88382 commit c308862
Copy full SHA for c308862

File tree

Expand file treeCollapse file tree

2 files changed

+5
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-3
lines changed
Open diff view settings
Collapse file

‎lib/internal/test_runner/runner.js‎

Copy file name to clipboardExpand all lines: lib/internal/test_runner/runner.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ function getRunArgs(path, { forceExit,
158158
ArrayPrototypePushApply(argv, execArgv);
159159

160160
if (path === kIsolatedProcessName) {
161-
ArrayPrototypePush(argv, '--test', ...ArrayPrototypeSlice(process.argv, 1));
161+
ArrayPrototypePush(argv, '--test');
162+
ArrayPrototypePushApply(argv, ArrayPrototypeSlice(process.argv, 1));
162163
} else {
163164
ArrayPrototypePush(argv, path);
164165
}
Collapse file

‎lib/internal/test_runner/test.js‎

Copy file name to clipboardExpand all lines: lib/internal/test_runner/test.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const {
88
ArrayPrototypeSome,
99
ArrayPrototypeSplice,
1010
ArrayPrototypeUnshift,
11+
ArrayPrototypeUnshiftApply,
1112
FunctionPrototype,
1213
MathMax,
1314
Number,
@@ -735,9 +736,9 @@ class Test extends AsyncResource {
735736

736737
computeInheritedHooks() {
737738
if (this.parent.hooks.beforeEach.length > 0) {
738-
ArrayPrototypeUnshift(
739+
ArrayPrototypeUnshiftApply(
739740
this.hooks.beforeEach,
740-
...ArrayPrototypeSlice(this.parent.hooks.beforeEach),
741+
ArrayPrototypeSlice(this.parent.hooks.beforeEach),
741742
);
742743
}
743744

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.