Repository navigation
fix: keep a literal % in logpoint messages that interpolate nothing - #2445
Merged
Connor Peet (connor4312) merged 1 commit intoOct 31, 2026
Merged
Connor Peet (connor4312) merged 1 commit into
Connor Peet (connor4312) merged 1 commit into
Conversation
Connor Peet (connor4312)
enabled auto-merge (squash)
October 29, 2026 18:57
Dmitriy Vasyura (dmitrivMS)
approved these changes
Oct 30, 2026
Alexandru Dima (alexdima)
approved these changes
Oct 31, 2026
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A logpoint message with a literal
%and no{expression}shows every%doubled in the Debug Console.50% donelogs50%% done, while{1} 50% donelogs1 50% done. The compiler escapes%because the message becomes aconsole.logformat string, but format specifiers are only applied when there is more than one argument, so with nothing interpolated the escape is never undone.This uses the escaped format string only when at least one expression was interpolated, and passes the message through unchanged otherwise.
npm run test:unit -- --grep logMessageToExpression. The two new cases fail on main (console.log("50%% done, 100%%")) and pass with the change. The existingescapingcase still covers the interpolated path.npm run test:unit, no new failures (the 8 NodeBinaryProvider failures also happen on main).npm run test:types,dprint checkandeslint --max-warnings=0on the touched files are clean.