docs: function Descriptor(attributes) {
  
      var instance = this,
  
          cur = 'descriptor: attributes argument: ',
  
          err = function (msg) {
              throw new TypeError(cur + msg);
          },
          getType = function (value) {
              if (typeof value === 'string')
                  return value;
              if (Array.isArray(value))
                  return getTypeArray(value);
              if (typeof value === 'function') {
                  if (Type[value]) return Type[value];
                  else {
                      instance.isClassType = true;
                      instance.className = value.name && value.name !== 'ClassWrapper' ? value.name : 'required class';
                      return value;
                  }
              }
              if (value instanceof Schema) {
                  instance.isSchemaType = true;
                  return value;
              }
              return false;
          },
  
          getTypeArray = function (typeArray) {
              if (typeArray.length !== 1)
                  err('type array must contain exactly one element specifying type');
              var type = typeArray[0];
              if (Array.isArray(type))
                  err('nested type arrays are not supported');
              type = getType(typeArray[0]);
              if (type) {
                  instance.isTypeArray = true;
                  return type;
              }
              err('invalid type');
          };
  
      getType = getType.bind(this);
      getTypeArray = getTypeArray.bind(this);
  
      if (typeof attributes !== 'object') err('missing or invalid');
  
      if (attributes.name === undefined)
          return err('missing required attribute: name');
  
      // ensure name is first attribute
      instance.name = attributes.name;
      for (var attr in attributes) {
          if (attributes.hasOwnProperty(attr)) {
              instance[attr] = attributes[attr];
          }
      }
      if (instance.type) {
          instance.type = getType(instance.type);
          if (!instance.type) err('invalid type');
      }
  
      return instance;
  }