mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
Check that bindingElement is in parameter declaration and pass in correct symbol exclusion flag
This commit is contained in:
parent
170403fc53
commit
0fa240d232
@ -440,6 +440,15 @@ module ts {
|
||||
else if (isBlockOrCatchScoped(<Declaration>node)) {
|
||||
bindBlockScopedVariableDeclaration(<Declaration>node);
|
||||
}
|
||||
else if (isParameterDeclaration(<VariableLikeDeclaration>node)) {
|
||||
// If node is a binding element in parameter declaration, we need to use ParameterExcludes.
|
||||
// Using ParameterExcludes flag allows the compiler to report an error on duplicate identifiers in Parameter Declaration
|
||||
// For example:
|
||||
// function foo([a,a]) {} // Duplicate Identifier error
|
||||
// function bar(a,a) {} // Duplicate Identifier error, binding parameter declaration in this case is handled in bindParameter
|
||||
// // which correctly set excluded symbols
|
||||
bindDeclaration(<Declaration>node, SymbolFlags.FunctionScopedVariable, SymbolFlags.ParameterExcludes, /*isBlockScopeContainer*/ false);
|
||||
}
|
||||
else {
|
||||
bindDeclaration(<Declaration>node, SymbolFlags.FunctionScopedVariable, SymbolFlags.FunctionScopedVariableExcludes, /*isBlockScopeContainer*/ false);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user