Add comment to clarify why we don't use copySymbol

This commit is contained in:
Yui T
2015-07-01 13:16:29 -07:00
parent 389e446742
commit 744f640f42
+4
View File
@@ -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;