Skip to content

Commit 48cd712

Browse files
aduh95danielleadams
authored andcommitted
lib: add trailing commas in internal/process
PR-URL: #46687 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent c40eec3 commit 48cd712

File tree

10 files changed

+46
-45
lines changed

10 files changed

+46
-45
lines changed

lib/.eslintrc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ overrides:
274274
- ./internal/per_context/messageport.js
275275
- ./internal/policy/*.js
276276
- ./internal/priority_queue.js
277+
- ./internal/process/*.js
277278
- ./internal/readline/*.js
278279
- ./internal/readme.md
279280
- ./internal/repl/history.js

lib/internal/process/execution.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function evalScript(name, body, breakFirstLine, print) {
8383
importModuleDynamically(specifier, _, importAssertions) {
8484
const loader = asyncESM.esmLoader;
8585
return loader.import(specifier, baseUrl, importAssertions);
86-
}
86+
},
8787
}));
8888
if (print) {
8989
const { log } = require('internal/console/global');
@@ -96,7 +96,7 @@ function evalScript(name, body, breakFirstLine, print) {
9696

9797
const exceptionHandlerState = {
9898
captureFn: null,
99-
reportFlag: false
99+
reportFlag: false,
100100
};
101101

102102
function setUncaughtExceptionCaptureCallback(fn) {
@@ -203,5 +203,5 @@ module.exports = {
203203
evalScript,
204204
onGlobalUncaughtException: createOnGlobalUncaughtException(),
205205
setUncaughtExceptionCaptureCallback,
206-
hasUncaughtExceptionCaptureCallback
206+
hasUncaughtExceptionCaptureCallback,
207207
};

lib/internal/process/per_thread.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ const {
3838
ERR_INVALID_ARG_TYPE,
3939
ERR_INVALID_ARG_VALUE,
4040
ERR_OUT_OF_RANGE,
41-
ERR_UNKNOWN_SIGNAL
42-
}
41+
ERR_UNKNOWN_SIGNAL,
42+
},
4343
} = require('internal/errors');
4444
const format = require('internal/util/inspect').format;
4545
const {
@@ -111,7 +111,7 @@ function wrapProcessMethods(binding) {
111111
cpuUsage: _cpuUsage,
112112
memoryUsage: _memoryUsage,
113113
rss,
114-
resourceUsage: _resourceUsage
114+
resourceUsage: _resourceUsage,
115115
} = binding;
116116

117117
function _rawDebug(...args) {
@@ -148,14 +148,14 @@ function wrapProcessMethods(binding) {
148148
if (prevValue) {
149149
return {
150150
user: cpuValues[0] - prevValue.user,
151-
system: cpuValues[1] - prevValue.system
151+
system: cpuValues[1] - prevValue.system,
152152
};
153153
}
154154

155155
// If no previous value passed in, return current value.
156156
return {
157157
user: cpuValues[0],
158-
system: cpuValues[1]
158+
system: cpuValues[1],
159159
};
160160
}
161161

@@ -175,7 +175,7 @@ function wrapProcessMethods(binding) {
175175
heapTotal: memValues[1],
176176
heapUsed: memValues[2],
177177
external: memValues[3],
178-
arrayBuffers: memValues[4]
178+
arrayBuffers: memValues[4],
179179
};
180180
}
181181

@@ -254,7 +254,7 @@ function wrapProcessMethods(binding) {
254254
ipcReceived: resourceValues[12],
255255
signalsCount: resourceValues[13],
256256
voluntaryContextSwitches: resourceValues[14],
257-
involuntaryContextSwitches: resourceValues[15]
257+
involuntaryContextSwitches: resourceValues[15],
258258
};
259259
}
260260

@@ -265,7 +265,7 @@ function wrapProcessMethods(binding) {
265265
resourceUsage,
266266
memoryUsage,
267267
kill,
268-
exit
268+
exit,
269269
};
270270
}
271271

lib/internal/process/policy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ module.exports = ObjectFreeze({
5757

5858
assertIntegrity(moduleURL, content) {
5959
this.manifest.assertIntegrity(moduleURL, content);
60-
}
60+
},
6161
});

lib/internal/process/pre_execution.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ function prepareMainThreadExecution(expandArgv1 = false, initializeModules = tru
3737
prepareExecution({
3838
expandArgv1,
3939
initializeModules,
40-
isMainThread: true
40+
isMainThread: true,
4141
});
4242
}
4343

4444
function prepareWorkerThreadExecution() {
4545
prepareExecution({
4646
expandArgv1: false,
4747
initializeModules: false, // Will need to initialize it after policy setup
48-
isMainThread: false
48+
isMainThread: false,
4949
});
5050
}
5151

@@ -135,7 +135,7 @@ function patchProcessObject(expandArgv1) {
135135
enumerable: true,
136136
// Only set it to true during snapshot building.
137137
configurable: getOptionValue('--build-snapshot'),
138-
value: process.argv[0]
138+
value: process.argv[0],
139139
});
140140

141141
process.exitCode = undefined;
@@ -184,15 +184,15 @@ function addReadOnlyProcessAlias(name, option, enumerable = true) {
184184
writable: false,
185185
configurable: true,
186186
enumerable,
187-
value
187+
value,
188188
});
189189
}
190190
}
191191

192192
function setupWarningHandler() {
193193
const {
194194
onWarning,
195-
resetForSerialization
195+
resetForSerialization,
196196
} = require('internal/process/warning');
197197
if (getOptionValue('--warnings') &&
198198
process.env.NODE_NO_WARNINGS !== '1') {
@@ -241,7 +241,7 @@ function setupFetch() {
241241
},
242242
set(value) {
243243
exposeInterface(globalThis, name, value);
244-
}
244+
},
245245
};
246246
}
247247

@@ -271,7 +271,7 @@ function setupWebCrypto() {
271271
get crypto() {
272272
webcrypto ??= require('internal/crypto/webcrypto');
273273
return webcrypto.crypto;
274-
}
274+
},
275275
}, 'crypto') });
276276
if (internalBinding('config').hasOpenSSL) {
277277
webcrypto ??= require('internal/crypto/webcrypto');
@@ -323,7 +323,7 @@ function initializeReport() {
323323
configurable: true,
324324
get() {
325325
return report;
326-
}
326+
},
327327
});
328328
}
329329

@@ -384,7 +384,7 @@ function setupInspectorHooks() {
384384
if (internalBinding('config').hasInspector) {
385385
const {
386386
enable,
387-
disable
387+
disable,
388388
} = require('internal/inspector_async_hook');
389389
internalBinding('inspector').registerAsyncHook(enable, disable);
390390
}
@@ -439,7 +439,7 @@ function initializeDeprecations() {
439439
writable: false,
440440
enumerable: true,
441441
configurable: true,
442-
value: noBrowserGlobals
442+
value: noBrowserGlobals,
443443
});
444444
}
445445

@@ -510,7 +510,7 @@ function readPolicyFromDisk() {
510510
for (let i = 0; i < integrityEntries.length; i++) {
511511
const {
512512
algorithm,
513-
value: expected
513+
value: expected,
514514
} = integrityEntries[i];
515515
const hash = createHash(algorithm);
516516
hash.update(src);
@@ -527,7 +527,7 @@ function readPolicyFromDisk() {
527527
}
528528
}
529529
return {
530-
manifestSrc: src, manifestURL: manifestURL.href
530+
manifestSrc: src, manifestURL: manifestURL.href,
531531
};
532532
}
533533
}
@@ -557,7 +557,7 @@ function initializeESMLoader() {
557557

558558
const {
559559
setImportModuleDynamicallyCallback,
560-
setInitializeImportMetaObjectCallback
560+
setInitializeImportMetaObjectCallback,
561561
} = internalBinding('module_wrap');
562562
const esm = require('internal/process/esm_loader');
563563
// Setup per-isolate callbacks that locate data or callbacks that we keep
@@ -600,7 +600,7 @@ function loadPreloadModules() {
600600
if (preloadModules && preloadModules.length > 0) {
601601
const {
602602
Module: {
603-
_preloadModules
603+
_preloadModules,
604604
},
605605
} = require('internal/modules/cjs/loader');
606606
_preloadModules(preloadModules);
@@ -615,5 +615,5 @@ module.exports = {
615615
setupUserModules,
616616
prepareMainThreadExecution,
617617
prepareWorkerThreadExecution,
618-
markBootstrapComplete
618+
markBootstrapComplete,
619619
};

lib/internal/process/promises.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ const {
1515
kPromiseRejectWithNoHandler,
1616
kPromiseHandlerAddedAfterReject,
1717
kPromiseResolveAfterResolved,
18-
kPromiseRejectAfterResolved
18+
kPromiseRejectAfterResolved,
1919
},
20-
setPromiseRejectCallback
20+
setPromiseRejectCallback,
2121
} = internalBinding('task_queue');
2222

2323
const { deprecate } = require('internal/util');
2424

2525
const {
2626
noSideEffectsToString,
27-
triggerUncaughtException
27+
triggerUncaughtException,
2828
} = internalBinding('errors');
2929

3030
const {
3131
pushAsyncContext,
3232
popAsyncContext,
3333
symbols: {
3434
async_id_symbol: kAsyncIdSymbol,
35-
trigger_async_id_symbol: kTriggerAsyncIdSymbol
36-
}
35+
trigger_async_id_symbol: kTriggerAsyncIdSymbol,
36+
},
3737
} = require('internal/async_hooks');
3838
const { isErrorStackTraceLimitWritable } = require('internal/errors');
3939

@@ -154,7 +154,7 @@ function unhandledRejection(promise, reason) {
154154
uid: ++lastPromiseId,
155155
warned: false,
156156
domain: process.domain,
157-
emit
157+
emit,
158158
});
159159
// This causes the promise to be referenced at least for one tick.
160160
ArrayPrototypePush(pendingUnhandledRejections, promise);

lib/internal/process/report.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22
const {
3-
ERR_SYNTHETIC
3+
ERR_SYNTHETIC,
44
} = require('internal/errors').codes;
55
const {
66
validateBoolean,
@@ -92,7 +92,7 @@ const report = {
9292
validateBoolean(trigger, 'trigger');
9393

9494
nr.setReportOnUncaughtException(trigger);
95-
}
95+
},
9696
};
9797

9898
function addSignalHandler(sig) {
@@ -117,5 +117,5 @@ function signalHandler(sig) {
117117

118118
module.exports = {
119119
addSignalHandler,
120-
report
120+
report,
121121
};

lib/internal/process/signal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ function stopListeningIfSignal(type) {
5050

5151
module.exports = {
5252
startListeningIfSignal,
53-
stopListeningIfSignal
53+
stopListeningIfSignal,
5454
};

lib/internal/process/task_queues.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ const {
1212
// Used to run V8's micro task queue.
1313
runMicrotasks,
1414
setTickCallback,
15-
enqueueMicrotask
15+
enqueueMicrotask,
1616
} = internalBinding('task_queue');
1717

1818
const {
1919
setHasRejectionToWarn,
2020
hasRejectionToWarn,
2121
listenForRejections,
22-
processPromiseRejections
22+
processPromiseRejections,
2323
} = require('internal/process/promises');
2424

2525
const {
@@ -31,7 +31,7 @@ const {
3131
emitBefore,
3232
emitAfter,
3333
emitDestroy,
34-
symbols: { async_id_symbol, trigger_async_id_symbol }
34+
symbols: { async_id_symbol, trigger_async_id_symbol },
3535
} = require('internal/async_hooks');
3636
const FixedQueue = require('internal/fixed_queue');
3737

@@ -126,7 +126,7 @@ function nextTick(callback) {
126126
[async_id_symbol]: asyncId,
127127
[trigger_async_id_symbol]: triggerAsyncId,
128128
callback,
129-
args
129+
args,
130130
};
131131
if (initHooksExist())
132132
emitInit(asyncId, 'TickObject', triggerAsyncId, tickObject);
@@ -166,8 +166,8 @@ module.exports = {
166166
setTickCallback(processTicksAndRejections);
167167
return {
168168
nextTick,
169-
runNextTicks
169+
runNextTicks,
170170
};
171171
},
172-
queueMicrotask
172+
queueMicrotask,
173173
};

lib/internal/process/worker_thread_only.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// run in the worker thread.
55

66
const {
7-
codes: { ERR_WORKER_UNSUPPORTED_OPERATION }
7+
codes: { ERR_WORKER_UNSUPPORTED_OPERATION },
88
} = require('internal/errors');
99

1010
function unavailable(name) {
@@ -17,5 +17,5 @@ function unavailable(name) {
1717
}
1818

1919
module.exports = {
20-
unavailable
20+
unavailable,
2121
};

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy