File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -4260,13 +4260,11 @@ namespace ts {
4260
4260
4261
4261
if (isPropertyAccessExpression(expression.left) && expression.left.expression.kind === SyntaxKind.ThisKeyword) {
4262
4262
const thisContainer = getThisContainer(expression, /*includeArrowFunctions*/ false);
4263
- const isPrototypeProperty = isBinaryExpression(thisContainer.parent) &&
4264
- getSpecialPropertyAssignmentKind(thisContainer.parent) === SpecialPropertyAssignmentKind.PrototypeProperty;
4265
4263
// Properties defined in a constructor (or javascript constructor function) don't get undefined added.
4266
4264
// Function expressions that are assigned to the prototype count as methods.
4267
4265
if (thisContainer.kind === SyntaxKind.Constructor ||
4268
4266
thisContainer.kind === SyntaxKind.FunctionDeclaration ||
4269
- (thisContainer.kind === SyntaxKind.FunctionExpression && !isPrototypeProperty )) {
4267
+ (thisContainer.kind === SyntaxKind.FunctionExpression && !isPrototypePropertyAssignment(thisContainer.parent) )) {
4270
4268
definedInConstructor = true;
4271
4269
}
4272
4270
else {
Original file line number Diff line number Diff line change @@ -1656,6 +1656,10 @@ namespace ts {
1656
1656
return SpecialPropertyAssignmentKind . None ;
1657
1657
}
1658
1658
1659
+ export function isPrototypePropertyAssignment ( node : Node ) : boolean {
1660
+ return isBinaryExpression ( node ) && getSpecialPropertyAssignmentKind ( node ) === SpecialPropertyAssignmentKind . PrototypeProperty ;
1661
+ }
1662
+
1659
1663
export function isSpecialPropertyDeclaration ( expr : PropertyAccessExpression ) : boolean {
1660
1664
return isInJavaScriptFile ( expr ) &&
1661
1665
expr . parent && expr . parent . kind === SyntaxKind . ExpressionStatement &&
You can’t perform that action at this time.
0 commit comments