@@ -12,6 +12,7 @@ const {
1212 ReflectGetOwnPropertyDescriptor,
1313 ReflectOwnKeys,
1414 Symbol,
15+ SymbolIterator,
1516} = primordials ;
1617
1718const { inspect } = require ( 'internal/util/inspect' ) ;
@@ -87,7 +88,7 @@ const kFormat = Symbol('format');
8788
8889// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
8990const IteratorPrototype = ObjectGetPrototypeOf (
90- ObjectGetPrototypeOf ( [ ] [ Symbol . iterator ] ( ) )
91+ ObjectGetPrototypeOf ( [ ] [ SymbolIterator ] ( ) )
9192) ;
9293
9394const unpairedSurrogateRe =
@@ -139,8 +140,8 @@ class URLSearchParams {
139140 if ( init === null || init === undefined ) {
140141 this [ searchParams ] = [ ] ;
141142 } else if ( typeof init === 'object' || typeof init === 'function' ) {
142- const method = init [ Symbol . iterator ] ;
143- if ( method === this [ Symbol . iterator ] ) {
143+ const method = init [ SymbolIterator ] ;
144+ if ( method === this [ SymbolIterator ] ) {
144145 // While the spec does not have this branch, we can use it as a
145146 // shortcut to avoid having to go through the costly generic iterator.
146147 const childParams = init [ searchParams ] ;
@@ -156,7 +157,7 @@ class URLSearchParams {
156157 for ( const pair of init ) {
157158 if ( ( typeof pair !== 'object' && typeof pair !== 'function' ) ||
158159 pair === null ||
159- typeof pair [ Symbol . iterator ] !== 'function' ) {
160+ typeof pair [ SymbolIterator ] !== 'function' ) {
160161 throw new ERR_INVALID_TUPLE ( 'Each query pair' , '[name, value]' ) ;
161162 }
162163 const convertedPair = [ ] ;
@@ -1149,7 +1150,7 @@ defineIDLClass(URLSearchParams.prototype, 'URLSearchParams', {
11491150} ) ;
11501151
11511152// https://heycam.github.io/webidl/#es-iterable-entries
1152- ObjectDefineProperty ( URLSearchParams . prototype , Symbol . iterator , {
1153+ ObjectDefineProperty ( URLSearchParams . prototype , SymbolIterator , {
11531154 writable : true ,
11541155 configurable : true ,
11551156 value : URLSearchParams . prototype . entries
0 commit comments