Skip to content

Commit e31f982

Browse files
author
Andy
authored
Merge pull request #11323 from Microsoft/use_for_of
Use a `for-of` loop for a dense array instead of iterating over keys and then indexing
2 parents 20c17ef + fcb4c2b commit e31f982

File tree

1 file changed

+1
-2
lines changed
  • src/compiler/transformers

1 file changed

+1
-2
lines changed

src/compiler/transformers/es6.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2308,8 +2308,7 @@ namespace ts {
23082308
extraVariableDeclarations = [];
23092309
}
23102310
// hoist collected variable declarations
2311-
for (const name in currentState.hoistedLocalVariables) {
2312-
const identifier = currentState.hoistedLocalVariables[name];
2311+
for (const identifier of currentState.hoistedLocalVariables) {
23132312
extraVariableDeclarations.push(createVariableDeclaration(identifier));
23142313
}
23152314
}

0 commit comments

Comments
 (0)