module: do not wrap module._load when tracing is not enabled · nodejs/node@8d7190b · GitHub
Skip to content

Commit 8d7190b

Browse files
joyeecheungaduh95
authored andcommitted
module: do not wrap module._load when tracing is not enabled
This prevents clobbering the stack traces with another internal frame and removes the unnecessary hoops from step-debugging. PR-URL: #61479 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
1 parent 16bab79 commit 8d7190b

15 files changed

Lines changed: 21 additions & 46 deletions

lib/internal/modules/cjs/loader.js

Lines changed: 11 additions & 5 deletions

test/fixtures/console/console.snapshot

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ Trace: foo
77
at *
88
at *
99
at *
10-
at *

test/fixtures/errors/force_colors.snapshot

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ Error: Should include grayed stack trace
1111
[90m at *[39m
1212
[90m at *[39m
1313
[90m at *[39m
14-
[90m at *[39m
1514

1615
Node.js *

test/fixtures/errors/promise_unhandled_warn_with_error.snapshot

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@
77
at *
88
at *
99
at *
10-
at *
1110
(Use `* --trace-warnings ...` to show where the warning was created)
1211
(node:*) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https:*nodejs.org*api*cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

test/fixtures/errors/unhandled_promise_trace_warnings.snapshot

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
at *
1212
at *
1313
at *
14-
at *
1514
(node:*) Error: This was rejected
1615
at *
1716
at *
@@ -21,7 +20,6 @@
2120
at *
2221
at *
2322
at *
24-
at *
2523
(node:*) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
2624
at *
2725
at *

test/fixtures/source-map/output/source_map_assert_source_line.snapshot

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
1010
*
1111
*
1212
*
13-
*
1413
generatedMessage: true,
1514
code: 'ERR_ASSERTION',
1615
actual: false,

test/message/assert_throws_stack.out

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
1717
at *
1818
at *
1919
at *
20-
at *
2120
at * {
2221
generatedMessage: true,
2322
code: 'ERR_ASSERTION',

test/message/internal_assert.out

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Please open an issue with this stack trace at https://github.com/nodejs/node/iss
1313
at *
1414
at *
1515
at *
16-
at *
1716
at * {
1817
code: 'ERR_INTERNAL_ASSERTION'
1918
}

test/message/internal_assert_fail.out

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Please open an issue with this stack trace at https://github.com/nodejs/node/iss
1414
at *
1515
at *
1616
at *
17-
at *
1817
at * {
1918
code: 'ERR_INTERNAL_ASSERTION'
2019
}

test/message/util-inspect-error-cause.out

Lines changed: 10 additions & 20 deletions

0 commit comments

Comments
 (0)