File tree Expand file tree Collapse file tree 2 files changed +10
-87
lines changed Expand file tree Collapse file tree 2 files changed +10
-87
lines changed Original file line number Diff line number Diff line change 87
87
}
88
88
}
89
89
},
90
- "Document" : {
91
- "methods" : {
92
- "method" : {
93
- "evaluate" : null
94
- }
95
- }
96
- },
97
90
"FederatedCredential" : null ,
98
91
"HTMLAreasCollection" : null ,
99
92
"HTMLBodyElement" : {
108
101
}
109
102
}
110
103
},
111
- "HTMLElement" : {
112
- "methods" : {
113
- "method" : {
114
- "scrollIntoView" : null ,
115
- "insertAdjacentElement" : null ,
116
- "insertAdjacentHTML" : null ,
117
- "insertAdjacentText" : null
118
- }
119
- }
120
- },
121
- "HTMLHRElement" : {
122
- "implements" : null
123
- },
124
- "HTMLIFrameElement" : {
125
- "properties" : {
126
- "property" : {
127
- "onload" : null
128
- }
129
- }
130
- },
131
- "MediaQueryListListener" : null ,
132
104
"MessageEvent" : {
133
105
"methods" : {
134
106
"method" : {
139
111
"MSCredentials" : null ,
140
112
"MSDCCEvent" : null ,
141
113
"MSDSHEvent" : null ,
142
- "MSPortRange" : null ,
143
114
"MSStreamReader" : null ,
144
- "OverconstrainedErrorEvent" : null ,
145
115
"PasswordCredential" : null ,
146
- "Screen" : {
147
- "methods" : {
148
- "method" : {
149
- "msLockOrientation" : null ,
150
- "msUnlockOrientation" : null
151
- }
152
- }
153
- },
154
116
"StorageEvent" : {
155
117
"methods" : {
156
118
"method" : {
197
159
}
198
160
}
199
161
},
200
- "SVGFilterElement" : {
201
- "implements" : [
202
- " SVGUnitTypes"
203
- ]
204
- },
205
162
"SVGGradientElement" : {
206
163
"implements" : [
207
164
" SVGUnitTypes"
221
178
"SVGPoint" : null ,
222
179
"SVGRect" : null ,
223
180
"SVGSVGElement" : {
224
- "implements" : [
225
- " SVGUnitTypes"
226
- ],
227
181
"properties" : {
228
182
"property" : {
229
183
"onabort" : null ,
233
187
}
234
188
}
235
189
},
236
- "SVGViewElement" : {
237
- "implements" : [
238
- " SVGUnitTypes"
239
- ]
240
- },
241
190
"WebKitCSSMatrix" : null ,
242
191
"WebKitDirectoryEntry" : null ,
243
192
"WebKitDirectoryReader" : null ,
265
214
" GlobalFetch"
266
215
]
267
216
},
268
- "WheelEvent" : {
269
- "properties" : {
270
- "property" : {
271
- "wheelDelta" : null ,
272
- "wheelDeltaX" : null ,
273
- "wheelDeltaY" : null
274
- }
275
- }
276
- },
277
217
"WorkerGlobalScope" : {
278
218
"implements" : [
279
219
" GlobalFetch"
280
220
]
281
221
},
282
- "XPathEvaluator" : {
283
- "methods" : {
284
- "method" : {
285
- "evaluate" : null
286
- }
287
- }
288
- },
289
222
"XPathNSResolver" : null
290
223
}
291
224
},
314
247
"portRange" : null
315
248
}
316
249
}
317
- },
318
- "RTCRtpContributingSource" : {
319
- "members" : {
320
- "member" : {
321
- "csrc" : null
322
- }
323
- }
324
- },
325
- "MediaTrackConstraintSet" : {
326
- "members" : {
327
- "member" : {
328
- "echoCancelation" : null
329
- }
330
- }
331
250
}
332
251
}
333
252
},
Original file line number Diff line number Diff line change @@ -197,12 +197,11 @@ function emitDom() {
197
197
198
198
function filterByNull ( obj : any , template : any ) {
199
199
if ( ! template ) return obj ;
200
- const filtered : any = { } ;
201
- for ( const k in obj ) {
202
- if ( ! template . hasOwnProperty ( k ) ) {
203
- filtered [ k ] = obj [ k ] ;
204
- }
205
- else if ( Array . isArray ( template [ k ] ) ) {
200
+ const filtered = { ...obj } ;
201
+ for ( const k in template ) {
202
+ if ( ! obj [ k ] ) {
203
+ console . warn ( `removedTypes.json has a redundant field ${ k } in ${ JSON . stringify ( template ) } ` ) ;
204
+ } else if ( Array . isArray ( template [ k ] ) ) {
206
205
if ( ! Array . isArray ( obj [ k ] ) ) {
207
206
throw new Error ( `Removal template ${ k } is an array but the original field is not` ) ;
208
207
}
@@ -211,9 +210,14 @@ function emitDom() {
211
210
const name = typeof item === "string" ? item : ( item . name || item [ "new-type" ] ) ;
212
211
return ! template [ k ] . includes ( name ) ;
213
212
} ) ;
213
+ if ( filtered [ k ] . length === obj [ k ] . length ) {
214
+ console . warn ( `removedTypes.json has a redundant array item in ${ JSON . stringify ( template [ k ] ) } ` ) ;
215
+ }
214
216
}
215
217
else if ( template [ k ] !== null ) {
216
218
filtered [ k ] = filterByNull ( obj [ k ] , template [ k ] ) ;
219
+ } else {
220
+ delete filtered [ k ] ;
217
221
}
218
222
}
219
223
return filtered ;
You can’t perform that action at this time.
0 commit comments