util: fix wrong usage of Error.prepareStackTrace · nodejs/node@2948e96 (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Commit 2948e96
authored and
committed
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#96PR-URL: #27250Reviewed-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
File tree
1 file changed
lines changed
1 file changed
lines changed
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -347,7 +347,7 @@ function isInsideNodeModules() { | ||
347 | 347 | // the perf implications should be okay. |
348 | 348 | getStructuredStack = runInNewContext(`(function() { |
349 | 349 | Error.prepareStackTrace = function(err, trace) { |
350 | - err.stack = trace; | |
350 | + return trace; | |
351 | 351 | }; |
352 | 352 | Error.stackTraceLimit = Infinity; |
353 | 353 |