Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2034f68

Browse filesBrowse files
evanlucasFishrock123
authored andcommitted
src: honor --abort_on_uncaught_exception flag
Fix regression introduced in 0af4c9e 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: #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>
1 parent 0b1ca4a commit 2034f68
Copy full SHA for 2034f68

File tree

Expand file treeCollapse file tree

2 files changed

+36
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+36
-1
lines changed
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,11 @@ void FatalException(Isolate* isolate,
21922192

21932193
if (false == caught->BooleanValue()) {
21942194
ReportException(env, error, message);
2195-
exit(1);
2195+
if (abort_on_uncaught_exception) {
2196+
ABORT();
2197+
} else {
2198+
exit(1);
2199+
}
21962200
}
21972201
}
21982202

Collapse file
+31Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const assert = require('assert');
5+
const spawn = require('child_process').spawn;
6+
const node = process.execPath;
7+
8+
if (process.argv[2] === 'child') {
9+
throw new Error('child error');
10+
} else {
11+
run('', null);
12+
run('--abort-on-uncaught-exception', 'SIGABRT');
13+
}
14+
15+
function run(flags, signal) {
16+
const args = [__filename, 'child'];
17+
if (flags)
18+
args.unshift(flags);
19+
20+
const child = spawn(node, args);
21+
child.on('exit', common.mustCall(function(code, sig) {
22+
if (!common.isWindows) {
23+
assert.strictEqual(sig, signal);
24+
} else {
25+
if (signal)
26+
assert.strictEqual(code, 3);
27+
else
28+
assert.strictEqual(code, 1);
29+
}
30+
}));
31+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.