mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 20:31:36 +00:00

PR-URL: https://github.com/nodejs/node/pull/39928 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.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, /^ at/);
|
|
});
|
|
}));
|
|
|
|
new EventEmitter().emit('error', new Error());
|