src/node/patcher/attrs.js
function patch(element, previous, attrs) {
  if (!previous && !attrs) {
    return attrs;
  }
  var name, value;
  previous = previous || {};
  attrs = attrs || {};

  for (name in previous) {
    if (previous[name] && !attrs[name]) {
      unset(name, element, previous);
    }
  }
  for (name in attrs) {
    if (previous[name] === attrs[name]) {
      continue;
    }
    if (attrs[name] || attrs[name] === '') {
      set(name, element, previous, attrs);
    }
  }
  return attrs;
}
function patch(element, previous, attrs) {
  if (!previous && !attrs) {
    return attrs;
  }
  var name, value;
  previous = previous || {};
  attrs = attrs || {};

  for (name in previous) {
    if (previous[name] && !attrs[name]) {
      unset(name, element, previous);
    }
  }
  for (name in attrs) {
    if (previous[name] === attrs[name]) {
      continue;
    }
    if (attrs[name] || attrs[name] === '') {
      set(name, element, previous, attrs);
    }
  }
  return attrs;
}
function patch ( element , previous , attrs ) { if ( ! previous && ! attrs ) { return attrs ; } var name , value ; previous = previous || { } ; attrs = attrs || { } ; for ( name in previous ) { if ( previous [ name ] && ! attrs [ name ] ) { unset ( name , element , previous ) ; } } for ( name in attrs ) { if ( previous [ name ] === attrs [ name ] ) { continue ; } if ( attrs [ name ] || attrs [ name ] === '' ) { set ( name , element , previous , attrs ) ; } } return attrs ; }
Maintains state of element attributes.

@param  Object element   A DOM element.
@param  Object previous  The previous state of attributes.
@param  Object attrs     The attributes to match on.
@return Object attrs     The element attributes state.
Maintains state of element attributes .