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>
24 lines
617 B
JavaScript
24 lines
617 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const vm = require('vm');
|
|
// Make this test OS-independent by overriding stdio getColorDepth().
|
|
process.stdout.getColorDepth = () => 8;
|
|
process.stderr.getColorDepth = () => 8;
|
|
Error.stackTraceLimit = Infinity;
|
|
|
|
console.log({ foo: 'bar' });
|
|
console.log('%s q', 'string');
|
|
console.log('%o with object format param', { foo: 'bar' });
|
|
|
|
console.log(
|
|
new Error('test\n at abc (../fixtures/node_modules/bar.js:4:4)\nfoobar'),
|
|
);
|
|
|
|
try {
|
|
require('../fixtures/node_modules/node_modules/bar.js');
|
|
} catch (err) {
|
|
console.log(err);
|
|
}
|
|
|
|
vm.runInThisContext('console.log(new Error())');
|