Skip to content

Commit e60bd1a

Browse files
targosruyadorno
authored andcommitted
perf_hooks: make Performance extend EventTarget
Refs: https://www.w3.org/TR/hr-time/#sec-performance PR-URL: #37621 Backport-PR-URL: #37832 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 d33f446 commit e60bd1a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/perf_hooks.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ const {
5454
NODE_PERFORMANCE_MILESTONE_ENVIRONMENT
5555
} = constants;
5656

57+
const {
58+
EventTarget,
59+
} = require('internal/event_target');
5760
const L = require('internal/linkedlist');
5861
const kInspect = require('internal/util').customInspectSymbol;
5962

@@ -418,8 +421,9 @@ class PerformanceObserver {
418421
}
419422
}
420423

421-
class Performance {
424+
class Performance extends EventTarget {
422425
constructor() {
426+
super();
423427
this[kIndex] = {
424428
[kMarks]: new SafeSet()
425429
};

test/wpt/status/hr-time.json

-3
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)