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: https://github.com/v8/node/pull/96 PR-URL: https://github.com/nodejs/node/pull/27250 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Masashi Hirano <shisama07@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
This commit is contained in:
parent
dc8b57fdc1
commit
2948e96afd
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user