mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
921f2de6cf
Fix regression introduced in 0af4c9ea74
that ignores the --abort-on-uncaught-exception flag. Prior to that
commit, the flag was passed through to v8. After that commit, the
process just calls exit(1).
PR-URL: https://github.com/nodejs/node/pull/2776
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
32 lines
711 B
JavaScript
32 lines
711 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const spawn = require('child_process').spawn;
|
|
const node = process.execPath;
|
|
|
|
if (process.argv[2] === 'child') {
|
|
throw new Error('child error');
|
|
} else {
|
|
run('', null);
|
|
run('--abort-on-uncaught-exception', 'SIGABRT');
|
|
}
|
|
|
|
function run(flags, signal) {
|
|
const args = [__filename, 'child'];
|
|
if (flags)
|
|
args.unshift(flags);
|
|
|
|
const child = spawn(node, args);
|
|
child.on('exit', common.mustCall(function(code, sig) {
|
|
if (!common.isWindows) {
|
|
assert.strictEqual(sig, signal);
|
|
} else {
|
|
if (signal)
|
|
assert.strictEqual(code, 3);
|
|
else
|
|
assert.strictEqual(code, 1);
|
|
}
|
|
}));
|
|
}
|