Description
_There are probably other cases that cause this, like comments_
If a string starts with
Ti
or
Titanium
then it will be detected as Titanium API usage and be inserted into the TI_SYMBOL_MACROS definition. This will then cause a compile error like below if the string is not compatible"
[TRACE] error: conditional compilation flags must be valid Swift identifiers (rather than 'ISSUE?')
[TRACE] error: conditional compilation flags must be valid Swift identifiers (rather than 'ISSUE?TOUPPERCASE')
I think this fix will have two parts:
* Firstly, improve the detection of API usage in the babel plugin we use
* Secondly, when mapping the symbols, reject any that do not match the format we expect
const win = Ti.UI.createWindow();
win.add(Ti.UI.createLabel({
text: 'Ti In A String Causes Issues?'.toUpperCase()
}));
win.open();
Steps to reproduce
1. Add the above code to an existing app
2. Build for
-p ios -T dist-appstore
Actual
Compile error
Expected
No compile error
Note: "Ti In A String Causes Issues?" isn't an issue, but "Ti In A String Causes Issues?".toUpperCase() is This can also be reproduced by building ks-v2 to device
node-titanium-sdk PR: https://github.com/appcelerator/node-titanium-sdk/pull/451
titanium_mobile PR: https://github.com/appcelerator/titanium_mobile/pull/12985
Merged to master and 10_0_X