Skip to content

Commit

Permalink
console: remove trace frame
Browse files Browse the repository at this point in the history
The own function's frame was removed originally. This restors that
behavior.

Fixes: nodejs#27134
  • Loading branch information
BridgeAR committed Apr 9, 2019
1 parent bf766c1 commit 4b1cb41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/internal/console/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},

Expand Down
1 change: 0 additions & 1 deletion test/message/console.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Trace: foo
at Object.trace (*)
at Object.<anonymous> (*console.js:*:*)
at *
at *
Expand Down

0 comments on commit 4b1cb41

Please sign in to comment.