-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assert: do not use EOL in ERR_ASSERTION messages #19221
Conversation
On Windows if an error is thrown from a script that uses `\n` to break lines - which is very common in the JavaScript ecosystem, and is the case in our own code base - then the error messages would contain mixed line feeds: the part coming from the source code breaks with `\n` while the message itself break with `\r\n`. Since we do not use `\r\n` in util.inspect(), we should use `\n` in error messages as well.
I am wondering why this does not fail on the CI but fails on my Windows 10 machine. I have EDIT: huh, I guess it's because the windows CI does not run the linter so it just converts LF in the code to CRLF and gets away with it.. |
Refs: #18967 |
Is this semver-major? |
@vsemozhetbyt this is not semver-major because it relies on a semver-major feature. I added the do not land labels. |
@joyeecheung this currently fails on the CI. When I implemented this I had the exact same issue when first using |
@nodejs/build Can we set |
Instead of setting a git config option, wouldn't it be better to add a line to |
@MSLaguana That sounds like a better idea, I'll try to figure out the necessary update to |
We should try to respect naive EOL where possible. I believe a better solution would be to mark this test explicitly for EOL normalization, adding something like this to
|
Superseded by #20754. Closing. |
On Windows if an error is thrown from a script that uses
\n
to break lines - which is very common in the JavaScript ecosystem,
and is the case in our own code base -
then the error messages would contain mixed line feeds:
the part coming from the source code breaks with
\n
while themessage itself break with
\r\n
.Since we do not use
\r\n
in util.inspect(), we should use\n
in error messages as well.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passescc @BridgeAR