File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
packages/jest-worker/src/workers Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ export default function messageParent(
20
20
parentProcess . send ( [ PARENT_MESSAGE_CUSTOM , message ] ) ;
21
21
} catch ( e : any ) {
22
22
if ( / c i r c u l a r s t r u c t u r e / . test ( e ?. message ) ) {
23
+ // We can safely send a message to the parent process again
24
+ // because previous sending was halted by "TypeError: Converting circular structure to JSON".
25
+ // But this time the message will be cleared from circular references.
23
26
parentProcess . send ( [
24
27
PARENT_MESSAGE_CUSTOM ,
25
28
withoutCircularRefs ( message ) ,
Original file line number Diff line number Diff line change @@ -101,6 +101,9 @@ function reportSuccess(result: unknown) {
101
101
try {
102
102
process . send ( [ PARENT_MESSAGE_OK , result ] ) ;
103
103
} catch ( e : any ) {
104
+ // We can safely send a message to the parent process again
105
+ // because previous sending was halted by "TypeError: Converting circular structure to JSON".
106
+ // But this time the message will be cleared from circular references.
104
107
if ( e && / c i r c u l a r s t r u c t u r e / . test ( e ?. message ) ) {
105
108
process . send ( [ PARENT_MESSAGE_OK , withoutCircularRefs ( result ) ] ) ;
106
109
} else {
You can’t perform that action at this time.
0 commit comments