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

Function insertCaptureThisForNodeIfNeeded

test/fixtures/snapshot/typescript.js:99506–99512  ·  view source on GitHub ↗

* Adds a statement to capture the `this` of a function declaration if it is needed. * NOTE: This must be executed *after* the subtree has been visited. * * @param statements The statements for the new function body. * @param node A node.

(statements, node)

Source from the content-addressed store, hash-verified

99504 * @param node A node.
99505 */
99506 function insertCaptureThisForNodeIfNeeded(statements, node) {
99507 if (hierarchyFacts & 65536 /* HierarchyFacts.CapturedLexicalThis */ && node.kind !== 214 /* SyntaxKind.ArrowFunction */) {
99508 insertCaptureThisForNode(statements, node, factory.createThis());
99509 return true;
99510 }
99511 return false;
99512 }
99513 /**
99514 * Assigns the `this` in a constructor to the result of its `super()` call.
99515 *

Callers 3

visitSourceFileFunction · 0.85
transformConstructorBodyFunction · 0.85
transformFunctionBodyFunction · 0.85

Calls 1

insertCaptureThisForNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…