@@ -289,24 +289,26 @@ To handle the errors that it catches, listen to its `'error'` event.
289289
290290* Type: {Array}
291291
292- An array of timers and event emitters that have been explicitly added
293- to the domain.
292+ An array of event emitters that have been explicitly added to the domain.
294293
295294### ` domain.add(emitter) `
296295
297- * ` emitter ` {EventEmitter|Timer} emitter or timer to be added to the domain
296+ <!-- YAML
297+ changes:
298+ - version: v9.3.0
299+ pr-url: https://github.com/nodejs/node/pull/16222
300+ description: No longer accepts timer objects.
301+ -->
302+
303+ * ` emitter ` {EventEmitter} emitter to be added to the domain
298304
299305Explicitly adds an emitter to the domain. If any event handlers called by
300306the emitter throw an error, or if the emitter emits an ` 'error' ` event, it
301307will be routed to the domain's ` 'error' ` event, just like with implicit
302308binding.
303309
304- This also works with timers that are returned from [ ` setInterval() ` ] [ ] and
305- [ ` setTimeout() ` ] [ ] . If their callback function throws, it will be caught by
306- the domain ` 'error' ` handler.
307-
308- If the Timer or ` EventEmitter ` was already bound to a domain, it is removed
309- from that one, and bound to this one instead.
310+ If the ` EventEmitter ` was already bound to a domain, it is removed from that
311+ one, and bound to this one instead.
310312
311313### ` domain.bind(callback) `
312314
@@ -398,7 +400,7 @@ d.on('error', (er) => {
398400
399401### ` domain.remove(emitter) `
400402
401- * ` emitter ` {EventEmitter|Timer } emitter or timer to be removed from the domain
403+ * ` emitter ` {EventEmitter} emitter to be removed from the domain
402404
403405The opposite of [ ` domain.add(emitter) ` ] [ ] . Removes domain handling from the
404406specified emitter.
@@ -484,6 +486,4 @@ promises. In other words, no `'error'` event will be emitted for unhandled
484486[ `domain.add(emitter)` ] : #domainaddemitter
485487[ `domain.bind(callback)` ] : #domainbindcallback
486488[ `domain.exit()` ] : #domainexit
487- [ `setInterval()` ] : timers.md#setintervalcallback-delay-args
488- [ `setTimeout()` ] : timers.md#settimeoutcallback-delay-args
489489[ `throw` ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw
0 commit comments