spec/uglify/riot.js
function addChildTag(tag, tagName, parent) {
  var cachedTag = parent.tags[tagName]

  // if there are multiple children tags having the same name
  if (cachedTag) {
    // if the parent tags property is not yet an array
    // create it adding the first cached tag
    if (!isArray(cachedTag))
      // don't add the same tag twice
      if (cachedTag !== tag)
        parent.tags[tagName] = [cachedTag]
    // add the new nested tag to the array
    if (!contains(parent.tags[tagName], tag))
      parent.tags[tagName].push(tag)
  } else {
    parent.tags[tagName] = tag
  }
}
function addChildTag(tag, tagName, parent) {
  var cachedTag = parent.tags[tagName]

  // if there are multiple children tags having the same name
  if (cachedTag) {
    // if the parent tags property is not yet an array
    // create it adding the first cached tag
    if (!isArray(cachedTag))
      // don't add the same tag twice
      if (cachedTag !== tag)
        parent.tags[tagName] = [cachedTag]
    // add the new nested tag to the array
    if (!contains(parent.tags[tagName], tag))
      parent.tags[tagName].push(tag)
  } else {
    parent.tags[tagName] = tag
  }
}
function addChildTag ( tag , tagName , parent ) { var cachedTag = parent . tags [ tagName ] // if there are multiple children tags having the same name if ( cachedTag ) { // if the parent tags property is not yet an array // create it adding the first cached tag if ( ! isArray ( cachedTag ) ) // don't add the same tag twice if ( cachedTag !== tag ) parent . tags [ tagName ] = [ cachedTag ] // add the new nested tag to the array if ( ! contains ( parent . tags [ tagName ] , tag ) ) parent . tags [ tagName ] . push ( tag ) } else { parent . tags [ tagName ] = tag } }
Add a child tag to its parent into the `tags` object
@param   { Object } tag - child tag instance
@param   { String } tagName - key where the new tag will be stored
@param   { Object } parent - tag instance where the new child tag will be included
Add a child tag to its parent into the tags object