mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
65fbc95949
Previously, --trace-exit and --trace-sync-io doesn't take care of --stack-trace-limit and always print a stack trace with maximum size of 10. This patch parses --stack-trace-limit during initialization and use the value in --trace-* flags. PR-URL: https://github.com/nodejs/node/pull/55121 Fixes: https://github.com/nodejs/node/issues/55100 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
16 lines
247 B
JavaScript
16 lines
247 B
JavaScript
'use strict';
|
|
|
|
// This is meant to be run with --trace-exit.
|
|
|
|
const depth = parseInt(process.env.STACK_DEPTH) || 30;
|
|
let counter = 1;
|
|
function recurse() {
|
|
if (counter++ < depth) {
|
|
recurse();
|
|
} else {
|
|
process.exit(0);
|
|
}
|
|
}
|
|
|
|
recurse();
|