* Replaces the head segments with the given segments. * The current head segments are removed. * @param {Array } replacementHeadSegments The new head segments. * @returns {void}
(replacementHeadSegments)
| 311 | * @returns {void} |
| 312 | */ |
| 313 | replaceHead(replacementHeadSegments) { |
| 314 | assert( |
| 315 | replacementHeadSegments.length >= this.count, |
| 316 | `${replacementHeadSegments.length} >= ${this.count}`, |
| 317 | ); |
| 318 | this.segmentsList.splice( |
| 319 | -1, |
| 320 | 1, |
| 321 | mergeExtraSegments(this, replacementHeadSegments), |
| 322 | ); |
| 323 | } |
| 324 | |
| 325 | /** |
| 326 | * Adds all segments of a given fork context into this context. |
no test coverage detected