@@ -26,7 +26,7 @@ const IteratorPrototype = Object.getPrototypeOf(
26
26
const unpairedSurrogateRe =
27
27
/ ( [ ^ \uD800 - \uDBFF ] | ^ ) [ \uDC00 - \uDFFF ] | [ \uD800 - \uDBFF ] (? ! [ \uDC00 - \uDFFF ] ) / ;
28
28
function toUSVString ( val ) {
29
- const str = '' + val ;
29
+ const str = ` ${ val } ` ;
30
30
// As of V8 5.5, `str.search()` (and `unpairedSurrogateRe[@@search]()`) are
31
31
// slower than `unpairedSurrogateRe.exec()`.
32
32
const match = unpairedSurrogateRe . exec ( str ) ;
@@ -218,7 +218,7 @@ function onParseHashComplete(flags, protocol, username, password,
218
218
class URL {
219
219
constructor ( input , base ) {
220
220
// toUSVString is not needed.
221
- input = '' + input ;
221
+ input = ` ${ input } ` ;
222
222
if ( base !== undefined && ! ( base instanceof URL ) )
223
223
base = new URL ( base ) ;
224
224
parse ( this , input , base ) ;
@@ -329,7 +329,7 @@ Object.defineProperties(URL.prototype, {
329
329
} ,
330
330
set ( input ) {
331
331
// toUSVString is not needed.
332
- input = '' + input ;
332
+ input = ` ${ input } ` ;
333
333
parse ( this , input ) ;
334
334
}
335
335
} ,
@@ -348,7 +348,7 @@ Object.defineProperties(URL.prototype, {
348
348
} ,
349
349
set ( scheme ) {
350
350
// toUSVString is not needed.
351
- scheme = '' + scheme ;
351
+ scheme = ` ${ scheme } ` ;
352
352
if ( scheme . length === 0 )
353
353
return ;
354
354
binding . parse ( scheme , binding . kSchemeStart , null , this [ context ] ,
@@ -363,7 +363,7 @@ Object.defineProperties(URL.prototype, {
363
363
} ,
364
364
set ( username ) {
365
365
// toUSVString is not needed.
366
- username = '' + username ;
366
+ username = ` ${ username } ` ;
367
367
if ( ! this . hostname )
368
368
return ;
369
369
const ctx = this [ context ] ;
@@ -384,7 +384,7 @@ Object.defineProperties(URL.prototype, {
384
384
} ,
385
385
set ( password ) {
386
386
// toUSVString is not needed.
387
- password = '' + password ;
387
+ password = ` ${ password } ` ;
388
388
if ( ! this . hostname )
389
389
return ;
390
390
const ctx = this [ context ] ;
@@ -410,7 +410,7 @@ Object.defineProperties(URL.prototype, {
410
410
set ( host ) {
411
411
const ctx = this [ context ] ;
412
412
// toUSVString is not needed.
413
- host = '' + host ;
413
+ host = ` ${ host } ` ;
414
414
if ( this [ cannotBeBase ] ||
415
415
( this [ special ] && host . length === 0 ) ) {
416
416
// Cannot set the host if cannot-be-base is set or
@@ -435,7 +435,7 @@ Object.defineProperties(URL.prototype, {
435
435
set ( host ) {
436
436
const ctx = this [ context ] ;
437
437
// toUSVString is not needed.
438
- host = '' + host ;
438
+ host = ` ${ host } ` ;
439
439
if ( this [ cannotBeBase ] ||
440
440
( this [ special ] && host . length === 0 ) ) {
441
441
// Cannot set the host if cannot-be-base is set or
@@ -460,7 +460,7 @@ Object.defineProperties(URL.prototype, {
460
460
} ,
461
461
set ( port ) {
462
462
// toUSVString is not needed.
463
- port = '' + port ;
463
+ port = ` ${ port } ` ;
464
464
const ctx = this [ context ] ;
465
465
if ( ! ctx . host || this [ cannotBeBase ] ||
466
466
this . protocol === 'file:' )
@@ -484,7 +484,7 @@ Object.defineProperties(URL.prototype, {
484
484
} ,
485
485
set ( path ) {
486
486
// toUSVString is not needed.
487
- path = '' + path ;
487
+ path = ` ${ path } ` ;
488
488
if ( this [ cannotBeBase ] )
489
489
return ;
490
490
binding . parse ( path , binding . kPathStart , null , this [ context ] ,
@@ -533,7 +533,7 @@ Object.defineProperties(URL.prototype, {
533
533
set ( hash ) {
534
534
const ctx = this [ context ] ;
535
535
// toUSVString is not needed.
536
- hash = '' + hash ;
536
+ hash = ` ${ hash } ` ;
537
537
if ( this . protocol === 'javascript:' )
538
538
return ;
539
539
if ( ! hash ) {
@@ -1125,12 +1125,12 @@ function originFor(url, base) {
1125
1125
1126
1126
function domainToASCII ( domain ) {
1127
1127
// toUSVString is not needed.
1128
- return binding . domainToASCII ( '' + domain ) ;
1128
+ return binding . domainToASCII ( ` ${ domain } ` ) ;
1129
1129
}
1130
1130
1131
1131
function domainToUnicode ( domain ) {
1132
1132
// toUSVString is not needed.
1133
- return binding . domainToUnicode ( '' + domain ) ;
1133
+ return binding . domainToUnicode ( ` ${ domain } ` ) ;
1134
1134
}
1135
1135
1136
1136
// Utility function that converts a URL object into an ordinary
0 commit comments