summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2018-01-05 17:37:18 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-01-10 11:15:49 -0800
commit834e9cda58a173b8b88fff8f1262ab30dbc45e86 (patch)
tree216263822b89be40f5af08e1415048249f706253
parenta170c18bb228a12cf0cb2d041d3c91fc99d19600 (diff)
downloadqtlocation-mapboxgl-834e9cda58a173b8b88fff8f1262ab30dbc45e86.tar.gz
[ios, macos] Update cross-refs to properties in doc comments
-rw-r--r--platform/darwin/scripts/generate-style-code.js10
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);
})
});