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

Function copyPrologue

test/fixtures/snapshot/typescript.js:26999–27002  ·  view source on GitHub ↗

* Copies any necessary standard and custom prologue-directives into target array. * @param source origin statements array * @param target result statements array * @param ensureUseStrict boolean determining whether the function need to add prologue-directives * @p

(source, target, ensureUseStrict, visitor)

Source from the content-addressed store, hash-verified

26997 * @param visitor Optional callback used to visit any custom prologue directives.
26998 */
26999 function copyPrologue(source, target, ensureUseStrict, visitor) {
27000 var offset = copyStandardPrologue(source, target, 0, ensureUseStrict);
27001 return copyCustomPrologue(source, target, offset, visitor);
27002 }
27003 function isUseStrictPrologue(node) {
27004 return ts.isStringLiteral(node.expression) && node.expression.text === "use strict";
27005 }

Callers

nothing calls this directly

Calls 2

copyStandardPrologueFunction · 0.85
copyCustomPrologueFunction · 0.85

Tested by

no test coverage detected