Error.stackTraceLimit


Error.stackTraceLimit 属性指定了堆栈跟踪收集的栈帧数量(无论是 new Error().stackError.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.