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:
Ruben Bridgewater authored and Michaël Zasso committed 2019-03-27 22:16:05 +01:00
1 parent c7b34cd8ee
commit e49cd40789
3 files changed
+16 -1

No files matched your search

+1 -1
View File
@@ -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);
},
+5
View File
@@ -0,0 +1,5 @@
'use strict';
require('../common');
console.trace('foo');
+10
View File
@@ -0,0 +1,10 @@
Trace: foo
at Console.trace (*)
at Object.<anonymous> (*console.js:*:*)
at *
at *
at *
at *
at *
at *
at *