fix all aliasing tests

pull/468/head
Rich Harris 8 years ago
parent a793398d63
commit 91a58a0f26

@ -140,7 +140,7 @@ export default function visitComponent ( generator, block, state, node ) {
if ( local.bindings.length ) { if ( local.bindings.length ) {
const initialData = block.getUniqueName( `${name}_initial_data` ); const initialData = block.getUniqueName( `${name}_initial_data` );
statements.push( `var ${name}_initial_data = ${initialPropString};` ); statements.push( `var ${initialData} = ${initialPropString};` );
local.bindings.forEach( binding => { local.bindings.forEach( binding => {
statements.push( `if ( ${binding.prop} in ${binding.obj} ) ${initialData}.${binding.name} = ${binding.value};` ); statements.push( `if ( ${binding.prop} in ${binding.obj} ) ${initialData}.${binding.name} = ${binding.value};` );

@ -37,8 +37,9 @@ export default function visitEventHandler ( generator, block, state, node, attri
const listName = block.listNames.get( name ); const listName = block.listNames.get( name );
const indexName = block.indexNames.get( name ); const indexName = block.indexNames.get( name );
const contextName = block.contexts.get( name );
return `var ${listName} = ${_this}._svelte.${listName}, ${indexName} = ${_this}._svelte.${indexName}, ${name} = ${listName}[${indexName}];`; return `var ${listName} = ${_this}._svelte.${listName}, ${indexName} = ${_this}._svelte.${indexName}, ${contextName} = ${listName}[${indexName}];`;
}); });
// get a name for the event handler that is globally unique // get a name for the event handler that is globally unique

Loading…
Cancel
Save