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

Function insertStatementAfterPrologue

test/fixtures/snapshot/typescript.js:14634–14646  ·  view source on GitHub ↗
(to, statement, isPrologueDirective)

Source from the content-addressed store, hash-verified

14632 return to;
14633 }
14634 function insertStatementAfterPrologue(to, statement, isPrologueDirective) {
14635 if (statement === undefined)
14636 return to;
14637 var statementIndex = 0;
14638 // skip all prologue directives to insert at the correct position
14639 for (; statementIndex < to.length; ++statementIndex) {
14640 if (!isPrologueDirective(to[statementIndex])) {
14641 break;
14642 }
14643 }
14644 to.splice(statementIndex, 0, statement);
14645 return to;
14646 }
14647 function isAnyPrologueDirective(node) {
14648 return isPrologueDirective(node) || !!(getEmitFlags(node) & 1048576 /* EmitFlags.CustomPrologue */);
14649 }

Calls 1

isPrologueDirectiveFunction · 0.85

Tested by

no test coverage detected