Skip to content

Commit 54f452d

Browse files
authored
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 351d7fd commit 54f452d

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

lib/.eslintrc.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,15 @@ overrides:
271271
- ./cluster.js
272272
- ./console.js
273273
- ./constants.js
274+
- ./events.js
274275
- ./fs.js
275276
- ./internal/assert.js
276277
- ./internal/child_process.js
277278
- ./internal/child_process/*.js
278279
- ./internal/cli_table.js
279280
- ./internal/cluster/*.js
280281
- ./internal/debugger/*.js
282+
- ./internal/event_target.js
281283
- ./internal/events/*.js
282284
- ./internal/fixed_queue.js
283285
- ./internal/freelist.js

lib/events.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const {
6868
codes: {
6969
ERR_INVALID_ARG_TYPE,
7070
ERR_INVALID_THIS,
71-
ERR_UNHANDLED_ERROR
71+
ERR_UNHANDLED_ERROR,
7272
},
7373
genericNodeError,
7474
} = require('internal/errors');
@@ -99,7 +99,7 @@ let EventEmitterAsyncResource;
9999
function lazyEventEmitterAsyncResource() {
100100
if (EventEmitterAsyncResource === undefined) {
101101
const {
102-
AsyncResource
102+
AsyncResource,
103103
} = require('async_hooks');
104104

105105
const kEventEmitter = Symbol('kEventEmitter');
@@ -236,7 +236,7 @@ ObjectDefineProperty(EventEmitter, 'captureRejections', {
236236

237237
EventEmitter.prototype[kCapture] = value;
238238
},
239-
enumerable: true
239+
enumerable: true,
240240
});
241241

242242
ObjectDefineProperty(EventEmitter, 'EventEmitterAsyncResource', {
@@ -254,7 +254,7 @@ ObjectDefineProperty(EventEmitter.prototype, kCapture, {
254254
__proto__: null,
255255
value: false,
256256
writable: true,
257-
enumerable: false
257+
enumerable: false,
258258
});
259259

260260
EventEmitter.prototype._events = undefined;
@@ -279,7 +279,7 @@ ObjectDefineProperty(EventEmitter, 'defaultMaxListeners', {
279279
set: function(arg) {
280280
validateNumber(arg, 'defaultMaxListeners', 0);
281281
defaultMaxListeners = arg;
282-
}
282+
},
283283
});
284284

285285
ObjectDefineProperties(EventEmitter, {
@@ -296,7 +296,7 @@ ObjectDefineProperties(EventEmitter, {
296296
enumerable: false,
297297
configurable: false,
298298
writable: false,
299-
}
299+
},
300300
});
301301

302302
/**
@@ -477,7 +477,7 @@ EventEmitter.prototype.emit = function emit(type, ...args) {
477477
ObjectDefineProperty(er, kEnhanceStackBeforeInspector, {
478478
__proto__: null,
479479
value: FunctionPrototypeBind(enhanceStackTrace, this, er, capture),
480-
configurable: true
480+
configurable: true,
481481
});
482482
} catch {
483483
// Continue regardless of error.
@@ -1111,7 +1111,7 @@ function on(emitter, event, options = kEmptyObject) {
11111111
*/
11121112
get isPaused() {
11131113
return paused;
1114-
}
1114+
},
11151115
},
11161116
}, AsyncIteratorPrototype);
11171117

@@ -1186,6 +1186,6 @@ function listenersController() {
11861186
while (listeners.length > 0) {
11871187
ReflectApply(eventTargetAgnosticRemoveListener, undefined, ArrayPrototypePop(listeners));
11881188
}
1189-
}
1189+
},
11901190
};
11911191
}

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)