mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
938e11882b
Partition test/addons-napi into test/js-native-api and test/node-api to isolate the Node.js-agnostic portion of the N-API tests from the Node.js-specific portion. PR-URL: https://github.com/nodejs/node/pull/24557 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
18 lines
426 B
JavaScript
18 lines
426 B
JavaScript
'use strict';
|
|
|
|
const common = require('../../common');
|
|
const assert = require('assert');
|
|
const { runInCallbackScope } = require(`./build/${common.buildType}/binding`);
|
|
|
|
assert.strictEqual(runInCallbackScope({}, 0, 0, () => 42), 42);
|
|
|
|
{
|
|
process.once('uncaughtException', common.mustCall((err) => {
|
|
assert.strictEqual(err.message, 'foo');
|
|
}));
|
|
|
|
runInCallbackScope({}, 0, 0, () => {
|
|
throw new Error('foo');
|
|
});
|
|
}
|