PR-URL: https://github.com/nodejs/node/pull/61228 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
40 lines
626 B
JavaScript
40 lines
626 B
JavaScript
'use strict';
|
|
|
|
require('../../common');
|
|
const { spawnSync } = require('child_process');
|
|
const fixtures = require('../../common/fixtures');
|
|
|
|
const four = fixtures
|
|
.readSync('async-error.js')
|
|
.toString()
|
|
.split('\n')
|
|
.slice(2, -2)
|
|
.join('\n');
|
|
|
|
const main = `${four}
|
|
|
|
async function main() {
|
|
try {
|
|
await four();
|
|
} catch (e) {
|
|
console.log(e);
|
|
}
|
|
}
|
|
|
|
main();
|
|
`;
|
|
|
|
// --eval CJS
|
|
{
|
|
const child = spawnSync(process.execPath, [
|
|
'-e',
|
|
main,
|
|
], {
|
|
env: { ...process.env },
|
|
});
|
|
|
|
if (child.status !== 0) {
|
|
console.error(child.stderr.toString());
|
|
}
|
|
console.error(child.stdout.toString());
|
|
}
|