Skip to content

Conversation

BridgeAR
Copy link
Member

My take of #19221. @joyeecheung please feel free to close this PR and just update yours.

I cite @joyeecheung:

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.
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@BridgeAR BridgeAR requested a review from joyeecheung May 15, 2018 20:04
@nodejs-github-bot nodejs-github-bot added the assert Issues and PRs related to the assert subsystem. label May 15, 2018
@BridgeAR
Copy link
Member Author

.slice(args[0].start, args[args.length - 1].end)
.replace(escapeSequencesRegExp, escapeFn);
if (EOL === '\r\n') {
message = message.replace(/\r\n/g, '\n');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I am just bikeshedding, but what if the user deliberately put \r\n in their custom messages?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message is not a user message. It is the code that is read and parsed from the file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BridgeAR Oh, didn't look at this close enough, sorry. In that case it should probably be fine.

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 16, 2018
BridgeAR added a commit to BridgeAR/node that referenced this pull request May 18, 2018
PR-URL: nodejs#20754
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@BridgeAR
Copy link
Member Author

Landed in 2c42999

@BridgeAR BridgeAR closed this May 18, 2018
MylesBorins pushed a commit that referenced this pull request May 22, 2018
PR-URL: #20754
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@addaleax addaleax mentioned this pull request May 22, 2018
@BridgeAR BridgeAR deleted the fix-assert-eol branch January 20, 2020 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

assert Issues and PRs related to the assert subsystem. author ready PRs that have at least one approval, no pending requests for changes, and a CI started.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants