diff options
Diffstat (limited to 'lib/internal/assert/assertion_error.js')
-rw-r--r-- | lib/internal/assert/assertion_error.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/internal/assert/assertion_error.js b/lib/internal/assert/assertion_error.js index c8edf13eca..7c9bace378 100644 --- a/lib/internal/assert/assertion_error.js +++ b/lib/internal/assert/assertion_error.js @@ -300,6 +300,9 @@ class AssertionError extends Error { stackStartFn } = options; + const limit = Error.stackTraceLimit; + Error.stackTraceLimit = 0; + if (message != null) { super(String(message)); } else { @@ -387,6 +390,8 @@ class AssertionError extends Error { } } + Error.stackTraceLimit = limit; + this.generatedMessage = !message; Object.defineProperty(this, 'name', { value: 'AssertionError [ERR_ASSERTION]', |