File tree 2 files changed +22
-12
lines changed
2 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -715,7 +715,17 @@ Used when the main process is trying to read data from the child process's
715
715
STDERR/STDOUT, and the data's length is longer than the ` maxBuffer ` option.
716
716
717
717
<a id =" ERR_CLOSED_MESSAGE_PORT " ></a >
718
- ### ERR_CLOSED_MESSAGE_PORT
718
+ ### ` ERR_CLOSED_MESSAGE_PORT `
719
+ <!--
720
+ added: REPLACEME
721
+ changes:
722
+ - version: 11.12.0
723
+ pr-url: https://github.com/nodejs/node/pull/26487
724
+ description: The error message was removed.
725
+ - version: REPLACEME
726
+ pr-url: https://github.com/nodejs/node/pull/38510
727
+ description: The error message was reintroduced.
728
+ -->
719
729
720
730
There was an attempt to use a ` MessagePort ` instance in a closed
721
731
state, usually after ` .close() ` has been called.
@@ -2284,16 +2294,6 @@ removed: v12.5.0
2284
2294
The value passed to ` postMessage() ` contained an object that is not supported
2285
2295
for transferring.
2286
2296
2287
- <a id =" ERR_CLOSED_MESSAGE_PORT " ></a >
2288
- ### ` ERR_CLOSED_MESSAGE_PORT `
2289
- <!-- YAML
2290
- added: v10.5.0
2291
- removed: v11.12.0
2292
- -->
2293
-
2294
- There was an attempt to use a ` MessagePort ` instance in a closed
2295
- state, usually after ` .close() ` has been called.
2296
-
2297
2297
<a id =" ERR_CRYPTO_HASH_DIGEST_NO_UTF16 " ></a >
2298
2298
### ` ERR_CRYPTO_HASH_DIGEST_NO_UTF16 `
2299
2299
<!-- YAML
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
const common = require ( '../common' ) ;
3
- const { MessageChannel } = require ( 'worker_threads' ) ;
3
+ const assert = require ( 'assert' ) ;
4
+ const { MessageChannel, moveMessagePortToContext } = require ( 'worker_threads' ) ;
4
5
5
6
// Make sure that .start() and .stop() do not throw on closing/closed
6
7
// MessagePorts.
@@ -29,3 +30,12 @@ function dummy() {}
29
30
port1 . off ( 'message' , dummy ) ;
30
31
} ) ) ;
31
32
}
33
+
34
+ {
35
+ const { port2 } = new MessageChannel ( ) ;
36
+ port2 . close ( ) ;
37
+ assert . throws ( ( ) => moveMessagePortToContext ( port2 , { } ) , {
38
+ code : 'ERR_CLOSED_MESSAGE_PORT' ,
39
+ message : 'Cannot send data on closed MessagePort'
40
+ } ) ;
41
+ }
You can’t perform that action at this time.
0 commit comments