@@ -368,8 +368,8 @@ class URLSearchParams {
368
368
// Append (innerSequence[0], innerSequence[1]) to querys list.
369
369
ArrayPrototypePush (
370
370
this . #searchParams,
371
- StringPrototypeToWellFormed ( pair [ 0 ] ) ,
372
- StringPrototypeToWellFormed ( pair [ 1 ] ) ,
371
+ StringPrototypeToWellFormed ( ` ${ pair [ 0 ] } ` ) ,
372
+ StringPrototypeToWellFormed ( ` ${ pair [ 1 ] } ` ) ,
373
373
) ;
374
374
} else {
375
375
if ( ( ( typeof pair !== 'object' && typeof pair !== 'function' ) ||
@@ -381,7 +381,7 @@ class URLSearchParams {
381
381
382
382
for ( const element of pair ) {
383
383
length ++ ;
384
- ArrayPrototypePush ( this . #searchParams, StringPrototypeToWellFormed ( element ) ) ;
384
+ ArrayPrototypePush ( this . #searchParams, StringPrototypeToWellFormed ( ` ${ element } ` ) ) ;
385
385
}
386
386
387
387
// If innerSequence's size is not 2, then throw a TypeError.
@@ -400,7 +400,7 @@ class URLSearchParams {
400
400
const desc = ReflectGetOwnPropertyDescriptor ( init , key ) ;
401
401
if ( desc !== undefined && desc . enumerable ) {
402
402
const typedKey = StringPrototypeToWellFormed ( key ) ;
403
- const typedValue = StringPrototypeToWellFormed ( init [ key ] ) ;
403
+ const typedValue = StringPrototypeToWellFormed ( ` ${ init [ key ] } ` ) ;
404
404
405
405
// Two different keys may become the same USVString after normalization.
406
406
// In that case, we retain the later one. Refer to WPT.
@@ -417,7 +417,7 @@ class URLSearchParams {
417
417
}
418
418
} else {
419
419
// https://url.spec.whatwg.org/#dom-urlsearchparams-urlsearchparams
420
- init = StringPrototypeToWellFormed ( init ) ;
420
+ init = StringPrototypeToWellFormed ( ` ${ init } ` ) ;
421
421
this . #searchParams = init ? parseParams ( init ) : [ ] ;
422
422
}
423
423
}
@@ -472,8 +472,8 @@ class URLSearchParams {
472
472
throw new ERR_MISSING_ARGS ( 'name' , 'value' ) ;
473
473
}
474
474
475
- name = StringPrototypeToWellFormed ( name ) ;
476
- value = StringPrototypeToWellFormed ( value ) ;
475
+ name = StringPrototypeToWellFormed ( ` ${ name } ` ) ;
476
+ value = StringPrototypeToWellFormed ( ` ${ value } ` ) ;
477
477
ArrayPrototypePush ( this . #searchParams, name , value ) ;
478
478
if ( this . #context) {
479
479
this . #context. search = this . toString ( ) ;
@@ -489,10 +489,10 @@ class URLSearchParams {
489
489
}
490
490
491
491
const list = this . #searchParams;
492
- name = StringPrototypeToWellFormed ( name ) ;
492
+ name = StringPrototypeToWellFormed ( ` ${ name } ` ) ;
493
493
494
494
if ( value !== undefined ) {
495
- value = StringPrototypeToWellFormed ( value ) ;
495
+ value = StringPrototypeToWellFormed ( ` ${ value } ` ) ;
496
496
for ( let i = 0 ; i < list . length ; ) {
497
497
if ( list [ i ] === name && list [ i + 1 ] === value ) {
498
498
list . splice ( i , 2 ) ;
@@ -523,7 +523,7 @@ class URLSearchParams {
523
523
}
524
524
525
525
const list = this . #searchParams;
526
- name = StringPrototypeToWellFormed ( name ) ;
526
+ name = StringPrototypeToWellFormed ( ` ${ name } ` ) ;
527
527
for ( let i = 0 ; i < list . length ; i += 2 ) {
528
528
if ( list [ i ] === name ) {
529
529
return list [ i + 1 ] ;
@@ -542,7 +542,7 @@ class URLSearchParams {
542
542
543
543
const list = this . #searchParams;
544
544
const values = [ ] ;
545
- name = StringPrototypeToWellFormed ( name ) ;
545
+ name = StringPrototypeToWellFormed ( ` ${ name } ` ) ;
546
546
for ( let i = 0 ; i < list . length ; i += 2 ) {
547
547
if ( list [ i ] === name ) {
548
548
values . push ( list [ i + 1 ] ) ;
@@ -560,10 +560,10 @@ class URLSearchParams {
560
560
}
561
561
562
562
const list = this . #searchParams;
563
- name = StringPrototypeToWellFormed ( name ) ;
563
+ name = StringPrototypeToWellFormed ( ` ${ name } ` ) ;
564
564
565
565
if ( value !== undefined ) {
566
- value = StringPrototypeToWellFormed ( value ) ;
566
+ value = StringPrototypeToWellFormed ( ` ${ value } ` ) ;
567
567
}
568
568
569
569
for ( let i = 0 ; i < list . length ; i += 2 ) {
@@ -586,8 +586,8 @@ class URLSearchParams {
586
586
}
587
587
588
588
const list = this . #searchParams;
589
- name = StringPrototypeToWellFormed ( name ) ;
590
- value = StringPrototypeToWellFormed ( value ) ;
589
+ name = StringPrototypeToWellFormed ( ` ${ name } ` ) ;
590
+ value = StringPrototypeToWellFormed ( ` ${ value } ` ) ;
591
591
592
592
// If there are any name-value pairs whose name is `name`, in `list`, set
593
593
// the value of the first such name-value pair to `value` and remove the
@@ -1010,7 +1010,7 @@ class URL {
1010
1010
}
1011
1011
1012
1012
set search ( value ) {
1013
- const href = bindingUrl . update ( this . #context. href , updateActions . kSearch , StringPrototypeToWellFormed ( value ) ) ;
1013
+ const href = bindingUrl . update ( this . #context. href , updateActions . kSearch , StringPrototypeToWellFormed ( ` ${ value } ` ) ) ;
1014
1014
if ( href ) {
1015
1015
this . #updateContext( href ) ;
1016
1016
}
0 commit comments