mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
Fixes: https://github.com/nodejs/node/issues/60034 PR-URL: https://github.com/nodejs/node/pull/60103 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
30 lines
505 B
JavaScript
30 lines
505 B
JavaScript
// Flags: --unhandled-rejections=strict
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
const fs = require('fs');
|
|
const assert = require('assert');
|
|
|
|
process.on('unhandledRejection', common.mustNotCall);
|
|
|
|
process.on('uncaughtException', common.mustCall((err) => {
|
|
assert.ok(err.message.includes('foo'));
|
|
}));
|
|
|
|
|
|
async function readFile() {
|
|
return fs.promises.readFile(__filename);
|
|
}
|
|
|
|
async function crash() {
|
|
throw new Error('foo');
|
|
}
|
|
|
|
|
|
async function main() {
|
|
crash();
|
|
readFile();
|
|
}
|
|
|
|
main();
|