@@ -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 ) ;
@@ -215,7 +215,7 @@ function onParseHashComplete(flags, protocol, username, password,
215
215
class URL {
216
216
constructor ( input , base ) {
217
217
// toUSVString is not needed.
218
- input = '' + input ;
218
+ input = ` ${ input } ` ;
219
219
if ( base !== undefined && ! ( base instanceof URL ) )
220
220
base = new URL ( base ) ;
221
221
parse ( this , input , base ) ;
@@ -326,7 +326,7 @@ Object.defineProperties(URL.prototype, {
326
326
} ,
327
327
set ( input ) {
328
328
// toUSVString is not needed.
329
- input = '' + input ;
329
+ input = ` ${ input } ` ;
330
330
parse ( this , input ) ;
331
331
}
332
332
} ,
@@ -345,7 +345,7 @@ Object.defineProperties(URL.prototype, {
345
345
} ,
346
346
set ( scheme ) {
347
347
// toUSVString is not needed.
348
- scheme = '' + scheme ;
348
+ scheme = ` ${ scheme } ` ;
349
349
if ( scheme . length === 0 )
350
350
return ;
351
351
binding . parse ( scheme , binding . kSchemeStart , null , this [ context ] ,
@@ -360,7 +360,7 @@ Object.defineProperties(URL.prototype, {
360
360
} ,
361
361
set ( username ) {
362
362
// toUSVString is not needed.
363
- username = '' + username ;
363
+ username = ` ${ username } ` ;
364
364
if ( ! this . hostname )
365
365
return ;
366
366
const ctx = this [ context ] ;
@@ -381,7 +381,7 @@ Object.defineProperties(URL.prototype, {
381
381
} ,
382
382
set ( password ) {
383
383
// toUSVString is not needed.
384
- password = '' + password ;
384
+ password = ` ${ password } ` ;
385
385
if ( ! this . hostname )
386
386
return ;
387
387
const ctx = this [ context ] ;
@@ -407,7 +407,7 @@ Object.defineProperties(URL.prototype, {
407
407
set ( host ) {
408
408
const ctx = this [ context ] ;
409
409
// toUSVString is not needed.
410
- host = '' + host ;
410
+ host = ` ${ host } ` ;
411
411
if ( this [ cannotBeBase ] ||
412
412
( this [ special ] && host . length === 0 ) ) {
413
413
// Cannot set the host if cannot-be-base is set or
@@ -432,7 +432,7 @@ Object.defineProperties(URL.prototype, {
432
432
set ( host ) {
433
433
const ctx = this [ context ] ;
434
434
// toUSVString is not needed.
435
- host = '' + host ;
435
+ host = ` ${ host } ` ;
436
436
if ( this [ cannotBeBase ] ||
437
437
( this [ special ] && host . length === 0 ) ) {
438
438
// Cannot set the host if cannot-be-base is set or
@@ -457,7 +457,7 @@ Object.defineProperties(URL.prototype, {
457
457
} ,
458
458
set ( port ) {
459
459
// toUSVString is not needed.
460
- port = '' + port ;
460
+ port = ` ${ port } ` ;
461
461
const ctx = this [ context ] ;
462
462
if ( ! ctx . host || this [ cannotBeBase ] ||
463
463
this . protocol === 'file:' )
@@ -481,7 +481,7 @@ Object.defineProperties(URL.prototype, {
481
481
} ,
482
482
set ( path ) {
483
483
// toUSVString is not needed.
484
- path = '' + path ;
484
+ path = ` ${ path } ` ;
485
485
if ( this [ cannotBeBase ] )
486
486
return ;
487
487
binding . parse ( path , binding . kPathStart , null , this [ context ] ,
@@ -530,7 +530,7 @@ Object.defineProperties(URL.prototype, {
530
530
set ( hash ) {
531
531
const ctx = this [ context ] ;
532
532
// toUSVString is not needed.
533
- hash = '' + hash ;
533
+ hash = ` ${ hash } ` ;
534
534
if ( this . protocol === 'javascript:' )
535
535
return ;
536
536
if ( ! hash ) {
@@ -1122,12 +1122,12 @@ function originFor(url, base) {
1122
1122
1123
1123
function domainToASCII ( domain ) {
1124
1124
// toUSVString is not needed.
1125
- return binding . domainToASCII ( '' + domain ) ;
1125
+ return binding . domainToASCII ( ` ${ domain } ` ) ;
1126
1126
}
1127
1127
1128
1128
function domainToUnicode ( domain ) {
1129
1129
// toUSVString is not needed.
1130
- return binding . domainToUnicode ( '' + domain ) ;
1130
+ return binding . domainToUnicode ( ` ${ domain } ` ) ;
1131
1131
}
1132
1132
1133
1133
// Utility function that converts a URL object into an ordinary
0 commit comments