(node *Node)
| 1520 | ) |
| 1521 | |
| 1522 | func GetAssignmentDeclarationKind(node *Node) JSDeclarationKind { |
| 1523 | switch node.Kind { |
| 1524 | case KindBinaryExpression: |
| 1525 | bin := node.AsBinaryExpression() |
| 1526 | if bin.OperatorToken.Kind == KindEqualsToken && IsAccessExpression(bin.Left) { |
| 1527 | if IsInJSFile(bin.Left) { |
| 1528 | if IsModuleExportsAccessExpression(bin.Left) && !IsExportsIdentifier(bin.Right) { |
| 1529 | return JSDeclarationKindModuleExports |
| 1530 | } |
| 1531 | if (IsModuleExportsAccessExpression(bin.Left.Expression()) || IsExportsIdentifier(bin.Left.Expression())) && |
| 1532 | GetElementOrPropertyAccessName(bin.Left) != nil { |
| 1533 | return JSDeclarationKindExportsProperty |
| 1534 | } |
| 1535 | if bin.Left.Expression().Kind == KindThisKeyword { |
| 1536 | return JSDeclarationKindThisProperty |
| 1537 | } |
| 1538 | } |
| 1539 | if bin.Left.Kind == KindPropertyAccessExpression && IsEntityNameExpressionEx(bin.Left.Expression(), IsInJSFile(bin.Left)) && IsIdentifier(bin.Left.Name()) || |
| 1540 | bin.Left.Kind == KindElementAccessExpression && IsEntityNameExpressionEx(bin.Left.Expression(), IsInJSFile(bin.Left)) { |
| 1541 | return JSDeclarationKindProperty |
| 1542 | } |
| 1543 | } |
| 1544 | case KindCallExpression: |
| 1545 | if IsInJSFile(node) && IsBindableObjectDefinePropertyCall(node) { |
| 1546 | entityName := node.Arguments()[0] |
| 1547 | if IsExportsIdentifier(entityName) || IsModuleExportsAccessExpression(entityName) { |
| 1548 | return JSDeclarationKindObjectDefinePropertyExports |
| 1549 | } |
| 1550 | return JSDeclarationKindObjectDefinePropertyValue |
| 1551 | } |
| 1552 | } |
| 1553 | return JSDeclarationKindNone |
| 1554 | } |
| 1555 | |
| 1556 | func IsBindableObjectDefinePropertyCall(node *Node) bool { |
| 1557 | if args := node.Arguments(); len(args) == 3 { |
no test coverage detected