@@ -12,6 +12,7 @@ const {
12
12
ReflectGetOwnPropertyDescriptor,
13
13
ReflectOwnKeys,
14
14
Symbol,
15
+ SymbolIterator,
15
16
} = primordials ;
16
17
17
18
const { inspect } = require ( 'internal/util/inspect' ) ;
@@ -87,7 +88,7 @@ const kFormat = Symbol('format');
87
88
88
89
// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
89
90
const IteratorPrototype = ObjectGetPrototypeOf (
90
- ObjectGetPrototypeOf ( [ ] [ Symbol . iterator ] ( ) )
91
+ ObjectGetPrototypeOf ( [ ] [ SymbolIterator ] ( ) )
91
92
) ;
92
93
93
94
const unpairedSurrogateRe =
@@ -139,8 +140,8 @@ class URLSearchParams {
139
140
if ( init === null || init === undefined ) {
140
141
this [ searchParams ] = [ ] ;
141
142
} 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 ] ) {
144
145
// While the spec does not have this branch, we can use it as a
145
146
// shortcut to avoid having to go through the costly generic iterator.
146
147
const childParams = init [ searchParams ] ;
@@ -156,7 +157,7 @@ class URLSearchParams {
156
157
for ( const pair of init ) {
157
158
if ( ( typeof pair !== 'object' && typeof pair !== 'function' ) ||
158
159
pair === null ||
159
- typeof pair [ Symbol . iterator ] !== 'function' ) {
160
+ typeof pair [ SymbolIterator ] !== 'function' ) {
160
161
throw new ERR_INVALID_TUPLE ( 'Each query pair' , '[name, value]' ) ;
161
162
}
162
163
const convertedPair = [ ] ;
@@ -1149,7 +1150,7 @@ defineIDLClass(URLSearchParams.prototype, 'URLSearchParams', {
1149
1150
} ) ;
1150
1151
1151
1152
// https://heycam.github.io/webidl/#es-iterable-entries
1152
- ObjectDefineProperty ( URLSearchParams . prototype , Symbol . iterator , {
1153
+ ObjectDefineProperty ( URLSearchParams . prototype , SymbolIterator , {
1153
1154
writable : true ,
1154
1155
configurable : true ,
1155
1156
value : URLSearchParams . prototype . entries
0 commit comments