summaryrefslogtreecommitdiff
path: root/test/node-api/test_threadsafe_function/test_force_uncaught_exception.js
blob: b1f95715eadf6033f95d9051623bd87d6e7ded7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'use strict';
// Flags: --no-force-node-api-uncaught-exceptions-policy

const common = require('../../common');
const binding = require(`./build/${common.buildType}/binding`);

process.on(
  'uncaughtException',
  common.mustNotCall('uncaught callback errors should be suppressed ' +
    'with the option --no-force-node-api-uncaught-exceptions-policy'),
);

binding.CallIntoModule(
  common.mustCall(() => {
    throw new Error('callback error');
  }),
  {},
  'resource_name',
  common.mustCall(function finalizer() {
    throw new Error('finalizer error');
  }),
);