| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -415,7 +415,7 @@ Server.prototype.setTimeout = function setTimeout(msecs, callback) { | |||
| 415 | 415 | Server.prototype[EE.captureRejectionSymbol] = function(err, event, ...args) { | |
| 416 | 416 | switch (event) { | |
| 417 | 417 | case 'request': | |
| 418 | - const [ , res] = args; | ||
| 418 | + const { 1: res } = args; | ||
| 419 | 419 | if (!res.headersSent && !res.writableEnded) { | |
| 420 | 420 | // Don't leak headers. | |
| 421 | 421 | ArrayPrototypeForEach(res.getHeaderNames(), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -335,15 +335,15 @@ function getErrMessage(message, fn) { | |||
| 335 | 335 | } | |
| 336 | 336 | fd = openSync(filename, 'r', 0o666); | |
| 337 | 337 | // Reset column and message. | |
| 338 | - [column, message] = getCode(fd, line, column); | ||
| 338 | + ({ 0: column, 1: message } = getCode(fd, line, column)); | ||
| 339 | 339 | // Flush unfinished multi byte characters. | |
| 340 | 340 | decoder.end(); | |
| 341 | 341 | } else { | |
| 342 | 342 | for (let i = 0; i < line; i++) { | |
| 343 | 343 | code = StringPrototypeSlice(code, | |
| 344 | 344 | StringPrototypeIndexOf(code, '\n') + 1); | |
| 345 | 345 | } | |
| 346 | - [column, message] = parseCode(code, column); | ||
| 346 | + ({ 0: column, 1: message } = parseCode(code, column)); | ||
| 347 | 347 | } | |
| 348 | 348 | // Always normalize indentation, otherwise the message could look weird. | |
| 349 | 349 | if (StringPrototypeIncludes(message, '\n')) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -315,7 +315,7 @@ function enhanceStackTrace(err, own) { | |||
| 315 | 315 | const errStack = err.stack.split('\n').slice(1); | |
| 316 | 316 | const ownStack = own.stack.split('\n').slice(1); | |
| 317 | 317 | ||
| 318 | - const [ len, off ] = identicalSequenceRange(ownStack, errStack); | ||
| 318 | + const { 0: len, 1: off } = identicalSequenceRange(ownStack, errStack); | ||
| 319 | 319 | if (len > 0) { | |
| 320 | 320 | ownStack.splice(off + 1, len - 2, | |
| 321 | 321 | ' [... lines matching original stack trace ...]'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2073,7 +2073,8 @@ function copyFileSync(src, dest, mode) { | |||
| 2073 | 2073 | function lazyLoadStreams() { | |
| 2074 | 2074 | if (!ReadStream) { | |
| 2075 | 2075 | ({ ReadStream, WriteStream } = require('internal/fs/streams')); | |
| 2076 | - [ FileReadStream, FileWriteStream ] = [ ReadStream, WriteStream ]; | ||
| 2076 | + FileReadStream = ReadStream; | ||
| 2077 | + FileWriteStream = WriteStream; | ||
| 2077 | 2078 | } | |
| 2078 | 2079 | } | |
| 2079 | 2080 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -198,7 +198,7 @@ class NativeModule { | |||
| 198 | 198 | // To be called during pre-execution when --expose-internals is on. | |
| 199 | 199 | // Enables the user-land module loader to access internal modules. | |
| 200 | 200 | static exposeInternals() { | |
| 201 | - for (const [id, mod] of NativeModule.map) { | ||
| 201 | + for (const { 0: id, 1: mod } of NativeModule.map) { | ||
| 202 | 202 | // Do not expose this to user land even with --expose-internals. | |
| 203 | 203 | if (id !== loaderId) { | |
| 204 | 204 | mod.canBeRequiredByUsers = true; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,8 @@ const cluster = new EventEmitter(); | |||
| 23 | 23 | const intercom = new EventEmitter(); | |
| 24 | 24 | const SCHED_NONE = 1; | |
| 25 | 25 | const SCHED_RR = 2; | |
| 26 | - const [ minPort, maxPort ] = [ 1024, 65535 ]; | ||
| 26 | + const minPort = 1024; | ||
| 27 | + const maxPort = 65535; | ||
| 27 | 28 | const { validatePort } = require('internal/validators'); | |
| 28 | 29 | ||
| 29 | 30 | module.exports = cluster; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -93,10 +93,11 @@ RoundRobinHandle.prototype.remove = function(worker) { | |||
| 93 | 93 | ||
| 94 | 94 | RoundRobinHandle.prototype.distribute = function(err, handle) { | |
| 95 | 95 | ArrayPrototypePush(this.handles, handle); | |
| 96 | - const [ workerEntry ] = this.free; | ||
| 96 | + // eslint-disable-next-line node-core/no-array-destructuring | ||
| 97 | + const [ workerEntry ] = this.free; // this.free is a SafeMap | ||
| 97 | 98 | ||
| 98 | 99 | if (ArrayIsArray(workerEntry)) { | |
| 99 | - const [ workerId, worker ] = workerEntry; | ||
| 100 | + const { 0: workerId, 1: worker } = workerEntry; | ||
| 100 | 101 | this.free.delete(workerId); | |
| 101 | 102 | this.handoff(worker); | |
| 102 | 103 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -525,7 +525,7 @@ const consoleMethods = { | |||
| 525 | 525 | length++; | |
| 526 | 526 | } | |
| 527 | 527 | } else { | |
| 528 | - for (const [k, v] of tabularData) { | ||
| 528 | + for (const { 0: k, 1: v } of tabularData) { | ||
| 529 | 529 | ArrayPrototypePush(keys, _inspect(k)); | |
| 530 | 530 | ArrayPrototypePush(values, _inspect(v)); | |
| 531 | 531 | length++; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -86,12 +86,12 @@ for (const m of [[kKeyEncodingPKCS1, 'pkcs1'], [kKeyEncodingPKCS8, 'pkcs8'], | |||
| 86 | 86 | // which requires the KeyObject base class to be implemented in C++. | |
| 87 | 87 | // The creation requires a callback to make sure that the NativeKeyObject | |
| 88 | 88 | // base class cannot exist without the other KeyObject implementations. | |
| 89 | - const [ | ||
| 90 | - KeyObject, | ||
| 91 | - SecretKeyObject, | ||
| 92 | - PublicKeyObject, | ||
| 93 | - PrivateKeyObject, | ||
| 94 | - ] = createNativeKeyObjectClass((NativeKeyObject) => { | ||
| 89 | + const { | ||
| 90 | + 0: KeyObject, | ||
| 91 | + 1: SecretKeyObject, | ||
| 92 | + 2: PublicKeyObject, | ||
| 93 | + 3: PrivateKeyObject, | ||
| 94 | + } = createNativeKeyObjectClass((NativeKeyObject) => { | ||
| 95 | 95 | // Publicly visible KeyObject class. | |
| 96 | 96 | class KeyObject extends NativeKeyObject { | |
| 97 | 97 | constructor(type, handle) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -429,7 +429,7 @@ const captureLargerStackTrace = hideStackFrames( | |||
| 429 | 429 | * @returns {Error} | |
| 430 | 430 | */ | |
| 431 | 431 | const uvException = hideStackFrames(function uvException(ctx) { | |
| 432 | - const [code, uvmsg] = uvErrmapGet(ctx.errno) || uvUnmappedError; | ||
| 432 | + const { 0: code, 1: uvmsg } = uvErrmapGet(ctx.errno) || uvUnmappedError; | ||
| 433 | 433 | let message = `${code}: ${ctx.message || uvmsg}, ${ctx.syscall}`; | |
| 434 | 434 | ||
| 435 | 435 | let path; | |
@@ -485,7 +485,7 @@ const uvException = hideStackFrames(function uvException(ctx) { | |||
| 485 | 485 | */ | |
| 486 | 486 | const uvExceptionWithHostPort = hideStackFrames( | |
| 487 | 487 | function uvExceptionWithHostPort(err, syscall, address, port) { | |
| 488 | - const [code, uvmsg] = uvErrmapGet(err) || uvUnmappedError; | ||
| 488 | + const { 0: code, 1: uvmsg } = uvErrmapGet(err) || uvUnmappedError; | ||
| 489 | 489 | const message = `${syscall} ${code}: ${uvmsg}`; | |
| 490 | 490 | let details = ''; | |
| 491 | 491 | ||
@@ -1243,7 +1243,8 @@ E('ERR_MANIFEST_ASSERT_INTEGRITY', | |||
| 1243 | 1243 | }" does not match the expected integrity.`; | |
| 1244 | 1244 | if (realIntegrities.size) { | |
| 1245 | 1245 | const sri = ArrayPrototypeJoin( | |
| 1246 | - ArrayFrom(realIntegrities.entries(), ([alg, dgs]) => `${alg}-${dgs}`), | ||
| 1246 | + ArrayFrom(realIntegrities.entries(), | ||
| 1247 | + ({ 0: alg, 1: dgs }) => `${alg}-${dgs}`), | ||
| 1247 | 1248 | ' ' | |
| 1248 | 1249 | ); | |
| 1249 | 1250 | msg += ` Integrities found are: ${sri}`; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments