Commit Graph

2 Commits

Author SHA1 Message Date
Antoine du Hamel
036ff03691
test: reduce flakiness of test-assert-esm-cjs-message-verify
PR-URL: https://github.com/nodejs/node/pull/53967
Fixes: https://github.com/nodejs/node/issues/53962
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2024-07-21 17:34:38 +00:00
Jithil P Ponnan
25fdb48876
lib: fix assert shows diff messages in ESM and CJS
This PR addresses an issue which was caused by the design in
the ESM loader.
The ESM loader was modifying the file path and replacing the 'file'
property with the file proto in the stack trace.
This, in turn, led to unhandled exceptions when the assert module
attempted to open the file to display erroneous code.
The changes in this PR resolve this issue by handling the file path
correctly, ensuring that the remaining message formatting code can
execute as expected.

PR-URL: https://github.com/nodejs/node/pull/50634
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-11-11 14:24:56 +00:00