Skip to content

Commit 3227a91

Browse files
committed
[Squash] Rename
1 parent fa7e500 commit 3227a91

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

doc/api/perf_hooks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Creates a new `PerformanceMark` entry in the Performance Timeline. A
125125
`performanceEntry.duration` is always `0`. Performance marks are used
126126
to mark specific significant moments in the Performance Timeline.
127127

128-
### performance.maxBufferSize
128+
### performance.maxEntries
129129
<!-- YAML
130130
added: REPLACEME
131131
-->

lib/perf_hooks.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -403,15 +403,15 @@ class Performance extends PerformanceObserverEntryList {
403403
this[kInsertEntry](nodeTiming);
404404
}
405405

406-
set maxBufferSize(val) {
406+
set maxEntries(val) {
407407
if (typeof val !== 'number' || val >>> 0 !== val) {
408408
const errors = lazyErrors();
409409
throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'val', 'number');
410410
}
411411
this[kMaxCount] = Math.max(1, val >>> 0);
412412
}
413413

414-
get maxBufferSize() {
414+
get maxEntries() {
415415
return this[kMaxCount];
416416
}
417417

@@ -432,8 +432,8 @@ class Performance extends PerformanceObserverEntryList {
432432
`There ${text} in the ` +
433433
'Performance Timeline. Use the clear methods ' +
434434
'to remove entries that are no longer needed or ' +
435-
'set performance.maxBufferSize equal to a higher ' +
436-
'value (currently the maxBufferSize is ' +
435+
'set performance.maxEntries equal to a higher ' +
436+
'value (currently the maxEntries is ' +
437437
`${this[kMaxCount]}).`);
438438
}
439439
}

test/parallel/test-performance-warning.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ const { performance } = require('perf_hooks');
66
const assert = require('assert');
77

88
assert.strictEqual(performance.length, 1);
9-
assert.strictEqual(performance.maxBufferSize, 150);
9+
assert.strictEqual(performance.maxEntries, 150);
1010

11-
performance.maxBufferSize = 1;
11+
performance.maxEntries = 1;
1212

1313
[-1, 0xffffffff + 1, '', null, undefined, Infinity].forEach((i) => {
1414
common.expectsError(
15-
() => performance.maxBufferSize = i,
15+
() => performance.maxEntries = i,
1616
{
1717
code: 'ERR_INVALID_ARG_TYPE',
1818
type: TypeError
@@ -23,7 +23,7 @@ performance.maxBufferSize = 1;
2323
common.expectWarning('Warning', [
2424
'Possible perf_hooks memory leak detected. There are 2 entries in the ' +
2525
'Performance Timeline. Use the clear methods to remove entries that are no ' +
26-
'longer needed or set performance.maxBufferSize equal to a higher value ' +
27-
'(currently the maxBufferSize is 1).']);
26+
'longer needed or set performance.maxEntries equal to a higher value ' +
27+
'(currently the maxEntries is 1).']);
2828

2929
performance.mark('test');

0 commit comments

Comments
 (0)