MCPcopy
hub / github.com/eslint/eslint / makeYield

Method makeYield

lib/linter/code-path-analysis/code-path-state.js:1762–1772  ·  view source on GitHub ↗

* Records abrupt resumption paths from a suspended `yield` expression, * then splits normal post-`yield` continuation into a fresh segment. * @returns {void}

()

Source from the content-addressed store, hash-verified

1760 * @returns {void}
1761 */
1762 makeYield() {
1763 const forkContext = this.forkContext;
1764 const leavingSegments = forkContext.head;
1765
1766 if (forkContext.reachable) {
1767 getReturnContext(this).returnedForkContext.add(leavingSegments);
1768 getThrowContext(this).thrownForkContext.add(leavingSegments);
1769
1770 forkContext.replaceHead(forkContext.makeNext(-1, -1));
1771 }
1772 }
1773
1774 /**
1775 * Makes a code path segment from the first throwable node in a `try` block to the `catch`

Callers 1

processCodePathToExitFunction · 0.80

Calls 5

getReturnContextFunction · 0.85
getThrowContextFunction · 0.85
replaceHeadMethod · 0.80
makeNextMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected