[lexical-mark] Bug Fix: reverse ternary in MarkNode.addID #7020
+1
−1
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.
Description
Ternary logic introduced in 7c21d4f#diff-b30867251dac89bfc41aba98899f9ca7e6b1045cc8bcfbcc9e9824caaf53d695R112-R122 is the wrong way around. Trying to add a new ID is a no-op, and adding an existing ID duplicates it.
Test plan
I have the following test code to replace IDs:
Which produces the following on 0.23.0:
That last line should be
[ '57404623-3ae5-5cfa-812f-762e507a69ae' ]
. To further confirm, I changed the code to just callnode.addID(id)
(i.e. the old ID), which then prints: