`require(mod)` does not keep the mod in require cache if mod throws synchronously. This fixes the tests to print the stack immediately in case that source map cache could be cleaned up when the CJS module is reclaimed by GC in the next event loop tick. PR-URL: https://github.com/nodejs/node/pull/61699 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
11 lines
201 B
JavaScript
11 lines
201 B
JavaScript
// Flags: --enable-source-maps
|
|
|
|
'use strict';
|
|
require('../../../common');
|
|
Error.stackTraceLimit = 2;
|
|
|
|
try {
|
|
require('../typescript-sourcemapping_url_string');
|
|
} catch (err) {
|
|
console.info(err);
|
|
}
|