Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
perf_hooks: add initiatorType getter
  • Loading branch information
RafaelGSS committed Jun 27, 2022
commit a468c878bd5da504e290837f1cb94ca0a9c0a0cb
4 changes: 4 additions & 0 deletions lib/internal/perf/resource_timing.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ class InternalPerformanceResourceTiming extends InternalPerformanceEntry {
return this[kTimingInfo].endTime - this[kTimingInfo].startTime;
}

get initiatorType() {
return this[kInitiatorType];
}

get workerStart() {
return this[kTimingInfo].finalServiceWorkerStartTime;
}
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-perf-hooks-resourcetiming.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ function createTimingInfo({
assert.ok(typeof resource.cacheMode === 'undefined', 'cacheMode does not have a getter');
assert.strictEqual(resource.startTime, timingInfo.startTime);
assert.strictEqual(resource.duration, 0);
assert.strictEqual(resource.initiatorType, initiatorType);
assert.strictEqual(resource.workerStart, 0);
assert.strictEqual(resource.redirectStart, 0);
assert.strictEqual(resource.redirectEnd, 0);
Expand Down