Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
util: fix wrong usage of Error.prepareStackTrace
The return value of Error.prepareStackTrace will become the result
of Error.stack accesses. Setting Error.stack inside this callback
relies on the fact that the magic get accessor detects the change in
the middle of formatting, and is unnecessary in this instance.

Refs: v8#96
  • Loading branch information
szuend authored and addaleax committed Apr 16, 2019
commit 8c0fcdc5906d8e8abd8072bbe3d2a14321568752
2 changes: 1 addition & 1 deletion lib/internal/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ function isInsideNodeModules() {
// the perf implications should be okay.
getStructuredStack = runInNewContext(`(function() {
Error.prepareStackTrace = function(err, trace) {
err.stack = trace;
return trace;
};
Error.stackTraceLimit = Infinity;

Expand Down