| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -187,7 +187,7 @@ function WritableState(options, stream, isDuplex) { | |||
| 187 | 187 | } | |
| 188 | 188 | ||
| 189 | 189 | WritableState.prototype.getBuffer = function getBuffer() { | |
| 190 | - var current = this.bufferedRequest; | ||
| 190 | + let current = this.bufferedRequest; | ||
| 191 | 191 | const out = []; | |
| 192 | 192 | while (current) { | |
| 193 | 193 | out.push(current); | |
@@ -205,7 +205,7 @@ ObjectDefineProperty(WritableState.prototype, 'buffer', { | |||
| 205 | 205 | ||
| 206 | 206 | // Test _writableState for inheritance to account for Duplex streams, | |
| 207 | 207 | // whose prototype chain only points to Readable. | |
| 208 | - var realHasInstance; | ||
| 208 | + let realHasInstance; | ||
| 209 | 209 | if (typeof Symbol === 'function' && SymbolHasInstance) { | |
| 210 | 210 | realHasInstance = FunctionPrototype[SymbolHasInstance]; | |
| 211 | 211 | ObjectDefineProperty(Writable, SymbolHasInstance, { | |
@@ -357,7 +357,7 @@ function writeOrBuffer(stream, state, chunk, encoding, cb) { | |||
| 357 | 357 | state.needDrain = true; | |
| 358 | 358 | ||
| 359 | 359 | if (state.writing || state.corked || state.errored) { | |
| 360 | - var last = state.lastBufferedRequest; | ||
| 360 | + const last = state.lastBufferedRequest; | ||
| 361 | 361 | state.lastBufferedRequest = { | |
| 362 | 362 | chunk, | |
| 363 | 363 | encoding, | |
@@ -428,7 +428,7 @@ function onwrite(stream, er) { | |||
| 428 | 428 | } | |
| 429 | 429 | } else { | |
| 430 | 430 | // Check if we're actually ready to finish, but don't emit yet | |
| 431 | - var finished = needFinish(state) || stream.destroyed; | ||
| 431 | + const finished = needFinish(state) || stream.destroyed; | ||
| 432 | 432 | ||
| 433 | 433 | if (!finished && | |
| 434 | 434 | !state.corked && | |
@@ -499,17 +499,17 @@ function errorBuffer(state, err) { | |||
| 499 | 499 | // If there's something in the buffer waiting, then process it | |
| 500 | 500 | function clearBuffer(stream, state) { | |
| 501 | 501 | state.bufferProcessing = true; | |
| 502 | - var entry = state.bufferedRequest; | ||
| 502 | + let entry = state.bufferedRequest; | ||
| 503 | 503 | ||
| 504 | 504 | if (stream._writev && entry && entry.next) { | |
| 505 | 505 | // Fast case, write everything using _writev() | |
| 506 | - var l = state.bufferedRequestCount; | ||
| 507 | - var buffer = new Array(l); | ||
| 508 | - var holder = state.corkedRequestsFree; | ||
| 506 | + const l = state.bufferedRequestCount; | ||
| 507 | + const buffer = new Array(l); | ||
| 508 | + const holder = state.corkedRequestsFree; | ||
| 509 | 509 | holder.entry = entry; | |
| 510 | 510 | ||
| 511 | - var count = 0; | ||
| 512 | - var allBuffers = true; | ||
| 511 | + let count = 0; | ||
| 512 | + let allBuffers = true; | ||
| 513 | 513 | while (entry) { | |
| 514 | 514 | buffer[count] = entry; | |
| 515 | 515 | if (entry.encoding !== 'buffer') | |
@@ -529,18 +529,18 @@ function clearBuffer(stream, state) { | |||
| 529 | 529 | state.corkedRequestsFree = holder.next; | |
| 530 | 530 | holder.next = null; | |
| 531 | 531 | } else { | |
| 532 | - var corkReq = { next: null, entry: null, finish: undefined }; | ||
| 532 | + const corkReq = { next: null, entry: null, finish: undefined }; | ||
| 533 | 533 | corkReq.finish = onCorkedFinish.bind(undefined, corkReq, state); | |
| 534 | 534 | state.corkedRequestsFree = corkReq; | |
| 535 | 535 | } | |
| 536 | 536 | state.bufferedRequestCount = 0; | |
| 537 | 537 | } else { | |
| 538 | 538 | // Slow case, write chunks one-by-one | |
| 539 | 539 | while (entry) { | |
| 540 | - var chunk = entry.chunk; | ||
| 541 | - var encoding = entry.encoding; | ||
| 542 | - var cb = entry.callback; | ||
| 543 | - var len = state.objectMode ? 1 : chunk.length; | ||
| 540 | + const chunk = entry.chunk; | ||
| 541 | + const encoding = entry.encoding; | ||
| 542 | + const cb = entry.callback; | ||
| 543 | + const len = state.objectMode ? 1 : chunk.length; | ||
| 544 | 544 | ||
| 545 | 545 | doWrite(stream, state, false, len, chunk, encoding, cb); | |
| 546 | 546 | entry = entry.next; | |
@@ -677,10 +677,10 @@ function endWritable(stream, state, cb) { | |||
| 677 | 677 | } | |
| 678 | 678 | ||
| 679 | 679 | function onCorkedFinish(corkReq, state, err) { | |
| 680 | - var entry = corkReq.entry; | ||
| 680 | + let entry = corkReq.entry; | ||
| 681 | 681 | corkReq.entry = null; | |
| 682 | 682 | while (entry) { | |
| 683 | - var cb = entry.callback; | ||
| 683 | + const cb = entry.callback; | ||
| 684 | 684 | state.pendingcb--; | |
| 685 | 685 | cb(err); | |
| 686 | 686 | entry = entry.next; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments