Skip to content

Commit 5d4fc63

Browse files
committed
perf_hooks: make Performance extend EventTarget
Refs: https://www.w3.org/TR/hr-time/#sec-performance PR-URL: #37621 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent f44f021 commit 5d4fc63

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/perf_hooks.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ const {
1212
constants,
1313
} = internalBinding('performance');
1414

15+
const {
16+
EventTarget,
17+
} = require('internal/event_target');
18+
1519
const {
1620
PerformanceEntry,
1721
now,
@@ -36,7 +40,7 @@ const timerify = require('internal/perf/timerify');
3640
const { customInspectSymbol: kInspect } = require('internal/util');
3741
const { inspect } = require('util');
3842

39-
class Performance {
43+
class Performance extends EventTarget {
4044
constructor() {
4145
// eslint-disable-next-line no-restricted-syntax
4246
throw new TypeError('Illegal constructor');
@@ -57,7 +61,7 @@ class Performance {
5761
}
5862
}
5963

60-
class InternalPerformance {}
64+
class InternalPerformance extends EventTarget {}
6165
InternalPerformance.prototype.constructor = Performance.prototype.constructor;
6266
ObjectSetPrototypeOf(InternalPerformance.prototype, Performance.prototype);
6367

test/wpt/status/hr-time.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"basic.any.js": {
3-
"fail": "self.performance.addEventListener is not a function"
4-
},
52
"idlharness.any.js": {
63
"skip": "TODO: update IDL parser"
74
},

0 commit comments

Comments
 (0)