| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -289,24 +289,26 @@ To handle the errors that it catches, listen to its `'error'` event. | |||
| 289 | 289 | ||
| 290 | 290 | * Type: {Array} | |
| 291 | 291 | ||
| 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. | ||
| 294 | 293 | ||
| 295 | 294 | ### `domain.add(emitter)` | |
| 296 | 295 | ||
| 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 | ||
| 298 | 304 | ||
| 299 | 305 | Explicitly adds an emitter to the domain. If any event handlers called by | |
| 300 | 306 | the emitter throw an error, or if the emitter emits an `'error'` event, it | |
| 301 | 307 | will be routed to the domain's `'error'` event, just like with implicit | |
| 302 | 308 | binding. | |
| 303 | 309 | ||
| 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. | ||
| 310 | 312 | ||
| 311 | 313 | ### `domain.bind(callback)` | |
| 312 | 314 | ||
@@ -398,7 +400,7 @@ d.on('error', (er) => { | |||
| 398 | 400 | ||
| 399 | 401 | ### `domain.remove(emitter)` | |
| 400 | 402 | ||
| 401 | - * `emitter` {EventEmitter|Timer} emitter or timer to be removed from the domain | ||
| 403 | + * `emitter` {EventEmitter} emitter to be removed from the domain | ||
| 402 | 404 | ||
| 403 | 405 | The opposite of [`domain.add(emitter)`][]. Removes domain handling from the | |
| 404 | 406 | specified emitter. | |
@@ -484,6 +486,4 @@ promises. In other words, no `'error'` event will be emitted for unhandled | |||
| 484 | 486 | [`domain.add(emitter)`]: #domainaddemitter | |
| 485 | 487 | [`domain.bind(callback)`]: #domainbindcallback | |
| 486 | 488 | [`domain.exit()`]: #domainexit | |
| 487 | - [`setInterval()`]: timers.md#setintervalcallback-delay-args | ||
| 488 | - [`setTimeout()`]: timers.md#settimeoutcallback-delay-args | ||
| 489 | 489 | [`throw`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw | |
| Back | FazBrowse Home | New Git URL |
0 commit comments