Skip to content

Commit 75c6281

Browse files
addaleaxtargos
authored andcommitted
lib: use class ... extends in perf_hooks.js
Don’t unnecessarily set the protoype afterwards. PR-URL: #28495 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent d2ba454 commit 75c6281

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/perf_hooks.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function getMilestoneTimestamp(milestoneIdx) {
149149
return ns / 1e6 - timeOrigin;
150150
}
151151

152-
class PerformanceNodeTiming {
152+
class PerformanceNodeTiming extends PerformanceEntry {
153153
get name() {
154154
return 'node';
155155
}
@@ -213,9 +213,6 @@ class PerformanceNodeTiming {
213213
};
214214
}
215215
}
216-
Object.setPrototypeOf(
217-
PerformanceNodeTiming.prototype, PerformanceEntry.prototype);
218-
Object.setPrototypeOf(PerformanceNodeTiming, PerformanceEntry);
219216

220217
const nodeTiming = new PerformanceNodeTiming();
221218

0 commit comments

Comments
 (0)