From 091902ae0057894d66ca925d8c4f721f86e9b6cd Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Tue, 9 Apr 2019 22:42:56 +0200 Subject: [PATCH] console: remove trace frame MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The own function's frame was removed originally. This restors that behavior. Fixes: https://github.com/nodejs/node/issues/27134 PR-URL: https://github.com/nodejs/node/pull/27159 Reviewed-By: Eugene Ostroukhov Reviewed-By: Richard Lau Reviewed-By: Michaël Zasso Reviewed-By: James M Snell Reviewed-By: Yongsheng Zhang Reviewed-By: Luigi Pinca Reviewed-By: Сковорода Никита Андреевич --- lib/internal/console/constructor.js | 4 ++-- test/message/console.out | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index d3db1ec1ae8511..f1f3c725eca25a 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -325,13 +325,13 @@ const consoleMethods = { trace(kTraceInstant, kTraceConsoleCategory, `time::${label}`, 0); }, - trace(...args) { + trace: function trace(...args) { const err = { name: 'Trace', message: this[kFormatForStderr](args) }; // eslint-disable-next-line no-restricted-syntax - Error.captureStackTrace(err, this.trace); + Error.captureStackTrace(err, trace); this.error(err.stack); }, diff --git a/test/message/console.out b/test/message/console.out index 6d6e2bd1abb5b7..57d56028663120 100644 --- a/test/message/console.out +++ b/test/message/console.out @@ -1,5 +1,4 @@ Trace: foo - at Object.trace (*) at Object. (*console.js:*:*) at * at *