(node: SplootNode, index: number)
| 80 | } |
| 81 | |
| 82 | insertNode(node: SplootNode, index: number) { |
| 83 | if (node.parent && node.enableMutations) { |
| 84 | console.warn('Inserting a node with mutations enabled which alredy has a parent!') |
| 85 | } |
| 86 | this.children.splice(index, 0, node) |
| 87 | node.parent = this.childParentRef |
| 88 | if (this.enableMutations) { |
| 89 | node.afterInsert() |
| 90 | node.parent.node.recursivelyValidate() |
| 91 | node.recursivelySetMutations(true) |
| 92 | const mutation = new ChildSetMutation() |
| 93 | mutation.type = ChildSetMutationType.INSERT |
| 94 | mutation.childSet = this |
| 95 | mutation.nodes = [node] |
| 96 | mutation.index = index |
| 97 | this.fireMutation(mutation) |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | allowDelete(): boolean { |
| 102 | if (this.type === ChildSetType.Immutable) { |
no test coverage detected