Repository: eslint/eslint
File: lib/linter/code-path-analysis/code-path.js (JavaScript)

Code before:
        return this.internal.returnedForkContext;
    }

    /**
     * Final code path segments that represent `throw` statements.
     * This is a passthrough to the underlying `CodePathState`.
     * These segments are also present in `finalSegments`.
     * @type {CodePathSegment[]}
     */
    get thrownSegments() {
        return this.internal.thrownForkContext;
    }

    /**
     * Tracks the traversal of the code path through each segment. This array
     * starts empty and segments are added or removed as the code path is
     * traversed. This array always ends up empty at the end of a code path
     * traversal. The `CodePathState` uses this to track its progress through
     * the code path.
     * This is a passthrough to the underlying `CodePathState`.
     * @type {CodePathSegment[]}
     * @deprecated
     */
    get currentSegments() {
        return this.internal.currentSegments;
    }

    /**
     * Traverses all segments in this code path.
     *
     *     codePath.traverseSegments(function(segment, controller) {
     *         // do something.
     *     });
     *
     * This method enumerates segments in order from the head.
     *
     * A note on the parameters: the `options` argument is optional and not used
     * within ESLint. This means the first argument might be an options object or
     * the callback function.
     * @param {Object} [optionsOrCallback] Optional first and last segments to traverse.
     * @param {CodePathSegment} [optionsOrCallback.first] The first segment to traverse.
     * @param {CodePathSegment} [optionsOrCallback.last] The last segment to traverse.
     * @param {Function} callback A callback function.
     * @returns {void}
     */
    traverseSegments(optionsOrCallback, callback) {

        // normalize the arguments into a callback and options
        let resolvedOptions;
        let resolvedCallback;


Review comment (suggestion):
I think we should keep this here as it's part of the interface of this function so for a consumer it shouldn't be necessary to search for it in the implementation of the function. 

Code after:
     */
    get returnedSegments() {
        return this.internal.returnedForkContext;
    }

    /**
     * Final code path segments that represent `throw` statements.
     * This is a passthrough to the underlying `CodePathState`.
     * These segments are also present in `finalSegments`.
     * @type {CodePathSegment[]}
     */
    get thrownSegments() {
        return this.internal.thrownForkContext;
    }

    /**
     * Tracks the traversal of the code path through each segment. This array
     * starts empty and segments are added or removed as the code path is
     * traversed. This array always ends up empty at the end of a code path
     * traversal. The `CodePathState` uses this to track its progress through
     * the code path.
     * This is a passthrough to the underlying `CodePathState`.
     * @type {CodePathSegment[]}
     * @deprecated
     */
    get currentSegments() {
        return this.internal.currentSegments;
    }

    /**
     * Traverses all segments in this code path.
     *
     *     codePath.traverseSegments((segment, controller) => {
     *         // do something.
     *     });
     *
     * This method enumerates segments in order from the head.
     *
     * The `controller` argument has two methods:
     *
     * - `skip()` - skips the following segments in this branch
     * - `break()` - skips all following segments in the traversal
     *
     * A note on the parameters: the `options` argument is optional. This means
     * the first argument might be an options object or the callback function.
     * @param {Object} [optionsOrCallback] Optional first and last segments to traverse.
     * @param {CodePathSegment} [optionsOrCallback.first] The first segment to traverse.
     * @param {CodePathSegment} [optionsOrCallback.last] The last segment to traverse.
     * @param {Function} callback A callback function.
     * @returns {void}
     */