@@ -14,16 +14,10 @@ const stream = require('stream');
1414 cb ( new Error ( 'write test error' ) ) ;
1515 } ;
1616
17- let firstError = false ;
18- writable . on ( 'finish' , common . mustCall ( function ( ) {
19- assert . strictEqual ( firstError , true ) ;
20- } ) ) ;
21-
22- writable . on ( 'prefinish' , common . mustCall ( ) ) ;
23-
17+ writable . on ( 'finish' , common . mustNotCall ( ) ) ;
18+ writable . on ( 'prefinish' , common . mustNotCall ( ) ) ;
2419 writable . on ( 'error' , common . mustCall ( ( er ) => {
2520 assert . strictEqual ( er . message , 'write test error' ) ;
26- firstError = true ;
2721 } ) ) ;
2822
2923 writable . end ( 'test' ) ;
@@ -36,16 +30,10 @@ const stream = require('stream');
3630 setImmediate ( cb , new Error ( 'write test error' ) ) ;
3731 } ;
3832
39- let firstError = false ;
40- writable . on ( 'finish' , common . mustCall ( function ( ) {
41- assert . strictEqual ( firstError , true ) ;
42- } ) ) ;
43-
44- writable . on ( 'prefinish' , common . mustCall ( ) ) ;
45-
33+ writable . on ( 'finish' , common . mustNotCall ( ) ) ;
34+ writable . on ( 'prefinish' , common . mustNotCall ( ) ) ;
4635 writable . on ( 'error' , common . mustCall ( ( er ) => {
4736 assert . strictEqual ( er . message , 'write test error' ) ;
48- firstError = true ;
4937 } ) ) ;
5038
5139 writable . end ( 'test' ) ;
@@ -62,16 +50,10 @@ const stream = require('stream');
6250 cb ( new Error ( 'writev test error' ) ) ;
6351 } ;
6452
65- let firstError = false ;
66- writable . on ( 'finish' , common . mustCall ( function ( ) {
67- assert . strictEqual ( firstError , true ) ;
68- } ) ) ;
69-
70- writable . on ( 'prefinish' , common . mustCall ( ) ) ;
71-
53+ writable . on ( 'finish' , common . mustNotCall ( ) ) ;
54+ writable . on ( 'prefinish' , common . mustNotCall ( ) ) ;
7255 writable . on ( 'error' , common . mustCall ( ( er ) => {
7356 assert . strictEqual ( er . message , 'writev test error' ) ;
74- firstError = true ;
7557 } ) ) ;
7658
7759 writable . cork ( ) ;
@@ -93,16 +75,10 @@ const stream = require('stream');
9375 setImmediate ( cb , new Error ( 'writev test error' ) ) ;
9476 } ;
9577
96- let firstError = false ;
97- writable . on ( 'finish' , common . mustCall ( function ( ) {
98- assert . strictEqual ( firstError , true ) ;
99- } ) ) ;
100-
101- writable . on ( 'prefinish' , common . mustCall ( ) ) ;
102-
78+ writable . on ( 'finish' , common . mustNotCall ( ) ) ;
79+ writable . on ( 'prefinish' , common . mustNotCall ( ) ) ;
10380 writable . on ( 'error' , common . mustCall ( ( er ) => {
10481 assert . strictEqual ( er . message , 'writev test error' ) ;
105- firstError = true ;
10682 } ) ) ;
10783
10884 writable . cork ( ) ;
@@ -123,14 +99,9 @@ const stream = require('stream');
12399 rs . _read = ( ) => { } ;
124100
125101 const ws = new stream . Writable ( ) ;
126- let firstError = false ;
127102
128- ws . on ( 'finish' , common . mustCall ( function ( ) {
129- assert . strictEqual ( firstError , true ) ;
130- } ) ) ;
131- ws . on ( 'error' , common . mustCall ( function ( ) {
132- firstError = true ;
133- } ) ) ;
103+ ws . on ( 'finish' , common . mustNotCall ( ) ) ;
104+ ws . on ( 'error' , common . mustCall ( ) ) ;
134105
135106 ws . _write = ( chunk , encoding , done ) => {
136107 setImmediate ( done , new Error ( ) ) ;
0 commit comments