factor in attributes and bindings

pull/489/head
Rich-Harris 8 years ago
parent b574c405eb
commit 7132551183

@ -82,7 +82,22 @@ const preprocessors = {
}, },
Element: ( generator, block, node ) => { Element: ( generator, block, node ) => {
// TODO attributes and bindings (and refs?)... node.attributes.forEach( attribute => {
if ( attribute.type === 'Attribute' && attribute.value !== true ) {
attribute.value.forEach( chunk => {
if ( chunk.type !== 'Text' ) {
const { dependencies } = block.contextualise( chunk.expression );
block.addDependencies( dependencies );
}
});
}
else if ( attribute.type === 'Binding' ) {
const { dependencies } = block.contextualise( attribute.value );
block.addDependencies( dependencies );
}
});
preprocessChildren( generator, block, node.children ); preprocessChildren( generator, block, node.children );
} }
}; };

Loading…
Cancel
Save