{ "id": "81117", "key": "TIMOB-5434", "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": "12082", "description": "", "name": "Sprint 2011-42", "archived": true, "released": true, "releaseDate": "2011-10-24" }, { "id": "12470", "description": "", "name": "Release 1.7.4", "archived": true, "released": true, "releaseDate": "2011-10-31" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-01-09T13:48:17.000+0000", "created": "2011-10-04T18:26:18.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "module_module", "qe-testadded" ], "versions": [ { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "issuelinks": [ { "id": "22238", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "103569", "key": "TIMOB-11525", "fields": { "summary": "Android: Relative path for Window URL does not work on 3_0_X", "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": "High", "id": "2" }, "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } } ], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2012-10-24T21:04:40.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": "If an app has a second (or third, or fourth...) Javascript execution context (via a window being opened with a {{url}} property), a {{require()}} statement anywhere in that context will break any {{include()}} statements below it.\r\n\r\nReproduction of the failcase (and test of the fix):\r\n\r\nIn a new app use this app.js:\r\n\r\n{code:title=app.js}\r\nTi.UI.createWindow({\r\n\turl: \"win.js\", // causes new JS context\r\n\tbackgroundColor: \"#000\",\r\n\texitOnClose: true\r\n}).open();\r\n{code}\r\n\r\nAnd this win.js:\r\n\r\n{code:title=win.js}\r\nrequire(\"module\"); // Don't need return value, just important that this runs.\r\nTi.include(\"included.js\");\r\nalert(\"The included word is \" + includedWord);\r\n{code}\r\n\r\nAnd this module.js:\r\n\r\n{code:title=module.js}\r\nexports.x = function() {}; //not important\r\n{code}\r\n\r\nAnd this included.js:\r\n\r\n{code:title=included.js}\r\nvar includedWord = \"test\";\r\n{code}\r\n\r\nWhen you run that, you'll get an error in the failcase, saying that {{includedWord}} is not defined.\r\n\r\nWhen testing the fix, you should see an alert dialog telling you \"The included word is test\".", "attachment": [], "flagged": false, "summary": "Android: require() in a non-root context breaks any include() statements below it.", "creator": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Titanium 1.8.0 cf539b51e or before, any desktop platform, any Android platform", "comment": { "comments": [ { "id": "167970", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "Pull request ready:\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/526", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-10-04T19:05:21.000+0000", "updated": "2011-10-04T19:05:21.000+0000" }, { "id": "168188", "author": { "name": "avaghti", "key": "avaghti", "displayName": "Alan Vaghti", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing.\n\nPassed as expected on Nexus One running 2.2.2 with SDK 1.8.0.v20111006001414.", "updateAuthor": { "name": "avaghti", "key": "avaghti", "displayName": "Alan Vaghti", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-06T16:32:44.000+0000", "updated": "2011-10-06T16:32:44.000+0000" }, { "id": "170126", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "Re-opening b/c will need to be re-tested with changes coming for TIMOB-5748", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-10-21T15:41:06.000+0000", "updated": "2011-10-21T15:41:06.000+0000" }, { "id": "170147", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "New pull request ready:\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/578", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-10-21T21:39:27.000+0000", "updated": "2011-10-21T21:39:27.000+0000" }, { "id": "172295", "author": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This problem is still occurring for me on 1.7.x (both 1.7.5 and the current 1.7.6 build as of Nov 10, 2011).\r\n\r\nI am including event handlers into a CommonJS module via Ti.include, but they're not showing up at runtime.", "updateAuthor": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-11T08:23:02.000+0000", "updated": "2011-11-11T08:23:02.000+0000" }, { "id": "172299", "author": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I take that back. The events get included. However, the included events refer to functions in the main (CommonJS) file, but it can't see them. I get an error \"Cannot find function xxxx in object [object Object]\".", "updateAuthor": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-11T08:27:42.000+0000", "updated": "2011-11-11T08:27:42.000+0000" }, { "id": "175085", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 1.8.0.1.v20111205164258 v8/rhino on\r\nGalaxy 10.1 (3.1)\r\nDroid 1 (2.2.2)\r\nNexus S (2.3.6)\r\nEmulator (4.0)", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-06T15:53:56.000+0000", "updated": "2011-12-06T15:53:56.000+0000" }, { "id": "178561", "author": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Added label: qe-testadded.", "updateAuthor": { "name": "dhyde", "key": "dhyde", "displayName": "Dustin Hyde", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-09T13:47:51.000+0000", "updated": "2012-01-09T13:47:51.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }