diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index 1bf76762fb269a..7d070dc58fe171 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -140,7 +140,7 @@ inherit from its global `Object` class. Objects passed to the and inherit from its global `Object` class. However, the created `MessagePort` will no longer inherit from -[`EventEmitter`][], and only [`port.onmessage()`][] can be used to receive +[`EventTarget`][], and only [`port.onmessage()`][] can be used to receive events using it. ## `worker.parentPort` @@ -295,17 +295,22 @@ port2.postMessage({ foo: 'bar' }); ## Class: `MessagePort` -* Extends: {EventEmitter} +* Extends: {EventTarget} Instances of the `worker.MessagePort` class represent one end of an asynchronous, two-way communications channel. It can be used to transfer structured data, memory regions and other `MessagePort`s between different [`Worker`][]s. -With the exception of `MessagePort`s being [`EventEmitter`][]s rather -than [`EventTarget`][]s, this implementation matches [browser `MessagePort`][]s. +This implementation matches [browser `MessagePort`][]s. ### Event: `'close'`