@@ -126,7 +126,7 @@ namespace ts {
126
126
constructor ( shimMap : ShimMap < T > , selector : ( data : MapLike < T > , key : string ) => U ) {
127
127
this . shimMap = shimMap ;
128
128
this . selector = selector ;
129
-
129
+
130
130
if ( ! shimMap . currentIteratoKeys ) {
131
131
// Create the key array on the map over which we (and other new iterators)
132
132
// will iterate.
@@ -142,17 +142,18 @@ namespace ts {
142
142
// Check if we still have the same key array. Otherwise, this means
143
143
// an element has been deleted from the map in the meanwhile, so we
144
144
// cannot continue.
145
- if ( this . index != - 1 && this . originalIteratoKeys != this . shimMap . currentIteratoKeys )
145
+ if ( this . index !== - 1 && this . originalIteratoKeys !== this . shimMap . currentIteratoKeys ) {
146
146
throw new Error ( "Cannot continue iteration because a map element has been deleted." ) ;
147
+ }
147
148
148
149
const iteratorKeys = this . originalIteratoKeys ;
149
- if ( this . index != - 1 && this . index < iteratorKeys . length ) {
150
+ if ( this . index !== - 1 && this . index < iteratorKeys . length ) {
150
151
const index = this . index ++ ;
151
152
return { value : this . selector ( this . shimMap . data , iteratorKeys [ index ] ) , done : false } ;
152
153
}
153
154
else {
154
155
// Ensure subsequent invocations will always return done.
155
- this . index = - 1 ;
156
+ this . index = - 1 ;
156
157
157
158
return { value : undefined as never , done : true } ;
158
159
}
@@ -163,7 +164,7 @@ namespace ts {
163
164
size = 0 ;
164
165
165
166
data = createDictionaryObject < T > ( ) ;
166
-
167
+
167
168
currentIteratoKeys ?: string [ ] ;
168
169
169
170
get ( key : string ) : T | undefined {
@@ -179,7 +180,7 @@ namespace ts {
179
180
this . currentIteratoKeys . push ( key ) ;
180
181
}
181
182
}
182
-
183
+
183
184
this . data [ key ] = value ;
184
185
return this ;
185
186
}
@@ -232,8 +233,9 @@ namespace ts {
232
233
const iterator = this . entries ( ) ;
233
234
while ( true ) {
234
235
const { value : entry , done } = iterator . next ( ) ;
235
- if ( done )
236
+ if ( done ) {
236
237
break ;
238
+ }
237
239
238
240
action ( entry [ 1 ] , entry [ 0 ] ) ;
239
241
}
0 commit comments