mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
fbdfe9399c
This commit adds a tracing channel for module loading through `import()` and `require()`. Co-Authored-By: Stephen Belanger <admin@stephenbelanger.com> PR-URL: https://github.com/nodejs/node/pull/44340 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
31 lines
763 B
JavaScript
31 lines
763 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
Error.stackTraceLimit = Infinity;
|
|
|
|
(function foobar() {
|
|
require('domain');
|
|
})();
|
|
|
|
assert.throws(
|
|
() => process.setUncaughtExceptionCaptureCallback(common.mustNotCall()),
|
|
(err) => {
|
|
common.expectsError(
|
|
{
|
|
code: 'ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE',
|
|
name: 'Error',
|
|
message: /^The `domain` module is in use, which is mutually/
|
|
}
|
|
)(err);
|
|
|
|
assert(err.stack.includes('-'.repeat(40)),
|
|
`expected ${err.stack} to contain dashes`);
|
|
|
|
const location = `at foobar (${__filename}:`;
|
|
assert(err.stack.includes(location),
|
|
`expected ${err.stack} to contain ${location}`);
|
|
return true;
|
|
}
|
|
);
|