mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
4c9fb0b706
For unhandled `'error'` events, include the constructor name for subclasses of EventEmitter, if possible. This makes tracing errors easier when both creation of the `Error` object and emitting it happen in code that does not refer back to the event emitter. PR-URL: https://github.com/nodejs/node/pull/28952 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
6 lines
148 B
JavaScript
6 lines
148 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const EventEmitter = require('events');
|
|
class Foo extends EventEmitter {}
|
|
new Foo().emit('error', new Error());
|