Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
10ba94f
Refactor self=this
benjamingr Jan 24, 2016
60e4ad3
Update self=this in http.js
benjamingr Jan 24, 2016
1ebb5b2
Refactor self=this to arrows
benjamingr Jan 24, 2016
dd96a00
fix leading whitespace linter issue
benjamingr Jan 24, 2016
889f467
fix emberrasing mistake
benjamingr Jan 25, 2016
5f8b49d
doc: undo move http.IncomingMessage.statusMessage
techjeffharris Jan 22, 2016
e82760f
doc: check for errors in 'listen' event
benjamingr Jan 24, 2016
efc4f01
vm: introduce `cachedData`/`produceCachedData`
indutny Jan 21, 2016
0e16694
test: mark test-tick-processor flaky
Trott Jan 21, 2016
29775ae
stream: refactor redeclared variables
Trott Jan 22, 2016
1164bcb
doc: fix code type of markdowns
JacksonTian Jan 25, 2016
d3ce9d3
doc: add `servername` parameter docs
estliberitas Jan 17, 2016
085c5a0
dns: throw a TypeError in lookupService with invalid port
evanlucas Jan 24, 2016
38aa39d
test: refactor test-net-settimeout
Trott Jan 21, 2016
516d5da
test: fs.link() test runs on same device
drewfish Jan 25, 2016
935768b
tools: enable assorted ESLint error rules
silverwind Jan 25, 2016
a6f50c6
test: fix irregular whitespace issue
silverwind Jan 25, 2016
db19416
src: attach error to stack on displayErrors
cjihrig Jan 26, 2016
25c4f98
tools: add support for subkeys in release tools
MylesBorins Jan 21, 2016
1348386
doc: fix nonsensical grammar in Buffer::write
Jimbly Jan 25, 2016
69176e1
doc: keep the names in sorted order
thefourtheye Jan 26, 2016
4b876bf
doc: remove unnecessary bind(this)
wKich Jan 21, 2016
5d8a742
tls: scope loop vars with let
Trott Jan 25, 2016
e99a50d
test: scope redeclared variable
Trott Jan 14, 2016
ae09fc2
doc: document deprecation of util._extend
benjamingr Jan 27, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
stream: refactor redeclared variables
`lib/_stream_readable.js` contained three instances of `var`
declarations occurring twice in the same scope. Refactored to `const` or
`let` as appropriate.

PR-URL: #4816
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
Trott authored and benjamingr committed Jan 27, 2016
commit 29775ae70d3bbf65b19fe8cf9c56baae3ba01290
12 changes: 6 additions & 6 deletions lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ function readableAddChunk(stream, state, chunk, encoding, addToFront) {
onEofChunk(stream, state);
} else if (state.objectMode || chunk && chunk.length > 0) {
if (state.ended && !addToFront) {
var e = new Error('stream.push() after EOF');
const e = new Error('stream.push() after EOF');
stream.emit('error', e);
} else if (state.endEmitted && addToFront) {
var e = new Error('stream.unshift() after end event');
const e = new Error('stream.unshift() after end event');
stream.emit('error', e);
} else {
if (state.decoder && !addToFront && !encoding)
Expand Down Expand Up @@ -640,13 +640,13 @@ Readable.prototype.unpipe = function(dest) {
state.pipesCount = 0;
state.flowing = false;

for (var i = 0; i < len; i++)
for (let i = 0; i < len; i++)
dests[i].emit('unpipe', this);
return this;
}

// try to find the right one.
var i = state.pipes.indexOf(dest);
const i = state.pipes.indexOf(dest);
if (i === -1)
return this;

Expand Down Expand Up @@ -847,7 +847,7 @@ function fromList(n, state) {
if (n < list[0].length) {
// just take a part of the first list item.
// slice is the same for buffers and strings.
var buf = list[0];
const buf = list[0];
ret = buf.slice(0, n);
list[0] = buf.slice(n);
} else if (n === list[0].length) {
Expand All @@ -863,7 +863,7 @@ function fromList(n, state) {

var c = 0;
for (var i = 0, l = list.length; i < l && c < n; i++) {
var buf = list[0];
const buf = list[0];
var cpy = Math.min(n - c, buf.length);

if (stringMode)
Expand Down