Skip to content

Commit

Permalink
lib: add trailing commas in internal/perf
Browse files Browse the repository at this point in the history
PR-URL: #46697
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
aduh95 authored and targos committed Mar 13, 2023
1 parent 4c12e6e commit 7b5c00a
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 29 deletions.
1 change: 1 addition & 0 deletions lib/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ overrides:
- ./internal/mime.js
- ./internal/modules/*.js
- ./internal/per_context/messageport.js
- ./internal/perf/*.js
- ./internal/policy/*.js
- ./internal/priority_queue.js
- ./internal/process/*.js
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/perf/event_loop_delay.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const {
codes: {
ERR_ILLEGAL_CONSTRUCTOR,
ERR_INVALID_THIS,
}
},
} = require('internal/errors');

const {
Expand Down
26 changes: 13 additions & 13 deletions lib/internal/perf/nodetiming.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const {
NODE_PERFORMANCE_MILESTONE_LOOP_START,
NODE_PERFORMANCE_MILESTONE_LOOP_EXIT,
NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE,
NODE_PERFORMANCE_MILESTONE_ENVIRONMENT
NODE_PERFORMANCE_MILESTONE_ENVIRONMENT,
},
loopIdleTime,
} = internalBinding('performance');
Expand All @@ -37,28 +37,28 @@ class PerformanceNodeTiming {
__proto__: null,
enumerable: true,
configurable: true,
value: 'node'
value: 'node',
},

entryType: {
__proto__: null,
enumerable: true,
configurable: true,
value: 'node'
value: 'node',
},

startTime: {
__proto__: null,
enumerable: true,
configurable: true,
value: 0
value: 0,
},

duration: {
__proto__: null,
enumerable: true,
configurable: true,
get: now
get: now,
},

nodeStart: {
Expand All @@ -67,7 +67,7 @@ class PerformanceNodeTiming {
configurable: true,
get() {
return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_NODE_START);
}
},
},

v8Start: {
Expand All @@ -76,7 +76,7 @@ class PerformanceNodeTiming {
configurable: true,
get() {
return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_V8_START);
}
},
},

environment: {
Expand All @@ -85,7 +85,7 @@ class PerformanceNodeTiming {
configurable: true,
get() {
return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_ENVIRONMENT);
}
},
},

loopStart: {
Expand All @@ -94,7 +94,7 @@ class PerformanceNodeTiming {
configurable: true,
get() {
return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_LOOP_START);
}
},
},

loopExit: {
Expand All @@ -103,7 +103,7 @@ class PerformanceNodeTiming {
configurable: true,
get() {
return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_LOOP_EXIT);
}
},
},

bootstrapComplete: {
Expand All @@ -113,15 +113,15 @@ class PerformanceNodeTiming {
get() {
return getMilestoneTimestamp(
NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
}
},
},

idleTime: {
__proto__: null,
enumerable: true,
configurable: true,
get: loopIdleTime,
}
},
});
}

Expand All @@ -130,7 +130,7 @@ class PerformanceNodeTiming {

const opts = {
...options,
depth: options.depth == null ? null : options.depth - 1
depth: options.depth == null ? null : options.depth - 1,
};

return `PerformanceNodeTiming ${inspect(this.toJSON(), opts)}`;
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/perf/observe.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class PerformanceObserverEntryList {

const opts = {
...options,
depth: options.depth == null ? null : options.depth - 1
depth: options.depth == null ? null : options.depth - 1,
};

return `PerformanceObserverEntryList ${inspect(this[kBuffer], opts)}`;
Expand Down Expand Up @@ -358,7 +358,7 @@ class PerformanceObserver {

const opts = {
...options,
depth: options.depth == null ? null : options.depth - 1
depth: options.depth == null ? null : options.depth - 1,
};

return `PerformanceObserver ${inspect({
Expand Down
10 changes: 5 additions & 5 deletions lib/internal/perf/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const {
const {
codes: {
ERR_ILLEGAL_CONSTRUCTOR,
ERR_MISSING_ARGS
}
ERR_MISSING_ARGS,
},
} = require('internal/errors');

const {
Expand Down Expand Up @@ -47,7 +47,7 @@ const { validateInternalField } = require('internal/validators');
const { convertToInt } = require('internal/webidl');

const {
getTimeOriginTimestamp
getTimeOriginTimestamp,
} = internalBinding('performance');

const kPerformanceBrand = Symbol('performance');
Expand All @@ -62,7 +62,7 @@ class Performance extends EventTarget {

const opts = {
...options,
depth: options.depth == null ? null : options.depth - 1
depth: options.depth == null ? null : options.depth - 1,
};

return `Performance ${inspect({
Expand Down Expand Up @@ -235,7 +235,7 @@ const performance = createPerformance();

function dispatchBufferFull(type) {
const event = new Event(type, {
[kTrustEvent]: true
[kTrustEvent]: true,
});
performance.dispatchEvent(event);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/perf/performance_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const {
const {
codes: {
ERR_ILLEGAL_CONSTRUCTOR,
}
},
} = require('internal/errors');

const {
Expand Down Expand Up @@ -60,7 +60,7 @@ class PerformanceEntry {

const opts = {
...options,
depth: options.depth == null ? null : options.depth - 1
depth: options.depth == null ? null : options.depth - 1,
};

return `${this.constructor.name} ${inspect(this.toJSON(), opts)}`;
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/perf/resource_timing.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { enqueue, bufferResourceTiming } = require('internal/perf/observe');
const {
codes: {
ERR_ILLEGAL_CONSTRUCTOR,
}
},
} = require('internal/errors');
const { validateInternalField } = require('internal/validators');
const { kEnumerableProperty } = require('internal/util');
Expand Down
8 changes: 4 additions & 4 deletions lib/internal/perf/timerify.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const {
} = require('internal/validators');

const {
isHistogram
isHistogram,
} = require('internal/histogram');

const {
Expand Down Expand Up @@ -57,7 +57,7 @@ function timerify(fn, options = kEmptyObject) {

validateObject(options, 'options');
const {
histogram
histogram,
} = options;

if (histogram !== undefined &&
Expand Down Expand Up @@ -99,8 +99,8 @@ function timerify(fn, options = kEmptyObject) {
__proto__: null,
configurable: false,
enumerable: true,
value: `timerified ${fn.name}`
}
value: `timerified ${fn.name}`,
},
});

return timerified;
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/perf/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ function refreshTimeOrigin() {
module.exports = {
now,
getMilestoneTimestamp,
refreshTimeOrigin
refreshTimeOrigin,
};

0 comments on commit 7b5c00a

Please sign in to comment.