File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4260,13 +4260,11 @@ namespace ts {
42604260
42614261 if (isPropertyAccessExpression(expression.left) && expression.left.expression.kind === SyntaxKind.ThisKeyword) {
42624262 const thisContainer = getThisContainer(expression, /*includeArrowFunctions*/ false);
4263- const isPrototypeProperty = isBinaryExpression(thisContainer.parent) &&
4264- getSpecialPropertyAssignmentKind(thisContainer.parent) === SpecialPropertyAssignmentKind.PrototypeProperty;
42654263 // Properties defined in a constructor (or javascript constructor function) don't get undefined added.
42664264 // Function expressions that are assigned to the prototype count as methods.
42674265 if (thisContainer.kind === SyntaxKind.Constructor ||
42684266 thisContainer.kind === SyntaxKind.FunctionDeclaration ||
4269- (thisContainer.kind === SyntaxKind.FunctionExpression && !isPrototypeProperty )) {
4267+ (thisContainer.kind === SyntaxKind.FunctionExpression && !isPrototypePropertyAssignment(thisContainer.parent) )) {
42704268 definedInConstructor = true;
42714269 }
42724270 else {
Original file line number Diff line number Diff line change @@ -1656,6 +1656,10 @@ namespace ts {
16561656 return SpecialPropertyAssignmentKind . None ;
16571657 }
16581658
1659+ export function isPrototypePropertyAssignment ( node : Node ) : boolean {
1660+ return isBinaryExpression ( node ) && getSpecialPropertyAssignmentKind ( node ) === SpecialPropertyAssignmentKind . PrototypeProperty ;
1661+ }
1662+
16591663 export function isSpecialPropertyDeclaration ( expr : PropertyAccessExpression ) : boolean {
16601664 return isInJavaScriptFile ( expr ) &&
16611665 expr . parent && expr . parent . kind === SyntaxKind . ExpressionStatement &&
You can’t perform that action at this time.
0 commit comments