diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-01-05 17:37:18 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2018-01-10 11:15:49 -0800 |
commit | 834e9cda58a173b8b88fff8f1262ab30dbc45e86 (patch) | |
tree | 216263822b89be40f5af08e1415048249f706253 | |
parent | a170c18bb228a12cf0cb2d041d3c91fc99d19600 (diff) | |
download | qtlocation-mapboxgl-834e9cda58a173b8b88fff8f1262ab30dbc45e86.tar.gz |
[ios, macos] Update cross-refs to properties in doc comments
-rw-r--r-- | platform/darwin/scripts/generate-style-code.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js index 4ee86e65da..ff3f02eefe 100644 --- a/platform/darwin/scripts/generate-style-code.js +++ b/platform/darwin/scripts/generate-style-code.js @@ -27,8 +27,10 @@ _.forOwn(cocoaConventions, function (properties, kind) { delete spec[kind][oldName]; spec[kind][newName] = property; - // Update requirements in other properties. - let updateRequirements = function (property, name) { + // Update cross-references to this property in other properties' + // documentation and requirements. + let renameCrossReferences = function (property, name) { + property.doc = property.doc.replace(new RegExp('`' + oldName + '`', 'g'), '`' + newName + '`'); let requires = property.requires || []; for (let i = 0; i < requires.length; i++) { if (requires[i] === oldName) { @@ -45,8 +47,8 @@ _.forOwn(cocoaConventions, function (properties, kind) { } } }; - _.forOwn(spec[kind.replace(/^layout_/, 'paint_')], updateRequirements); - _.forOwn(spec[kind.replace(/^paint_/, 'layout_')], updateRequirements); + _.forOwn(spec[kind.replace(/^layout_/, 'paint_')], renameCrossReferences); + _.forOwn(spec[kind.replace(/^paint_/, 'layout_')], renameCrossReferences); }) }); |