(parent, block)
| 652 | } |
| 653 | |
| 654 | appendChild(parent, block) { |
| 655 | const len = parent.children.length |
| 656 | const lastChild = parent.children[len - 1] |
| 657 | parent.children.push(block) |
| 658 | block.parent = parent.key |
| 659 | if (lastChild) { |
| 660 | lastChild.nextSibling = block.key |
| 661 | block.preSibling = lastChild.key |
| 662 | } else { |
| 663 | block.preSibling = null |
| 664 | } |
| 665 | block.nextSibling = null |
| 666 | } |
| 667 | |
| 668 | replaceBlock(newBlock, oldBlock) { |
| 669 | const blockList = oldBlock.parent ? this.getParent(oldBlock).children : this.blocks |