DescriptionUse WithoutPathExpansion on DictionaryValue in GN.
The normal 'Set' methods on DictionaryValue scan for '.' in the path and
assume that the '.' indexes into an inner DictionaryValue. At no point
does gn appear to desire this behavior, so call the WithoutPathExpansion
variants instead.
This is mandatory when the path is user supplied, as it may have a '.'
This change was motivated by a target named like 'x.y' which caused
gn desc config //:x.y --format=json
to produce something like
"//:x": {
"y": {
"args": [ ... ]
...
}
}
and similar issues when producing the project.json from the json ide
generator.
When the path is a constant which is known not to contain '.' there is
no behavioral change, but the extra work of scanning for the '.' is
avoided. In addition, if all uses are of the WithoutPathExpansion
variant then it becomes much less likely that similar errors will be
introduced in the future.
Committed: https://crrev.com/d51d3527da33b8f736dda1e99bcd9dc1586b366f
Cr-Commit-Position: refs/heads/master@{#421005}
Patch Set 1 #
Total comments: 1
Messages
Total messages: 15 (10 generated)
|