mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
566 B
22 lines
566 B
7 years ago
|
'use strict';
|
||
|
|
||
|
require('../common');
|
||
|
|
||
|
if (process.argv[2] === 'async') {
|
||
|
async function fn() {
|
||
|
fn();
|
||
|
throw new Error();
|
||
|
}
|
||
|
(async function() { await fn(); })();
|
||
|
// While the above should error, just in case it dosn't the script shouldn't
|
||
|
// fork itself indefinitely so return early.
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
const assert = require('assert');
|
||
|
const { spawnSync } = require('child_process');
|
||
|
|
||
|
const ret = spawnSync(process.execPath, [__filename, 'async']);
|
||
|
assert.strictEqual(ret.status, 0);
|
||
|
assert.ok(!/async.*hook/i.test(ret.stderr.toString('utf8', 0, 1024)));
|