* Returns merged fragment. * @param {ConditionalInitFragment} other fragment to merge with * @returns {ConditionalInitFragment} merged fragment
(other)
| 104 | * @returns {ConditionalInitFragment} merged fragment |
| 105 | */ |
| 106 | merge(other) { |
| 107 | if (this.runtimeCondition === true) return this; |
| 108 | if (other.runtimeCondition === true) return other; |
| 109 | if (this.runtimeCondition === false) return other; |
| 110 | if (other.runtimeCondition === false) return this; |
| 111 | const runtimeCondition = mergeRuntime( |
| 112 | this.runtimeCondition, |
| 113 | other.runtimeCondition |
| 114 | ); |
| 115 | return new ConditionalInitFragment( |
| 116 | this.content, |
| 117 | this.stage, |
| 118 | this.position, |
| 119 | this.key, |
| 120 | runtimeCondition, |
| 121 | this.endContent |
| 122 | ); |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | module.exports = ConditionalInitFragment; |
no test coverage detected