mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
508890d795
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>
26 lines
691 B
JavaScript
26 lines
691 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
|
|
if (process.argv[2] === 'async') {
|
|
async function fn() {
|
|
fn();
|
|
throw new Error();
|
|
}
|
|
return (async function() { await fn(); })();
|
|
}
|
|
|
|
const assert = require('assert');
|
|
const { spawnSync } = require('child_process');
|
|
|
|
const ret = spawnSync(
|
|
process.execPath,
|
|
['--unhandled-rejections=none', '--stack_size=150', __filename, 'async'],
|
|
{ maxBuffer: Infinity }
|
|
);
|
|
assert.strictEqual(ret.status, 0,
|
|
`EXIT CODE: ${ret.status}, STDERR:\n${ret.stderr}`);
|
|
const stderr = ret.stderr.toString('utf8', 0, 2048);
|
|
assert.doesNotMatch(stderr, /async.*hook/i);
|
|
assert.ok(stderr.includes('Maximum call stack size exceeded'), stderr);
|