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

Function onEmitNode

test/fixtures/snapshot/typescript.js:94117–94132  ·  view source on GitHub ↗

* Hook for node emit. * * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emit A callback used to emit the node in the printer.

(hint, node, emitCallback)

Source from the content-addressed store, hash-verified

94115 * @param emit A callback used to emit the node in the printer.
94116 */
94117 function onEmitNode(hint, node, emitCallback) {
94118 var savedApplicableSubstitutions = applicableSubstitutions;
94119 var savedCurrentSourceFile = currentSourceFile;
94120 if (ts.isSourceFile(node)) {
94121 currentSourceFile = node;
94122 }
94123 if (enabledSubstitutions & 2 /* TypeScriptSubstitutionFlags.NamespaceExports */ && isTransformedModuleDeclaration(node)) {
94124 applicableSubstitutions |= 2 /* TypeScriptSubstitutionFlags.NamespaceExports */;
94125 }
94126 if (enabledSubstitutions & 8 /* TypeScriptSubstitutionFlags.NonQualifiedEnumMembers */ && isTransformedEnumDeclaration(node)) {
94127 applicableSubstitutions |= 8 /* TypeScriptSubstitutionFlags.NonQualifiedEnumMembers */;
94128 }
94129 previousOnEmitNode(hint, node, emitCallback);
94130 applicableSubstitutions = savedApplicableSubstitutions;
94131 currentSourceFile = savedCurrentSourceFile;
94132 }
94133 /**
94134 * Hooks node substitutions.
94135 *

Callers 2

emitNodeWithNotificationFunction · 0.85

Calls 7

isSuperContainerFunction · 0.85
enterSubtreeFunction · 0.85
exitSubtreeFunction · 0.85
assertMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected