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