Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d4f6c8c

Browse filesBrowse files
committed
Merge branch 'js-ctor-props-type-annotation-as-declaration' into jsdoc-values-as-namespaces
2 parents 2f0e581 + 082802e commit d4f6c8c
Copy full SHA for d4f6c8c

2 files changed

+10-1Lines changed: 10 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/compiler/binder.ts‎

Copy file name to clipboardExpand all lines: src/compiler/binder.ts
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2009,6 +2009,9 @@ namespace ts {
20092009
if (currentFlow && isNarrowableReference(<Expression>node)) {
20102010
node.flowNode = currentFlow;
20112011
}
2012+
if (isSpecialPropertyDeclaration(node as PropertyAccessExpression)) {
2013+
bindThisPropertyAssignment(node as PropertyAccessExpression);
2014+
}
20122015
break;
20132016
case SyntaxKind.BinaryExpression:
20142017
const specialKind = getSpecialPropertyAssignmentKind(node as BinaryExpression);
@@ -2317,7 +2320,7 @@ namespace ts {
23172320
declareSymbol(file.symbol.exports, file.symbol, node, SymbolFlags.Property | SymbolFlags.ExportValue | SymbolFlags.ValueModule, SymbolFlags.None);
23182321
}
23192322

2320-
function bindThisPropertyAssignment(node: BinaryExpression) {
2323+
function bindThisPropertyAssignment(node: BinaryExpression | PropertyAccessExpression) {
23212324
Debug.assert(isInJavaScriptFile(node));
23222325
const container = getThisContainer(node, /*includeArrowFunctions*/ false);
23232326
switch (container.kind) {
Collapse file

‎src/compiler/utilities.ts‎

Copy file name to clipboardExpand all lines: src/compiler/utilities.ts
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,6 +1508,12 @@ namespace ts {
15081508
return SpecialPropertyAssignmentKind.None;
15091509
}
15101510

1511+
export function isSpecialPropertyDeclaration(expr: ts.PropertyAccessExpression): boolean {
1512+
return isInJavaScriptFile(expr) &&
1513+
expr.parent && expr.parent.kind === SyntaxKind.ExpressionStatement &&
1514+
!!getJSDocTypeTag(expr.parent);
1515+
}
1516+
15111517
export function getExternalModuleName(node: Node): Expression {
15121518
if (node.kind === SyntaxKind.ImportDeclaration) {
15131519
return (<ImportDeclaration>node).moduleSpecifier;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.