0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/message/async_error_eval_esm.js
Guy Bedford 796f3d0af4
esm: unflag --experimental-modules
PR-URL: https://github.com/nodejs/node/pull/29866
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2019-11-12 14:04:55 -08:00

42 lines
625 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());
}