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

Function createPrivateIdentifierAssignment

test/fixtures/snapshot/typescript.js:94862–94882  ·  view source on GitHub ↗
(info, receiver, right, operator)

Source from the content-addressed store, hash-verified

94860 return ts.visitEachChild(node, visitor, context);
94861 }
94862 function createPrivateIdentifierAssignment(info, receiver, right, operator) {
94863 receiver = ts.visitNode(receiver, visitor, ts.isExpression);
94864 right = ts.visitNode(right, visitor, ts.isExpression);
94865 if (ts.isCompoundAssignment(operator)) {
94866 var _a = createCopiableReceiverExpr(receiver), readExpression = _a.readExpression, initializeExpression = _a.initializeExpression;
94867 receiver = initializeExpression || readExpression;
94868 right = factory.createBinaryExpression(createPrivateIdentifierAccessHelper(info, readExpression), ts.getNonAssignmentOperatorForCompoundAssignment(operator), right);
94869 }
94870 ts.setCommentRange(receiver, ts.moveRangePos(receiver, -1));
94871 switch (info.kind) {
94872 case "a" /* PrivateIdentifierKind.Accessor */:
94873 return context.getEmitHelperFactory().createClassPrivateFieldSetHelper(receiver, info.brandCheckIdentifier, right, info.kind, info.setterName);
94874 case "m" /* PrivateIdentifierKind.Method */:
94875 return context.getEmitHelperFactory().createClassPrivateFieldSetHelper(receiver, info.brandCheckIdentifier, right, info.kind,
94876 /* f */ undefined);
94877 case "f" /* PrivateIdentifierKind.Field */:
94878 return context.getEmitHelperFactory().createClassPrivateFieldSetHelper(receiver, info.brandCheckIdentifier, right, info.kind, info.variableName);
94879 default:
94880 ts.Debug.assertNever(info, "Unknown private element type");
94881 }
94882 }
94883 /**
94884 * Set up the environment for a class.
94885 */

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…