From 9ac404716446e8d9a4d26b70cd4f3b2e3adb4bf7 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 4 Jan 2021 10:29:45 -0800 Subject: [PATCH] doc: clarify when messageerror is emitted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adapting addaleax's explanation from the issue. Fixes: https://github.com/nodejs/node/issues/36333 Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/36780 Reviewed-By: Anna Henningsen Reviewed-By: Juan José Arboleda --- 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..e745b5aa799319 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 occurring 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()`