11cb0ef41Sopenharmony_ci// Flags: --abort-on-uncaught-exception 21cb0ef41Sopenharmony_ci'use strict'; 31cb0ef41Sopenharmony_ciconst common = require('../common'); 41cb0ef41Sopenharmony_ciconst assert = require('assert'); 51cb0ef41Sopenharmony_ci 61cb0ef41Sopenharmony_ciassert.strictEqual(process.hasUncaughtExceptionCaptureCallback(), false); 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ci// This should make the process not crash even though the flag was passed. 91cb0ef41Sopenharmony_ciprocess.setUncaughtExceptionCaptureCallback(common.mustCall((err) => { 101cb0ef41Sopenharmony_ci assert.strictEqual(err.message, 'foo'); 111cb0ef41Sopenharmony_ci})); 121cb0ef41Sopenharmony_ciprocess.on('uncaughtException', common.mustNotCall()); 131cb0ef41Sopenharmony_cithrow new Error('foo'); 14