File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -244,23 +244,31 @@ export function patchForNode16() {
244
244
if ( String . prototype . toWellFormed === undefined ) {
245
245
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
246
246
// @ts -ignore
247
- String . prototype . toWellFormed = function ( ) {
248
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
249
- // @ts -ignore
250
- return toUSVString ( this ) ;
251
- } ;
247
+ Object . defineProperty ( String . prototype , 'toWellFormed' , {
248
+ value : function ( ) {
249
+ return toUSVString ( this ) ;
250
+ } ,
251
+ enumerable : false ,
252
+ configurable : true ,
253
+ writable : true ,
254
+ } )
252
255
}
253
256
254
257
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
255
258
// @ts -ignore
256
259
if ( String . prototype . isWellFormed === undefined ) {
257
260
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
258
261
// @ts -ignore
259
- String . prototype . isWellFormed = function ( ) {
260
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
261
- // @ts -ignore
262
- return toUSVString ( this ) === this ;
263
- } ;
262
+ Object . defineProperty ( String . prototype , 'isWellFormed' , {
263
+ value : function ( ) {
264
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
265
+ // @ts -ignore
266
+ return toUSVString ( this ) === this ;
267
+ } ,
268
+ enumerable : false ,
269
+ configurable : true ,
270
+ writable : true ,
271
+ } ) ;
264
272
}
265
273
266
274
}
You can’t perform that action at this time.
0 commit comments