mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
test_runner: remove root tracking set
The wasRootSetup Set in the test harness appears to be redundant, since the startTime field can be used interchangeably. This commit removes wasRootSetup. PR-URL: https://github.com/nodejs/node/pull/46961 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
1 parent
4b7198c3cb
commit
069ff1cc63
1 file changed
+1
-5
@@ -2,7 +2,6 @@
|
||||
const {
|
||||
ArrayPrototypeForEach,
|
||||
SafeMap,
|
||||
SafeWeakSet,
|
||||
} = primordials;
|
||||
const {
|
||||
createHook,
|
||||
@@ -25,7 +24,6 @@ const {
|
||||
const { bigint: hrtime } = process.hrtime;
|
||||
|
||||
const testResources = new SafeMap();
|
||||
const wasRootSetup = new SafeWeakSet();
|
||||
|
||||
function createTestTree(options = kEmptyObject) {
|
||||
return setup(new Test({ __proto__: null, ...options, name: '<root>' }));
|
||||
@@ -104,7 +102,7 @@ function collectCoverage(rootTest, coverage) {
|
||||
}
|
||||
|
||||
function setup(root) {
|
||||
if (wasRootSetup.has(root)) {
|
||||
if (root.startTime !== null) {
|
||||
return root;
|
||||
}
|
||||
|
||||
@@ -168,8 +166,6 @@ function setup(root) {
|
||||
coverage: null,
|
||||
};
|
||||
root.startTime = hrtime();
|
||||
|
||||
wasRootSetup.add(root);
|
||||
return root;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user