From c09df40595e5f9e90e00555199f0ec8d1baaad1e Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 4 Jan 2021 10:29:45 -0800 Subject: [PATCH 1/2] doc: clarify when messageerror is emitted Adapting addaleax's explanation from the issue. Fixes: https://github.com/nodejs/node/issues/36333 Signed-off-by: James M Snell --- doc/api/worker_threads.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index f32c2c4cf5ecf1..9fa610cb5eef09 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -452,6 +452,12 @@ added: The `'messageerror'` event is emitted when deserializing a message failed. +Currently, this event is emitted when there is an error occuring while +instantiating the posted JS object on the receiving end. Such situations +are rare, but can happen, for instance, when certain Node.js API objects +are received in a `vm.Context` (where Node.js APIs are currently +unavailable). + ### `port.close()`