Skip to content

Commit e49cd40

Browse files
BridgeARtargos
authored andcommitted
console: fix trace function
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]>
1 parent c7b34cd commit e49cd40

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

Diff for: lib/internal/console/constructor.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ const consoleMethods = {
330330
name: 'Trace',
331331
message: this[kFormatForStderr](args)
332332
};
333-
Error.captureStackTrace(err, trace);
333+
Error.captureStackTrace(err, this.trace);
334334
this.error(err.stack);
335335
},
336336

Diff for: test/message/console.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict';
2+
3+
require('../common');
4+
5+
console.trace('foo');

Diff for: test/message/console.out

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Trace: foo
2+
at Console.trace (*)
3+
at Object.<anonymous> (*console.js:*:*)
4+
at *
5+
at *
6+
at *
7+
at *
8+
at *
9+
at *
10+
at *

0 commit comments

Comments
 (0)