summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine du Hamel <duhamelantoine1995@gmail.com>2023-02-24 09:45:04 +0100
committerMichaël Zasso <targos@protonmail.com>2023-03-14 07:54:15 +0100
commit1a23eab6144b43170186142fbd09dfd76fc648f6 (patch)
tree511f824502a4cf5ef147452fa04e511bda970fae
parent6d32a16319f4b6628b66146517c49931065af11a (diff)
downloadnode-new-1a23eab6144b43170186142fbd09dfd76fc648f6.tar.gz
events: add trailing commas in source files
PR-URL: https://github.com/nodejs/node/pull/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>
-rw-r--r--lib/.eslintrc.yaml2
-rw-r--r--lib/events.js16
-rw-r--r--lib/internal/event_target.js14
3 files changed, 17 insertions, 15 deletions
diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml
index 70909218cd..55ca324876 100644
--- a/lib/.eslintrc.yaml
+++ b/lib/.eslintrc.yaml
@@ -269,6 +269,7 @@ overrides:
- ./cluster.js
- ./console.js
- ./constants.js
+ - ./events.js
- ./fs.js
- ./internal/assert.js
- ./internal/child_process.js
@@ -276,6 +277,7 @@ overrides:
- ./internal/cli_table.js
- ./internal/cluster/*.js
- ./internal/debugger/*.js
+ - ./internal/event_target.js
- ./internal/events/*.js
- ./internal/fixed_queue.js
- ./internal/freelist.js
diff --git a/lib/events.js b/lib/events.js
index 9e5c1100d8..55a551fd07 100644
--- a/lib/events.js
+++ b/lib/events.js
@@ -66,7 +66,7 @@ const {
ERR_INVALID_ARG_TYPE,
ERR_INVALID_THIS,
ERR_OUT_OF_RANGE,
- ERR_UNHANDLED_ERROR
+ ERR_UNHANDLED_ERROR,
},
genericNodeError,
} = require('internal/errors');
@@ -94,7 +94,7 @@ let EventEmitterAsyncResource;
function lazyEventEmitterAsyncResource() {
if (EventEmitterAsyncResource === undefined) {
const {
- AsyncResource
+ AsyncResource,
} = require('async_hooks');
const kEventEmitter = Symbol('kEventEmitter');
@@ -231,7 +231,7 @@ ObjectDefineProperty(EventEmitter, 'captureRejections', {
EventEmitter.prototype[kCapture] = value;
},
- enumerable: true
+ enumerable: true,
});
ObjectDefineProperty(EventEmitter, 'EventEmitterAsyncResource', {
@@ -249,7 +249,7 @@ ObjectDefineProperty(EventEmitter.prototype, kCapture, {
__proto__: null,
value: false,
writable: true,
- enumerable: false
+ enumerable: false,
});
EventEmitter.prototype._events = undefined;
@@ -278,7 +278,7 @@ ObjectDefineProperty(EventEmitter, 'defaultMaxListeners', {
arg);
}
defaultMaxListeners = arg;
- }
+ },
});
ObjectDefineProperties(EventEmitter, {
@@ -295,7 +295,7 @@ ObjectDefineProperties(EventEmitter, {
enumerable: false,
configurable: false,
writable: false,
- }
+ },
});
/**
@@ -479,7 +479,7 @@ EventEmitter.prototype.emit = function emit(type, ...args) {
ObjectDefineProperty(er, kEnhanceStackBeforeInspector, {
__proto__: null,
value: FunctionPrototypeBind(enhanceStackTrace, this, er, capture),
- configurable: true
+ configurable: true,
});
} catch {
// Continue regardless of error.
@@ -1092,7 +1092,7 @@ function on(emitter, event, options = kEmptyObject) {
[SymbolAsyncIterator]() {
return this;
- }
+ },
}, AsyncIteratorPrototype);
eventTargetAgnosticAddListener(emitter, event, eventHandler);
diff --git a/lib/internal/event_target.js b/lib/internal/event_target.js
index a8a7fb2ed9..60c5eb80ce 100644
--- a/lib/internal/event_target.js
+++ b/lib/internal/event_target.js
@@ -32,7 +32,7 @@ const {
ERR_EVENT_RECURSION,
ERR_MISSING_ARGS,
ERR_INVALID_THIS,
- }
+ },
} = require('internal/errors');
const { validateAbortSignal, validateObject, validateString, validateInternalField } = require('internal/validators');
@@ -75,7 +75,7 @@ const isTrustedSet = new SafeWeakSet();
const isTrusted = ObjectGetOwnPropertyDescriptor({
get isTrusted() {
return isTrustedSet.has(this);
- }
+ },
}, 'isTrusted').get;
const isTrustedDescriptor = {
@@ -150,7 +150,7 @@ class Event {
return name;
const opts = ObjectAssign({}, options, {
- depth: NumberIsInteger(options.depth) ? options.depth - 1 : options.depth
+ depth: NumberIsInteger(options.depth) ? options.depth - 1 : options.depth,
});
return `${name} ${inspect({
@@ -784,7 +784,7 @@ class EventTarget {
return name;
const opts = ObjectAssign({}, options, {
- depth: NumberIsInteger(options.depth) ? options.depth - 1 : options.depth
+ depth: NumberIsInteger(options.depth) ? options.depth - 1 : options.depth,
});
return `${name} ${inspect({}, opts)}`;
@@ -801,7 +801,7 @@ ObjectDefineProperties(EventTarget.prototype, {
enumerable: false,
configurable: true,
value: 'EventTarget',
- }
+ },
});
function initNodeEventTarget(self) {
@@ -1001,7 +1001,7 @@ function validateEventListenerOptions(options) {
passive: Boolean(options.passive),
signal: options.signal,
weak: options[kWeakHandler],
- isNodeStyleListener: Boolean(options[kIsNodeStyleListener])
+ isNodeStyleListener: Boolean(options[kIsNodeStyleListener]),
};
}
@@ -1089,7 +1089,7 @@ function defineEventHandler(emitter, name, event = name) {
get,
set,
configurable: true,
- enumerable: true
+ enumerable: true,
});
}