From a800b5b6986f53b1eec06b5e39f4f9e06f949ea7 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 56eaf3f1cb857c..245acb35806d92 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -356,6 +356,12 @@ added: v14.5.0 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()`