mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-20 01:54:20 -06:00
Clean up comment.
This commit is contained in:
parent
0a144e1806
commit
b1417d408d
@ -322,7 +322,7 @@ module ts {
|
||||
case SyntaxKind.TypeLiteral:
|
||||
case SyntaxKind.ObjectLiteralExpression:
|
||||
return ContainerFlags.IsContainer;
|
||||
|
||||
|
||||
case SyntaxKind.CallSignature:
|
||||
case SyntaxKind.ConstructSignature:
|
||||
case SyntaxKind.IndexSignature:
|
||||
@ -348,13 +348,19 @@ module ts {
|
||||
return ContainerFlags.IsBlockScopedContainer;
|
||||
|
||||
case SyntaxKind.Block:
|
||||
// do not treat function block a block-scope container
|
||||
// all block-scope locals that reside in this block should go to the function locals.
|
||||
// Otherwise this won't be considered as redeclaration of a block scoped local:
|
||||
// function foo(x) {
|
||||
// let x;
|
||||
// }
|
||||
// 'x' will be placed into the function locals and 'let x' - into the locals of the block
|
||||
// do not treat function block a block-scope container. All block-scope locals
|
||||
// that reside in this block should go to the function locals. Otherwise this
|
||||
// wouldn't be considered as redeclaration of a block scoped local:
|
||||
//
|
||||
// function foo() {
|
||||
// var x;
|
||||
// let x;
|
||||
// }
|
||||
//
|
||||
// If we placed 'var x' into the function locals and 'let x' - into the locals of
|
||||
// the block, then there would be no collision. By doing this, we ensure that both
|
||||
// 'var x' and 'let x' go into the Function-container's locals, and we do get a
|
||||
// collision conflict.
|
||||
return isFunctionLike(node.parent) ? ContainerFlags.None : ContainerFlags.IsBlockScopedContainer;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user