From 5ef5116311f5e78333dc0dbe378553e64f06cab3 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 14 Jun 2020 14:50:28 +0200 Subject: [PATCH] worker: rename error code to be more accurate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` to `ERR_MISSING_TRANSFERABLE_IN_TRANSFER_LIST` in order to be more accurate. PR-URL: https://github.com/nodejs/node/pull/33872 Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell Reviewed-By: Michaël Zasso Reviewed-By: Tobias Nießen --- doc/api/errors.md | 29 ++++++++++++++++--- src/node_errors.h | 4 +-- src/node_messaging.cc | 4 +-- ...worker-message-port-transfer-filehandle.js | 3 +- .../test-worker-workerdata-messageport.js | 2 +- 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/doc/api/errors.md b/doc/api/errors.md index 6bc57d656a5a97..268e66cffbcaa4 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1597,12 +1597,20 @@ strict compliance with the API specification (which in some cases may accept For APIs that accept options objects, some options might be mandatory. This code is thrown if a required option is missing. - -### `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` + +### `ERR_MISSING_TRANSFERABLE_IN_TRANSFER_LIST` + An object that needs to be explicitly listed in the `transferList` argument -was found in the object passed to a `postMessage()` call, but not provided in -the `transferList` for that call. Usually, this is a `MessagePort`. +was found in the object passed to a [`postMessage()`][] call, but not provided +in the `transferList` for that call. Usually, this is a `MessagePort`. + +In Node.js versions prior to REPLACEME, the error code being used here was +[`ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST`][]. However, the set of +transferable object types has been expanded to cover more types than +`MessagePort`. ### `ERR_MISSING_PASSPHRASE` @@ -2442,6 +2450,16 @@ Used when an invalid character is found in an HTTP response status message --> A given index was out of the accepted range (e.g. negative offsets). + +### `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` + + +This error code was replaced by [`ERR_MISSING_TRANSFERABLE_IN_TRANSFER_LIST`][] +in Node.js REPLACEME, because it is no longer accurate as other types of +transferable objects also exist now. + ### `ERR_NAPI_CONS_PROTOTYPE_OBJECT`