node/test/message/events_unhandled_error_sameline.js
Anna Henningsen 68d508a9e0
events: show throw stack trace for uncaught exception
Show the stack trace for the `eventemitter.emit('error')` call
in the case of an uncaught exception.

Previously, there would be no clue in Node’s output about where
the actual `throw` comes from.

PR-URL: https://github.com/nodejs/node/pull/19003
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-04 21:20:43 +00:00

5 lines
123 B
JavaScript

'use strict';
require('../common');
const EventEmitter = require('events');
new EventEmitter().emit('error', new Error());