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

Function emitNodeWithNotification

test/fixtures/snapshot/typescript.js:109714–109726  ·  view source on GitHub ↗

* Emits a node with possible emit notification. * * @param hint A hint as to the intended usage of the node. * @param node The node to emit. * @param emitCallback The callback used to emit the node.

(hint, node, emitCallback)

Source from the content-addressed store, hash-verified

109712 * @param emitCallback The callback used to emit the node.
109713 */
109714 function emitNodeWithNotification(hint, node, emitCallback) {
109715 ts.Debug.assert(state < 3 /* TransformationState.Disposed */, "Cannot invoke TransformationResult callbacks after the result is disposed.");
109716 if (node) {
109717 // TODO: Remove check and unconditionally use onEmitNode when API is breakingly changed
109718 // (see https://github.com/microsoft/TypeScript/pull/36248/files/5062623f39120171b98870c71344b3242eb03d23#r369766739)
109719 if (isEmitNotificationEnabled(node)) {
109720 onEmitNode(hint, node, emitCallback);
109721 }
109722 else {
109723 emitCallback(hint, node);
109724 }
109725 }
109726 }
109727 /**
109728 * Records a hoisted variable declaration for the provided name within a lexical environment.
109729 */

Callers

nothing calls this directly

Calls 3

onEmitNodeFunction · 0.85
assertMethod · 0.80

Tested by

no test coverage detected