Skip to content

Commit

Permalink
lib: use class ... extends in perf_hooks.js
Browse files Browse the repository at this point in the history
Don’t unnecessarily set the protoype afterwards.

PR-URL: #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>
  • Loading branch information
addaleax authored and targos committed Jul 20, 2019
1 parent d2ba454 commit 75c6281
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/perf_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function getMilestoneTimestamp(milestoneIdx) {
return ns / 1e6 - timeOrigin;
}

class PerformanceNodeTiming {
class PerformanceNodeTiming extends PerformanceEntry {
get name() {
return 'node';
}
Expand Down Expand Up @@ -213,9 +213,6 @@ class PerformanceNodeTiming {
};
}
}
Object.setPrototypeOf(
PerformanceNodeTiming.prototype, PerformanceEntry.prototype);
Object.setPrototypeOf(PerformanceNodeTiming, PerformanceEntry);

const nodeTiming = new PerformanceNodeTiming();

Expand Down

0 comments on commit 75c6281

Please sign in to comment.