node/test/message/source_map_disabled_by_api.js
Geoffrey Booth d6e626d54c
test: remove cjs loader from stack traces
PR-URL: https://github.com/nodejs/node/pull/44197
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2022-08-14 21:59:02 +00:00

26 lines
490 B
JavaScript

// Flags: --enable-source-maps
'use strict';
require('../common');
Error.stackTraceLimit = 5;
process.setSourceMapsEnabled(false);
try {
require('../fixtures/source-map/enclosing-call-site-min.js');
} catch (e) {
console.log(e);
}
delete require.cache[require
.resolve('../fixtures/source-map/enclosing-call-site-min.js')];
// Re-enable.
process.setSourceMapsEnabled(true);
try {
require('../fixtures/source-map/enclosing-call-site-min.js');
} catch (e) {
console.log(e);
}