mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
lib: add trailing commas in internal/process
PR-URL: https://github.com/nodejs/node/pull/46687 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Darshan Sen <raisinten@gmail.com>
This commit is contained in:
1 parent
c40eec3f3b
commit
48cd712c0d
10 files changed
+46
-45
No files matched your search
@@ -274,6 +274,7 @@ overrides:
|
||||
- ./internal/per_context/messageport.js
|
||||
- ./internal/policy/*.js
|
||||
- ./internal/priority_queue.js
|
||||
- ./internal/process/*.js
|
||||
- ./internal/readline/*.js
|
||||
- ./internal/readme.md
|
||||
- ./internal/repl/history.js
|
||||
|
||||
@@ -83,7 +83,7 @@ function evalScript(name, body, breakFirstLine, print) {
|
||||
importModuleDynamically(specifier, _, importAssertions) {
|
||||
const loader = asyncESM.esmLoader;
|
||||
return loader.import(specifier, baseUrl, importAssertions);
|
||||
}
|
||||
},
|
||||
}));
|
||||
if (print) {
|
||||
const { log } = require('internal/console/global');
|
||||
@@ -96,7 +96,7 @@ function evalScript(name, body, breakFirstLine, print) {
|
||||
|
||||
const exceptionHandlerState = {
|
||||
captureFn: null,
|
||||
reportFlag: false
|
||||
reportFlag: false,
|
||||
};
|
||||
|
||||
function setUncaughtExceptionCaptureCallback(fn) {
|
||||
@@ -203,5 +203,5 @@ module.exports = {
|
||||
evalScript,
|
||||
onGlobalUncaughtException: createOnGlobalUncaughtException(),
|
||||
setUncaughtExceptionCaptureCallback,
|
||||
hasUncaughtExceptionCaptureCallback
|
||||
hasUncaughtExceptionCaptureCallback,
|
||||
};
|
||||
@@ -38,8 +38,8 @@ const {
|
||||
ERR_INVALID_ARG_TYPE,
|
||||
ERR_INVALID_ARG_VALUE,
|
||||
ERR_OUT_OF_RANGE,
|
||||
ERR_UNKNOWN_SIGNAL
|
||||
}
|
||||
ERR_UNKNOWN_SIGNAL,
|
||||
},
|
||||
} = require('internal/errors');
|
||||
const format = require('internal/util/inspect').format;
|
||||
const {
|
||||
@@ -111,7 +111,7 @@ function wrapProcessMethods(binding) {
|
||||
cpuUsage: _cpuUsage,
|
||||
memoryUsage: _memoryUsage,
|
||||
rss,
|
||||
resourceUsage: _resourceUsage
|
||||
resourceUsage: _resourceUsage,
|
||||
} = binding;
|
||||
|
||||
function _rawDebug(...args) {
|
||||
@@ -148,14 +148,14 @@ function wrapProcessMethods(binding) {
|
||||
if (prevValue) {
|
||||
return {
|
||||
user: cpuValues[0] - prevValue.user,
|
||||
system: cpuValues[1] - prevValue.system
|
||||
system: cpuValues[1] - prevValue.system,
|
||||
};
|
||||
}
|
||||
|
||||
// If no previous value passed in, return current value.
|
||||
return {
|
||||
user: cpuValues[0],
|
||||
system: cpuValues[1]
|
||||
system: cpuValues[1],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ function wrapProcessMethods(binding) {
|
||||
heapTotal: memValues[1],
|
||||
heapUsed: memValues[2],
|
||||
external: memValues[3],
|
||||
arrayBuffers: memValues[4]
|
||||
arrayBuffers: memValues[4],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ function wrapProcessMethods(binding) {
|
||||
ipcReceived: resourceValues[12],
|
||||
signalsCount: resourceValues[13],
|
||||
voluntaryContextSwitches: resourceValues[14],
|
||||
involuntaryContextSwitches: resourceValues[15]
|
||||
involuntaryContextSwitches: resourceValues[15],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ function wrapProcessMethods(binding) {
|
||||
resourceUsage,
|
||||
memoryUsage,
|
||||
kill,
|
||||
exit
|
||||
exit,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -57,5 +57,5 @@ module.exports = ObjectFreeze({
|
||||
|
||||
assertIntegrity(moduleURL, content) {
|
||||
this.manifest.assertIntegrity(moduleURL, content);
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -37,7 +37,7 @@ function prepareMainThreadExecution(expandArgv1 = false, initializeModules = tru
|
||||
prepareExecution({
|
||||
expandArgv1,
|
||||
initializeModules,
|
||||
isMainThread: true
|
||||
isMainThread: true,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ function prepareWorkerThreadExecution() {
|
||||
prepareExecution({
|
||||
expandArgv1: false,
|
||||
initializeModules: false, // Will need to initialize it after policy setup
|
||||
isMainThread: false
|
||||
isMainThread: false,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ function patchProcessObject(expandArgv1) {
|
||||
enumerable: true,
|
||||
// Only set it to true during snapshot building.
|
||||
configurable: getOptionValue('--build-snapshot'),
|
||||
value: process.argv[0]
|
||||
value: process.argv[0],
|
||||
});
|
||||
|
||||
process.exitCode = undefined;
|
||||
@@ -184,7 +184,7 @@ function addReadOnlyProcessAlias(name, option, enumerable = true) {
|
||||
writable: false,
|
||||
configurable: true,
|
||||
enumerable,
|
||||
value
|
||||
value,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -192,7 +192,7 @@ function addReadOnlyProcessAlias(name, option, enumerable = true) {
|
||||
function setupWarningHandler() {
|
||||
const {
|
||||
onWarning,
|
||||
resetForSerialization
|
||||
resetForSerialization,
|
||||
} = require('internal/process/warning');
|
||||
if (getOptionValue('--warnings') &&
|
||||
process.env.NODE_NO_WARNINGS !== '1') {
|
||||
@@ -241,7 +241,7 @@ function setupFetch() {
|
||||
},
|
||||
set(value) {
|
||||
exposeInterface(globalThis, name, value);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ function setupWebCrypto() {
|
||||
get crypto() {
|
||||
webcrypto ??= require('internal/crypto/webcrypto');
|
||||
return webcrypto.crypto;
|
||||
}
|
||||
},
|
||||
}, 'crypto') });
|
||||
if (internalBinding('config').hasOpenSSL) {
|
||||
webcrypto ??= require('internal/crypto/webcrypto');
|
||||
@@ -323,7 +323,7 @@ function initializeReport() {
|
||||
configurable: true,
|
||||
get() {
|
||||
return report;
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ function setupInspectorHooks() {
|
||||
if (internalBinding('config').hasInspector) {
|
||||
const {
|
||||
enable,
|
||||
disable
|
||||
disable,
|
||||
} = require('internal/inspector_async_hook');
|
||||
internalBinding('inspector').registerAsyncHook(enable, disable);
|
||||
}
|
||||
@@ -439,7 +439,7 @@ function initializeDeprecations() {
|
||||
writable: false,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
value: noBrowserGlobals
|
||||
value: noBrowserGlobals,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -510,7 +510,7 @@ function readPolicyFromDisk() {
|
||||
for (let i = 0; i < integrityEntries.length; i++) {
|
||||
const {
|
||||
algorithm,
|
||||
value: expected
|
||||
value: expected,
|
||||
} = integrityEntries[i];
|
||||
const hash = createHash(algorithm);
|
||||
hash.update(src);
|
||||
@@ -527,7 +527,7 @@ function readPolicyFromDisk() {
|
||||
}
|
||||
}
|
||||
return {
|
||||
manifestSrc: src, manifestURL: manifestURL.href
|
||||
manifestSrc: src, manifestURL: manifestURL.href,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -557,7 +557,7 @@ function initializeESMLoader() {
|
||||
|
||||
const {
|
||||
setImportModuleDynamicallyCallback,
|
||||
setInitializeImportMetaObjectCallback
|
||||
setInitializeImportMetaObjectCallback,
|
||||
} = internalBinding('module_wrap');
|
||||
const esm = require('internal/process/esm_loader');
|
||||
// Setup per-isolate callbacks that locate data or callbacks that we keep
|
||||
@@ -600,7 +600,7 @@ function loadPreloadModules() {
|
||||
if (preloadModules && preloadModules.length > 0) {
|
||||
const {
|
||||
Module: {
|
||||
_preloadModules
|
||||
_preloadModules,
|
||||
},
|
||||
} = require('internal/modules/cjs/loader');
|
||||
_preloadModules(preloadModules);
|
||||
@@ -615,5 +615,5 @@ module.exports = {
|
||||
setupUserModules,
|
||||
prepareMainThreadExecution,
|
||||
prepareWorkerThreadExecution,
|
||||
markBootstrapComplete
|
||||
markBootstrapComplete,
|
||||
};
|
||||
@@ -15,16 +15,16 @@ const {
|
||||
kPromiseRejectWithNoHandler,
|
||||
kPromiseHandlerAddedAfterReject,
|
||||
kPromiseResolveAfterResolved,
|
||||
kPromiseRejectAfterResolved
|
||||
kPromiseRejectAfterResolved,
|
||||
},
|
||||
setPromiseRejectCallback
|
||||
setPromiseRejectCallback,
|
||||
} = internalBinding('task_queue');
|
||||
|
||||
const { deprecate } = require('internal/util');
|
||||
|
||||
const {
|
||||
noSideEffectsToString,
|
||||
triggerUncaughtException
|
||||
triggerUncaughtException,
|
||||
} = internalBinding('errors');
|
||||
|
||||
const {
|
||||
@@ -32,8 +32,8 @@ const {
|
||||
popAsyncContext,
|
||||
symbols: {
|
||||
async_id_symbol: kAsyncIdSymbol,
|
||||
trigger_async_id_symbol: kTriggerAsyncIdSymbol
|
||||
}
|
||||
trigger_async_id_symbol: kTriggerAsyncIdSymbol,
|
||||
},
|
||||
} = require('internal/async_hooks');
|
||||
const { isErrorStackTraceLimitWritable } = require('internal/errors');
|
||||
|
||||
@@ -154,7 +154,7 @@ function unhandledRejection(promise, reason) {
|
||||
uid: ++lastPromiseId,
|
||||
warned: false,
|
||||
domain: process.domain,
|
||||
emit
|
||||
emit,
|
||||
});
|
||||
// This causes the promise to be referenced at least for one tick.
|
||||
ArrayPrototypePush(pendingUnhandledRejections, promise);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
const {
|
||||
ERR_SYNTHETIC
|
||||
ERR_SYNTHETIC,
|
||||
} = require('internal/errors').codes;
|
||||
const {
|
||||
validateBoolean,
|
||||
@@ -92,7 +92,7 @@ const report = {
|
||||
validateBoolean(trigger, 'trigger');
|
||||
|
||||
nr.setReportOnUncaughtException(trigger);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
function addSignalHandler(sig) {
|
||||
@@ -117,5 +117,5 @@ function signalHandler(sig) {
|
||||
|
||||
module.exports = {
|
||||
addSignalHandler,
|
||||
report
|
||||
report,
|
||||
};
|
||||
@@ -50,5 +50,5 @@ function stopListeningIfSignal(type) {
|
||||
|
||||
module.exports = {
|
||||
startListeningIfSignal,
|
||||
stopListeningIfSignal
|
||||
stopListeningIfSignal,
|
||||
};
|
||||
@@ -12,14 +12,14 @@ const {
|
||||
// Used to run V8's micro task queue.
|
||||
runMicrotasks,
|
||||
setTickCallback,
|
||||
enqueueMicrotask
|
||||
enqueueMicrotask,
|
||||
} = internalBinding('task_queue');
|
||||
|
||||
const {
|
||||
setHasRejectionToWarn,
|
||||
hasRejectionToWarn,
|
||||
listenForRejections,
|
||||
processPromiseRejections
|
||||
processPromiseRejections,
|
||||
} = require('internal/process/promises');
|
||||
|
||||
const {
|
||||
@@ -31,7 +31,7 @@ const {
|
||||
emitBefore,
|
||||
emitAfter,
|
||||
emitDestroy,
|
||||
symbols: { async_id_symbol, trigger_async_id_symbol }
|
||||
symbols: { async_id_symbol, trigger_async_id_symbol },
|
||||
} = require('internal/async_hooks');
|
||||
const FixedQueue = require('internal/fixed_queue');
|
||||
|
||||
@@ -126,7 +126,7 @@ function nextTick(callback) {
|
||||
[async_id_symbol]: asyncId,
|
||||
[trigger_async_id_symbol]: triggerAsyncId,
|
||||
callback,
|
||||
args
|
||||
args,
|
||||
};
|
||||
if (initHooksExist())
|
||||
emitInit(asyncId, 'TickObject', triggerAsyncId, tickObject);
|
||||
@@ -166,8 +166,8 @@ module.exports = {
|
||||
setTickCallback(processTicksAndRejections);
|
||||
return {
|
||||
nextTick,
|
||||
runNextTicks
|
||||
runNextTicks,
|
||||
};
|
||||
},
|
||||
queueMicrotask
|
||||
queueMicrotask,
|
||||
};
|
||||
@@ -4,7 +4,7 @@
|
||||
// run in the worker thread.
|
||||
|
||||
const {
|
||||
codes: { ERR_WORKER_UNSUPPORTED_OPERATION }
|
||||
codes: { ERR_WORKER_UNSUPPORTED_OPERATION },
|
||||
} = require('internal/errors');
|
||||
|
||||
function unavailable(name) {
|
||||
@@ -17,5 +17,5 @@ function unavailable(name) {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
unavailable
|
||||
unavailable,
|
||||
};
|
||||
Reference in new issue
Block a user