mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add comment to clarify why we don't use copySymbol
This commit is contained in:
@@ -12680,6 +12680,10 @@ namespace ts {
|
||||
break;
|
||||
case SyntaxKind.FunctionExpression:
|
||||
case SyntaxKind.ClassExpression:
|
||||
// The reason we are not using copySymbol for function expression and class expression
|
||||
// is that copySymbol will not copy a symbol into SymbolTable if the symbol has name prefix
|
||||
// with "__". Therefore, if class expression or function expression have declared name,
|
||||
// we will add the symbol into the table using its declared name
|
||||
let name = (<FunctionExpression|ClassExpression>location).name;
|
||||
if (name) {
|
||||
let symbol = location.symbol;
|
||||
|
||||
Reference in New Issue
Block a user