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

Function bindCaseBlock

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

Source from the content-addressed store, hash-verified

45766 currentFlow = finishFlowLabel(postSwitchLabel);
45767 }
45768 function bindCaseBlock(node) {
45769 var clauses = node.clauses;
45770 var isNarrowingSwitch = isNarrowingExpression(node.parent.expression);
45771 var fallthroughFlow = unreachableFlow;
45772 for (var i = 0; i < clauses.length; i++) {
45773 var clauseStart = i;
45774 while (!clauses[i].statements.length && i + 1 < clauses.length) {
45775 bind(clauses[i]);
45776 i++;
45777 }
45778 var preCaseLabel = createBranchLabel();
45779 addAntecedent(preCaseLabel, isNarrowingSwitch ? createFlowSwitchClause(preSwitchCaseFlow, node.parent, clauseStart, i + 1) : preSwitchCaseFlow);
45780 addAntecedent(preCaseLabel, fallthroughFlow);
45781 currentFlow = finishFlowLabel(preCaseLabel);
45782 var clause = clauses[i];
45783 bind(clause);
45784 fallthroughFlow = currentFlow;
45785 if (!(currentFlow.flags & 1 /* FlowFlags.Unreachable */) && i !== clauses.length - 1 && options.noFallthroughCasesInSwitch) {
45786 clause.fallthroughFlowNode = currentFlow;
45787 }
45788 }
45789 }
45790 function bindCaseClause(node) {
45791 var saveCurrentFlow = currentFlow;
45792 currentFlow = preSwitchCaseFlow;

Callers 1

bindChildrenFunction · 0.85

Calls 6

isNarrowingExpressionFunction · 0.85
createBranchLabelFunction · 0.85
addAntecedentFunction · 0.85
createFlowSwitchClauseFunction · 0.85
finishFlowLabelFunction · 0.85
bindFunction · 0.70

Tested by

no test coverage detected