Merge branch 'js-ctor-props-type-annotation-as-declaration' into jsdoc-values-as-namespaces
This commit is contained in:
commit
d4f6c8cc09
2 changed files with 10 additions and 1 deletions
|
@ -2009,6 +2009,9 @@ namespace ts {
|
|||
if (currentFlow && isNarrowableReference(<Expression>node)) {
|
||||
node.flowNode = currentFlow;
|
||||
}
|
||||
if (isSpecialPropertyDeclaration(node as PropertyAccessExpression)) {
|
||||
bindThisPropertyAssignment(node as PropertyAccessExpression);
|
||||
}
|
||||
break;
|
||||
case SyntaxKind.BinaryExpression:
|
||||
const specialKind = getSpecialPropertyAssignmentKind(node as BinaryExpression);
|
||||
|
@ -2317,7 +2320,7 @@ namespace ts {
|
|||
declareSymbol(file.symbol.exports, file.symbol, node, SymbolFlags.Property | SymbolFlags.ExportValue | SymbolFlags.ValueModule, SymbolFlags.None);
|
||||
}
|
||||
|
||||
function bindThisPropertyAssignment(node: BinaryExpression) {
|
||||
function bindThisPropertyAssignment(node: BinaryExpression | PropertyAccessExpression) {
|
||||
Debug.assert(isInJavaScriptFile(node));
|
||||
const container = getThisContainer(node, /*includeArrowFunctions*/ false);
|
||||
switch (container.kind) {
|
||||
|
|
|
@ -1508,6 +1508,12 @@ namespace ts {
|
|||
return SpecialPropertyAssignmentKind.None;
|
||||
}
|
||||
|
||||
export function isSpecialPropertyDeclaration(expr: ts.PropertyAccessExpression): boolean {
|
||||
return isInJavaScriptFile(expr) &&
|
||||
expr.parent && expr.parent.kind === SyntaxKind.ExpressionStatement &&
|
||||
!!getJSDocTypeTag(expr.parent);
|
||||
}
|
||||
|
||||
export function getExternalModuleName(node: Node): Expression {
|
||||
if (node.kind === SyntaxKind.ImportDeclaration) {
|
||||
return (<ImportDeclaration>node).moduleSpecifier;
|
||||
|
|
Loading…
Reference in a new issue