1'use strict'; 2const common = require('../common'); 3const assert = require('assert'); 4const v8 = require('v8'); 5 6assert.strictEqual(process.hasUncaughtExceptionCaptureCallback(), false); 7 8v8.setFlagsFromString('--abort-on-uncaught-exception'); 9// This should make the process not crash even though the flag was passed. 10process.setUncaughtExceptionCaptureCallback(common.mustCall((err) => { 11 assert.strictEqual(err.message, 'foo'); 12})); 13throw new Error('foo'); 14