MCPcopy
hub / github.com/eslint/eslint / endCodePath

Function endCodePath

lib/linter/code-path-analysis/code-path-analyzer.js:676–694  ·  view source on GitHub ↗

* Ends the code path for the current node. * @returns {void}

()

Source from the content-addressed store, hash-verified

674 * @returns {void}
675 */
676 function endCodePath() {
677 let codePath = analyzer.codePath;
678
679 // Mark the current path as the final node.
680 CodePath.getState(codePath).makeFinal();
681
682 // Emits onCodePathSegmentEnd event of the current segments.
683 leaveFromCurrentSegment(analyzer, node);
684
685 // Emits onCodePathEnd event of this code path.
686 debug.dump(`onCodePathEnd ${codePath.id}`);
687 analyzer.emit("onCodePathEnd", [codePath, node]);
688 debug.dumpDot(codePath);
689
690 codePath = analyzer.codePath = analyzer.codePath.upper;
691 if (codePath) {
692 debug.dumpState(node, CodePath.getState(codePath), true);
693 }
694 }
695
696 switch (node.type) {
697 case "Program":

Callers 1

postprocessFunction · 0.85

Calls 4

leaveFromCurrentSegmentFunction · 0.85
makeFinalMethod · 0.80
getStateMethod · 0.80
emitMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…