Skip to content

Commit

Permalink
events: add trailing commas in source files
Browse files Browse the repository at this point in the history
PR-URL: #46759
Reviewed-By: Deokjin Kim <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
aduh95 authored Feb 24, 2023
1 parent 351d7fd commit 54f452d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
2 changes: 2 additions & 0 deletions lib/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,15 @@ overrides:
- ./cluster.js
- ./console.js
- ./constants.js
- ./events.js
- ./fs.js
- ./internal/assert.js
- ./internal/child_process.js
- ./internal/child_process/*.js
- ./internal/cli_table.js
- ./internal/cluster/*.js
- ./internal/debugger/*.js
- ./internal/event_target.js
- ./internal/events/*.js
- ./internal/fixed_queue.js
- ./internal/freelist.js
Expand Down
18 changes: 9 additions & 9 deletions lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const {
codes: {
ERR_INVALID_ARG_TYPE,
ERR_INVALID_THIS,
ERR_UNHANDLED_ERROR
ERR_UNHANDLED_ERROR,
},
genericNodeError,
} = require('internal/errors');
Expand Down Expand Up @@ -99,7 +99,7 @@ let EventEmitterAsyncResource;
function lazyEventEmitterAsyncResource() {
if (EventEmitterAsyncResource === undefined) {
const {
AsyncResource
AsyncResource,
} = require('async_hooks');

const kEventEmitter = Symbol('kEventEmitter');
Expand Down Expand Up @@ -236,7 +236,7 @@ ObjectDefineProperty(EventEmitter, 'captureRejections', {

EventEmitter.prototype[kCapture] = value;
},
enumerable: true
enumerable: true,
});

ObjectDefineProperty(EventEmitter, 'EventEmitterAsyncResource', {
Expand All @@ -254,7 +254,7 @@ ObjectDefineProperty(EventEmitter.prototype, kCapture, {
__proto__: null,
value: false,
writable: true,
enumerable: false
enumerable: false,
});

EventEmitter.prototype._events = undefined;
Expand All @@ -279,7 +279,7 @@ ObjectDefineProperty(EventEmitter, 'defaultMaxListeners', {
set: function(arg) {
validateNumber(arg, 'defaultMaxListeners', 0);
defaultMaxListeners = arg;
}
},
});

ObjectDefineProperties(EventEmitter, {
Expand All @@ -296,7 +296,7 @@ ObjectDefineProperties(EventEmitter, {
enumerable: false,
configurable: false,
writable: false,
}
},
});

/**
Expand Down Expand Up @@ -477,7 +477,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.
Expand Down Expand Up @@ -1111,7 +1111,7 @@ function on(emitter, event, options = kEmptyObject) {
*/
get isPaused() {
return paused;
}
},
},
}, AsyncIteratorPrototype);

Expand Down Expand Up @@ -1186,6 +1186,6 @@ function listenersController() {
while (listeners.length > 0) {
ReflectApply(eventTargetAgnosticRemoveListener, undefined, ArrayPrototypePop(listeners));
}
}
},
};
}
14 changes: 7 additions & 7 deletions lib/internal/event_target.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -75,7 +75,7 @@ const isTrustedSet = new SafeWeakSet();
const isTrusted = ObjectGetOwnPropertyDescriptor({
get isTrusted() {
return isTrustedSet.has(this);
}
},
}, 'isTrusted').get;

const isTrustedDescriptor = {
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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)}`;
Expand All @@ -801,7 +801,7 @@ ObjectDefineProperties(EventTarget.prototype, {
enumerable: false,
configurable: true,
value: 'EventTarget',
}
},
});

function initNodeEventTarget(self) {
Expand Down Expand Up @@ -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]),
};
}

Expand Down Expand Up @@ -1089,7 +1089,7 @@ function defineEventHandler(emitter, name, event = name) {
get,
set,
configurable: true,
enumerable: true
enumerable: true,
});
}

Expand Down

0 comments on commit 54f452d

Please sign in to comment.