Skip to content

Commit 069ff1c

Browse files
cjihrigtargos
authored andcommitted
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: #46961 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent 4b7198c commit 069ff1c

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎lib/internal/test_runner/harness.js‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
const{
33
ArrayPrototypeForEach,
44
SafeMap,
5-
SafeWeakSet,
65
}=primordials;
76
const{
87
createHook,
@@ -25,7 +24,6 @@ const {
2524
const{bigint: hrtime}=process.hrtime;
2625

2726
consttestResources=newSafeMap();
28-
constwasRootSetup=newSafeWeakSet();
2927

3028
functioncreateTestTree(options=kEmptyObject){
3129
returnsetup(newTest({__proto__: null, ...options,name: '<root>'}));
@@ -104,7 +102,7 @@ function collectCoverage(rootTest, coverage) {
104102
}
105103

106104
functionsetup(root){
107-
if(wasRootSetup.has(root)){
105+
if(root.startTime!==null){
108106
returnroot;
109107
}
110108

@@ -168,8 +166,6 @@ function setup(root) {
168166
coverage: null,
169167
};
170168
root.startTime=hrtime();
171-
172-
wasRootSetup.add(root);
173169
returnroot;
174170
}
175171

0 commit comments

Comments
 (0)