{ "id": "105984", "key": "TIMOB-11961", "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": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "14700", "description": "2012 Sprint 25", "name": "2012 Sprint 25", "archived": true, "released": true, "releaseDate": "2012-12-17" }, { "id": "14785", "description": "2012 Sprint 25 JS", "name": "2012 Sprint 25 JS", "archived": true, "released": true, "releaseDate": "2012-12-17" }, { "id": "15703", "description": "2013 Sprint 22", "name": "2013 Sprint 22", "archived": true, "released": true, "releaseDate": "2013-11-01" }, { "id": "15705", "description": "2013 Sprint 22 Core", "name": "2013 Sprint 22 Core", "archived": true, "released": true, "releaseDate": "2013-11-01" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-11-01T06:09:49.000+0000", "created": "2012-12-05T07:30:50.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "3.0.0.rc2", "module_titanium", "qe-ios100112", "qe-testadded", "regression" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2014-02-12T08:20:49.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": "13103", "name": "CLI", "description": "Node-based command line interface" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Error on assigning app id to the instance of Titanium.Facebook\r\nThis is regression since the issue does not occur on 2.1.4 GA and below.\r\n\r\nSteps to reproduce:\r\n1. Create an app using the code below.\r\n{code}\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\nvar facebook = Titanium.Facebook;\r\n\tfacebook.appid = \"495338853813822\";\t\r\n\r\nvar fb = facebook.createLoginButton();\r\n\tfb.width = 80;\r\n\tfb.height = 20;\r\n\tfb.top = 370;\r\nwin1.add(fb);\r\nwin1.open();\r\n{code}\r\n2. Launch the app.\r\n\r\nActual:\r\nThe error is thrown as below:\r\n 'undefined' is not an object (evaluating 'facebook.appid=\"495338853813822\"') at app.js (line 1).\r\n \r\nExpected:\r\nThe app should work normally.\r\n\r\nBut if the following code is used instead of above code, no error is thrown and the code works normally.\r\n\r\n{code}\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\n\tTitanium.Facebook.appid = \"495338853813822\";\r\n\t\r\n\r\nvar fb = Titanium.Facebook.createLoginButton();\r\n\tfb.width = 80;\r\n\tfb.height = 20;\r\n\tfb.top = 370;\r\nwin1.add(fb);\r\n\r\nwin1.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "CLI: iOS: Facebook - Error on assigning app id to the instance of Titanium.Facebook", "creator": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK: 3.0.0.v20121204181658\r\nStudio: 3.0.0.201211301903\r\nDevice: Iphone4s(v 5.1), iPad3(v 6.0)\r\nOS: OSX 10.8", "comment": { "comments": [ { "id": "230160", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Talked with emerriman, he was able to reproduce this while I wasn't, because I have the CLI disabled. When the issue was happening, #define USE_TI_FACEBOOK was missing from defines.h\n\nIn latter tests, having Titanium.Facebook.createLoginButton, even on an unused line, was sufficient for CLI to add the define. I'm guessing that the search is of \"Ti\\.[A-Za-z]+\\.\", using a period as part of the search, instead of allowing whitespace or semicolon to be terminators.\n\nThis is a CLI issue, so directing to Cbarber.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-06T00:30:19.000+0000", "updated": "2012-12-06T00:30:19.000+0000" }, { "id": "230242", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Moved to JS sprint", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-12-06T18:14:56.000+0000", "updated": "2012-12-06T18:14:56.000+0000" }, { "id": "230374", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "FWIW, the new CLI's iOS build command does not use fragile regular expressions. I load each and every JavaScript file into the AST parser, then walk the AST tree to find all Titanium instances. It's not bulletproof, but it's a million times better than what was there in the old builder.py.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2012-12-07T07:48:13.000+0000", "updated": "2012-12-07T07:48:13.000+0000" }, { "id": "230375", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Master pull request: https://github.com/appcelerator/titanium_mobile/pull/3553\n3.0.x pull request: https://github.com/appcelerator/titanium_mobile/pull/3554", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2012-12-07T07:49:57.000+0000", "updated": "2012-12-07T07:49:57.000+0000" }, { "id": "230500", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed with:\nSDK: 3.0.0.v20121207120202\nTitanium Studio, build: 3.0.0.201212061921\nMac OS X 10.8.2\nXcode 4.5.2\nCLI: 3.0.20\n", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-07T23:52:27.000+0000", "updated": "2012-12-07T23:52:27.000+0000" }, { "id": "263141", "author": { "name": "prastogi", "key": "prastogi", "displayName": "Pragya Rastogi", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Issue is still reproducible using:\r\nOSX: 10.8.4\r\nXcode:4.5\r\nAppcelerator Studio, build: 3.1.2.201307232148\r\nSDK:3.1.2.v20130723170106\r\n\r\nError also appears while using workaround code provided in test steps by Anshu:\r\n\r\n\r\n[INFO] : Application started\r\n[ERROR] : Script Error {\r\n[INFO] : TIMOB-11961/1.0 (3.1.2.v20130723170106.3bb836f)\r\n[ERROR] : backtrace = \"#0 () at :0\";\r\n[ERROR] : line = 18;\r\n[ERROR] : message = \"'undefined' is not an object (evaluating 'Titanium.Facebook.appid = \\\"495338853813822\\\"')\";\r\n[ERROR] : name = TypeError;\r\n[ERROR] : sourceId = 296909216;\r\n[ERROR] : sourceURL = \"file://localhost/Users/pragya.rastogi/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/401C973E-BE4D-4862-AF73-399CE2CC6AEE/TIMOB-11961.app/app.js\";\r\n[ERROR] : }\r\n", "updateAuthor": { "name": "prastogi", "key": "prastogi", "displayName": "Pragya Rastogi", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-07-25T10:49:31.000+0000", "updated": "2013-07-25T10:49:31.000+0000" }, { "id": "277623", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "You need to add this to the tiapp.xml:\n\n{code}\n\n facebook\n\n{code}", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2013-11-01T06:09:20.000+0000", "updated": "2013-11-01T06:09:20.000+0000" }, { "id": "279509", "author": { "name": "prastogi", "key": "prastogi", "displayName": "Pragya Rastogi", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Tested and Verified the fix with:\r\nOSX: 10.8.5\r\nXcode:5.0\r\nAppcelerator Studio: 3.2.0.201311122338\r\nSDK: 3.2.0.v20131113183932\r\nacs:1.0.7\r\nalloy:1.3.0\r\nnpm:1.3.2\r\ntitanium:3.2.0\r\ntitanium-code-processo:1.0.3\r\nDevice: iOS7(v7.0.3)-iPodTouch1\r\nSimulator- iPhone Retina(3.5-inch) iOS 7.0\r\n\r\nTest Code Used:\r\napp.js\r\n{code}\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\n\r\nvar facebook = require('facebook');\r\nfacebook.appid = \"495338853813822\";\r\n \r\nvar fb = facebook.createLoginButton();\r\n fb.width = 80;\r\n fb.height = 20;\r\n fb.top = 370;\r\n \r\nwin1.add(fb);\r\nwin1.open();\r\n{code}\r\n\r\ntiapp.xml\r\n{code}\r\n \r\n \r\n facebook\r\n facebook\r\n\r\n{code}", "updateAuthor": { "name": "prastogi", "key": "prastogi", "displayName": "Pragya Rastogi", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-11-14T06:44:03.000+0000", "updated": "2013-11-14T06:44:03.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }