test_runner: avoid spread operator on arrays

PR-URL: https://github.com/nodejs/node/pull/55143
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Antoine du Hamel authored and Michaël Zasso committed 2024-10-04 19:20:18 +02:00
1 parent cc8838252e
commit c308862d2e
2 files changed
+5 -3

No files matched your search

+2 -1
View File
@@ -158,7 +158,8 @@ function getRunArgs(path, { forceExit,
ArrayPrototypePushApply(argv, execArgv);
if (path === kIsolatedProcessName) {
ArrayPrototypePush(argv, '--test', ...ArrayPrototypeSlice(process.argv, 1));
ArrayPrototypePush(argv, '--test');
ArrayPrototypePushApply(argv, ArrayPrototypeSlice(process.argv, 1));
} else {
ArrayPrototypePush(argv, path);
}
+3 -2
View File
@@ -8,6 +8,7 @@ const {
ArrayPrototypeSome,
ArrayPrototypeSplice,
ArrayPrototypeUnshift,
ArrayPrototypeUnshiftApply,
FunctionPrototype,
MathMax,
Number,
@@ -735,9 +736,9 @@ class Test extends AsyncResource {
computeInheritedHooks() {
if (this.parent.hooks.beforeEach.length > 0) {
ArrayPrototypeUnshift(
ArrayPrototypeUnshiftApply(
this.hooks.beforeEach,
...ArrayPrototypeSlice(this.parent.hooks.beforeEach),
ArrayPrototypeSlice(this.parent.hooks.beforeEach),
);
}