@@ -154,7 +154,7 @@ Writable.prototype.pipe = function() {
154
154
} ;
155
155
156
156
157
- function writeAfterEnd ( stream , state , cb ) {
157
+ function writeAfterEnd ( stream , cb ) {
158
158
var er = new Error ( 'write after end' ) ;
159
159
// TODO: defer error events consistently everywhere, not just the cb
160
160
stream . emit ( 'error' , er ) ;
@@ -204,7 +204,7 @@ Writable.prototype.write = function(chunk, encoding, cb) {
204
204
cb = nop ;
205
205
206
206
if ( state . ended )
207
- writeAfterEnd ( this , state , cb ) ;
207
+ writeAfterEnd ( this , cb ) ;
208
208
else if ( validChunk ( this , state , chunk , cb ) ) {
209
209
state . pendingcb ++ ;
210
210
ret = writeOrBuffer ( this , state , chunk , encoding , cb ) ;
@@ -329,7 +329,7 @@ function onwrite(stream, er) {
329
329
onwriteError ( stream , state , sync , er , cb ) ;
330
330
else {
331
331
// Check if we're actually ready to finish, but don't emit yet
332
- var finished = needFinish ( stream , state ) ;
332
+ var finished = needFinish ( state ) ;
333
333
334
334
if ( ! finished &&
335
335
! state . corked &&
@@ -453,7 +453,7 @@ Writable.prototype.end = function(chunk, encoding, cb) {
453
453
} ;
454
454
455
455
456
- function needFinish ( stream , state ) {
456
+ function needFinish ( state ) {
457
457
return ( state . ending &&
458
458
state . length === 0 &&
459
459
state . bufferedRequest === null &&
@@ -469,7 +469,7 @@ function prefinish(stream, state) {
469
469
}
470
470
471
471
function finishMaybe ( stream , state ) {
472
- var need = needFinish ( stream , state ) ;
472
+ var need = needFinish ( state ) ;
473
473
if ( need ) {
474
474
if ( state . pendingcb === 0 ) {
475
475
prefinish ( stream , state ) ;
0 commit comments