Error.stackTraceLimit


Error.stackTraceLimit 属性指定堆栈跟踪收集的堆栈帧数(无论是由 new Error().stack 还是 Error.captureStackTrace(obj) 生成)。

默认值为 10,但可以设置为任何有效的 JavaScript 数值。 更改将影响值更改后捕获的任何堆栈跟踪。

如果设置为非数字值,或设置为负数,则堆栈跟踪将不会捕获任何帧。

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)).

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.