mirror of
https://github.com/nodejs/node.git
synced 2024-11-24 20:29:23 +01:00
dcc368f4be
PR-URL: https://github.com/nodejs/node/pull/41463 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
17 lines
477 B
JavaScript
17 lines
477 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const EventEmitter = require('events');
|
|
|
|
// Tests that the error stack where the exception was thrown is *not* appended.
|
|
|
|
process.on('uncaughtException', common.mustCall((err) => {
|
|
const lines = err.stack.split('\n');
|
|
assert.strictEqual(lines[0], 'Error');
|
|
lines.slice(1).forEach((line) => {
|
|
assert.match(line, /^ {4}at/);
|
|
});
|
|
}));
|
|
|
|
new EventEmitter().emit('error', new Error());
|