{ "id": "143151", "key": "TIMOB-18405", "fields": { "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "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": [], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-04-06T01:11:01.000+0000", "created": "2015-01-19T18:50:16.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [ { "id": "44883", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "143148", "key": "TIMOB-18403", "fields": { "summary": "HAL: Create helper functions/macros for common property additions to classes", "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": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-16T22:31:13.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "{code:cpp}\r\nJSValue UIModule::js_createSlider(const std::vector& arguments, JSObject& this_object)\r\n{\r\n\tJSObject parameters = get_context().CreateObject();\r\n\tif (arguments.size() >= 1) {\r\n\t\tconst auto _0 = arguments.at(0);\r\n\t\tTITANIUM_ASSERT(_0.IsObject());\r\n\t\tparameters = _0;\r\n\t}\r\n\treturn createSlider(parameters, this_object);\r\n}\r\n{code}\r\nwe seem to do this pattern a lot where we pull something out of a argument list, cast it, check the type via assertion, etc.\r\n\r\nthis is a good place to come up with either an inlined helper function or a macro. makes the code more readable and has the advantage for developers to ensure we have a very common pattern for how to do this logic.\r\n\r\nFrom Jeff's review comments here: https://github.com/sgtcoolguy/titanium_mobile_windows/commit/c2d07889a2ca6fbb4f689138252003838a42a7e6#commitcomment-9323187\r\n\r\n\r\n", "attachment": [], "flagged": false, "summary": "HAL: Create helper functions/macros for typical argument list type checking/casting in js_* bridge methods", "creator": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "environment": null, "closedSprints": [ { "id": 352, "state": "closed", "name": "2015 Sprint 07 Windows", "startDate": "2015-03-29T05:00:59.261Z", "endDate": "2015-04-25T03:59:00.000Z", "completeDate": "2015-04-12T17:16:40.691Z", "originBoardId": 144 } ], "comment": { "comments": [ { "id": "348539", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/202", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-04-06T01:11:02.000+0000", "updated": "2015-04-06T01:11:02.000+0000" }, { "id": "413370", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-16T22:31:13.000+0000", "updated": "2017-03-16T22:31:13.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }