Skip to content

Commit a0363be

Browse files
committed
perf_hooks: fix webperf idlharness
1. Enforce receiver checks on IDL interfaces. 2. Avoid prototype manipulation on constructing IDL interfaces with `ReflectConstruct`. 3. `defineReplaceableAttribute` should create IDL getter/setter. 4. Event handler properties defined by `defineEventHandler` should check if the receiver is a valid `EventTarget`. 5. Corrected `PerformanceResourceTiming` to inherit the public interface `PerformanceEntry` instead of the internal interface `InternalPerformanceResourceTiming`.
1 parent 5ec2c99 commit a0363be

220 files changed

Lines changed: 8022 additions & 512 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

doc/api/perf_hooks.md

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ Node.js instance. It is similar to [`window.performance`][] in browsers.
4949

5050
<!-- YAML
5151
added: v8.5.0
52+
changes:
53+
- version: REPLACEME
54+
pr-url: https://github.com/nodejs/node/pull/44483
55+
description: This method must be called with the `performance` object as
56+
the receiver.
5257
-->
5358

5459
* `name` {string}
@@ -60,6 +65,11 @@ Performance Timeline. If `name` is provided, removes only the named mark.
6065

6166
<!-- YAML
6267
added: v16.7.0
68+
changes:
69+
- version: REPLACEME
70+
pr-url: https://github.com/nodejs/node/pull/44483
71+
description: This method must be called with the `performance` object as
72+
the receiver.
6373
-->
6474

6575
* `name` {string}
@@ -73,6 +83,11 @@ Performance Timeline. If `name` is provided, removes only the named measure.
7383
added:
7484
- v18.2.0
7585
- v16.17.0
86+
changes:
87+
- version: REPLACEME
88+
pr-url: https://github.com/nodejs/node/pull/44483
89+
description: This method must be called with the `performance` object as
90+
the receiver.
7691
-->
7792

7893
* `name` {string}
@@ -147,6 +162,11 @@ are not guaranteed to reflect any correct state of the event loop.
147162

148163
<!-- YAML
149164
added: v16.7.0
165+
changes:
166+
- version: REPLACEME
167+
pr-url: https://github.com/nodejs/node/pull/44483
168+
description: This method must be called with the `performance` object as
169+
the receiver.
150170
-->
151171

152172
* Returns: {PerformanceEntry\[]}
@@ -160,6 +180,11 @@ performance entries of certain types or that have certain names, see
160180

161181
<!-- YAML
162182
added: v16.7.0
183+
changes:
184+
- version: REPLACEME
185+
pr-url: https://github.com/nodejs/node/pull/44483
186+
description: This method must be called with the `performance` object as
187+
the receiver.
163188
-->
164189

165190
* `name` {string}
@@ -175,6 +200,11 @@ equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to
175200

176201
<!-- YAML
177202
added: v16.7.0
203+
changes:
204+
- version: REPLACEME
205+
pr-url: https://github.com/nodejs/node/pull/44483
206+
description: This method must be called with the `performance` object as
207+
the receiver.
178208
-->
179209

180210
* `type` {string}
@@ -189,6 +219,10 @@ is equal to `type`.
189219
<!-- YAML
190220
added: v8.5.0
191221
changes:
222+
- version: REPLACEME
223+
pr-url: https://github.com/nodejs/node/pull/44483
224+
description: This method must be called with the `performance` object as
225+
the receiver.
192226
- version: v16.0.0
193227
pr-url: https://github.com/nodejs/node/pull/37136
194228
description: Updated to conform to the User Timing Level 3 specification.
@@ -244,6 +278,10 @@ Performance Timeline manually with `performance.clearResourceTimings`.
244278
<!-- YAML
245279
added: v8.5.0
246280
changes:
281+
- version: REPLACEME
282+
pr-url: https://github.com/nodejs/node/pull/44483
283+
description: This method must be called with the `performance` object as
284+
the receiver.
247285
- version: v16.0.0
248286
pr-url: https://github.com/nodejs/node/pull/37136
249287
description: Updated to conform to the User Timing Level 3 specification.
@@ -305,6 +343,11 @@ metrics for specific Node.js operational milestones.
305343

306344
<!-- YAML
307345
added: v8.5.0
346+
changes:
347+
- version: REPLACEME
348+
pr-url: https://github.com/nodejs/node/pull/44483
349+
description: This method must be called with the `performance` object as
350+
the receiver.
308351
-->
309352

310353
* Returns: {number}
@@ -316,6 +359,11 @@ the start of the current `node` process.
316359

317360
<!-- YAML
318361
added: v18.8.0
362+
changes:
363+
- version: REPLACEME
364+
pr-url: https://github.com/nodejs/node/pull/44483
365+
description: This method must be called with the `performance` object as
366+
the receiver.
319367
-->
320368

321369
Sets the global performance resource timing buffer size to the specified number
@@ -393,6 +441,11 @@ invoked.
393441

394442
<!-- YAML
395443
added: v16.1.0
444+
changes:
445+
- version: REPLACEME
446+
pr-url: https://github.com/nodejs/node/pull/44483
447+
description: This method must be called with the `performance` object as
448+
the receiver.
396449
-->
397450

398451
An object which is JSON representation of the `performance` object. It
@@ -420,6 +473,11 @@ added: v8.5.0
420473

421474
<!-- YAML
422475
added: v16.0.0
476+
changes:
477+
- version: REPLACEME
478+
pr-url: https://github.com/nodejs/node/pull/44483
479+
description: This property getter must be called with the
480+
`PerformanceEntry` object as the receiver.
423481
-->
424482

425483
* {any}
@@ -430,6 +488,11 @@ Additional detail specific to the `entryType`.
430488

431489
<!-- YAML
432490
added: v8.5.0
491+
changes:
492+
- version: REPLACEME
493+
pr-url: https://github.com/nodejs/node/pull/44483
494+
description: This property getter must be called with the
495+
`PerformanceEntry` object as the receiver.
433496
-->
434497

435498
* {number}
@@ -441,6 +504,11 @@ be meaningful for all Performance Entry types.
441504

442505
<!-- YAML
443506
added: v8.5.0
507+
changes:
508+
- version: REPLACEME
509+
pr-url: https://github.com/nodejs/node/pull/44483
510+
description: This property getter must be called with the
511+
`PerformanceEntry` object as the receiver.
444512
-->
445513

446514
* {string}
@@ -488,6 +556,11 @@ The value may be one of:
488556

489557
<!-- YAML
490558
added: v8.5.0
559+
changes:
560+
- version: REPLACEME
561+
pr-url: https://github.com/nodejs/node/pull/44483
562+
description: This property getter must be called with the
563+
`PerformanceEntry` object as the receiver.
491564
-->
492565

493566
* {string}
@@ -522,6 +595,11 @@ The value may be one of:
522595

523596
<!-- YAML
524597
added: v8.5.0
598+
changes:
599+
- version: REPLACEME
600+
pr-url: https://github.com/nodejs/node/pull/44483
601+
description: This property getter must be called with the
602+
`PerformanceEntry` object as the receiver.
525603
-->
526604

527605
* {number}
@@ -758,6 +836,11 @@ The constructor of this class is not exposed to users directly.
758836
added:
759837
- v18.2.0
760838
- v16.17.0
839+
changes:
840+
- version: REPLACEME
841+
pr-url: https://github.com/nodejs/node/pull/44483
842+
description: This property getter must be called with the
843+
`PerformanceResourceTiming` object as the receiver.
761844
-->
762845

763846
* {number}
@@ -772,6 +855,11 @@ will always return 0.
772855
added:
773856
- v18.2.0
774857
- v16.17.0
858+
changes:
859+
- version: REPLACEME
860+
pr-url: https://github.com/nodejs/node/pull/44483
861+
description: This property getter must be called with the
862+
`PerformanceResourceTiming` object as the receiver.
775863
-->
776864

777865
* {number}
@@ -785,6 +873,11 @@ of the fetch which initiates the redirect.
785873
added:
786874
- v18.2.0
787875
- v16.17.0
876+
changes:
877+
- version: REPLACEME
878+
pr-url: https://github.com/nodejs/node/pull/44483
879+
description: This property getter must be called with the
880+
`PerformanceResourceTiming` object as the receiver.
788881
-->
789882

790883
* {number}
@@ -798,6 +891,11 @@ receiving the last byte of the response of the last redirect.
798891
added:
799892
- v18.2.0
800893
- v16.17.0
894+
changes:
895+
- version: REPLACEME
896+
pr-url: https://github.com/nodejs/node/pull/44483
897+
description: This property getter must be called with the
898+
`PerformanceResourceTiming` object as the receiver.
801899
-->
802900

803901
* {number}
@@ -811,6 +909,11 @@ to fetch the resource.
811909
added:
812910
- v18.2.0
813911
- v16.17.0
912+
changes:
913+
- version: REPLACEME
914+
pr-url: https://github.com/nodejs/node/pull/44483
915+
description: This property getter must be called with the
916+
`PerformanceResourceTiming` object as the receiver.
814917
-->
815918

816919
* {number}
@@ -824,6 +927,11 @@ the domain name lookup for the resource.
824927
added:
825928
- v18.2.0
826929
- v16.17.0
930+
changes:
931+
- version: REPLACEME
932+
pr-url: https://github.com/nodejs/node/pull/44483
933+
description: This property getter must be called with the
934+
`PerformanceResourceTiming` object as the receiver.
827935
-->
828936

829937
* {number}
@@ -837,6 +945,11 @@ after the Node.js finished the domain name lookup for the resource.
837945
added:
838946
- v18.2.0
839947
- v16.17.0
948+
changes:
949+
- version: REPLACEME
950+
pr-url: https://github.com/nodejs/node/pull/44483
951+
description: This property getter must be called with the
952+
`PerformanceResourceTiming` object as the receiver.
840953
-->
841954

842955
* {number}
@@ -851,6 +964,11 @@ the resource.
851964
added:
852965
- v18.2.0
853966
- v16.17.0
967+
changes:
968+
- version: REPLACEME
969+
pr-url: https://github.com/nodejs/node/pull/44483
970+
description: This property getter must be called with the
971+
`PerformanceResourceTiming` object as the receiver.
854972
-->
855973

856974
* {number}
@@ -865,6 +983,11 @@ the resource.
865983
added:
866984
- v18.2.0
867985
- v16.17.0
986+
changes:
987+
- version: REPLACEME
988+
pr-url: https://github.com/nodejs/node/pull/44483
989+
description: This property getter must be called with the
990+
`PerformanceResourceTiming` object as the receiver.
868991
-->
869992

870993
* {number}
@@ -878,6 +1001,11 @@ before Node.js starts the handshake process to secure the current connection.
8781001
added:
8791002
- v18.2.0
8801003
- v16.17.0
1004+
changes:
1005+
- version: REPLACEME
1006+
pr-url: https://github.com/nodejs/node/pull/44483
1007+
description: This property getter must be called with the
1008+
`PerformanceResourceTiming` object as the receiver.
8811009
-->
8821010

8831011
* {number}
@@ -891,6 +1019,11 @@ before Node.js receives the first byte of the response from the server.
8911019
added:
8921020
- v18.2.0
8931021
- v16.17.0
1022+
changes:
1023+
- version: REPLACEME
1024+
pr-url: https://github.com/nodejs/node/pull/44483
1025+
description: This property getter must be called with the
1026+
`PerformanceResourceTiming` object as the receiver.
8941027
-->
8951028

8961029
* {number}
@@ -905,6 +1038,11 @@ the transport connection is closed, whichever comes first.
9051038
added:
9061039
- v18.2.0
9071040
- v16.17.0
1041+
changes:
1042+
- version: REPLACEME
1043+
pr-url: https://github.com/nodejs/node/pull/44483
1044+
description: This property getter must be called with the
1045+
`PerformanceResourceTiming` object as the receiver.
9081046
-->
9091047

9101048
* {number}
@@ -918,6 +1056,11 @@ includes the response header fields plus the response payload body.
9181056
added:
9191057
- v18.2.0
9201058
- v16.17.0
1059+
changes:
1060+
- version: REPLACEME
1061+
pr-url: https://github.com/nodejs/node/pull/44483
1062+
description: This property getter must be called with the
1063+
`PerformanceResourceTiming` object as the receiver.
9211064
-->
9221065

9231066
* {number}
@@ -932,6 +1075,11 @@ content-codings.
9321075
added:
9331076
- v18.2.0
9341077
- v16.17.0
1078+
changes:
1079+
- version: REPLACEME
1080+
pr-url: https://github.com/nodejs/node/pull/44483
1081+
description: This property getter must be called with the
1082+
`PerformanceResourceTiming` object as the receiver.
9351083
-->
9361084

9371085
* {number}
@@ -946,6 +1094,11 @@ content-codings.
9461094
added:
9471095
- v18.2.0
9481096
- v16.17.0
1097+
changes:
1098+
- version: REPLACEME
1099+
pr-url: https://github.com/nodejs/node/pull/44483
1100+
description: This method must be called with the
1101+
`PerformanceResourceTiming` object as the receiver.
9491102
-->
9501103

9511104
Returns a `object` that is the JSON representation of the

0 commit comments

Comments
 (0)