doc: include stack trace difference in ES modules

This change highlights in the docs difference between stack traces for
CommonJS modules and ES Modules.

Fixes: https://github.com/nodejs/node/issues/39787

PR-URL: https://github.com/nodejs/node/pull/41157
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Marcos Bérgamo authored and Danielle Adams committed 2022-01-31 23:54:09 -05:00
1 parent 2c7f17c72c
commit 9eb8233bf6
1 file changed
+4 -1
+4 -1
View File
@@ -344,7 +344,10 @@ The location information will be one of:
* `plain-filename.js:line:column`, if the frame represents a call internal
to Node.js.
* `/absolute/path/to/file.js:line:column`, if the frame represents a call in
a user program, or its dependencies.
a user program (using CommonJS module system), or its dependencies.
* `<transport-protocol>:///url/to/module/file.mjs:line:column`, if the frame
represents a call in a user program (using ES module system), or
its dependencies.
The string representing the stack trace is lazily generated when the
`error.stack` property is **accessed**.