File tree Expand file tree Collapse file tree 2 files changed +5
-16
lines changed Expand file tree Collapse file tree 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 {
171171 this [ kPublicPort ] = null ;
172172
173173 const { stdout, stderr } = this [ kParentSideStdio ] ;
174- this [ kParentSideStdio ] = null ;
175174
176175 if ( ! stdout . _readableState . ended ) {
177176 debug ( `[${ threadId } ] explicitly closes stdout for ${ this . threadId } ` ) ;
@@ -221,20 +220,14 @@ class Worker extends EventEmitter {
221220 }
222221
223222 get stdin ( ) {
224- if ( this [ kParentSideStdio ] === null ) return null ;
225-
226223 return this [ kParentSideStdio ] . stdin ;
227224 }
228225
229226 get stdout ( ) {
230- if ( this [ kParentSideStdio ] === null ) return null ;
231-
232227 return this [ kParentSideStdio ] . stdout ;
233228 }
234229
235230 get stderr ( ) {
236- if ( this [ kParentSideStdio ] === null ) return null ;
237-
238231 return this [ kParentSideStdio ] . stderr ;
239232 }
240233}
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ if (isMainThread) {
1212 stderr : true
1313 } ) ;
1414
15+ const { stdin, stdout, stderr } = w ;
16+
1517 w . on ( 'exit' , common . mustCall ( ( code ) => {
1618 assert . strictEqual ( code , 0 ) ;
1719
@@ -21,17 +23,11 @@ if (isMainThread) {
2123 w . ref ( ) ;
2224 w . unref ( ) ;
2325
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-
3026 // Sanity check.
3127 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 ) ;
3531 } ) ) ;
3632} else {
3733 process . exit ( 0 ) ;
You can’t perform that action at this time.
0 commit comments