mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
307c67be17
napi_async_context should be an opaque type and not be used as same as node::async_context. PR-URL: https://github.com/nodejs/node/pull/32928 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
18 lines
448 B
JavaScript
18 lines
448 B
JavaScript
'use strict';
|
|
|
|
const common = require('../../common');
|
|
const assert = require('assert');
|
|
const { runInCallbackScope } = require(`./build/${common.buildType}/binding`);
|
|
|
|
assert.strictEqual(runInCallbackScope({}, 'test-resource', () => 42), 42);
|
|
|
|
{
|
|
process.once('uncaughtException', common.mustCall((err) => {
|
|
assert.strictEqual(err.message, 'foo');
|
|
}));
|
|
|
|
runInCallbackScope({}, 'test-resource', () => {
|
|
throw new Error('foo');
|
|
});
|
|
}
|