summaryrefslogtreecommitdiff
path: root/test/parallel/test-process-exception-capture-should-abort-on-uncaught-setflagsfromstring.js
blob: de14177b45a6095fc17ad7402534d662c033f9ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
'use strict';
const common = require('../common');
const assert = require('assert');
const v8 = require('v8');

assert.strictEqual(process.hasUncaughtExceptionCaptureCallback(), false);

v8.setFlagsFromString('--abort-on-uncaught-exception');
// This should make the process not crash even though the flag was passed.
process.setUncaughtExceptionCaptureCallback(common.mustCall((err) => {
  assert.strictEqual(err.message, 'foo');
}));
throw new Error('foo');