Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup!
  • Loading branch information
himself65 committed Apr 22, 2020
commit 92cdf773f1cc5dbf5e9ece0eed89c60a6cf2564b
19 changes: 11 additions & 8 deletions lib/internal/process/warning.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ function onWarning(warning) {
if (warning.code)
msg += `[${warning.code}] `;
if (trace && warning.stack) {
// hide internal stack
msg += hideInternalStacks(`${warning.stack}`);
msg += `${warning.stack}`;
} else {
const toString =
typeof warning.toString === 'function' ?
Expand All @@ -91,12 +90,16 @@ function onWarning(warning) {
if (typeof warning.detail === 'string') {
msg += `\n${warning.detail}`;
}
if (!trace && !traceWarningHelperShown) {
const flag = isDeprecation ? '--trace-deprecation' : '--trace-warnings';
const argv0 = require('path').basename(process.argv0 || 'node', '.exe');
msg += `\n(Use \`${argv0} ${flag} ...\` to show where the warning ` +
'was created)';
traceWarningHelperShown = true;
if (!traceWarningHelperShown) {
if (!trace) {
const flag = isDeprecation ? '--trace-deprecation' : '--trace-warnings';
const argv0 = require('path').basename(process.argv0 || 'node', '.exe');
msg += `\n(Use \`${argv0} ${flag} ...\` to show where the warning ` +
'was created)';
traceWarningHelperShown = true;
} else {
msg = hideInternalStacks(msg);
}
}
const warningFile = lazyOption();
if (warningFile) {
Expand Down