Skip to content
Permalink
Browse files

lib: use `class ... extends` in perf_hooks.js

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 1, 2019
1 parent d2ba454 commit 75c628130f76eafb83e6c60506971dff88bb66df
Showing with 1 addition and 4 deletions.
  1. +1 −4 lib/perf_hooks.js
@@ -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();

0 comments on commit 75c6281

Please sign in to comment.
You can’t perform that action at this time.