@@ -14,16 +14,10 @@ const stream = require('stream');
14
14
cb ( new Error ( 'write test error' ) ) ;
15
15
} ;
16
16
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 ( ) ) ;
24
19
writable . on ( 'error' , common . mustCall ( ( er ) => {
25
20
assert . strictEqual ( er . message , 'write test error' ) ;
26
- firstError = true ;
27
21
} ) ) ;
28
22
29
23
writable . end ( 'test' ) ;
@@ -36,16 +30,10 @@ const stream = require('stream');
36
30
setImmediate ( cb , new Error ( 'write test error' ) ) ;
37
31
} ;
38
32
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 ( ) ) ;
46
35
writable . on ( 'error' , common . mustCall ( ( er ) => {
47
36
assert . strictEqual ( er . message , 'write test error' ) ;
48
- firstError = true ;
49
37
} ) ) ;
50
38
51
39
writable . end ( 'test' ) ;
@@ -62,16 +50,10 @@ const stream = require('stream');
62
50
cb ( new Error ( 'writev test error' ) ) ;
63
51
} ;
64
52
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 ( ) ) ;
72
55
writable . on ( 'error' , common . mustCall ( ( er ) => {
73
56
assert . strictEqual ( er . message , 'writev test error' ) ;
74
- firstError = true ;
75
57
} ) ) ;
76
58
77
59
writable . cork ( ) ;
@@ -93,16 +75,10 @@ const stream = require('stream');
93
75
setImmediate ( cb , new Error ( 'writev test error' ) ) ;
94
76
} ;
95
77
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 ( ) ) ;
103
80
writable . on ( 'error' , common . mustCall ( ( er ) => {
104
81
assert . strictEqual ( er . message , 'writev test error' ) ;
105
- firstError = true ;
106
82
} ) ) ;
107
83
108
84
writable . cork ( ) ;
@@ -123,14 +99,9 @@ const stream = require('stream');
123
99
rs . _read = ( ) => { } ;
124
100
125
101
const ws = new stream . Writable ( ) ;
126
- let firstError = false ;
127
102
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 ( ) ) ;
134
105
135
106
ws . _write = ( chunk , encoding , done ) => {
136
107
setImmediate ( done , new Error ( ) ) ;
0 commit comments