@@ -6609,7 +6609,7 @@ namespace ts {
66096609 while (current && !nodeStartsNewLexicalEnvironment(current)) {
66106610 if (isIterationStatement(current, /*lookInLabeledStatements*/ false)) {
66116611 if (inFunction) {
6612- grammarErrorOnFirstToken (current, Diagnostics.Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher, declarationNameToString(node)) ;
6612+ getNodeLinks (current).flags |= NodeCheckFlags.LoopWithBlockScopedBindingCapturedInFunction ;
66136613 }
66146614 // mark value declaration so during emit they can have a special handling
66156615 getNodeLinks(<VariableDeclaration>symbol.valueDeclaration).flags |= NodeCheckFlags.BlockScopedBindingInLoop;
@@ -14580,6 +14580,10 @@ namespace ts {
1458014580
1458114581 // Emitter support
1458214582
14583+ function isArgumentsLocalBinding(node: Identifier): boolean {
14584+ return getReferencedValueSymbol(node) === argumentsSymbol;
14585+ }
14586+
1458314587 // When resolved as an expression identifier, if the given node references an exported entity, return the declaration
1458414588 // node of the exported entity's container. Otherwise, return undefined.
1458514589 function getReferencedExportContainer(node: Identifier): SourceFile | ModuleDeclaration | EnumDeclaration {
@@ -14884,7 +14888,8 @@ namespace ts {
1488414888 collectLinkedAliases,
1488514889 getReferencedValueDeclaration,
1488614890 getTypeReferenceSerializationKind,
14887- isOptionalParameter
14891+ isOptionalParameter,
14892+ isArgumentsLocalBinding
1488814893 };
1488914894 }
1489014895
@@ -15711,21 +15716,6 @@ namespace ts {
1571115716 }
1571215717 }
1571315718
15714- function isIterationStatement(node: Node, lookInLabeledStatements: boolean): boolean {
15715- switch (node.kind) {
15716- case SyntaxKind.ForStatement:
15717- case SyntaxKind.ForInStatement:
15718- case SyntaxKind.ForOfStatement:
15719- case SyntaxKind.DoStatement:
15720- case SyntaxKind.WhileStatement:
15721- return true;
15722- case SyntaxKind.LabeledStatement:
15723- return lookInLabeledStatements && isIterationStatement((<LabeledStatement>node).statement, lookInLabeledStatements);
15724- }
15725-
15726- return false;
15727- }
15728-
1572915719 function checkGrammarBreakOrContinueStatement(node: BreakOrContinueStatement): boolean {
1573015720 let current: Node = node;
1573115721 while (current) {
0 commit comments