()
| 145 | } |
| 146 | |
| 147 | shift() { |
| 148 | // If this portion has less than 3 portions, it means that when |
| 149 | // want to delete one, this portion describes the space. |
| 150 | if (this.portionLength <= 2) { |
| 151 | this.children = []; |
| 152 | this.borders = []; |
| 153 | |
| 154 | return; |
| 155 | } |
| 156 | |
| 157 | const child = this.children[0]; |
| 158 | |
| 159 | if (child) { |
| 160 | if (child.children.length) { |
| 161 | child.shift(); |
| 162 | } else { |
| 163 | this.children.shift(); |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | this.updateBorders(); |
| 168 | } |
| 169 | |
| 170 | pop() { |
| 171 | // If this portion has less than 3 portions, it means that when |
no test coverage detected