Skip to content

Commit d834d21

Browse files
RafaelGSStargos
authored andcommitted
perf_hooks: add initiatorType getter
PR-URL: #43593 Refs: https://w3c.github.io/resource-timing/#dfn-initiator-type Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
1 parent 54a8a0c commit d834d21

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/internal/perf/resource_timing.js

+4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ class InternalPerformanceResourceTiming extends InternalPerformanceEntry {
4646
return this[kTimingInfo].endTime - this[kTimingInfo].startTime;
4747
}
4848

49+
get initiatorType() {
50+
return this[kInitiatorType];
51+
}
52+
4953
get workerStart() {
5054
return this[kTimingInfo].finalServiceWorkerStartTime;
5155
}

test/parallel/test-perf-hooks-resourcetiming.js

+1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ function createTimingInfo({
134134
assert.ok(typeof resource.cacheMode === 'undefined', 'cacheMode does not have a getter');
135135
assert.strictEqual(resource.startTime, timingInfo.startTime);
136136
assert.strictEqual(resource.duration, 0);
137+
assert.strictEqual(resource.initiatorType, initiatorType);
137138
assert.strictEqual(resource.workerStart, 0);
138139
assert.strictEqual(resource.redirectStart, 0);
139140
assert.strictEqual(resource.redirectEnd, 0);

0 commit comments

Comments
 (0)