{ "id": "111843", "key": "AC-2363", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-03-28T21:06:57.000+0000", "created": "2013-03-28T16:15:18.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:41:23.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "This (quite simple) project will not work with Titanium (and according to the docs at http://wiki.commonjs.org/wiki/Modules/1.1.1#Require it should, see point 3 over there):\r\n\r\n{code:javascript}\r\n// app.js\r\nvar first = require('first');\r\n{code}\r\n\r\n{code:javascript}\r\n// first.js\r\nvar first = {\r\n name: 'first'\r\n};\r\n\r\nmodule.exports = first;\r\n\r\nfirst.child = require('second');\r\n{code}\r\n\r\n{code:javascript}\r\n// second.js\r\nvar second = {\r\n name: 'second'\r\n};\r\n\r\nmodule.exports = second;\r\n\r\nsecond.child = require('first');\r\n{code}\r\n\r\nPlease fix this.", "attachment": [], "flagged": false, "summary": "require() does not properly handle circular dependencies", "creator": { "name": "herzberg", "key": "herzberg", "displayName": "Sven Herzberg", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "herzberg", "key": "herzberg", "displayName": "Sven Herzberg", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Titanium Mobile 3.0.2.GA", "comment": { "comments": [ { "id": "244540", "author": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Sven, I'm sorry but I can't seem to find where it says that this code should work for titanium. This wiki is for commonjs. Point three in this document shows:\nmath.js\n{code}\nexports.add = function() {\n var sum = 0, i = 0, args = arguments, l = args.length;\n while (i < l) {\n sum += args[i++];\n }\n return sum;\n};\n{code}\nincrement.js\n{code}\nvar add = require('math').add;\nexports.increment = function(val) {\n return add(val, 1);\n};\n{code}\nprogram.js\n{code}\nvar inc = require('increment').increment;\nvar a = 1;\ninc(a); // 2\n \nmodule.id == \"program\";\n{code}\n\nthis code will not work for Titanium as there is no UI declarations. May you please clarify?\nThank you,\nCarter", "updateAuthor": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-28T21:06:26.000+0000", "updated": "2013-03-28T21:06:26.000+0000" }, { "id": "280944", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Invalid issue. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-11-24T22:18:16.000+0000", "updated": "2013-11-24T22:18:16.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }