src/compiler/attribute.js
function attr(loc, reference, attrName, value) {
  if (plainAttributes.indexOf(attrName) != -1) {
    return sourceNode(loc, [reference, '.', attrName, ' = ', value, ';']);
  } else {
    return sourceNode(loc, [reference, '.setAttribute(', esc(attrName), ', ', value, ');']);
  }
}
function attr(loc, reference, attrName, value) {
  if (plainAttributes.indexOf(attrName) != -1) {
    return sourceNode(loc, [reference, '.', attrName, ' = ', value, ';']);
  } else {
    return sourceNode(loc, [reference, '.setAttribute(', esc(attrName), ', ', value, ');']);
  }
}
function attr ( loc , reference , attrName , value ) { if ( plainAttributes . indexOf ( attrName ) != - 1 ) { return sourceNode ( loc , [ reference , '.' , attrName , ' = ' , value , ';' ] ) ; } else { return sourceNode ( loc , [ reference , '.setAttribute(' , esc ( attrName ) , ', ' , value , ');' ] ) ; } }
Generate source nodes for attribute.
@param {Object} loc
@param {string} reference
@param {string} attrName
@param {string} value
@returns {SourceNode}
Generate source nodes for attribute .