{ "id": "62836", "key": "TIMOB-2204", "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": "11227", "name": "Release 1.5.0 M02", "archived": true, "released": true, "releaseDate": "2010-11-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:58:24.000+0000", "created": "2011-04-15T03:13:26.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "android_refactor", "date", "defect", "javascript", "refactor", "regression" ], "versions": [], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:58:24.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": "{html}
Seems to have happened recently. Here's a small test case. This\nsame code works under 1.4.1 fine and iPhone fine:
\n\nvar testDate = new Date();\nvar dateObj = {bla:\"foo\", testDateObj:testDate};\nvar noDateObj = {bla:\"foo\"};\n\nvar row = Ti.UI.createTableViewRow({\n _dateObj: dateObj,\n _noDateObj: noDateObj,\n _testDate: testDate\n});\n\nTi.API.info(\"works: \" + row._noDateObj.bla);\nTi.API.info(\"fails: \" + row._dateObj.bla); //Constructor for \"Date\" not found\nTi.API.info(\"fails: \" + row._dateObj.testDateObj);\nTi.API.info(\"fails: \" + row._testDate);\n\n//Also, may be of interest:\n//Ti.API.info(\"1: \" + row._noDateObj); //\"cannot find default value for object\" ...is that what should happen?\n//Ti.API.info(\"2: \" + row._dateObj); //\"cannot find default value for object\" as well
\n
One thing to note: Simple types like string and int work fine.\nMore complex objects like Date seem to be the problem here.
It appears this bug may even affect things like accessing\n\"label.font.fontSize\" as well...
\n\norg.appcelerator.titanium.kroll.KrollCallback@45404e50], message: TypeError: Cannot read property \"fontSize\" from undefined (file:///android_asset/Resources/shared.js#733)\n[TRACE] E/KrollCallback( 1009): org.mozilla.javascript.EcmaError: TypeError: Cannot read property \"fontSize\" from undefined (file:///android_asset/Resources/shared.js#733)
\n
\nOuch!
(from [c640e0f9613717e649b361cc9a0a2b5690565c9b])\nreference the Date constructor from the top level KrollBridge\nscope, and keep Date references around when converting to avoid new\nobject creation when we unwrap. added test case to kroll test suite\n[#2204 state:fixed-in-qa] \nhttps://github.com/appcelerator/titanium_mobile/commit/c640e0f96137...
confirmed on emulator (2.1) and G2 (2.2) using provided code\nsample Titanium SDK version: 1.5.0 (12/03/10 09:29 33c2058)