Skip to content

Commit

Permalink
console: fix trace function
Browse files Browse the repository at this point in the history
A recent refactoring made the slight mistake of calling `trace()`
instead of `this.trace()`.

PR-URL: #26764
Fixes: #26763
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
  • Loading branch information
BridgeAR authored and targos committed Mar 27, 2019
1 parent c7b34cd commit e49cd40
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/console/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,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 Console.trace (*)
at Object.<anonymous> (*console.js:*:*)
at *
at *
at *
at *
at *
at *
at *

0 comments on commit e49cd40

Please sign in to comment.