Skip to content

Commit 1a23eab

Browse files
aduh95targos
authored andcommitted
events: add trailing commas in source files
PR-URL: #46759 Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 6d32a16 commit 1a23eab

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

lib/.eslintrc.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,15 @@ overrides:
269269
- ./cluster.js
270270
- ./console.js
271271
- ./constants.js
272+
- ./events.js
272273
- ./fs.js
273274
- ./internal/assert.js
274275
- ./internal/child_process.js
275276
- ./internal/child_process/*.js
276277
- ./internal/cli_table.js
277278
- ./internal/cluster/*.js
278279
- ./internal/debugger/*.js
280+
- ./internal/event_target.js
279281
- ./internal/events/*.js
280282
- ./internal/fixed_queue.js
281283
- ./internal/freelist.js

lib/events.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const {
6666
ERR_INVALID_ARG_TYPE,
6767
ERR_INVALID_THIS,
6868
ERR_OUT_OF_RANGE,
69-
ERR_UNHANDLED_ERROR
69+
ERR_UNHANDLED_ERROR,
7070
},
7171
genericNodeError,
7272
} = require('internal/errors');
@@ -94,7 +94,7 @@ let EventEmitterAsyncResource;
9494
function lazyEventEmitterAsyncResource() {
9595
if (EventEmitterAsyncResource === undefined) {
9696
const {
97-
AsyncResource
97+
AsyncResource,
9898
} = require('async_hooks');
9999

100100
const kEventEmitter = Symbol('kEventEmitter');
@@ -231,7 +231,7 @@ ObjectDefineProperty(EventEmitter, 'captureRejections', {
231231

232232
EventEmitter.prototype[kCapture] = value;
233233
},
234-
enumerable: true
234+
enumerable: true,
235235
});
236236

237237
ObjectDefineProperty(EventEmitter, 'EventEmitterAsyncResource', {
@@ -249,7 +249,7 @@ ObjectDefineProperty(EventEmitter.prototype, kCapture, {
249249
__proto__: null,
250250
value: false,
251251
writable: true,
252-
enumerable: false
252+
enumerable: false,
253253
});
254254

255255
EventEmitter.prototype._events = undefined;
@@ -278,7 +278,7 @@ ObjectDefineProperty(EventEmitter, 'defaultMaxListeners', {
278278
arg);
279279
}
280280
defaultMaxListeners = arg;
281-
}
281+
},
282282
});
283283

284284
ObjectDefineProperties(EventEmitter, {
@@ -295,7 +295,7 @@ ObjectDefineProperties(EventEmitter, {
295295
enumerable: false,
296296
configurable: false,
297297
writable: false,
298-
}
298+
},
299299
});
300300

301301
/**
@@ -479,7 +479,7 @@ EventEmitter.prototype.emit = function emit(type, ...args) {
479479
ObjectDefineProperty(er, kEnhanceStackBeforeInspector, {
480480
__proto__: null,
481481
value: FunctionPrototypeBind(enhanceStackTrace, this, er, capture),
482-
configurable: true
482+
configurable: true,
483483
});
484484
} catch {
485485
// Continue regardless of error.
@@ -1092,7 +1092,7 @@ function on(emitter, event, options = kEmptyObject) {
10921092

10931093
[SymbolAsyncIterator]() {
10941094
return this;
1095-
}
1095+
},
10961096
}, AsyncIteratorPrototype);
10971097

10981098
eventTargetAgnosticAddListener(emitter, event, eventHandler);

lib/internal/event_target.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const {
3232
ERR_EVENT_RECURSION,
3333
ERR_MISSING_ARGS,
3434
ERR_INVALID_THIS,
35-
}
35+
},
3636
} = require('internal/errors');
3737
const { validateAbortSignal, validateObject, validateString, validateInternalField } = require('internal/validators');
3838

@@ -75,7 +75,7 @@ const isTrustedSet = new SafeWeakSet();
7575
const isTrusted = ObjectGetOwnPropertyDescriptor({
7676
get isTrusted() {
7777
return isTrustedSet.has(this);
78-
}
78+
},
7979
}, 'isTrusted').get;
8080

8181
const isTrustedDescriptor = {
@@ -150,7 +150,7 @@ class Event {
150150
return name;
151151

152152
const opts = ObjectAssign({}, options, {
153-
depth: NumberIsInteger(options.depth) ? options.depth - 1 : options.depth
153+
depth: NumberIsInteger(options.depth) ? options.depth - 1 : options.depth,
154154
});
155155

156156
return `${name} ${inspect({
@@ -784,7 +784,7 @@ class EventTarget {
784784
return name;
785785

786786
const opts = ObjectAssign({}, options, {
787-
depth: NumberIsInteger(options.depth) ? options.depth - 1 : options.depth
787+
depth: NumberIsInteger(options.depth) ? options.depth - 1 : options.depth,
788788
});
789789

790790
return `${name} ${inspect({}, opts)}`;
@@ -801,7 +801,7 @@ ObjectDefineProperties(EventTarget.prototype, {
801801
enumerable: false,
802802
configurable: true,
803803
value: 'EventTarget',
804-
}
804+
},
805805
});
806806

807807
function initNodeEventTarget(self) {
@@ -1001,7 +1001,7 @@ function validateEventListenerOptions(options) {
10011001
passive: Boolean(options.passive),
10021002
signal: options.signal,
10031003
weak: options[kWeakHandler],
1004-
isNodeStyleListener: Boolean(options[kIsNodeStyleListener])
1004+
isNodeStyleListener: Boolean(options[kIsNodeStyleListener]),
10051005
};
10061006
}
10071007

@@ -1089,7 +1089,7 @@ function defineEventHandler(emitter, name, event = name) {
10891089
get,
10901090
set,
10911091
configurable: true,
1092-
enumerable: true
1092+
enumerable: true,
10931093
});
10941094
}
10951095

0 commit comments

Comments
 (0)