const process = require(
'process'
);
function
to_be_called(ex) {
console.log(ex);
}
if
(process.hasUncaughtExceptionCaptureCallback()) {
console.log(
"a callback has been set using "
+
"process.setUncaughtExceptionCaptureCallback() method"
);
}
else
{
console.log(
"no callback has been set using "
+
"process.setUncaughtExceptionCaptureCallback() method"
);
}
if
(process.setUncaughtExceptionCaptureCallback) {
process.setUncaughtExceptionCaptureCallback(to_be_called);
}
else
{
console.log(
"process.setUncaughtExceptionCaptureCallback() "
+
"method is not defined!"
);
}
if
(process.hasUncaughtExceptionCaptureCallback()) {
console.log(
"a callback has been set using "
+
"process.setUncaughtExceptionCaptureCallback() method"
);
}
else
{
console.log(
"no callback has been set using "
+
"process.setUncaughtExceptionCaptureCallback() method"
);
}
if
(process.setUncaughtExceptionCaptureCallback) {
process.setUncaughtExceptionCaptureCallback(
null
);
}
else
{
console.log(
"process.setUncaughtExceptionCaptureCallback() "
+
" method is not defined!"
);
}
if
(process.hasUncaughtExceptionCaptureCallback()) {
console.log(
"a callback has been set using "
+
"process.setUncaughtExceptionCaptureCallback() method"
);
}
else
{
console.log(
"no callback has been set using "
+
"process.setUncaughtExceptionCaptureCallback() method"
);
}