Error.stackTraceLimit
Error.stackTraceLimit 属性指定堆栈跟踪收集的堆栈帧数量(无论是由 new Error().stack 生成,还是由 Error.captureStackTrace(obj) 生成)。
🌐 The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).
默认值是 10,但可以设置为任何有效的 JavaScript 数字。更改后会影响所有在值更改后捕获的堆栈跟踪。
🌐 The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured after the value has been changed.
如果设置为非数字值,或设置为负数,堆栈跟踪将不会捕获任何帧。
🌐 If set to a non-number value, or set to a negative number, stack traces will not capture any frames.