MCPcopy Index your code
hub / github.com/nodejs/node / visitPrivateIdentifierInInExpression

Function visitPrivateIdentifierInInExpression

test/fixtures/snapshot/typescript.js:94436–94450  ·  view source on GitHub ↗

* Visits `#id in expr`

(node)

Source from the content-addressed store, hash-verified

94434 * Visits `#id in expr`
94435 */
94436 function visitPrivateIdentifierInInExpression(node) {
94437 if (!shouldTransformPrivateElementsOrClassStaticBlocks) {
94438 return node;
94439 }
94440 var privId = node.left;
94441 ts.Debug.assertNode(privId, ts.isPrivateIdentifier);
94442 ts.Debug.assert(node.operatorToken.kind === 101 /* SyntaxKind.InKeyword */);
94443 var info = accessPrivateIdentifier(privId);
94444 if (info) {
94445 var receiver = ts.visitNode(node.right, visitor, ts.isExpression);
94446 return ts.setOriginalNode(context.getEmitHelperFactory().createClassPrivateFieldInHelper(info.brandCheckIdentifier, receiver), node);
94447 }
94448 // Private name has not been declared. Subsequent transformers will handle this error
94449 return ts.visitEachChild(node, visitor, context);
94450 }
94451 /**
94452 * Visits the members of a class that has fields.
94453 *

Callers 1

visitBinaryExpressionFunction · 0.85

Calls 2

accessPrivateIdentifierFunction · 0.85
assertMethod · 0.80

Tested by

no test coverage detected