Skip to content

Commit 091902a

Browse files
BridgeARZYSzys
authored andcommitted
console: remove trace frame
The own function's frame was removed originally. This restors that behavior. Fixes: #27134 PR-URL: #27159 Reviewed-By: Eugene Ostroukhov <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]>
1 parent 908292c commit 091902a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/internal/console/constructor.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,13 @@ const consoleMethods = {
325325
trace(kTraceInstant, kTraceConsoleCategory, `time::${label}`, 0);
326326
},
327327

328-
trace(...args) {
328+
trace: function trace(...args) {
329329
const err = {
330330
name: 'Trace',
331331
message: this[kFormatForStderr](args)
332332
};
333333
// eslint-disable-next-line no-restricted-syntax
334-
Error.captureStackTrace(err, this.trace);
334+
Error.captureStackTrace(err, trace);
335335
this.error(err.stack);
336336
},
337337

test/message/console.out

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
Trace: foo
2-
at Object.trace (*)
32
at Object.<anonymous> (*console.js:*:*)
43
at *
54
at *

0 commit comments

Comments
 (0)