MCPcopy Create free account
hub / github.com/microsoft/typescript-go / IsBindableObjectDefinePropertyCall

Function IsBindableObjectDefinePropertyCall

internal/ast/utilities.go:1556–1567  ·  view source on GitHub ↗
(node *Node)

Source from the content-addressed store, hash-verified

1554}
1555
1556func IsBindableObjectDefinePropertyCall(node *Node) bool {
1557 if args := node.Arguments(); len(args) == 3 {
1558 if expr := node.Expression(); IsPropertyAccessExpression(expr) &&
1559 IsIdentifier(expr.Expression()) && expr.Expression().Text() == "Object" &&
1560 expr.Name().Text() == "defineProperty" &&
1561 IsStringOrNumericLiteralLike(args[1]) &&
1562 IsBindableStaticNameExpression(args[0] /*excludeThisKeyword*/, true) {
1563 return true
1564 }
1565 }
1566 return false
1567}
1568
1569/**
1570 * A declaration has a dynamic name if all of the following are true:

Callers 3

isValidReferencePositionFunction · 0.92
getSymbolAtLocationMethod · 0.92

Calls 9

lenFunction · 0.85
IsIdentifierFunction · 0.85
ArgumentsMethod · 0.80
ExpressionMethod · 0.80
TextMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected