Skip to content

Commit

Permalink
fix(ios): do not create invalid swift compiler flags from symbol usage
Browse files Browse the repository at this point in the history
The symbol detection is not perfect, so this is a belt and braces approach to ensure no invalid
symbols leak through

Part of TIMOB-28510
  • Loading branch information
ewanharris committed Aug 6, 2021
1 parent 2dabc8d commit 14985f1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6641,7 +6641,12 @@ iOSBuilder.prototype.processTiSymbols = function processTiSymbols() {
if (parts.length) {
namespaces[parts[0].toLowerCase()] = 1;
while (parts.length) {
symbols[parts.join('.').replace(/\.create/gi, '').replace(/\./g, '').replace(/-/g, '_').toUpperCase()] = 1;
const value = parts.join('.').replace(/\.create/gi, '').replace(/\./g, '').replace(/-/g, '_').toUpperCase();
// Ignore any value that is not a single uppercased word, this is most likely an
// invalid detection by the babel plugin that collects the symbols used
if (/^\w+$/.test(value)) {
symbols[value] = 1;
}
parts.pop();
}
}
Expand Down

0 comments on commit 14985f1

Please sign in to comment.