{ "id": "172796", "key": "TIMOB-26682", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2020-12-04T20:31:20.000+0000", "created": "2018-12-30T15:05:53.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "issuelinks": [ { "id": "59012", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "175002", "key": "TIMOB-27892", "fields": { "summary": "Android: Update toLocale*String() methods to support locale/options", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-12-04T20:31:20.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "When using the following example on Android (with ES6+ enabled), the app crashes:\r\n{code:js}\r\nconst stringVar = 'myString';\r\nconst numberVar = 1.337;\r\nconst myValue = `${stringVar}${numberVar.toFixed(2).toLocaleString()} €`;\r\n{code}\r\nError:\r\n{code}\r\n[ERROR] TiExceptionHandler: (main) [428,32694] ti:/titanium.js:146\r\n[ERROR] TiExceptionHandler: \tvalue: function(property, value) {\r\n[ERROR] TiExceptionHandler: ^\r\n[ERROR] TiExceptionHandler: RangeError: Maximum call stack size exceeded\r\n[ERROR] TiExceptionHandler: at Label.value (ti:/titanium.js:146:17)\r\n[ERROR] TiExceptionHandler: at onSummaryChanged (/alloy/controllers/trip/detail/expenses/index.js:113:34)\r\n{code}\r\nThe whole thing works fine on iOS. Please provide a workaround, thx!", "attachment": [], "flagged": false, "summary": "Android: ES6 template strings causing memory leak + crash", "creator": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "444897", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "[~hknoechel], does this definitely not happen when not using transpilation? There's nothing there that will be transpiled against that V8 version as far as I can see, I built an app with that code and am not seeing any signs. I also left an app running for 5 minutes and it didn't seem to crash for me. Is it an instant thing or a slow thing for you?\r\n\r\nIf you're sure the issue is down to template literals you could try using string concatenation {{const myValue = stringVar + numberVar.toFixed(2).toLocaleString() + ' €';}}", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2019-01-01T18:38:17.000+0000", "updated": "2019-01-01T18:38:17.000+0000" }, { "id": "452327", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "I took another look at this ticket. It doesn't seem to cause any issues on my side (using SDK 8.2.1 & CLI 7.1.1). [~hknoechel] can you confirm for me your status on this ticket? Do you still have the problem or did it go away for you?", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-10-29T09:08:00.000+0000", "updated": "2019-10-29T09:08:00.000+0000" }, { "id": "452444", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "We workarounded by writing an own native module for date formatting and haven't looked into it again. So no prio for us anymore.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-11-04T09:05:04.000+0000", "updated": "2019-11-04T09:05:04.000+0000" }, { "id": "457808", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I tested this with the newest Titanium and it doesn't crash on Android.\r\nAs of Titanium 9.1.0, we added {{toLocaleString()}} support on Android as well as other {{Intl}} related APIs. So, I think we can close this.\r\n\r\n*Side Note:*\r\nDoing a {{myNumber.toFixed(2).toLocaleString()}} won't \"localize\" the number to a string since {{toFixed()}} returns a string. You can do the following instead.\r\n{code:javascript}\r\nconst stringVar = 'myString';\r\nconst numberVar = 1.337;\r\n//const myValue = `${stringVar}${numberVar.toFixed(2).toLocaleString('de-DE')} €`;\r\nconst myValue = `${stringVar}${numberVar.toLocaleString(Ti.Locale.currentLocale, { maximumFractionDigits: 2, minimumFractionDigits: 2 })} €`;\r\n{code}\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-12-04T20:28:20.000+0000", "updated": "2020-12-04T20:28:20.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }