11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ciconst common = require('../common'); 31cb0ef41Sopenharmony_ciconst assert = require('assert'); 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ciassert.throws( 61cb0ef41Sopenharmony_ci () => process.setUncaughtExceptionCaptureCallback(42), 71cb0ef41Sopenharmony_ci { 81cb0ef41Sopenharmony_ci code: 'ERR_INVALID_ARG_TYPE', 91cb0ef41Sopenharmony_ci name: 'TypeError', 101cb0ef41Sopenharmony_ci message: 'The "fn" argument must be of type function or null. ' + 111cb0ef41Sopenharmony_ci 'Received type number (42)' 121cb0ef41Sopenharmony_ci } 131cb0ef41Sopenharmony_ci); 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_ciprocess.setUncaughtExceptionCaptureCallback(common.mustNotCall()); 161cb0ef41Sopenharmony_ci 171cb0ef41Sopenharmony_ciassert.throws( 181cb0ef41Sopenharmony_ci () => process.setUncaughtExceptionCaptureCallback(common.mustNotCall()), 191cb0ef41Sopenharmony_ci { 201cb0ef41Sopenharmony_ci code: 'ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET', 211cb0ef41Sopenharmony_ci name: 'Error', 221cb0ef41Sopenharmony_ci message: /setupUncaughtExceptionCapture.*called while a capture callback/ 231cb0ef41Sopenharmony_ci } 241cb0ef41Sopenharmony_ci); 25