8000 console: fix trace function by BridgeAR · Pull Request #26764 · nodejs/node · GitHub
[go: up one dir, main page]

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/internal/console/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ const consoleMethods = {
name: 'Trace',
message: this[kFormatForStderr](args)
};
Error.captureStackTrace(err, trace);
Error.captureStackTrace(err, this.trace);
this.error(err.stack);
},

Expand Down
5 changes: 5 additions & 0 deletions test/message/console.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

require('../common');

console.trace('foo');
10 changes: 10 additions & 0 deletions test/message/console.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Trace: foo
at Object.trace (*)
at Object.<anonymous> (*console.js:*:*)
at *
at *
at *
at *
at *
at *
at *
0