 : options.depth - 1,
    };

    return `${this.constructor.name} ${inspect(this.toJSON(), opts)}`;
  }

  toJSON() {
    return {
      name: this.name,
      entryType: this.entryType,
      startTime: this.startTime,
      duration: this.duration,
      detail: this.detail,
    };
  }
}

class InternalPerformanceEntry {
  constructor(name, type, start, duration, detail) {
    this[kName] = name;
    this[kType] = type;
    this[kStart] = start;
    this[kDuration] = duration;
    this[kDetail] = detail;
  }
}

InternalPerformanceEntry.prototype.constructor = PerformanceEntry;
ObjectSetPrototypeOf(
  InternalPerformanceEntry.prototype,
  PerformanceEntry.prototype);

module.exports = {
  InternalPerformanceEntry,
  PerformanceEntry,
  isPerformanceEntry,
};
