From ad61c91d7b2b754c1b6556a85ba128d034618cb3 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 11 May 2017 13:36:31 +0800 Subject: [PATCH] doc: note caveats in process message serialization The message sent using process.send() goes through JSON serialization and parsing, which could lead to surprising behaviors. This commit elaborate a bit more on this and add a link to the notes about these caveats in the ECMAScript specification. PR-URL: https://github.com/nodejs/node/pull/12963 Refs: https://github.com/nodejs/node/issues/12497 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Vse Mozhet Byt Reviewed-By: Ruben Bridgewater --- doc/api/child_process.md | 16 ++++++++++++---- doc/api/process.md | 11 ++++++++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/doc/api/child_process.md b/doc/api/child_process.md index a8bc0b38f7..573e1632ca 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -891,6 +891,10 @@ added: v0.5.9 The `'message'` event is triggered when a child process uses [`process.send()`][] to send messages. +*Note*: The message goes through JSON serialization and parsing. The resulting +message might not be the same as what is originally sent. See notes in +[the `JSON.stringify()` specification][`JSON.stringify` spec]. + ### subprocess.channel