{ "id": "84114", "key": "TIMOB-6789", "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": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-12-30T16:38:55.000+0000", "created": "2011-12-20T12:38:28.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_module", "qe-testadded" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [], "assignee": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "updated": "2014-06-19T12:44: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": "h1. Problem\r\nWith the 1.8.0.1 changes and KrollFunction being introduced, return values were overlooked.\r\n\r\nh2. Why it was Overlooked\r\nNothing in core or our private modules utilizes this portion of the API. But our demo module in the public repository makes use of it, and there may be third party developers that are using it.\r\n\r\nh2. How to Test\r\nCreate a new module:\r\n{quote}\r\ntitanium create --type=module --name=testcb --id=ti.testcb --platform=android\r\n{quote}\r\n\r\nUpdate the TestcbModule.java:\r\n{code:title=TestcbModule.java}\r\npackage ti.testcb;\r\n\r\nimport java.util.HashMap;\r\n\r\nimport org.appcelerator.kroll.KrollModule;\r\nimport org.appcelerator.kroll.KrollFunction;\r\nimport org.appcelerator.kroll.annotations.Kroll;\r\n\r\n@Kroll.module(name=\"Testcb\", id=\"ti.testcb\")\r\npublic class TestcbModule extends KrollModule\r\n{\r\n public TestcbModule()\r\n {\r\n super();\r\n }\r\n\r\n @Kroll.method \r\n public String initiateCrank(KrollFunction crank) {\r\n return crank.call(getKrollObject(), new HashMap()).toString();\r\n }\r\n}\r\n{code}\r\n\r\nUpdate the example/app.js:\r\n\r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\nwin.add(Ti.UI.createLabel({\r\n text: require('ti.testcb').initiateCrank(function() {\r\n return 'PASS: Is your refrigerator running? Tee hee.';\r\n }) || 'FAIL: Critical failure of joke Kroll traversal!'\r\n}));\r\nwin.open();\r\n{code}\r\n\r\nh2. Pull Request\r\nMaster: https://github.com/appcelerator/titanium_mobile/pull/1072\r\n1_8_X: https://github.com/appcelerator/titanium_mobile/pull/1073", "attachment": [], "flagged": false, "summary": "Android: KrollFunction Doesn't Allow for Return Values", "creator": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": null, "comment": { "comments": [ { "id": "179122", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing bug. Verified fix on:\r\n\r\nSDK build: 1.9.0.v20120112104633\r\nRuntime: V8, Rhino\r\nTitanium Studio, build: 1.0.8.201201111843\r\nDevice: Droid 3 (2.3.4)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-01-12T14:19:59.000+0000", "updated": "2012-01-12T14:19:59.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }