perf_hooks: make Performance extend EventTarget
Refs: https://www.w3.org/TR/hr-time/#sec-performance PR-URL: https://github.com/nodejs/node/pull/37621 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>
This commit is contained in:
parent
f44f02101f
commit
5d4fc63eb8
@ -12,6 +12,10 @@ const {
|
||||
constants,
|
||||
} = internalBinding('performance');
|
||||
|
||||
const {
|
||||
EventTarget,
|
||||
} = require('internal/event_target');
|
||||
|
||||
const {
|
||||
PerformanceEntry,
|
||||
now,
|
||||
@ -36,7 +40,7 @@ const timerify = require('internal/perf/timerify');
|
||||
const { customInspectSymbol: kInspect } = require('internal/util');
|
||||
const { inspect } = require('util');
|
||||
|
||||
class Performance {
|
||||
class Performance extends EventTarget {
|
||||
constructor() {
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
throw new TypeError('Illegal constructor');
|
||||
@ -57,7 +61,7 @@ class Performance {
|
||||
}
|
||||
}
|
||||
|
||||
class InternalPerformance {}
|
||||
class InternalPerformance extends EventTarget {}
|
||||
InternalPerformance.prototype.constructor = Performance.prototype.constructor;
|
||||
ObjectSetPrototypeOf(InternalPerformance.prototype, Performance.prototype);
|
||||
|
||||
|
@ -1,7 +1,4 @@
|
||||
{
|
||||
"basic.any.js": {
|
||||
"fail": "self.performance.addEventListener is not a function"
|
||||
},
|
||||
"idlharness.any.js": {
|
||||
"skip": "TODO: update IDL parser"
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user