Skip to content

Commit 2c205d8

Browse files
LiviaMedeirosaduh95
authored andcommitted
lib: rename validateInternalField into validateThisInternalField
PR-URL: #58765 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent f67e927 commit 2c205d8

8 files changed

Lines changed: 70 additions & 70 deletions

File tree

‎lib/internal/event_target.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const {
3535
validateAbortSignal,
3636
validateObject,
3737
validateString,
38-
validateInternalField,
38+
validateThisInternalField,
3939
kValidateObjectAllowObjects,
4040
}=require('internal/validators');
4141

@@ -1118,7 +1118,7 @@ function defineEventHandler(emitter, name, event = name) {
11181118
// 8.1.5.1 Event handlers - basically `on[eventName]` attributes
11191119
constpropName=`on${name}`;
11201120
functionget(){
1121-
validateInternalField(this,kHandlers,'EventTarget');
1121+
validateThisInternalField(this,kHandlers,'EventTarget');
11221122
returnthis[kHandlers]?.get(event)?.handler??null;
11231123
}
11241124
ObjectDefineProperty(get,'name',{
@@ -1127,7 +1127,7 @@ function defineEventHandler(emitter, name, event = name) {
11271127
});
11281128

11291129
functionset(value){
1130-
validateInternalField(this,kHandlers,'EventTarget');
1130+
validateThisInternalField(this,kHandlers,'EventTarget');
11311131
letwrappedHandler=this[kHandlers]?.get(event);
11321132
if(wrappedHandler){
11331133
if(typeofwrappedHandler.handler==='function'){

‎lib/internal/perf/observe.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const {
5252
const{
5353
validateFunction,
5454
validateObject,
55-
validateInternalField,
55+
validateThisInternalField,
5656
}=require('internal/validators');
5757

5858
const{
@@ -185,12 +185,12 @@ class PerformanceObserverEntryList {
185185
}
186186

187187
getEntries(){
188-
validateInternalField(this,kBuffer,'PerformanceObserverEntryList');
188+
validateThisInternalField(this,kBuffer,'PerformanceObserverEntryList');
189189
returnArrayPrototypeSlice(this[kBuffer]);
190190
}
191191

192192
getEntriesByType(type){
193-
validateInternalField(this,kBuffer,'PerformanceObserverEntryList');
193+
validateThisInternalField(this,kBuffer,'PerformanceObserverEntryList');
194194
if(arguments.length===0){
195195
thrownewERR_MISSING_ARGS('type');
196196
}
@@ -201,7 +201,7 @@ class PerformanceObserverEntryList {
201201
}
202202

203203
getEntriesByName(name,type=undefined){
204-
validateInternalField(this,kBuffer,'PerformanceObserverEntryList');
204+
validateThisInternalField(this,kBuffer,'PerformanceObserverEntryList');
205205
if(arguments.length===0){
206206
thrownewERR_MISSING_ARGS('name');
207207
}

‎lib/internal/perf/performance.js‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const nodeTiming = require('internal/perf/nodetiming');
4343
consttimerify=require('internal/perf/timerify');
4444
const{customInspectSymbol: kInspect, kEnumerableProperty, kEmptyObject }=require('internal/util');
4545
const{ inspect }=require('util');
46-
const{validateInternalField}=require('internal/validators');
46+
const{validateThisInternalField}=require('internal/validators');
4747
const{ convertToInt }=require('internal/webidl');
4848

4949
constkPerformanceBrand=Symbol('performance');
@@ -68,7 +68,7 @@ class Performance extends EventTarget {
6868
}
6969

7070
clearMarks(name=undefined){
71-
validateInternalField(this,kPerformanceBrand,'Performance');
71+
validateThisInternalField(this,kPerformanceBrand,'Performance');
7272
if(name!==undefined){
7373
name=`${name}`;
7474
}
@@ -77,28 +77,28 @@ class Performance extends EventTarget {
7777
}
7878

7979
clearMeasures(name=undefined){
80-
validateInternalField(this,kPerformanceBrand,'Performance');
80+
validateThisInternalField(this,kPerformanceBrand,'Performance');
8181
if(name!==undefined){
8282
name=`${name}`;
8383
}
8484
clearEntriesFromBuffer('measure',name);
8585
}
8686

8787
clearResourceTimings(name=undefined){
88-
validateInternalField(this,kPerformanceBrand,'Performance');
88+
validateThisInternalField(this,kPerformanceBrand,'Performance');
8989
if(name!==undefined){
9090
name=`${name}`;
9191
}
9292
clearEntriesFromBuffer('resource',name);
9393
}
9494

9595
getEntries(){
96-
validateInternalField(this,kPerformanceBrand,'Performance');
96+
validateThisInternalField(this,kPerformanceBrand,'Performance');
9797
returnfilterBufferMapByNameAndType();
9898
}
9999

100100
getEntriesByName(name,type=undefined){
101-
validateInternalField(this,kPerformanceBrand,'Performance');
101+
validateThisInternalField(this,kPerformanceBrand,'Performance');
102102
if(arguments.length===0){
103103
thrownewERR_MISSING_ARGS('name');
104104
}
@@ -110,7 +110,7 @@ class Performance extends EventTarget {
110110
}
111111

112112
getEntriesByType(type){
113-
validateInternalField(this,kPerformanceBrand,'Performance');
113+
validateThisInternalField(this,kPerformanceBrand,'Performance');
114114
if(arguments.length===0){
115115
thrownewERR_MISSING_ARGS('type');
116116
}
@@ -119,28 +119,28 @@ class Performance extends EventTarget {
119119
}
120120

121121
mark(name,options=kEmptyObject){
122-
validateInternalField(this,kPerformanceBrand,'Performance');
122+
validateThisInternalField(this,kPerformanceBrand,'Performance');
123123
if(arguments.length===0){
124124
thrownewERR_MISSING_ARGS('name');
125125
}
126126
returnmark(name,options);
127127
}
128128

129129
measure(name,startOrMeasureOptions=kEmptyObject,endMark=undefined){
130-
validateInternalField(this,kPerformanceBrand,'Performance');
130+
validateThisInternalField(this,kPerformanceBrand,'Performance');
131131
if(arguments.length===0){
132132
thrownewERR_MISSING_ARGS('name');
133133
}
134134
returnmeasure(name,startOrMeasureOptions,endMark);
135135
}
136136

137137
now(){
138-
validateInternalField(this,kPerformanceBrand,'Performance');
138+
validateThisInternalField(this,kPerformanceBrand,'Performance');
139139
returnnow();
140140
}
141141

142142
setResourceTimingBufferSize(maxSize){
143-
validateInternalField(this,kPerformanceBrand,'Performance');
143+
validateThisInternalField(this,kPerformanceBrand,'Performance');
144144
if(arguments.length===0){
145145
thrownewERR_MISSING_ARGS('maxSize');
146146
}
@@ -150,12 +150,12 @@ class Performance extends EventTarget {
150150
}
151151

152152
gettimeOrigin(){
153-
validateInternalField(this,kPerformanceBrand,'Performance');
153+
validateThisInternalField(this,kPerformanceBrand,'Performance');
154154
returngetTimeOriginTimestamp();
155155
}
156156

157157
toJSON(){
158-
validateInternalField(this,kPerformanceBrand,'Performance');
158+
validateThisInternalField(this,kPerformanceBrand,'Performance');
159159
return{
160160
nodeTiming: this.nodeTiming,
161161
timeOrigin: this.timeOrigin,

‎lib/internal/perf/performance_entry.js‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const {
1515
customInspectSymbol: kInspect,
1616
kEnumerableProperty,
1717
}=require('internal/util');
18-
const{validateInternalField}=require('internal/validators');
18+
const{validateThisInternalField}=require('internal/validators');
1919

2020
const{ inspect }=require('util');
2121

@@ -49,22 +49,22 @@ class PerformanceEntry {
4949
}
5050

5151
getname(){
52-
validateInternalField(this,kName,'PerformanceEntry');
52+
validateThisInternalField(this,kName,'PerformanceEntry');
5353
returnthis[kName];
5454
}
5555

5656
getentryType(){
57-
validateInternalField(this,kEntryType,'PerformanceEntry');
57+
validateThisInternalField(this,kEntryType,'PerformanceEntry');
5858
returnthis[kEntryType];
5959
}
6060

6161
getstartTime(){
62-
validateInternalField(this,kStartTime,'PerformanceEntry');
62+
validateThisInternalField(this,kStartTime,'PerformanceEntry');
6363
returnthis[kStartTime];
6464
}
6565

6666
getduration(){
67-
validateInternalField(this,kDuration,'PerformanceEntry');
67+
validateThisInternalField(this,kDuration,'PerformanceEntry');
6868
returnthis[kDuration];
6969
}
7070

@@ -80,7 +80,7 @@ class PerformanceEntry {
8080
}
8181

8282
toJSON(){
83-
validateInternalField(this,kName,'PerformanceEntry');
83+
validateThisInternalField(this,kName,'PerformanceEntry');
8484
return{
8585
name: this[kName],
8686
entryType: this[kEntryType],
@@ -106,12 +106,12 @@ function createPerformanceEntry(name, type, start, duration) {
106106
*/
107107
classPerformanceNodeEntryextendsPerformanceEntry{
108108
getdetail(){
109-
validateInternalField(this,kDetail,'NodePerformanceEntry');
109+
validateThisInternalField(this,kDetail,'NodePerformanceEntry');
110110
returnthis[kDetail];
111111
}
112112

113113
toJSON(){
114-
validateInternalField(this,kName,'PerformanceEntry');
114+
validateThisInternalField(this,kName,'PerformanceEntry');
115115
return{
116116
name: this[kName],
117117
entryType: this[kEntryType],

‎lib/internal/perf/resource_timing.js‎

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const {
1414
const{ PerformanceEntry, kSkipThrow }=require('internal/perf/performance_entry');
1515
constassert=require('internal/assert');
1616
const{ enqueue, bufferResourceTiming }=require('internal/perf/observe');
17-
const{validateInternalField}=require('internal/validators');
17+
const{validateThisInternalField}=require('internal/validators');
1818
const{ kEnumerableProperty }=require('internal/util');
1919

2020
constkCacheMode=Symbol('kCacheMode');
@@ -34,122 +34,122 @@ class PerformanceResourceTiming extends PerformanceEntry {
3434
}
3535

3636
getname(){
37-
validateInternalField(this,kRequestedUrl,'PerformanceResourceTiming');
37+
validateThisInternalField(this,kRequestedUrl,'PerformanceResourceTiming');
3838
returnthis[kRequestedUrl];
3939
}
4040

4141
getstartTime(){
42-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
42+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
4343
returnthis[kTimingInfo].startTime;
4444
}
4545

4646
getduration(){
47-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
47+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
4848
returnthis[kTimingInfo].endTime-this[kTimingInfo].startTime;
4949
}
5050

5151
getinitiatorType(){
52-
validateInternalField(this,kInitiatorType,'PerformanceResourceTiming');
52+
validateThisInternalField(this,kInitiatorType,'PerformanceResourceTiming');
5353
returnthis[kInitiatorType];
5454
}
5555

5656
getworkerStart(){
57-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
57+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
5858
returnthis[kTimingInfo].finalServiceWorkerStartTime;
5959
}
6060

6161
getredirectStart(){
62-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
62+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
6363
returnthis[kTimingInfo].redirectStartTime;
6464
}
6565

6666
getredirectEnd(){
67-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
67+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
6868
returnthis[kTimingInfo].redirectEndTime;
6969
}
7070

7171
getfetchStart(){
72-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
72+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
7373
returnthis[kTimingInfo].postRedirectStartTime;
7474
}
7575

7676
getdomainLookupStart(){
77-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
77+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
7878
returnthis[kTimingInfo].finalConnectionTimingInfo?.domainLookupStartTime;
7979
}
8080

8181
getdomainLookupEnd(){
82-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
82+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
8383
returnthis[kTimingInfo].finalConnectionTimingInfo?.domainLookupEndTime;
8484
}
8585

8686
getconnectStart(){
87-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
87+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
8888
returnthis[kTimingInfo].finalConnectionTimingInfo?.connectionStartTime;
8989
}
9090

9191
getconnectEnd(){
92-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
92+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
9393
returnthis[kTimingInfo].finalConnectionTimingInfo?.connectionEndTime;
9494
}
9595

9696
getsecureConnectionStart(){
97-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
97+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
9898
returnthis[kTimingInfo]
9999
.finalConnectionTimingInfo?.secureConnectionStartTime;
100100
}
101101

102102
getnextHopProtocol(){
103-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
103+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
104104
returnthis[kTimingInfo]
105105
.finalConnectionTimingInfo?.ALPNNegotiatedProtocol;
106106
}
107107

108108
getrequestStart(){
109-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
109+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
110110
returnthis[kTimingInfo].finalNetworkRequestStartTime;
111111
}
112112

113113
getresponseStart(){
114-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
114+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
115115
returnthis[kTimingInfo].finalNetworkResponseStartTime;
116116
}
117117

118118
getresponseEnd(){
119-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
119+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
120120
returnthis[kTimingInfo].endTime;
121121
}
122122

123123
getencodedBodySize(){
124-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
124+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
125125
returnthis[kTimingInfo].encodedBodySize;
126126
}
127127

128128
getdecodedBodySize(){
129-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
129+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
130130
returnthis[kTimingInfo].decodedBodySize;
131131
}
132132

133133
gettransferSize(){
134-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
134+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
135135
if(this[kCacheMode]==='local')return0;
136136
if(this[kCacheMode]==='validated')return300;
137137

138138
returnthis[kTimingInfo].encodedBodySize+300;
139139
}
140140

141141
getdeliveryType(){
142-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
142+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
143143
returnthis[kDeliveryType];
144144
}
145145

146146
getresponseStatus(){
147-
validateInternalField(this,kTimingInfo,'PerformanceResourceTiming');
147+
validateThisInternalField(this,kTimingInfo,'PerformanceResourceTiming');
148148
returnthis[kResponseStatus];
149149
}
150150

151151
toJSON(){
152-
validateInternalField(this,kInitiatorType,'PerformanceResourceTiming');
152+
validateThisInternalField(this,kInitiatorType,'PerformanceResourceTiming');
153153
return{
154154
name: this.name,
155155
entryType: this.entryType,

0 commit comments

Comments
 (0)