{ "id": "103931", "key": "ALOY-346", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-11-15T22:33:41.000+0000", "created": "2012-10-25T19:40:57.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-22T13:23:14.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": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" } ], "description": "REPRODUCTION:\r\n\r\nRun the following code on either the Android emulator or iOS simulator. Tried assigning an ID to the window and using it with getView. Same effect. Code works fine with other view-controllers besides index.\r\n\r\nviews/index.xml:\r\n{code}\r\n\r\n \r\n\r\n{code}\r\n\r\ncontrollers/index.js:\r\n{code}\r\nvar foo = require('foo');\r\nfoo.fooOpen();\r\n{code}\r\n\r\nlib/foo.js:\r\n{code}\r\nvar Alloy = require('alloy');\r\n\r\nexports.fooOpen = function(e) {\r\n var win = Alloy.createController('index').getView();\r\n win.open();\r\n return;\r\n}\r\n{code}\r\n\r\nRESULTS:\r\n\r\nOn the iPhone simulator, the Console View and simulator both report:\r\n[ERROR] : \b\b \bScript Error = Maximum call stack size exceeded. at underscore.js (line 428).\r\n\r\nOn the Android emulator:\r\n\r\nOn the Console View, the following message is repeated:\r\n{code}\r\n[INFO] [2012-10-25 12:38:32,287] alloy/controllers/alloy/controllers/BaseController.js exists: false\r\n[INFO] [2012-10-25 12:38:32,300] alloy/controllers/foo.js exists: false\r\n{code}\r\n\r\nOn adb logcat | grep '^./Ti', the following message is repeated:\r\n{code}\r\nD/TiFastDev( 1154): (KrollRuntimeThread) [NN,50NNN] sent tokens successfully\r\n{code}\r\n\r\nOn the emulator, the following message is displayed:\r\nIn ti:/path.js:71,23\r\nMessage: Uncaught RangeError: Maximum call stack size exceeded\r\nSource: var path = arguments[i];\r\n", "attachment": [], "flagged": false, "summary": "Unable to use createController('index')", "creator": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Alloy v0.3.0\r\nTitanium SDK v3.0.0.v20121019153308 \r\nTitanium Studio v3.0.0.201210182149\r\niOS SDK v5.1 / Xcode 4.4.1\r\nAndroid v2.2 / API Level 8", "comment": { "comments": [ { "id": "227602", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "You are creating the index controller inside the index controller, which is creating an infinite loop, which in turn is why your call stack blows up. You can create a new \"index\" controller, you just need to do it in another controller.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-15T22:33:41.000+0000", "updated": "2012-11-15T22:33:41.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }