mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00

PR-URL: https://github.com/nodejs/node/pull/47498 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
41 lines
633 B
JavaScript
41 lines
633 B
JavaScript
'use strict';
|
|
|
|
require('../../common');
|
|
const { spawnSync } = require('child_process');
|
|
|
|
const four = require('../../common/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 ESM
|
|
{
|
|
const child = spawnSync(process.execPath, [
|
|
'--input-type',
|
|
'module',
|
|
'-e',
|
|
main,
|
|
], {
|
|
env: { ...process.env },
|
|
});
|
|
|
|
if (child.status !== 0) {
|
|
console.error(child.stderr.toString());
|
|
}
|
|
console.error(child.stdout.toString());
|
|
}
|