|
|
@ -410,7 +410,7 @@ export default function generate ( parsed, template ) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const iteration = ${name}_iterations[i];
|
|
|
|
const iteration = ${name}_iterations[i];
|
|
|
|
${name}_iterations[i].update( ${current.contextChain.join( ', ' )}, ${expression}[i] );
|
|
|
|
${name}_iterations[i].update( ${current.contextChain.join( ', ' )}, ${expression}[i]${node.index ? `, i` : ''} );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for ( var i = ${expression}.length; i < ${name}_iterations.length; i += 1 ) {
|
|
|
|
for ( var i = ${expression}.length; i < ${name}_iterations.length; i += 1 ) {
|
|
|
@ -425,18 +425,28 @@ export default function generate ( parsed, template ) {
|
|
|
|
for ( let i = 0; i < ${name}_iterations.length; i += 1 ) {
|
|
|
|
for ( let i = 0; i < ${name}_iterations.length; i += 1 ) {
|
|
|
|
${name}_iterations[i].teardown();
|
|
|
|
${name}_iterations[i].teardown();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
${name}_anchor.parentNode.removeChild( ${name}_anchor );
|
|
|
|
` );
|
|
|
|
` );
|
|
|
|
|
|
|
|
|
|
|
|
const contexts = Object.assign( {}, current.contexts );
|
|
|
|
const contexts = Object.assign( {}, current.contexts );
|
|
|
|
|
|
|
|
const contextChain = current.contextChain.concat( node.context );
|
|
|
|
|
|
|
|
|
|
|
|
contexts[ node.context ] = true;
|
|
|
|
contexts[ node.context ] = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( node.index ) {
|
|
|
|
|
|
|
|
// not strictly a context, but we can treat it as such
|
|
|
|
|
|
|
|
contextChain.push( node.index );
|
|
|
|
|
|
|
|
contexts[ node.index ] = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
current = {
|
|
|
|
current = {
|
|
|
|
useAnchor: false,
|
|
|
|
useAnchor: false,
|
|
|
|
name: renderer,
|
|
|
|
name: renderer,
|
|
|
|
target: 'target',
|
|
|
|
target: 'target',
|
|
|
|
|
|
|
|
|
|
|
|
contexts,
|
|
|
|
contexts,
|
|
|
|
contextChain: current.contextChain.concat( node.context ),
|
|
|
|
contextChain,
|
|
|
|
|
|
|
|
|
|
|
|
initStatements: [],
|
|
|
|
initStatements: [],
|
|
|
|
updateStatements: [],
|
|
|
|
updateStatements: [],
|
|
|
|