Skip to content

Commit

Permalink
favor the constructor of the performance instance if it exists (#478)
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Kraus <jason.kraus@urbanfootprint.com>
  • Loading branch information
zbyte64 and Jason Kraus authored Aug 13, 2023
1 parent b568150 commit 20eaca1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fake-timers-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -1752,12 +1752,12 @@ function withGlobal(_global) {

if (clock.methods.includes("performance")) {
const proto = (() => {
if (hasPerformancePrototype) {
return _global.Performance.prototype;
}
if (hasPerformanceConstructorPrototype) {
return _global.performance.constructor.prototype;
}
if (hasPerformancePrototype) {
return _global.Performance.prototype;
}
})();
if (proto) {
Object.getOwnPropertyNames(proto).forEach(function (name) {
Expand Down

0 comments on commit 20eaca1

Please sign in to comment.