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

Function transformAndEmitWhileStatement

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

Source from the content-addressed store, hash-verified

102880 }
102881 }
102882 function transformAndEmitWhileStatement(node) {
102883 if (containsYield(node)) {
102884 // [source]
102885 // while (i < 10) {
102886 // /*body*/
102887 // }
102888 //
102889 // [intermediate]
102890 // .loop loopLabel, endLabel
102891 // .mark loopLabel
102892 // .brfalse endLabel, (i < 10)
102893 // /*body*/
102894 // .br loopLabel
102895 // .endloop
102896 // .mark endLabel
102897 var loopLabel = defineLabel();
102898 var endLabel = beginLoopBlock(loopLabel);
102899 markLabel(loopLabel);
102900 emitBreakWhenFalse(endLabel, ts.visitNode(node.expression, visitor, ts.isExpression));
102901 transformAndEmitEmbeddedStatement(node.statement);
102902 emitBreak(loopLabel);
102903 endLoopBlock();
102904 }
102905 else {
102906 emitStatement(ts.visitNode(node, visitor, ts.isStatement));
102907 }
102908 }
102909 function visitWhileStatement(node) {
102910 if (inStatementContainingYield) {
102911 beginScriptLoopBlock();

Callers 1

Calls 9

defineLabelFunction · 0.85
beginLoopBlockFunction · 0.85
markLabelFunction · 0.85
emitBreakWhenFalseFunction · 0.85
emitBreakFunction · 0.85
endLoopBlockFunction · 0.85
emitStatementFunction · 0.85
containsYieldFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…