summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Zünd <szuend@chromium.org>2019-04-16 08:55:44 +0200
committerAnna Henningsen <anna@addaleax.net>2019-04-18 13:04:50 +0200
commit2948e96afd7fde91ec39bb5434bad93760ccfe13 (patch)
tree3659f6d538804f272bb80955b4d490e5e1021489
parentdc8b57fdc191dca0de4597b67f3f7d2a3def95d3 (diff)
downloadandroid-node-v8-2948e96afd7fde91ec39bb5434bad93760ccfe13.tar.gz
android-node-v8-2948e96afd7fde91ec39bb5434bad93760ccfe13.tar.bz2
android-node-v8-2948e96afd7fde91ec39bb5434bad93760ccfe13.zip
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>
-rw-r--r--lib/internal/util.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/util.js b/lib/internal/util.js
index 82c42e2772..14c8baa68c 100644
--- a/lib/internal/util.js
+++ b/lib/internal/util.js
@@ -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;