mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Merge pull request #29136 from ajafff/usedbeforedeclaration-objectspread
property is used before its initialization: check more nodes
This commit is contained in:
@@ -19355,7 +19355,19 @@ namespace ts {
|
||||
case SyntaxKind.PropertyDeclaration:
|
||||
return true;
|
||||
case SyntaxKind.PropertyAssignment:
|
||||
// We might be in `a = { b: this.b }`, so keep looking. See `tests/cases/compiler/useBeforeDeclaration_propertyAssignment.ts`.
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
case SyntaxKind.SpreadAssignment:
|
||||
case SyntaxKind.ComputedPropertyName:
|
||||
case SyntaxKind.TemplateSpan:
|
||||
case SyntaxKind.JsxExpression:
|
||||
case SyntaxKind.JsxAttribute:
|
||||
case SyntaxKind.JsxAttributes:
|
||||
case SyntaxKind.JsxSpreadAttribute:
|
||||
case SyntaxKind.JsxOpeningElement:
|
||||
case SyntaxKind.ExpressionWithTypeArguments:
|
||||
case SyntaxKind.HeritageClause:
|
||||
return false;
|
||||
default:
|
||||
return isExpressionNode(node) ? false : "quit";
|
||||
|
||||
Reference in New Issue
Block a user