Use 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.

Review-Url: https://codereview.chromium.org/2363193002
Cr-Original-Commit-Position: refs/heads/master@{#421005}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d51d3527da33b8f736dda1e99bcd9dc1586b366f
4 files changed
tree: 91155a0671650f86859de0e72e7fb9a2febb2409
  1. tools/