diff --git a/compiler/ast/ArrayContainer.js b/compiler/ast/ArrayContainer.js index 26f9d2134..ab20b8781 100644 --- a/compiler/ast/ArrayContainer.js +++ b/compiler/ast/ArrayContainer.js @@ -75,7 +75,7 @@ class ArrayContainer extends Container { if (node.container !== this) { throw new Error('Node does not belong to container: ' + node); } - var array = this.array; + var array = this.array.concat([]); var found = false; for (var i=0; i + ${item} + \ No newline at end of file diff --git a/test/fixtures/render/autotest/for-iterator-as-target/test.js b/test/fixtures/render/autotest/for-iterator-as-target/test.js new file mode 100644 index 000000000..4794c94f7 --- /dev/null +++ b/test/fixtures/render/autotest/for-iterator-as-target/test.js @@ -0,0 +1,7 @@ +exports.templateData = { + myIterator: function(callback) { + for (var i=5; i>=0; i--) { + callback(i); + } + } +};