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

Function insertSuperThisCaptureThisForNode

test/fixtures/snapshot/typescript.js:99519–99524  ·  view source on GitHub ↗

* Assigns the `this` in a constructor to the result of its `super()` call. * * @param statements Statements in the constructor body. * @param superExpression Existing `super()` call for the constructor.

(statements, superExpression)

Source from the content-addressed store, hash-verified

99517 * @param superExpression Existing `super()` call for the constructor.
99518 */
99519 function insertSuperThisCaptureThisForNode(statements, superExpression) {
99520 enableSubstitutionsForCapturedThis();
99521 var assignSuperExpression = factory.createExpressionStatement(factory.createBinaryExpression(factory.createThis(), 63 /* SyntaxKind.EqualsToken */, superExpression));
99522 ts.insertStatementAfterCustomPrologue(statements, assignSuperExpression);
99523 ts.setCommentRange(assignSuperExpression, ts.getOriginalNode(superExpression).parent);
99524 }
99525 function insertCaptureThisForNode(statements, node, initializer) {
99526 enableSubstitutionsForCapturedThis();
99527 var captureThisStatement = factory.createVariableStatement(

Callers 1

transformConstructorBodyFunction · 0.85

Calls 1

Tested by

no test coverage detected