Skip to content

Commit

Permalink
perf_hooks: make Performance extend EventTarget
Browse files Browse the repository at this point in the history
Refs: https://www.w3.org/TR/hr-time/#sec-performance

PR-URL: #37621
Backport-PR-URL: #37832
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
targos authored and ruyadorno committed Mar 30, 2021
1 parent d33f446 commit e60bd1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lib/perf_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ const {
NODE_PERFORMANCE_MILESTONE_ENVIRONMENT
} = constants;

const {
EventTarget,
} = require('internal/event_target');
const L = require('internal/linkedlist');
const kInspect = require('internal/util').customInspectSymbol;

Expand Down Expand Up @@ -418,8 +421,9 @@ class PerformanceObserver {
}
}

class Performance {
class Performance extends EventTarget {
constructor() {
super();
this[kIndex] = {
[kMarks]: new SafeSet()
};
Expand Down
3 changes: 0 additions & 3 deletions test/wpt/status/hr-time.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"basic.any.js": {
"fail": "self.performance.addEventListener is not a function"
},
"idlharness.any.js": {
"skip": "TODO: update IDL parser"
},
Expand Down

0 comments on commit e60bd1a

Please sign in to comment.