/* automatically generated by JSCoverage - do not edit */
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
if (! _$jscoverage['define.js']) {
  _$jscoverage['define.js'] = [];
  _$jscoverage['define.js'][1] = 0;
  _$jscoverage['define.js'][7] = 0;
  _$jscoverage['define.js'][14] = 0;
  _$jscoverage['define.js'][15] = 0;
  _$jscoverage['define.js'][16] = 0;
  _$jscoverage['define.js'][18] = 0;
  _$jscoverage['define.js'][19] = 0;
  _$jscoverage['define.js'][20] = 0;
  _$jscoverage['define.js'][21] = 0;
  _$jscoverage['define.js'][23] = 0;
  _$jscoverage['define.js'][24] = 0;
  _$jscoverage['define.js'][25] = 0;
  _$jscoverage['define.js'][26] = 0;
  _$jscoverage['define.js'][27] = 0;
  _$jscoverage['define.js'][28] = 0;
  _$jscoverage['define.js'][29] = 0;
  _$jscoverage['define.js'][30] = 0;
  _$jscoverage['define.js'][31] = 0;
  _$jscoverage['define.js'][32] = 0;
  _$jscoverage['define.js'][33] = 0;
  _$jscoverage['define.js'][34] = 0;
  _$jscoverage['define.js'][35] = 0;
  _$jscoverage['define.js'][36] = 0;
  _$jscoverage['define.js'][37] = 0;
  _$jscoverage['define.js'][41] = 0;
  _$jscoverage['define.js'][42] = 0;
  _$jscoverage['define.js'][43] = 0;
  _$jscoverage['define.js'][44] = 0;
  _$jscoverage['define.js'][45] = 0;
  _$jscoverage['define.js'][49] = 0;
  _$jscoverage['define.js'][50] = 0;
  _$jscoverage['define.js'][51] = 0;
  _$jscoverage['define.js'][52] = 0;
  _$jscoverage['define.js'][53] = 0;
  _$jscoverage['define.js'][54] = 0;
  _$jscoverage['define.js'][55] = 0;
  _$jscoverage['define.js'][56] = 0;
  _$jscoverage['define.js'][57] = 0;
  _$jscoverage['define.js'][58] = 0;
  _$jscoverage['define.js'][59] = 0;
  _$jscoverage['define.js'][64] = 0;
  _$jscoverage['define.js'][65] = 0;
  _$jscoverage['define.js'][66] = 0;
  _$jscoverage['define.js'][67] = 0;
  _$jscoverage['define.js'][68] = 0;
  _$jscoverage['define.js'][69] = 0;
  _$jscoverage['define.js'][70] = 0;
  _$jscoverage['define.js'][76] = 0;
  _$jscoverage['define.js'][78] = 0;
  _$jscoverage['define.js'][79] = 0;
  _$jscoverage['define.js'][80] = 0;
  _$jscoverage['define.js'][81] = 0;
  _$jscoverage['define.js'][83] = 0;
  _$jscoverage['define.js'][90] = 0;
  _$jscoverage['define.js'][91] = 0;
  _$jscoverage['define.js'][92] = 0;
  _$jscoverage['define.js'][93] = 0;
  _$jscoverage['define.js'][94] = 0;
  _$jscoverage['define.js'][95] = 0;
  _$jscoverage['define.js'][96] = 0;
  _$jscoverage['define.js'][100] = 0;
  _$jscoverage['define.js'][101] = 0;
  _$jscoverage['define.js'][102] = 0;
  _$jscoverage['define.js'][103] = 0;
  _$jscoverage['define.js'][105] = 0;
  _$jscoverage['define.js'][109] = 0;
  _$jscoverage['define.js'][110] = 0;
  _$jscoverage['define.js'][111] = 0;
  _$jscoverage['define.js'][112] = 0;
  _$jscoverage['define.js'][113] = 0;
  _$jscoverage['define.js'][124] = 0;
  _$jscoverage['define.js'][125] = 0;
  _$jscoverage['define.js'][126] = 0;
  _$jscoverage['define.js'][127] = 0;
  _$jscoverage['define.js'][128] = 0;
  _$jscoverage['define.js'][129] = 0;
  _$jscoverage['define.js'][130] = 0;
  _$jscoverage['define.js'][131] = 0;
  _$jscoverage['define.js'][133] = 0;
  _$jscoverage['define.js'][134] = 0;
  _$jscoverage['define.js'][135] = 0;
  _$jscoverage['define.js'][137] = 0;
  _$jscoverage['define.js'][143] = 0;
  _$jscoverage['define.js'][144] = 0;
  _$jscoverage['define.js'][147] = 0;
  _$jscoverage['define.js'][148] = 0;
  _$jscoverage['define.js'][150] = 0;
  _$jscoverage['define.js'][151] = 0;
  _$jscoverage['define.js'][152] = 0;
  _$jscoverage['define.js'][153] = 0;
  _$jscoverage['define.js'][154] = 0;
  _$jscoverage['define.js'][158] = 0;
  _$jscoverage['define.js'][165] = 0;
  _$jscoverage['define.js'][166] = 0;
  _$jscoverage['define.js'][167] = 0;
  _$jscoverage['define.js'][168] = 0;
  _$jscoverage['define.js'][169] = 0;
  _$jscoverage['define.js'][170] = 0;
  _$jscoverage['define.js'][173] = 0;
  _$jscoverage['define.js'][174] = 0;
  _$jscoverage['define.js'][175] = 0;
  _$jscoverage['define.js'][176] = 0;
  _$jscoverage['define.js'][179] = 0;
  _$jscoverage['define.js'][180] = 0;
  _$jscoverage['define.js'][181] = 0;
  _$jscoverage['define.js'][182] = 0;
  _$jscoverage['define.js'][183] = 0;
  _$jscoverage['define.js'][184] = 0;
  _$jscoverage['define.js'][186] = 0;
  _$jscoverage['define.js'][187] = 0;
  _$jscoverage['define.js'][194] = 0;
  _$jscoverage['define.js'][195] = 0;
  _$jscoverage['define.js'][196] = 0;
  _$jscoverage['define.js'][198] = 0;
  _$jscoverage['define.js'][200] = 0;
  _$jscoverage['define.js'][207] = 0;
  _$jscoverage['define.js'][208] = 0;
  _$jscoverage['define.js'][209] = 0;
  _$jscoverage['define.js'][210] = 0;
  _$jscoverage['define.js'][211] = 0;
  _$jscoverage['define.js'][212] = 0;
  _$jscoverage['define.js'][214] = 0;
  _$jscoverage['define.js'][215] = 0;
  _$jscoverage['define.js'][216] = 0;
  _$jscoverage['define.js'][217] = 0;
  _$jscoverage['define.js'][218] = 0;
  _$jscoverage['define.js'][224] = 0;
  _$jscoverage['define.js'][231] = 0;
  _$jscoverage['define.js'][237] = 0;
  _$jscoverage['define.js'][244] = 0;
  _$jscoverage['define.js'][245] = 0;
  _$jscoverage['define.js'][246] = 0;
  _$jscoverage['define.js'][247] = 0;
  _$jscoverage['define.js'][248] = 0;
  _$jscoverage['define.js'][249] = 0;
  _$jscoverage['define.js'][250] = 0;
  _$jscoverage['define.js'][251] = 0;
  _$jscoverage['define.js'][253] = 0;
  _$jscoverage['define.js'][254] = 0;
  _$jscoverage['define.js'][255] = 0;
  _$jscoverage['define.js'][256] = 0;
  _$jscoverage['define.js'][257] = 0;
  _$jscoverage['define.js'][258] = 0;
  _$jscoverage['define.js'][262] = 0;
  _$jscoverage['define.js'][493] = 0;
  _$jscoverage['define.js'][496] = 0;
  _$jscoverage['define.js'][497] = 0;
  _$jscoverage['define.js'][498] = 0;
  _$jscoverage['define.js'][500] = 0;
  _$jscoverage['define.js'][501] = 0;
  _$jscoverage['define.js'][502] = 0;
  _$jscoverage['define.js'][503] = 0;
  _$jscoverage['define.js'][504] = 0;
  _$jscoverage['define.js'][505] = 0;
  _$jscoverage['define.js'][512] = 0;
  _$jscoverage['define.js'][528] = 0;
  _$jscoverage['define.js'][529] = 0;
  _$jscoverage['define.js'][530] = 0;
  _$jscoverage['define.js'][533] = 0;
  _$jscoverage['define.js'][534] = 0;
  _$jscoverage['define.js'][535] = 0;
  _$jscoverage['define.js'][537] = 0;
  _$jscoverage['define.js'][538] = 0;
  _$jscoverage['define.js'][539] = 0;
  _$jscoverage['define.js'][540] = 0;
  _$jscoverage['define.js'][541] = 0;
  _$jscoverage['define.js'][542] = 0;
  _$jscoverage['define.js'][546] = 0;
  _$jscoverage['define.js'][548] = 0;
  _$jscoverage['define.js'][550] = 0;
}
_$jscoverage['define.js'][1]++;
var base = require("./base/object");
_$jscoverage['define.js'][7]++;
var classCounter = 0;
_$jscoverage['define.js'][14]++;
var callSuper = (function (args, a) {
  _$jscoverage['define.js'][15]++;
  if (! args && ! a) {
    _$jscoverage['define.js'][16]++;
    throw new Error("arguments must be defined.");
  }
  _$jscoverage['define.js'][18]++;
  var f = "", u;
  _$jscoverage['define.js'][19]++;
  var callee, m, meta = this.__meta || {}, pos, supers, l;
  _$jscoverage['define.js'][20]++;
  if (! a) {
    _$jscoverage['define.js'][21]++;
    a = args;
  }
  _$jscoverage['define.js'][23]++;
  if (args.callee) {
    _$jscoverage['define.js'][24]++;
    callee = args.callee;
    _$jscoverage['define.js'][25]++;
    ! f && (f = callee._name);
    _$jscoverage['define.js'][26]++;
    u = callee._unique;
    _$jscoverage['define.js'][27]++;
    pos = meta.pos, supers = meta.supers, l = meta.supers.length;
    _$jscoverage['define.js'][28]++;
    if (f != "constructor") {
      _$jscoverage['define.js'][29]++;
      if (meta.unique === u) {
        _$jscoverage['define.js'][30]++;
        pos = 0;
      }
      else {
        _$jscoverage['define.js'][31]++;
        if (callee != meta.callee) {
          _$jscoverage['define.js'][32]++;
          pos = 0;
          _$jscoverage['define.js'][33]++;
          for (; pos < l; pos++) {
            _$jscoverage['define.js'][34]++;
            var sup = supers[pos], sm = sup? sup[f]: null;
            _$jscoverage['define.js'][35]++;
            if (sm == callee) {
              _$jscoverage['define.js'][36]++;
              pos++;
              _$jscoverage['define.js'][37]++;
              break;
            }
}
        }
      }
      _$jscoverage['define.js'][41]++;
      for (; pos < l; pos++) {
        _$jscoverage['define.js'][42]++;
        var sup = supers[pos], sm = sup? sup[f]: null;
        _$jscoverage['define.js'][43]++;
        if (sm && sm != callee) {
          _$jscoverage['define.js'][44]++;
          m = sm;
          _$jscoverage['define.js'][45]++;
          break;
        }
}
    }
    else {
      _$jscoverage['define.js'][49]++;
      if (meta.unique === u) {
        _$jscoverage['define.js'][50]++;
        pos = 0;
      }
      else {
        _$jscoverage['define.js'][51]++;
        if (callee != meta.callee) {
          _$jscoverage['define.js'][52]++;
          pos = 0;
          _$jscoverage['define.js'][53]++;
          for (; pos < l; pos++) {
            _$jscoverage['define.js'][54]++;
            var sup = supers[pos].__meta.proto;
            _$jscoverage['define.js'][55]++;
            if (sup.instance && sup.instance.hasOwnProperty(f)) {
              _$jscoverage['define.js'][56]++;
              sm = sup.instance[f];
              _$jscoverage['define.js'][57]++;
              if (sm == callee) {
                _$jscoverage['define.js'][58]++;
                pos++;
                _$jscoverage['define.js'][59]++;
                break;
              }
            }
}
        }
      }
      _$jscoverage['define.js'][64]++;
      for (; pos < l; pos++) {
        _$jscoverage['define.js'][65]++;
        var sup = supers[pos].__meta.proto;
        _$jscoverage['define.js'][66]++;
        if (sup.instance && sup.instance.hasOwnProperty(f)) {
          _$jscoverage['define.js'][67]++;
          sm = sup.instance[f];
          _$jscoverage['define.js'][68]++;
          if (sm && sm != callee) {
            _$jscoverage['define.js'][69]++;
            m = sm;
            _$jscoverage['define.js'][70]++;
            break;
          }
        }
}
    }
  }
  else {
    _$jscoverage['define.js'][76]++;
    throw new Error("can't find the super");
  }
  _$jscoverage['define.js'][78]++;
  meta.callee = m;
  _$jscoverage['define.js'][79]++;
  meta.pos = m? ++pos: -1;
  _$jscoverage['define.js'][80]++;
  if (m) {
    _$jscoverage['define.js'][81]++;
    return m.apply(this, a);
  }
  else {
    _$jscoverage['define.js'][83]++;
    return null;
  }
});
_$jscoverage['define.js'][90]++;
var defineMixinProps = (function (child, proto, unique) {
  _$jscoverage['define.js'][91]++;
  if (proto) {
    _$jscoverage['define.js'][92]++;
    var operations = proto.setters;
    _$jscoverage['define.js'][93]++;
    if (operations) {
      _$jscoverage['define.js'][94]++;
      for (var i in operations) {
        _$jscoverage['define.js'][95]++;
        if (! child.__lookupSetter__(i)) {
          _$jscoverage['define.js'][96]++;
          child.__defineSetter__(i, operations[i]);
        }
}
    }
    _$jscoverage['define.js'][100]++;
    operations = proto.getters;
    _$jscoverage['define.js'][101]++;
    if (operations) {
      _$jscoverage['define.js'][102]++;
      for (i in operations) {
        _$jscoverage['define.js'][103]++;
        if (! child.__lookupGetter__(i)) {
          _$jscoverage['define.js'][105]++;
          child.__defineGetter__(i, operations[i]);
        }
}
    }
    _$jscoverage['define.js'][109]++;
    if (proto) {
      _$jscoverage['define.js'][110]++;
      for (j in proto) {
        _$jscoverage['define.js'][111]++;
        if (j != "getters" && j != "setters") {
          _$jscoverage['define.js'][112]++;
          if (! child.hasOwnProperty(j)) {
            _$jscoverage['define.js'][113]++;
            child[j] = proto[j];
          }
        }
}
    }
  }
});
_$jscoverage['define.js'][124]++;
var mixin = (function () {
  _$jscoverage['define.js'][125]++;
  var args = Array.prototype.slice.call(arguments);
  _$jscoverage['define.js'][126]++;
  var child = this.prototype, bases = child.__meta.bases, staticBases = bases.slice(), constructor = child.constructor;
  _$jscoverage['define.js'][127]++;
  for (var i = 0; i < args.length; i++) {
    _$jscoverage['define.js'][128]++;
    var m = args[i];
    _$jscoverage['define.js'][129]++;
    var proto = m.prototype.__meta.proto;
    _$jscoverage['define.js'][130]++;
    defineMixinProps(child, proto.instance, constructor._unique);
    _$jscoverage['define.js'][131]++;
    defineMixinProps(this, proto["static"], constructor._unique);
    _$jscoverage['define.js'][133]++;
    var staticSupers = this.__meta.supers, supers = child.__meta.supers;
    _$jscoverage['define.js'][134]++;
    child.__meta.supers = mixinSupers(m.prototype, bases).concat(supers);
    _$jscoverage['define.js'][135]++;
    this.__meta.supers = mixinSupers(m, staticBases).concat(staticSupers);
}
  _$jscoverage['define.js'][137]++;
  return this;
});
_$jscoverage['define.js'][143]++;
var mixinSupers = (function (sup, bases) {
  _$jscoverage['define.js'][144]++;
  var arr = [], unique = sup.__meta.unique;
  _$jscoverage['define.js'][147]++;
  if (bases.indexOf(unique) == -1) {
    _$jscoverage['define.js'][148]++;
    arr.push(sup);
    _$jscoverage['define.js'][150]++;
    bases.push(unique);
    _$jscoverage['define.js'][151]++;
    var supers = sup.__meta.supers, l = supers.length;
    _$jscoverage['define.js'][152]++;
    if (supers && l) {
      _$jscoverage['define.js'][153]++;
      for (var i = 0; i < l; i++) {
        _$jscoverage['define.js'][154]++;
        arr = arr.concat(mixinSupers(supers[i], bases));
}
    }
  }
  _$jscoverage['define.js'][158]++;
  return arr;
});
_$jscoverage['define.js'][165]++;
var defineProps = (function (child, proto) {
  _$jscoverage['define.js'][166]++;
  if (proto) {
    _$jscoverage['define.js'][167]++;
    var operations = proto.setters;
    _$jscoverage['define.js'][168]++;
    if (operations) {
      _$jscoverage['define.js'][169]++;
      for (var i in operations) {
        _$jscoverage['define.js'][170]++;
        child.__defineSetter__(i, operations[i]);
}
    }
    _$jscoverage['define.js'][173]++;
    operations = proto.getters;
    _$jscoverage['define.js'][174]++;
    if (operations) {
      _$jscoverage['define.js'][175]++;
      for (i in operations) {
        _$jscoverage['define.js'][176]++;
        child.__defineGetter__(i, operations[i]);
}
    }
    _$jscoverage['define.js'][179]++;
    for (i in proto) {
      _$jscoverage['define.js'][180]++;
      if (i != "getters" && i != "setters") {
        _$jscoverage['define.js'][181]++;
        var f = proto[i];
        _$jscoverage['define.js'][182]++;
        if (typeof f == "function") {
          _$jscoverage['define.js'][183]++;
          f._name = i;
          _$jscoverage['define.js'][184]++;
          f._unique = "define" + classCounter;
        }
        _$jscoverage['define.js'][186]++;
        if (i != "constructor") {
          _$jscoverage['define.js'][187]++;
          child[i] = f;
        }
      }
}
  }
});
_$jscoverage['define.js'][194]++;
var export = (function (obj, name) {
  _$jscoverage['define.js'][195]++;
  if (obj && name) {
    _$jscoverage['define.js'][196]++;
    obj[name] = this;
  }
  else {
    _$jscoverage['define.js'][198]++;
    obj.exports = obj = this;
  }
  _$jscoverage['define.js'][200]++;
  return this;
});
_$jscoverage['define.js'][207]++;
var __define = (function (child, sup, proto) {
  _$jscoverage['define.js'][208]++;
  proto = proto || {};
  _$jscoverage['define.js'][209]++;
  var childProto = child.prototype, supers = [];
  _$jscoverage['define.js'][210]++;
  if (sup instanceof Array) {
    _$jscoverage['define.js'][211]++;
    supers = sup;
    _$jscoverage['define.js'][212]++;
    sup = supers.shift();
  }
  _$jscoverage['define.js'][214]++;
  var bases = [], meta, staticMeta;
  _$jscoverage['define.js'][215]++;
  if (sup) {
    _$jscoverage['define.js'][216]++;
    child.__proto__ = sup;
    _$jscoverage['define.js'][217]++;
    childProto.__proto__ = sup.prototype;
    _$jscoverage['define.js'][218]++;
    meta = childProto.__meta = {supers: mixinSupers(sup.prototype, bases), superPos: 0, superName: "", unique: "define" + classCounter};
    _$jscoverage['define.js'][224]++;
    staticMeta = child.__meta = {supers: mixinSupers(sup, []), superPos: 0, superName: "", unique: "define" + classCounter};
  }
  else {
    _$jscoverage['define.js'][231]++;
    meta = childProto.__meta = {supers: [], superPos: 0, superName: "", unique: "define" + classCounter};
    _$jscoverage['define.js'][237]++;
    staticMeta = child.__meta = {supers: [], superPos: 0, superName: "", unique: "define" + classCounter};
  }
  _$jscoverage['define.js'][244]++;
  meta.proto = proto;
  _$jscoverage['define.js'][245]++;
  childProto["static"] = child;
  _$jscoverage['define.js'][246]++;
  defineProps(childProto, proto.instance);
  _$jscoverage['define.js'][247]++;
  defineProps(child, proto["static"]);
  _$jscoverage['define.js'][248]++;
  meta.bases = bases;
  _$jscoverage['define.js'][249]++;
  staticMeta.bases = bases;
  _$jscoverage['define.js'][250]++;
  if (supers.length) {
    _$jscoverage['define.js'][251]++;
    mixin.apply(child, supers.reverse());
  }
  _$jscoverage['define.js'][253]++;
  child.mixin = mixin;
  _$jscoverage['define.js'][254]++;
  child["export"] = export;
  _$jscoverage['define.js'][255]++;
  child["super"] = callSuper;
  _$jscoverage['define.js'][256]++;
  childProto["super"] = callSuper;
  _$jscoverage['define.js'][257]++;
  classCounter++;
  _$jscoverage['define.js'][258]++;
  return child;
});
_$jscoverage['define.js'][262]++;
base.merge(exports, {define: (function (super, proto) {
  _$jscoverage['define.js'][493]++;
  var child = (function () {
  _$jscoverage['define.js'][496]++;
  var instance = this.__meta.proto.instance;
  _$jscoverage['define.js'][497]++;
  if (instance && instance.constructor && instance.constructor._unique) {
    _$jscoverage['define.js'][498]++;
    instance.constructor.apply(this, arguments);
  }
  else {
    _$jscoverage['define.js'][500]++;
    var supers = this.__meta.supers, l = supers.length;
    _$jscoverage['define.js'][501]++;
    for (var i = 0; i < l; i++) {
      _$jscoverage['define.js'][502]++;
      var protoInstance = supers[i].__meta.proto.instance;
      _$jscoverage['define.js'][503]++;
      if (protoInstance && protoInstance.hasOwnProperty("constructor")) {
        _$jscoverage['define.js'][504]++;
        protoInstance.constructor.apply(this, arguments);
        _$jscoverage['define.js'][505]++;
        break;
      }
}
  }
});
  _$jscoverage['define.js'][512]++;
  return __define(child, super, proto);
}), singleton: (function (super, proto) {
  _$jscoverage['define.js'][528]++;
  var retInstance;
  _$jscoverage['define.js'][529]++;
  var child = (function () {
  _$jscoverage['define.js'][530]++;
  if (! retInstance) {
    _$jscoverage['define.js'][533]++;
    var instance = this.__meta.proto.instance;
    _$jscoverage['define.js'][534]++;
    if (instance && instance.constructor._unique) {
      _$jscoverage['define.js'][535]++;
      instance.constructor.apply(this, arguments);
    }
    else {
      _$jscoverage['define.js'][537]++;
      var supers = this.__meta.supers, l = supers.length;
      _$jscoverage['define.js'][538]++;
      for (var i = 0; i < l; i++) {
        _$jscoverage['define.js'][539]++;
        var protoInstance = supers[i].__meta.proto.instance;
        _$jscoverage['define.js'][540]++;
        if (protoInstance && protoInstance.hasOwnProperty("constructor")) {
          _$jscoverage['define.js'][541]++;
          protoInstance.constructor.apply(this, arguments);
          _$jscoverage['define.js'][542]++;
          break;
        }
}
    }
    _$jscoverage['define.js'][546]++;
    retInstance = this;
  }
  _$jscoverage['define.js'][548]++;
  return retInstance;
});
  _$jscoverage['define.js'][550]++;
  return __define(child, super, proto);
})});
_$jscoverage['define.js'].source = ["var base = require(\"./base/object\");","","/**"," * Used to keep track of classes and to create unique ids"," * @ignore"," */","var classCounter = 0;","","/**"," * Alias to call the super method of a particular class"," *"," * @ignore"," */","var callSuper = function(args, a) {","    if (!args &amp;&amp; !a) {","        throw new Error(\"arguments must be defined.\");","    }","    var f = \"\", u;","    var callee, m, meta = this.__meta || {}, pos, supers, l;","    if (!a) {","        a = args;","    }","    if (args.callee) {","        callee = args.callee;","        !f &amp;&amp; (f = callee._name);","        u = callee._unique;","        pos = meta.pos,supers = meta.supers,l = meta.supers.length;","        if (f != \"constructor\") {","            if (meta.unique === u) {","                pos = 0;","            } else if (callee != meta.callee) {","                pos = 0;","                for (; pos &lt; l; pos++) {","                    var sup = supers[pos], sm = sup ? sup[f] : null;","                    if (sm == callee) {","                        pos++;","                        break;","                    }","                }","            }","            for (; pos &lt; l; pos++) {","                var sup = supers[pos], sm = sup ? sup[f] : null;","                if (sm &amp;&amp; sm != callee) {","                    m = sm;","                    break;","                }","            }","        } else {","            if (meta.unique === u) {","                pos = 0;","            } else if (callee != meta.callee) {","                pos = 0;","                for (; pos &lt; l; pos++) {","                    var sup = supers[pos].__meta.proto;","                    if (sup.instance &amp;&amp; sup.instance.hasOwnProperty(f)) {","                        sm = sup.instance[f];","                        if (sm == callee) {","                            pos++;","                            break;","                        }","                    }","                }","            }","            for (; pos &lt; l; pos++) {","                var sup = supers[pos].__meta.proto;","                if (sup.instance &amp;&amp; sup.instance.hasOwnProperty(f)) {","                    sm = sup.instance[f];","                    if (sm &amp;&amp; sm != callee) {","                        m = sm;","                        break;","                    }","                }","            }","        }","    } else {","        throw new Error(\"can't find the super\");","    }","    meta.callee = m;","    meta.pos = m ? ++pos : -1;","    if (m) {","        return m.apply(this, a);","    } else {","        return null;","    }","};","","/**"," * @ignore"," */","var defineMixinProps = function(child, proto, unique) {","    if (proto) {","        var operations = proto.setters;","        if (operations) {","            for (var i in operations) {","                if (!child.__lookupSetter__(i)) {  //make sure that the setter isnt already there","                    child.__defineSetter__(i, operations[i]);","                }","            }","        }","        operations = proto.getters;","        if (operations) {","            for (i in operations) {","                if (!child.__lookupGetter__(i)) {","                    //define the getter if the child does not already have it","                    child.__defineGetter__(i, operations[i]);","                }","            }","        }","        if (proto) {","            for (j in proto) {","                if (j != \"getters\" &amp;&amp; j != \"setters\") {","                    if (!child.hasOwnProperty(j)) {","                        child[j] = proto[j];","                    }","                }","            }","        }","    }","};","","/**"," * @ignore"," */","var mixin = function() {","    var args = Array.prototype.slice.call(arguments);","    var child = this.prototype, bases = child.__meta.bases, staticBases = bases.slice(), constructor = child.constructor;","    for (var i = 0; i &lt; args.length; i++) {","        var m = args[i];","        var proto = m.prototype.__meta.proto;","        defineMixinProps(child, proto.instance, constructor._unique);","        defineMixinProps(this, proto.static, constructor._unique);","        //copy the bases for static,","        var staticSupers = this.__meta.supers, supers = child.__meta.supers;","        child.__meta.supers = mixinSupers(m.prototype, bases).concat(supers);","        this.__meta.supers = mixinSupers(m, staticBases).concat(staticSupers);","    }","    return this;","};","","/**"," * @ignore"," */","var mixinSupers = function(sup, bases) {","    var arr = [], unique = sup.__meta.unique;","    //check it we already have this super mixed into our prototype chain","    //if true then we have already looped their supers!","    if (bases.indexOf(unique) == -1) {","        arr.push(sup);","        //add their id to our bases","        bases.push(unique);","        var supers = sup.__meta.supers, l = supers.length;","        if (supers &amp;&amp; l) {","            for (var i = 0; i &lt; l; i++) {","                arr = arr.concat(mixinSupers(supers[i], bases));","            }","        }","    }","    return arr;","};","","","/**"," * @ignore"," */","var defineProps = function(child, proto) {","    if (proto) {","        var operations = proto.setters;","        if (operations) {","            for (var i in operations) {","                child.__defineSetter__(i, operations[i]);","            }","        }","        operations = proto.getters;","        if (operations) {","            for (i in operations) {","                child.__defineGetter__(i, operations[i]);","            }","        }","        for (i in proto) {","            if (i != \"getters\" &amp;&amp; i != \"setters\") {","                var f = proto[i];","                if (typeof f == \"function\") {","                    f._name = i;","                    f._unique = \"define\" + classCounter;","                }","                if (i != \"constructor\") {","                    child[i] = f;","                }","            }","        }","    }","};","","var export = function(obj, name) {","    if (obj &amp;&amp; name) {","        obj[name] = this;","    } else {","        obj.exports = obj = this;","    }","    return this;","};","","","/**"," * @ignore"," */","var __define = function(child, sup, proto) {","    proto = proto || {};","    var childProto = child.prototype, supers = [];","    if (sup instanceof Array) {","        supers = sup;","        sup = supers.shift();","    }","    var bases = [], meta, staticMeta;","    if (sup) {","        child.__proto__ = sup;","        childProto.__proto__ = sup.prototype;","        meta = childProto.__meta = {","            supers : mixinSupers(sup.prototype, bases),","            superPos : 0,","            superName : \"\",","            unique : \"define\" + classCounter","        };","        staticMeta = child.__meta = {","            supers : mixinSupers(sup, []),","            superPos : 0,","            superName : \"\",","            unique : \"define\" + classCounter","        };","    } else {","        meta = childProto.__meta = {","            supers : [],","            superPos : 0,","            superName : \"\",","            unique : \"define\" + classCounter","        };","        staticMeta = child.__meta = {","            supers : [],","            superPos : 0,","            superName : \"\",","            unique : \"define\" + classCounter","        };","    }","    meta.proto = proto;","    childProto.static = child;","    defineProps(childProto, proto.instance);","    defineProps(child, proto.static);","    meta.bases = bases;","    staticMeta.bases = bases;","    if (supers.length) {","        mixin.apply(child, supers.reverse());","    }","    child.mixin = mixin;","    child.export = export;","    child.super = callSuper;","    childProto.super = callSuper;","    classCounter++;","    return child;","};","","","base.merge(exports, {","    /**@lends comb*/","","    /**","     * Defines a new class to be used","     *","     * &lt;p&gt;","     *     Class methods","     *     &lt;ul&gt;","     *         &lt;li&gt;export(module | bject, name): exports the object to module or the object with the name&lt;/li&gt;","     *         &lt;li&gt;mixin(mixin) : mixes in an object&lt;/li&gt;","     *     &lt;/ul&gt;","     *     &lt;/br&gt;","     *     Instance methods","     *     &lt;ul&gt;","     *         &lt;li&gt;super(argumnents, [?newargs]): calls the super of the current method&lt;/li&gt;","     *     &lt;/ul&gt;","     *","     *      &lt;/br&gt;","     *     Instance properties","     *     &lt;ul&gt;","     *         &lt;li&gt;static: use to reference class properties and methods&lt;/li&gt;","     *     &lt;/ul&gt;","     *","     * &lt;/p&gt;","     *","     *","     * @example","     *  //Class without a super class","     * var Mammal = comb.define(null, {","     *      instance : {","     *","     *          constructor: function(options) {","     *              options = options || {};","     *              this.super(arguments);","     *              this._type = options.type || \"mammal\";","     *          },","     *","     *          speak : function() {","     *              return  \"A mammal of type \" + this._type + \" sounds like\";","     *          },","     *","     *          //Define your getters","     *          getters : {","     *              type : function() {","     *                  return this._type;","     *              }","     *          },","     *","     *           //Define your setters","     *          setters : {","     *              type : function(t) {","     *                  this._type = t;","     *              }","     *          }","     *      },","     *","     *      //Define your static methods","     *      static : {","     *          soundOff : function() {","     *              return \"Im a mammal!!\";","     *          }","     *      }","     * });","     *","     * //Show singular inheritance","     *var Wolf = comb.define(Mammal, {","     *   instance: {","     *       constructor: function(options) {","     *          options = options || {};","     *          //You can call your super constructor, or you may not","     *          //call it to prevent the super initializing parameters","     *          this.super(arguments);","     *          this._sound = \"growl\";","     *          this._color = options.color || \"grey\";","     *      },","     *","     *      speak : function() {","     *          //override my super classes speak","     *          //Should return \"A mammal of type mammal sounds like a growl\"","     *          return this.super(arguments) + \" a \" + this._sound;","     *      },","     *","     *      //add new getters for sound and color","     *      getters : {","     *","     *          color : function() {","     *              return this._color;","     *          },","     *","     *          sound : function() {","     *              return this._sound;","     *          }","     *      },","     *","     *      setters : {","     *","     *          //NOTE color is read only except on initialization","     *","     *          sound : function(s) {","     *              this._sound = s;","     *          }","     *      }","     *","     *  },","     *","     *  static : {","     *      //override my satic soundOff","     *      soundOff : function() {","     *          //You can even call super in your statics!!!","     *          //should return \"I'm a mammal!! that growls\"","     *          return this.super(arguments) + \" that growls\";","     *      }","     *  }","     *});","     *","     *","     * //Typical hierarchical inheritance","     * // Mammal-&gt;Wolf-&gt;Dog","     * var Dog = comb.define(Wolf, {","     *    instance: {","     *        constructor: function(options) {","     *            options = options || {};","     *            this.super(arguments);","     *            //override Wolfs initialization of sound to woof.","     *            this._sound = \"woof\";","     *","     *        },","     *","     *        speak : function() {","     *            //Should return \"A mammal of type mammal sounds like a growl thats domesticated\"","     *            return this.super(arguments) + \" thats domesticated\";","     *        }","     *    },","     *","     *    static : {","     *        soundOff : function() {","     *            //should return \"I'm a mammal!! that growls but now barks\"","     *            return this.super(arguments) + \" but now barks\";","     *        }","     *    }","     *});","     *","     *","     *","     * dog instanceof Wolf =&gt; true","     * dog instanceof Mammal =&gt; true","     * dog.speak() =&gt; \"A mammal of type mammal sounds like a woof thats domesticated\"","     * dog.type =&gt; \"mammal\"","     * dog.color =&gt; \"gold\"","     * dog.sound =&gt; \"woof\"","     * Dog.soundOff() =&gt; \"Im a mammal!! that growls but now barks\"","     *","     * // Mammal-&gt;Wolf-&gt;Dog-&gt;Breed","     *var Breed = comb.define(Dog, {","     *    instance: {","     *","     *        //initialize outside of constructor","     *        _pitch : \"high\",","     *","     *        constructor: function(options) {","     *            options = options || {};","     *            this.super(arguments);","     *            this.breed = options.breed || \"lab\";","     *        },","     *","     *        speak : function() {","     *            //Should return \"A mammal of type mammal sounds like a","     *            //growl thats domesticated with a high pitch!\"","     *            return this.super(arguments) + \" with a \" + this._pitch + \" pitch!\";","     *        },","     *","     *        getters : {","     *            pitch : function() {","     *                return this._pitch;","     *            }","     *        }","     *    },","     *","     *    static : {","     *        soundOff : function() {","     *            //should return \"I'M A MAMMAL!! THAT GROWLS BUT NOW BARKS!\"","     *            return this.super(arguments).toUpperCase() + \"!\";","     *        }","     *    }","     * });","     *","     *","     * var breed = new Breed({color : \"gold\", type : \"lab\"}),","     *","     *","     *","     * breed instanceof Dog =&gt; true","     * breed instanceof Wolf =&gt; true","     * breed instanceof Mammal =&gt; true","     * breed.speak() =&gt; \"A mammal of type lab sounds like a woof \"","     *                  + \"thats domesticated with a high pitch!\"","     * breed.type =&gt; \"lab\"","     * breed.color =&gt; \"gold\"","     * breed.sound =&gt; \"woof\"","     * breed.soundOff() =&gt; \"IM A MAMMAL!! THAT GROWLS BUT NOW BARKS!\"","     *","     *","     *  //Example of multiple inheritance","     *  //NOTE proto is optional","     *","     *  //Mammal is super class","     *  //Wolf Dog and Breed inject functionality into the prototype","     * var Lab = comb.define([Mammal, Wolf, Dog, Breed]);","     *","     * var lab = new Lab();","     * lab instanceof Wolf =&gt; false","     * lab instanceof Dog =&gt; false","     * lab instanceof Breed =&gt; false","     * lab instanceof Mammal =&gt; true","     * lab.speak() =&gt; \"A mammal of type mammal sounds like a\"","     *                + \" woof thats domesticated with a high pitch!\"","     * Lab.soundOff() =&gt; \"IM A MAMMAL!! THAT GROWLS BUT NOW BARKS!\"","     *","     * @param {Array|Class} super the supers of this class","     * @param {Object} [proto] the object used to define this class","     * @param {Object} [proto.instance] the instance methods of the class","     * @param {Object} [proto.instance.getters] the getters for the class","     * @param {Object} [proto.instance.setters] the setters for the class","     * @param {Object} [proto.static] the Class level methods of this class","     * @param {Object} [proto.static.getters] static getters for the object","     * @param {Object} [proto.static.setters] static setters for the object","     *","     * @returns {Object} the constructor of the class to be used with new keyword","     */","    define : function(super, proto) {","        var child = function() {","            //if a unique wasn't defined then the","            //child didn't define one!","            var instance = this.__meta.proto.instance;","            if (instance &amp;&amp; instance.constructor &amp;&amp; instance.constructor._unique) {","                instance.constructor.apply(this, arguments);","            } else {","                var supers = this.__meta.supers, l = supers.length;","                for (var i = 0; i &lt; l; i++) {","                    var protoInstance = supers[i].__meta.proto.instance;","                    if (protoInstance &amp;&amp; protoInstance.hasOwnProperty(\"constructor\")) {","                        protoInstance.constructor.apply(this, arguments);","                        break;","                    }","                }","                //this.super(\"constructor\", arguments);","            }","","        };","        return __define(child, super, proto);","    },","","    /**","     * Defines a singleton instance of a Class","     * @example","     *  var MyLab = comb.singleton([Mammal, Wolf, Dog, Breed]);","     *  var myLab1 = new MyLab();","     *  myLab1.type = \"collie\"","     *  var myLab2 = new MyLab();","     *  myLab1 === myLab2 =&gt; true","     *  myLab1.type =&gt; \"collie\"","     *  myLab2.type =&gt; \"collie\"","     * See {@link define}","     */","    singleton : function(super, proto) {","        var retInstance;","        var child = function() {","            if (!retInstance) {","                //if a unique wasn't defined then the","                //child didn't define one!","                var instance = this.__meta.proto.instance;","                if (instance &amp;&amp; instance.constructor._unique) {","                    instance.constructor.apply(this, arguments);","                } else {","                    var supers = this.__meta.supers, l = supers.length;","                    for (var i = 0; i &lt; l; i++) {","                        var protoInstance = supers[i].__meta.proto.instance;","                        if (protoInstance &amp;&amp; protoInstance.hasOwnProperty(\"constructor\")) {","                            protoInstance.constructor.apply(this, arguments);","                            break;","                        }","                    }","                }","                retInstance = this;","            }","            return retInstance;","        };","        return __define(child, super, proto);","    }","});"];
