lib: use class ... extends
in perf_hooks.js
Don’t unnecessarily set the protoype afterwards. PR-URL: https://github.com/nodejs/node/pull/28495 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
d0e3c2346f
commit
33a8093411
@ -149,7 +149,7 @@ function getMilestoneTimestamp(milestoneIdx) {
|
||||
return ns / 1e6 - timeOrigin;
|
||||
}
|
||||
|
||||
class PerformanceNodeTiming {
|
||||
class PerformanceNodeTiming extends PerformanceEntry {
|
||||
get name() {
|
||||
return 'node';
|
||||
}
|
||||
@ -213,9 +213,6 @@ class PerformanceNodeTiming {
|
||||
};
|
||||
}
|
||||
}
|
||||
Object.setPrototypeOf(
|
||||
PerformanceNodeTiming.prototype, PerformanceEntry.prototype);
|
||||
Object.setPrototypeOf(PerformanceNodeTiming, PerformanceEntry);
|
||||
|
||||
const nodeTiming = new PerformanceNodeTiming();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user