mixin.js
function subOf(child, mixin) {
  if(child === mixin) return true;
  if(child && child.constructors) {
    for(var i in child.constructors) {
      var parent = child.constructors[i];

      // avoid dead loop
      if(parent === child) continue;

      if(parent === mixin) return true;
      if(subOf(parent, mixin)) return true;
    }
  }
  return false;
}
function subOf(child, mixin) {
  if(child === mixin) return true;
  if(child && child.constructors) {
    for(var i in child.constructors) {
      var parent = child.constructors[i];

      // avoid dead loop
      if(parent === child) continue;

      if(parent === mixin) return true;
      if(subOf(parent, mixin)) return true;
    }
  }
  return false;
}
function subOf ( child , mixin ) { if ( child === mixin ) return true ; if ( child && child . constructors ) { for ( var i in child . constructors ) { var parent = child . constructors [ i ] ; // avoid dead loop if ( parent === child ) continue ; if ( parent === mixin ) return true ; if ( subOf ( parent , mixin ) ) return true ; } } return false ; }
check whether mixin is in inherited chain of child class
check whether mixin is in inherited chain of child class