import attributeLookup from './lookup.js'; import createBinding from './binding/index.js'; import deindent from '../../utils/deindent.js'; export default function addElementAttributes ( generator, node, local ) { node.attributes.forEach( attribute => { if ( attribute.type === 'Attribute' ) { let metadata = generator.current.namespace ? null : attributeLookup[ attribute.name ]; if ( metadata && metadata.appliesTo && !~metadata.appliesTo.indexOf( node.name ) ) metadata = null; let dynamic = false; const isBoundOptionValue = node.name === 'option' && attribute.name === 'value'; // TODO check it's actually bound const propertyName = isBoundOptionValue ? '__value' : metadata && metadata.propertyName; if ( attribute.value === true ) { // attributes without values, e.g.