diff --git a/compiler/ast/ArrayContainer.js b/compiler/ast/ArrayContainer.js index 0fdaa1053..b545afdf5 100644 --- a/compiler/ast/ArrayContainer.js +++ b/compiler/ast/ArrayContainer.js @@ -49,6 +49,10 @@ class ArrayContainer extends Container { } } + removeChildren() { + this.array.length = 0; + } + prependChild(newChild) { ok(newChild, '"newChild" is required"'); this.array.unshift(newChild); diff --git a/compiler/ast/Node.js b/compiler/ast/Node.js index 74857c35b..7c75d4202 100644 --- a/compiler/ast/Node.js +++ b/compiler/ast/Node.js @@ -143,6 +143,10 @@ class Node { this.body.moveChildrenTo(targetNode); } + removeChildren() { + this.body.removeChildren(); + } + forEachNextSibling(callback, thisObj) { var container = this.container;