lib/code-path-analysis/code-path-analyzer.js
function leaveFromCurrentSegment(analyzer, node) {
    const state = CodePath.getState(analyzer.codePath);
    const currentSegments = state.currentSegments;

    for (let i = 0; i < currentSegments.length; ++i) {
        const currentSegment = currentSegments[i];

        debug.dump(`onCodePathSegmentEnd ${currentSegment.id}`);
        if (currentSegment.reachable) {
            analyzer.emitter.emit(
                "onCodePathSegmentEnd",
                currentSegment,
                node
            );
        }
    }

    state.currentSegments = [];
}
function leaveFromCurrentSegment(analyzer, node) {
    const state = CodePath.getState(analyzer.codePath);
    const currentSegments = state.currentSegments;

    for (let i = 0; i < currentSegments.length; ++i) {
        const currentSegment = currentSegments[i];

        debug.dump(`onCodePathSegmentEnd ${currentSegment.id}`);
        if (currentSegment.reachable) {
            analyzer.emitter.emit(
                "onCodePathSegmentEnd",
                currentSegment,
                node
            );
        }
    }

    state.currentSegments = [];
}
function leaveFromCurrentSegment ( analyzer , node ) { const state = CodePath . getState ( analyzer . codePath ) ; const currentSegments = state . currentSegments ; for ( let i = 0 ; i < currentSegments . length ; ++ i ) { const currentSegment = currentSegments [ i ] ; debug . dump ( ` ${ currentSegment . id } ` ) ; if ( currentSegment . reachable ) { analyzer . emitter . emit ( "onCodePathSegmentEnd" , currentSegment , node ) ; } } state . currentSegments = [ ] ; }
Updates the current segment with empty.
This is called at the last of functions or the program.

@param {CodePathAnalyzer} analyzer - The instance.
@param {ASTNode} node - The current AST node.
@returns {void}
Updates the current segment with empty . This is called at the last of functions or the program .