Don't mutate symbol flags after creation
This commit is contained in:
parent
0e4537e943
commit
7208204877
1 changed files with 4 additions and 4 deletions
|
@ -2425,13 +2425,13 @@ namespace ts {
|
||||||
if (!isPrototypeProperty && (!targetSymbol || !(targetSymbol.flags & SymbolFlags.Namespace)) && isLegalPosition) {
|
if (!isPrototypeProperty && (!targetSymbol || !(targetSymbol.flags & SymbolFlags.Namespace)) && isLegalPosition) {
|
||||||
Debug.assert(isIdentifier(propertyAccess.expression));
|
Debug.assert(isIdentifier(propertyAccess.expression));
|
||||||
const identifier = propertyAccess.expression as Identifier;
|
const identifier = propertyAccess.expression as Identifier;
|
||||||
|
const flags = SymbolFlags.Module | SymbolFlags.JSContainer;
|
||||||
|
const excludeFlags = SymbolFlags.ValueModuleExcludes & ~SymbolFlags.JSContainer;
|
||||||
if (targetSymbol) {
|
if (targetSymbol) {
|
||||||
addDeclarationToSymbol(symbol, identifier, SymbolFlags.Module);
|
addDeclarationToSymbol(symbol, identifier, flags);
|
||||||
symbol.flags |= SymbolFlags.JSContainer;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
targetSymbol = declareSymbol(container.locals, /*parent*/ undefined, identifier, SymbolFlags.Module, SymbolFlags.ValueModuleExcludes);
|
targetSymbol = declareSymbol(container.locals, /*parent*/ undefined, identifier, flags, excludeFlags);
|
||||||
targetSymbol.flags |= SymbolFlags.JSContainer;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!targetSymbol || !(targetSymbol.flags & (SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.NamespaceModule))) {
|
if (!targetSymbol || !(targetSymbol.flags & (SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.NamespaceModule))) {
|
||||||
|
|
Loading…
Reference in a new issue