File tree 2 files changed +5
-16
lines changed
2 files changed +5
-16
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,6 @@ class Worker extends EventEmitter {
171
171
this [ kPublicPort ] = null ;
172
172
173
173
const { stdout, stderr } = this [ kParentSideStdio ] ;
174
- this [ kParentSideStdio ] = null ;
175
174
176
175
if ( ! stdout . _readableState . ended ) {
177
176
debug ( `[${ threadId } ] explicitly closes stdout for ${ this . threadId } ` ) ;
@@ -221,20 +220,14 @@ class Worker extends EventEmitter {
221
220
}
222
221
223
222
get stdin ( ) {
224
- if ( this [ kParentSideStdio ] === null ) return null ;
225
-
226
223
return this [ kParentSideStdio ] . stdin ;
227
224
}
228
225
229
226
get stdout ( ) {
230
- if ( this [ kParentSideStdio ] === null ) return null ;
231
-
232
227
return this [ kParentSideStdio ] . stdout ;
233
228
}
234
229
235
230
get stderr ( ) {
236
- if ( this [ kParentSideStdio ] === null ) return null ;
237
-
238
231
return this [ kParentSideStdio ] . stderr ;
239
232
}
240
233
}
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ if (isMainThread) {
12
12
stderr : true
13
13
} ) ;
14
14
15
+ const { stdin, stdout, stderr } = w ;
16
+
15
17
w . on ( 'exit' , common . mustCall ( ( code ) => {
16
18
assert . strictEqual ( code , 0 ) ;
17
19
@@ -21,17 +23,11 @@ if (isMainThread) {
21
23
w . ref ( ) ;
22
24
w . unref ( ) ;
23
25
24
- // Although not browser specific, probably wise to
25
- // make sure the stream getters don't throw either.
26
- w . stdin ;
27
- w . stdout ;
28
- w . stderr ;
29
-
30
26
// Sanity check.
31
27
assert . strictEqual ( w . threadId , - 1 ) ;
32
- assert . strictEqual ( w . stdin , null ) ;
33
- assert . strictEqual ( w . stdout , null ) ;
34
- assert . strictEqual ( w . stderr , null ) ;
28
+ assert . strictEqual ( w . stdin , stdin ) ;
29
+ assert . strictEqual ( w . stdout , stdout ) ;
30
+ assert . strictEqual ( w . stderr , stderr ) ;
35
31
} ) ) ;
36
32
} else {
37
33
process . exit ( 0 ) ;
You can’t perform that action at this time.
0 commit comments