(name, options = undefined)
| 68 | |
| 69 | class PerformanceMark extends PerformanceEntry { |
| 70 | constructor(name, options = undefined) { |
| 71 | if (arguments.length === 0) { |
| 72 | throw new ERR_MISSING_ARGS('name'); |
| 73 | } |
| 74 | name = `${name}`; |
| 75 | if (nodeTimingReadOnlyAttributes.has(name)) |
| 76 | throw new ERR_INVALID_ARG_VALUE('name', name); |
| 77 | if (options != null) { |
| 78 | validateObject(options, 'options'); |
| 79 | } |
| 80 | const startTime = options?.startTime ?? now(); |
| 81 | validateNumber(startTime, 'startTime'); |
| 82 | if (startTime < 0) |
| 83 | throw new ERR_PERFORMANCE_INVALID_TIMESTAMP(startTime); |
| 84 | markTimings.set(name, startTime); |
| 85 | |
| 86 | let detail = options?.detail; |
| 87 | detail = detail != null ? |
| 88 | structuredClone(detail) : |
| 89 | null; |
| 90 | |
| 91 | super(kSkipThrow, name, 'mark', startTime, 0); |
| 92 | this[kDetail] = detail; |
| 93 | } |
| 94 | |
| 95 | get detail() { |
| 96 | validateThisInternalField(this, kDetail, 'PerformanceMark'); |
nothing calls this directly
no test coverage detected