mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
console: fix trace function
A recent refactoring made the slight mistake of calling `trace()` instead of `this.trace()`. PR-URL: https://github.com/nodejs/node/pull/26764 Fixes: https://github.com/nodejs/node/issues/26763 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
This commit is contained in:
1 parent
c7b34cd8ee
commit
e49cd40789
3 files changed
+16
-1
No files matched your search
@@ -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);
|
||||
},
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
require('../common');
|
||||
|
||||
console.trace('foo');
|
||||
@@ -0,0 +1,10 @@
|
||||
Trace: foo
|
||||
at Console.trace (*)
|
||||
at Object.<anonymous> (*console.js:*:*)
|
||||
at *
|
||||
at *
|
||||
at *
|
||||
at *
|
||||
at *
|
||||
at *
|
||||
at *
|
||||
Reference in new issue
Block a user