Commit 77e63802ab0 for nodejs
commit 77e63802ab03dd3897ce1c216835896ede28c9d7
Author: Livia Medeiros <livia@cirno.name>
Date: Sat Nov 28 16:28:51 2026 +0800
benchmark: prefer `tmpdir.resolve()` over `path.join(tmpdir.path, ...)`
Signed-off-by: LiviaMedeiros <livia@cirno.name>
PR-URL: https://github.com/nodejs/node/pull/67787
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
diff --git a/benchmark/fs/readfile-utf8-fastpath.js b/benchmark/fs/readfile-utf8-fastpath.js
index 9bf00717c5f..e561a39ee2d 100644
--- a/benchmark/fs/readfile-utf8-fastpath.js
+++ b/benchmark/fs/readfile-utf8-fastpath.js
@@ -2,7 +2,6 @@
const common = require('../common.js');
const fs = require('fs');
-const path = require('path');
const tmpdir = require('../../test/common/tmpdir');
const bench = common.createBenchmark(main, {
@@ -40,7 +39,7 @@ function buildContent(kind, size) {
function main({ n, size, content, source }) {
tmpdir.refresh();
- const file = path.join(tmpdir.path, `bench-${content}-${size}.bin`);
+ const file = tmpdir.resolve(`bench-${content}-${size}.bin`);
fs.writeFileSync(file, buildContent(content, size));
let arg;
diff --git a/benchmark/test_runner/run-single-test-file.js b/benchmark/test_runner/run-single-test-file.js
index 00e95e088a2..839517d8f93 100644
--- a/benchmark/test_runner/run-single-test-file.js
+++ b/benchmark/test_runner/run-single-test-file.js
@@ -16,7 +16,7 @@ function makeTestDirWithFiles(dirPath, count) {
}
function getTestDirPath(numberOfTestFiles) {
- return join(tmpdir.path, `${numberOfTestFiles}-tests`);
+ return tmpdir.resolve(`${numberOfTestFiles}-tests`);
}
function setup(numberOfTestFiles) {
diff --git a/benchmark/webstorage/getItem.js b/benchmark/webstorage/getItem.js
index b82960a6f48..2ebe62ae609 100644
--- a/benchmark/webstorage/getItem.js
+++ b/benchmark/webstorage/getItem.js
@@ -1,5 +1,4 @@
'use strict';
-const { join } = require('node:path');
const common = require('../common.js');
const tmpdir = require('../../test/common/tmpdir');
@@ -8,7 +7,7 @@ let cnt = 0;
tmpdir.refresh();
function nextLocalStorage() {
- return join(tmpdir.path, `${++cnt}.localstorage`);
+ return tmpdir.resolve(`${++cnt}.localstorage`);
}
const options = {
diff --git a/benchmark/webstorage/removeItem.js b/benchmark/webstorage/removeItem.js
index 738ae8a2426..325fa618abf 100644
--- a/benchmark/webstorage/removeItem.js
+++ b/benchmark/webstorage/removeItem.js
@@ -1,5 +1,4 @@
'use strict';
-const { join } = require('node:path');
const common = require('../common.js');
const tmpdir = require('../../test/common/tmpdir');
@@ -8,7 +7,7 @@ let cnt = 0;
tmpdir.refresh();
function nextLocalStorage() {
- return join(tmpdir.path, `${++cnt}.localstorage`);
+ return tmpdir.resolve(`${++cnt}.localstorage`);
}
const options = {
diff --git a/benchmark/webstorage/setItem.js b/benchmark/webstorage/setItem.js
index fa53bab20df..24cc5b4c087 100644
--- a/benchmark/webstorage/setItem.js
+++ b/benchmark/webstorage/setItem.js
@@ -1,5 +1,4 @@
'use strict';
-const { join } = require('node:path');
const common = require('../common.js');
const tmpdir = require('../../test/common/tmpdir');
@@ -8,7 +7,7 @@ let cnt = 0;
tmpdir.refresh();
function nextLocalStorage() {
- return join(tmpdir.path, `${++cnt}.localstorage`);
+ return tmpdir.resolve(`${++cnt}.localstorage`);
}
const options = {