bundles/org.eclipse.orion.client.javascript/web/eslint/lib/code-path-analysis/fork-context.js
function makeSegments(context, begin, end, create) {
		var list = context.segmentsList;

		if (begin < 0) {
			begin = list.length + begin;
		}
		if (end < 0) {
			end = list.length + end;
		}

		var segments = [];

		for (var i = 0; i < context.count; ++i) {
			var allPrevSegments = [];

			for (var j = begin; j <= end; ++j) {
				allPrevSegments.push(list[j][i]);
			}

			segments.push(create(context.idGenerator.next(), allPrevSegments));
		}

		return segments;
	}
function makeSegments(context, begin, end, create) {
		var list = context.segmentsList;

		if (begin < 0) {
			begin = list.length + begin;
		}
		if (end < 0) {
			end = list.length + end;
		}

		var segments = [];

		for (var i = 0; i < context.count; ++i) {
			var allPrevSegments = [];

			for (var j = begin; j <= end; ++j) {
				allPrevSegments.push(list[j][i]);
			}

			segments.push(create(context.idGenerator.next(), allPrevSegments));
		}

		return segments;
	}
function makeSegments ( context , begin , end , create ) { var list = context . segmentsList ; if ( begin < 0 ) { begin = list . length + begin ; } if ( end < 0 ) { end = list . length + end ; } var segments = [ ] ; for ( var i = 0 ; i < context . count ; ++ i ) { var allPrevSegments = [ ] ; for ( var j = begin ; j <= end ; ++ j ) { allPrevSegments . push ( list [ j ] [ i ] ) ; } segments . push ( create ( context . idGenerator . next ( ) , allPrevSegments ) ) ; } return segments ; }
Creates new segments from the specific range of `context.segmentsList`.

When `context.segmentsList` is `[[a, b], [c, d], [e, f]]`, `begin` is `0`, and
`end` is `-1`, this creates `[g, h]`. This `g` is from `a`, `c`, and `e`.
This `h` is from `b`, `d`, and `f`.

@param {ForkContext} context - An instance.
@param {number} begin - The first index of the previous segments.
@param {number} end - The last index of the previous segments.
@param {function} create - A factory function of new segments.
@returns {CodePathSegment[]} New segments.
Creates new segments from the specific range of context . segmentsList .