pull/3106/head
Rich Harris 6 years ago
parent b9b8575f55
commit 177680fa2c

@ -463,7 +463,7 @@ export default class EachBlockWrapper extends Wrapper {
}
`;
const start = this.block.has_update_method ? '0' : `old_length`;
const start = this.block.has_update_method ? '0' : `#old_length`;
let remove_old_blocks;
@ -482,7 +482,7 @@ export default class EachBlockWrapper extends Wrapper {
`;
} else {
remove_old_blocks = deindent`
for (${this.block.has_update_method ? `` : `#i = ${this.vars.each_block_value}.${length}`}; #i < ${this.block.has_update_method ? view_length : 'old_length'}; #i += 1) {
for (${this.block.has_update_method ? `` : `#i = ${this.vars.each_block_value}.${length}`}; #i < ${this.block.has_update_method ? view_length : '#old_length'}; #i += 1) {
${iterations}[#i].d(1);
}
${!fixed_length && `${view_length} = ${this.vars.each_block_value}.${length};`}
@ -490,7 +490,7 @@ export default class EachBlockWrapper extends Wrapper {
}
const update = deindent`
${!this.block.has_update_method && `const old_length = ${this.vars.each_block_value}.length;`}
${!this.block.has_update_method && `const #old_length = ${this.vars.each_block_value}.length;`}
${this.vars.each_block_value} = ${snippet};
for (var #i = ${start}; #i < ${this.vars.each_block_value}.${length}; #i += 1) {

Loading…
Cancel
Save