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

Function transformAndEmitDoStatement

test/fixtures/snapshot/typescript.js:102842–102870  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

102840 }
102841 }
102842 function transformAndEmitDoStatement(node) {
102843 if (containsYield(node)) {
102844 // [source]
102845 // do {
102846 // /*body*/
102847 // }
102848 // while (i < 10);
102849 //
102850 // [intermediate]
102851 // .loop conditionLabel, endLabel
102852 // .mark loopLabel
102853 // /*body*/
102854 // .mark conditionLabel
102855 // .brtrue loopLabel, (i < 10)
102856 // .endloop
102857 // .mark endLabel
102858 var conditionLabel = defineLabel();
102859 var loopLabel = defineLabel();
102860 beginLoopBlock(/*continueLabel*/ conditionLabel);
102861 markLabel(loopLabel);
102862 transformAndEmitEmbeddedStatement(node.statement);
102863 markLabel(conditionLabel);
102864 emitBreakWhenTrue(loopLabel, ts.visitNode(node.expression, visitor, ts.isExpression));
102865 endLoopBlock();
102866 }
102867 else {
102868 emitStatement(ts.visitNode(node, visitor, ts.isStatement));
102869 }
102870 }
102871 function visitDoStatement(node) {
102872 if (inStatementContainingYield) {
102873 beginScriptLoopBlock();

Callers 1

Calls 8

defineLabelFunction · 0.85
beginLoopBlockFunction · 0.85
markLabelFunction · 0.85
emitBreakWhenTrueFunction · 0.85
endLoopBlockFunction · 0.85
emitStatementFunction · 0.85
containsYieldFunction · 0.70

Tested by

no test coverage detected