docs: function() {
      var constructor;
      if (this._constructor) {
        constructor = this._constructor.toFunction();
      }
      var inherits;
      if (this.inherits) {
        if (lib.type.isString(this.inherits)) {
          inherits = lib.inherits.resolve(this.inherits);
        } else {
          inherits = this.inherits;
        }
      }
      var code = "return function " + this.name + "() {";
      code += "inherits && inherits.apply(this,arguments);";
      code += "constructor && constructor.apply(this,arguments);";
      code += "}";
      var mkcls = new Function("constructor","inherits",code);
      var cls = mkcls(constructor,inherits);
      if (inherits) {
        lib.inherits.inherits(cls,inherits);
      }
      var mixlength = this.mixins.length;
      for (var i = 0; i < mixlength; i++) {
        var mixin = this.mixins[i];
        var names = Object.keys(mixin);
        var nlength = names.length;
        for (var n = 0; n < nlength; n++) {
          var name = names[n];
          cls.prototype[name] = mixin[name];
        }
      }
      var methods = Object.keys(this.methods);
      var metlength = methods.length;
      for (var m = 0; m < metlength; m++) {
        var name = methods[m];
        var method = this.methods[name];
        cls.prototype[name] = method.toFunction();
      }
      var properties = Object.keys(this.properties);
      var proplength = properties.length;
      for (var p = 0; p < proplength; p++) {
        var name = properties[p];
        var property = this.properties[name];
        Object.defineProperty(cls.prototype,name,property);
      }
      return cls;
    }