{ "id": "114188", "key": "TIMOB-13815", "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": "15116", "description": "2013 Sprint 11 BB", "name": "2013 Sprint 11 BB", "archived": true, "released": true, "releaseDate": "2013-06-03" }, { "id": "15109", "description": "2013 Sprint 11", "name": "2013 Sprint 11", "archived": true, "released": true, "releaseDate": "2013-06-03" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-05-31T23:09:54.000+0000", "created": "2013-05-10T15:19:18.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:43:59.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": "10230", "name": "BlackBerry", "description": "BlackBerry Platform" } ], "description": "h2. problem\r\n\r\nWhen creating runtime unit tests for Alloy, I have a common expectation that I can identify an object as a Titanium proxy, and in certain cases can tell (roughly) what type of component that proxy is. The very basic code for this is as below:\r\n\r\n{code:javascript}\r\n// using a recent underscore.js\r\nvar _ = require('underscore')._\r\n\r\nvar someObject = Ti.UI.createWindow();\r\n\r\n// (roughly) identify a Ti.UI.Window\r\nif (_.isFunction(someObject.open)) {\r\n // this and other criteria ID this object as a Ti.UI.Window\r\n}\r\n{code}\r\n\r\nThe above code successfully identifies the 2 conditions on iOS, Android, and Mobileweb. On Blackberry though the conditions always return false. This has the dual problem of introducing a parity issue between BB and the other platforms, and it also breaks many of Alloy's runtime unit tests, making it very difficult to reliably test Blackberry builds.\r\n\r\nh2. expected\r\n\r\nBlackberry should behave as the other platforms and return true for the function-based Titanium proxy checks.", "attachment": [], "flagged": false, "summary": "Blackberry: Can't identify functions via JS on Titanium proxy objects", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 3.2.0.v20130412191647\r\nBB NDK 10.1.0.1020", "comment": { "comments": [ { "id": "251291", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "applyProperties is not implemented on BlackBerry right now, so it will be undefined.\naddEventListener might be a better choice for detecting proxies at this moment for all platforms.\n\nWe could probably implement this method (or at least stub it out) on BlackBerry as well\nwhich can be our action item for this ticket.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-10T16:08:50.000+0000", "updated": "2013-05-10T16:08:50.000+0000" }, { "id": "251293", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Josh, this doesn't explain why it returns false though when I do isFunction() on a Window's open() function.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-10T16:12:34.000+0000", "updated": "2013-05-10T16:12:34.000+0000" }, { "id": "251315", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Looked into the typeof check of window.open() and it seems we are just returning a\ncallable object rather than a normal function object instance. This is wrong and something\nwe should address.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-10T17:02:32.000+0000", "updated": "2013-05-10T17:02:32.000+0000" }, { "id": "251325", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "thanks for digging in so quickly josh, much appreciated", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-10T17:26:17.000+0000", "updated": "2013-05-10T17:26:17.000+0000" }, { "id": "252867", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "h4. Test Case\n{code:javascript}\nvar win = Ti.UI.createWindow();\nTi.API.info('typeof win.open = ' + typeof(win.open));\n{code}\n\nExpected: This log statement should be printed: \"typeof win.open = function\"", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-20T18:55:51.000+0000", "updated": "2013-05-20T18:55:51.000+0000" }, { "id": "252871", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Created pull request [#43|https://github.com/appcelerator/titanium_mobile_blackberry/pull/43] for master.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-20T19:17:08.000+0000", "updated": "2013-05-20T19:17:08.000+0000" }, { "id": "279422", "author": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed on:\nMac OSX 10.9 Mavericks\nTitanium Studio, build: 3.2.0.201311122225\nTitanium SDK, build: 3.2.0.v20131113094843\nCLI: 3.2.0\nAlloy: 1.3.0\nBlackBerry Simulator: 10.2.0.1791\n\nBlackBerry identifies functions via JavaScript using Test Case provided in comments.\nClosing.", "updateAuthor": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-13T22:44:49.000+0000", "updated": "2013-11-13T22:44:49.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }