Closed
Description
Version
v16.7.0 - v22.7.0
Platform
Darwin x86_64
Subsystem
perf_hooks
What steps will reproduce the bug?
Executing this script:
performance.mark('test');
performance.measure('test');
const markEntries = performance.getEntriesByName('test', 'mark');
console.log(markEntries);
How often does it reproduce? Is there a required condition?
100% of the time
What is the expected behavior? Why is that the expected behavior?
As per:
- https://nodejs.org/docs/latest-v22.x/api/perf_hooks.html#performancegetentriesbynamename-type
- https://github.com/nodejs/node/blob/v22.x/doc/api/perf_hooks.md#performancegetentriesbynamename-type
- https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/perf_hooks.d.ts#L257-L264
- https://w3c.github.io/performance-timeline/#dom-performance-getentriesbyname
- https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByName#browser_compatibility
The expected behaviour is:
[
PerformanceMark {
name: 'test',
entryType: 'mark',
...
}
]
What do you see instead?
[
PerformanceMeasure {
name: 'test',
entryType: 'measure',
...
},
PerformanceMark {
name: 'test',
entryType: 'mark',
...
}
]
Additional information
This bug appears to have existed since performance.getEntriesByName
was added as part of performance timeline spec compliance in v16.7.0.
#39297 introduced performance.getEntriesByName
without a type argument. While the type
argument was subsequently added to the underlying observe.getEntriesByName
method in #39532, it was never passed through by performance.getEntriesByName
.