[TIMOB-24744] iOS: Error when using ES6 arrow function
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Won't Do |
Resolution Date | 2019-07-18T14:34:44.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | ES6, titanium |
Reporter | Brenton House |
Assignee | Unknown |
Created | 2017-05-23T17:06:26.000+0000 |
Updated | 2019-07-18T14:34:44.000+0000 |
Description
When I have the following code in my controller:
// Some comments here
var toggleRight = e => {
$.rightmenu.zIndex = 500;
$.content.animate({
duration: 500,
left: 0,
});
};
I get this runtime error in iOS:
{noformat}
[ERROR] message = "Unexpected token ')'";
{noformat}
Android works as expected.
Please share a full reproducible code/project for us to test the issue. Thanks.
Steps to reproduce: 1. Create new Titanium project using CLI 2. Open
index.js
and replace the following:with this code:
3. Run the app:
appc ti build --platform ios --target simulator --log-level trace
Thanks [~cwilliams]! I've been going back and forth changing settings trying to recreate that I forgot to switch that back. I did set jscore to true and now I get this error: {noformat} [ERROR] message = "Cannot access uninitialized variable."; {noformat} (if I use 'var' instead of 'const' it works fine)
Closing per developer comments,