mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 11:35:42 -06:00
Check binding initialisers in parameters as well
This commit is contained in:
parent
92f2721b46
commit
72a1e85cd7
@ -17041,7 +17041,8 @@ namespace ts {
|
||||
// so we need to do a bit of extra work to check if reference is legal
|
||||
const enclosingContainer = getEnclosingBlockScopeContainer(symbol.valueDeclaration);
|
||||
if (enclosingContainer === func) {
|
||||
if (symbol.valueDeclaration.kind === SyntaxKind.Parameter) {
|
||||
if (symbol.valueDeclaration.kind === SyntaxKind.Parameter ||
|
||||
symbol.valueDeclaration.kind === SyntaxKind.BindingElement) {
|
||||
// it is ok to reference parameter in initializer if either
|
||||
// - parameter is located strictly on the left of current parameter declaration
|
||||
if (symbol.valueDeclaration.pos < node.pos) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user