Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export default [
// We want to lint only a few specific fixtures folders
'test/fixtures/*',
'!test/fixtures/console',
'!test/fixtures/source-map',

This comment was marked as off-topic.

'test/fixtures/source-map/*',
'!test/fixtures/source-map/output',
'!test/fixtures/v8',
'!test/fixtures/vm',
]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ try {
require('../node_modules/error-stack/enclosing-call-site-min.js').simpleErrorStack();
} catch (e) {
console.log(e);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Error.stackTraceLimit = 5;
assert.strictEqual(typeof Error.prepareStackTrace, 'function');
const defaultPrepareStackTrace = Error.prepareStackTrace;
Error.prepareStackTrace = (error, trace) => {
trace = trace.filter(it => {
trace = trace.filter((it) => {
return it.getFunctionName() !== 'functionC';
});
return defaultPrepareStackTrace(error, trace);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
// Flags: --enable-source-maps
import '../../../common/index.mjs';
async function Throw() {
await 0;
throw new Error('message');
await 0;
throw new Error('message');
}
// eslint-disable-next-line node-core/async-iife-no-unused-result
(async function main() {
await Promise.all([0, 1, 2, Throw()]);
await Promise.all([0, 1, 2, Throw()]);
})();
// To recreate:
//
// npx --package typescript tsc --module nodenext --target esnext --outDir test/fixtures/source-map/output --sourceMap test/fixtures/source-map/output/source_map_throw_async_stack_trace.mts
//# sourceMappingURL=source_map_throw_async_stack_trace.mjs.map
// npx --package typescript tsc --module nodenext --target esnext \
// --outDir test/fixtures/source-map/output \
// --sourceMap test/fixtures/source-map/output/source_map_throw_async_stack_trace.mts
// # sourceMappingURL=source_map_throw_async_stack_trace.mjs.map
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ async function Throw() {
throw new Error('message')
}

// eslint-disable-next-line node-core/async-iife-no-unused-result
(async function main() {
await Promise.all([0, 1, 2, Throw()]);
})()

// To recreate:
//
// npx --package typescript tsc --module nodenext --target esnext --outDir test/fixtures/source-map/output --sourceMap test/fixtures/source-map/output/source_map_throw_async_stack_trace.mts
// npx --package typescript tsc --module nodenext --target esnext
// --outDir test/fixtures/source-map/output
// --sourceMap test/fixtures/source-map/output/source_map_throw_async_stack_trace.mts
12 changes: 7 additions & 5 deletions test/fixtures/source-map/output/source_map_throw_construct.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// Flags: --enable-source-maps
import '../../../common/index.mjs';
class Foo {
constructor() {
throw new Error('message');
}
constructor() {
throw new Error('message');
}
}
new Foo();
// To recreate:
//
// npx --package typescript tsc --module nodenext --target esnext --outDir test/fixtures/source-map/output --sourceMap test/fixtures/source-map/output/source_map_throw_construct.mts
//# sourceMappingURL=source_map_throw_construct.mjs.map
// npx --package typescript tsc --module nodenext --target esnext
// --outDir test/fixtures/source-map/output
// --sourceMap test/fixtures/source-map/output/source_map_throw_construct.mts
// # sourceMappingURL=source_map_throw_construct.mjs.map
Loading