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

Function appendExportsOfHoistedDeclaration

test/fixtures/snapshot/typescript.js:105502–105514  ·  view source on GitHub ↗

* Appends the exports of a ClassDeclaration or FunctionDeclaration to a statement list, * returning the statement list. * * @param statements A statement list to which the down-level export statements are to be * appended. If `statements` is `undefined`, a new arr

(statements, decl)

Source from the content-addressed store, hash-verified

105500 * @param decl The declaration whose exports are to be recorded.
105501 */
105502 function appendExportsOfHoistedDeclaration(statements, decl) {
105503 if (currentModuleInfo.exportEquals) {
105504 return statements;
105505 }
105506 if (ts.hasSyntacticModifier(decl, 1 /* ModifierFlags.Export */)) {
105507 var exportName = ts.hasSyntacticModifier(decl, 512 /* ModifierFlags.Default */) ? factory.createIdentifier("default") : factory.getDeclarationName(decl);
105508 statements = appendExportStatement(statements, exportName, factory.getLocalName(decl), /*location*/ decl);
105509 }
105510 if (decl.name) {
105511 statements = appendExportsOfDeclaration(statements, decl);
105512 }
105513 return statements;
105514 }
105515 /**
105516 * Appends the exports of a declaration to a statement list, returning the statement list.
105517 *

Callers 2

visitFunctionDeclarationFunction · 0.85
visitClassDeclarationFunction · 0.85

Calls 2

appendExportStatementFunction · 0.85

Tested by

no test coverage detected