{ "id": "125363", "key": "ALOY-938", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "15758", "description": "Alloy 1.4.0", "name": "Alloy 1.4.0", "archived": false, "released": true, "releaseDate": "2014-07-17" }, { "id": "15903", "description": "2014 Sprint 07", "name": "2014 Sprint 07", "archived": true, "released": true, "releaseDate": "2014-04-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-11-26T21:59:42.000+0000", "created": "2014-01-24T15:35:27.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "alloy", "compiler", "conditions", "qe-manualtest" ], "versions": [ { "id": "15403", "description": "Alloy 1.3.0", "name": "Alloy 1.3.0", "archived": false, "released": true, "releaseDate": "2013-12-20" } ], "issuelinks": [], "assignee": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "updated": "2014-11-26T21:59:42.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": "13603", "name": "Styling", "description": "TSS, dynamic styling, styling API" } ], "description": "I have a complex project where the I saw a lot of inefficient and unlogical {{_.extend()}} calls in the controller.\r\n\r\nI brought it down to this test case:\r\n\r\n1. Create a default Alloy project.\r\n2. Create a {{styles/app.tss}}.\r\n3. In both {{styles/index.tss}} and {{styles/app.tss}} use:\r\n\r\n {code}\r\n \"Window[formFactor=handheld]\": {\r\n title: \"Window handheld\"\r\n }\r\n {code}\r\n\r\n4. Compile the project and see similar code like the following:\r\n\r\n {code}\r\n $.__views.id = Ti.UI.createWindow(function() {\r\n var o = {};\r\n _.extend(o, {});\r\n Alloy.isHandheld && _.extend(o, {\r\n title: \"Window handheld\"\r\n });\r\n _.extend(o, {});\r\n Alloy.isHandheld && _.extend(o, {\r\n title: \"Window handheld\"\r\n });\r\n _.extend(o, {\r\n id: \"id\"\r\n });\r\n return o;\r\n }());\r\n {code}\r\n\r\nThe empty {{_.extend(o, {});}} and the identical {{isHandheld}} lines should not be there.", "attachment": [], "flagged": false, "summary": "Using conditional TSS results in unexpected _.extend() calls", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "Alloy 1.3.0", "comment": { "comments": [ { "id": "299807", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "PR https://github.com/appcelerator/alloy/pull/357\n\nFunctional test: Follow the steps described in ticket description. There should be no extra extend(o, {}) statements now.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-04-03T21:49:58.000+0000", "updated": "2014-04-03T21:49:58.000+0000" }, { "id": "304541", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Tested as above described, there is no empty _.extend(o, {}); and identical isHandheld in the controller after building the app.\r\n\r\nVerified the fix on:\r\nDevice : iPhone 5s , iOS version : 7.1\r\nSDK: 3.3.0.v20140512162513\r\nCLI version : 3.3.0-dev\r\nOS : MAC OSX 10.9.2\r\nAlloy: 1.4.0-dev\r\nACS: 1.0.14\r\nnpm:1.3.2\r\nLiveView: 1.0.4\r\nAppcelerator Studio, build: 3.3.0.201405121247\r\ntitanium-code-processor: 1.1.1\r\nXCode : 5.1.1", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-05-13T07:46:27.000+0000", "updated": "2014-05-13T07:46:27.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }