diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index 4e63345d208493..f2ff49df8d86a2 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -289,7 +289,7 @@ inherits from its global `Object` class. Objects passed to the and inherit from its global `Object` class. However, the created `MessagePort` no longer inherits from -[`EventTarget`][], and only [`port.onmessage()`][] can be used to receive +{EventTarget}, and only [`port.onmessage()`][] can be used to receive events using it. ## `worker.parentPort` @@ -849,14 +849,14 @@ circularData.foo = circularData; port2.postMessage(circularData); ``` -`transferList` may be a list of [`ArrayBuffer`][], [`MessagePort`][], and +`transferList` may be a list of {ArrayBuffer}, [`MessagePort`][], and [`FileHandle`][] objects. After transferring, they are not usable on the sending side of the channel anymore (even if they are not contained in `value`). Unlike with [child processes][], transferring handles such as network sockets is currently not supported. -If `value` contains [`SharedArrayBuffer`][] instances, those are accessible +If `value` contains {SharedArrayBuffer} instances, those are accessible from either thread. They cannot be listed in `transferList`. `value` may still contain `ArrayBuffer` instances that are not in @@ -894,8 +894,8 @@ behind this API, see the [serialization API of the `node:v8` module][v8.serdes]. #### Considerations when transferring TypedArrays and Buffers -All `TypedArray` and `Buffer` instances are views over an underlying -`ArrayBuffer`. That is, it is the `ArrayBuffer` that actually stores +All {TypedArray|Buffer} instances are views over an underlying +{ArrayBuffer}. That is, it is the `ArrayBuffer` that actually stores the raw data while the `TypedArray` and `Buffer` objects provide a way of viewing and manipulating the data. It is possible and common for multiple views to be created over the same `ArrayBuffer` instance. @@ -944,8 +944,8 @@ those `ArrayBuffer`s unusable. Because object cloning uses the [HTML structured clone algorithm][], non-enumerable properties, property accessors, and object prototypes are -not preserved. In particular, [`Buffer`][] objects will be read as -plain [`Uint8Array`][]s on the receiving side, and instances of JavaScript +not preserved. In particular, {Buffer} objects will be read as +plain {Uint8Array}s on the receiving side, and instances of JavaScript classes will be cloned as plain JavaScript objects. @@ -1576,21 +1576,16 @@ thread spawned will spawn another until the application crashes. [`'online'` event]: #event-online [`--max-old-space-size`]: cli.md#--max-old-space-sizesize-in-mib [`--max-semi-space-size`]: cli.md#--max-semi-space-sizesize-in-mib -[`ArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer [`AsyncResource`]: async_hooks.md#class-asyncresource [`Buffer.allocUnsafe()`]: buffer.md#static-method-bufferallocunsafesize -[`Buffer`]: buffer.md [`ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST`]: errors.md#err_missing_message_port_in_transfer_list [`ERR_WORKER_MESSAGING_ERRORED`]: errors.md#err_worker_messaging_errored [`ERR_WORKER_MESSAGING_FAILED`]: errors.md#err_worker_messaging_failed [`ERR_WORKER_MESSAGING_SAME_THREAD`]: errors.md#err_worker_messaging_same_thread [`ERR_WORKER_MESSAGING_TIMEOUT`]: errors.md#err_worker_messaging_timeout [`ERR_WORKER_NOT_RUNNING`]: errors.md#err_worker_not_running -[`EventTarget`]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget [`FileHandle`]: fs.md#class-filehandle [`MessagePort`]: #class-messageport -[`SharedArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer -[`Uint8Array`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array [`WebAssembly.Module`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module [`Worker constructor options`]: #new-workerfilename-options [`Worker`]: #class-worker