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

Function addExtendsHelperIfNeeded

test/fixtures/snapshot/typescript.js:99048–99053  ·  view source on GitHub ↗

* Adds a call to the `__extends` helper if needed for a class. * * @param statements The statements of the class body function. * @param node The ClassExpression or ClassDeclaration node. * @param extendsClauseElement The expression for the class `extends` clause.

(statements, node, extendsClauseElement)

Source from the content-addressed store, hash-verified

99046 * @param extendsClauseElement The expression for the class `extends` clause.
99047 */
99048 function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) {
99049 if (extendsClauseElement) {
99050 statements.push(ts.setTextRange(factory.createExpressionStatement(emitHelpers().createExtendsHelper(factory.getInternalName(node))),
99051 /*location*/ extendsClauseElement));
99052 }
99053 }
99054 /**
99055 * Adds the constructor of the class to a class body function.
99056 *

Callers 1

transformClassBodyFunction · 0.85

Calls 2

emitHelpersFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…