Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
The first line of the trace, instead of being prefixed with ErrorType: message, will be the result of calling targetObject.toString().
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace. The constructorOpt argument is useful for hiding implementation details of error generation from an end user.
Error.captureStackTrace(targetObject[, constructorOpt])
Error.stackTraceLimit
Error Singleton