mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-20 01:54:20 -06:00
Clean up comment more.
This commit is contained in:
parent
93b7c33347
commit
fac9ab2508
@ -349,18 +349,21 @@ module ts {
|
||||
|
||||
case SyntaxKind.Block:
|
||||
// do not treat blocks directly inside a function as a block-scoped-container.
|
||||
// that reside in this block should go to the function locals. Otherwise this
|
||||
// wouldn't be considered as redeclaration of a block scoped local:
|
||||
// that reside in this block should go to the function locals. Othewise 'x'
|
||||
// would not appear to be a redeclaration of a block scoped local in the following
|
||||
// example:
|
||||
//
|
||||
// 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 not creating a new block-
|
||||
// scoped-container here, we ensure that both 'var x' and 'let x' go into the
|
||||
// Function - container's locals, and we do get a collision conflict.
|
||||
// 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 not creating a new block-scoped-container here, 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