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