From 4b1cb418ea953a5e3389ec1a612c45471d79fd48 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 The own function's frame was removed originally. This restors that behavior. Fixes: https://github.com/nodejs/node/issues/27134 --- 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 46fd1e9c625082..61301412b595a7 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -330,13 +330,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 *