@@ -140,7 +140,7 @@ inherit from its global `Object` class. Objects passed to the
140
140
and inherit from its global ` Object ` class.
141
141
142
142
However, the created ` MessagePort ` will no longer inherit from
143
- [ ` EventEmitter ` ] [ ] , and only [ ` port.onmessage() ` ] [ ] can be used to receive
143
+ [ ` EventTarget ` ] [ ] , and only [ ` port.onmessage() ` ] [ ] can be used to receive
144
144
events using it.
145
145
146
146
## ` worker.parentPort `
@@ -295,17 +295,22 @@ port2.postMessage({ foo: 'bar' });
295
295
## Class: ` MessagePort `
296
296
<!-- YAML
297
297
added: v10.5.0
298
+ changes:
299
+ - version:
300
+ - v14.7.0
301
+ pr-url: https://github.com/nodejs/node/pull/34057
302
+ description: This class now inherits from `EventTarget` rather than
303
+ from `EventEmitter`.
298
304
-->
299
305
300
- * Extends: {EventEmitter }
306
+ * Extends: {EventTarget }
301
307
302
308
Instances of the ` worker.MessagePort ` class represent one end of an
303
309
asynchronous, two-way communications channel. It can be used to transfer
304
310
structured data, memory regions and other ` MessagePort ` s between different
305
311
[ ` Worker ` ] [ ] s.
306
312
307
- With the exception of ` MessagePort ` s being [ ` EventEmitter ` ] [ ] s rather
308
- than [ ` EventTarget ` ] [ ] s, this implementation matches [ browser ` MessagePort ` ] [ ] s.
313
+ This implementation matches [ browser ` MessagePort ` ] [ ] s.
309
314
310
315
### Event: ` 'close' `
311
316
<!-- YAML
@@ -909,7 +914,6 @@ active handle in the event system. If the worker is already `unref()`ed calling
909
914
[ `Buffer` ] : buffer.md
910
915
[ `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` ] : errors.md#errors_err_missing_message_port_in_transfer_list
911
916
[ `ERR_WORKER_NOT_RUNNING` ] : errors.md#ERR_WORKER_NOT_RUNNING
912
- [ `EventEmitter` ] : events.md
913
917
[ `EventTarget` ] : https://developer.mozilla.org/en-US/docs/Web/API/EventTarget
914
918
[ `FileHandle` ] : fs.md#fs_class_filehandle
915
919
[ `KeyObject` ] : crypto.md#crypto_class_keyobject
0 commit comments