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 <moshe@atlow.co.il>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
aduh95 authored and danielleadams committed Apr 5, 2023
1 parent efc2409 commit 4cf3de8
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 @@ -275,6 +275,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 @@ -202,7 +202,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.#buffer, opts)}`;
Expand Down Expand Up @@ -327,7 +327,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 @@ -9,8 +9,8 @@ const {
const {
codes: {
ERR_ILLEGAL_CONSTRUCTOR,
ERR_MISSING_ARGS
}
ERR_MISSING_ARGS,
},
} = require('internal/errors');

const {
Expand Down Expand Up @@ -42,7 +42,7 @@ const { customInspectSymbol: kInspect } = require('internal/util');
const { inspect } = require('util');

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

class Performance extends EventTarget {
Expand All @@ -55,7 +55,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 @@ -237,7 +237,7 @@ const performance = new InternalPerformance();

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 @@ -8,7 +8,7 @@ const {
const {
codes: {
ERR_ILLEGAL_CONSTRUCTOR,
}
},
} = require('internal/errors');

const {
Expand Down Expand Up @@ -47,7 +47,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 @@ -15,7 +15,7 @@ const kInitiatorType = Symbol('kInitiatorType');
const {
codes: {
ERR_ILLEGAL_CONSTRUCTOR,
}
},
} = require('internal/errors');

class InternalPerformanceResourceTiming extends InternalPerformanceEntry {
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 4cf3de8

Please sign in to comment.