MCPcopy Create free account
hub / github.com/nodejs/node / isValidPropertyAccessForCompletions

Function isValidPropertyAccessForCompletions

test/fixtures/snapshot/typescript.js:75138–75142  ·  view source on GitHub ↗

* Checks if an existing property access is valid for completions purposes. * @param node a property access-like node where we want to check if we can access a property. * This node does not need to be an access of the property we are checking. * e.g. in completions, this n

(node, type, property)

Source from the content-addressed store, hash-verified

75136 * @param property the accessed property's symbol.
75137 */
75138 function isValidPropertyAccessForCompletions(node, type, property) {
75139 return isPropertyAccessible(node, node.kind === 206 /* SyntaxKind.PropertyAccessExpression */ && node.expression.kind === 106 /* SyntaxKind.SuperKeyword */,
75140 /* isWrite */ false, type, property);
75141 // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context.
75142 }
75143 function isValidPropertyAccessWithType(node, isSuper, propertyName, type) {
75144 // Short-circuiting for improved performance.
75145 if (isTypeAny(type)) {

Callers 2

createTypeCheckerFunction · 0.85

Calls 1

isPropertyAccessibleFunction · 0.85

Tested by

no test coverage detected