From fcb4c2ba0f1ab659e6ee4f80df0d36801f35d486 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Mon, 3 Oct 2016 08:32:37 -0700 Subject: [PATCH] Use a `for-of` loop for a dense array instead of iterating over keys and then indexing --- src/compiler/transformers/es6.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index e3ee1dd4c3a..7fb0594a6cc 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -2308,8 +2308,7 @@ namespace ts { extraVariableDeclarations = []; } // hoist collected variable declarations - for (const name in currentState.hoistedLocalVariables) { - const identifier = currentState.hoistedLocalVariables[name]; + for (const identifier of currentState.hoistedLocalVariables) { extraVariableDeclarations.push(createVariableDeclaration(identifier)); } }