code: function createConstructor(hasParentPrototype, parent) {
      var Class = function Class() {};
      return hasParentPrototype && ('' + parent) !== ('' + Class) ?
        function Class() {
          return parent.apply(this, arguments);
        } :
        Class
      ;
    }
docs: return the right constructor analyzing the parent. if the parent is empty there is no need to call it.