{"action":"created","issue":{"url":"https://api.github.com/repos/appcelerator/HAL/issues/42","labels_url":"https://api.github.com/repos/appcelerator/HAL/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/appcelerator/HAL/issues/42/comments","events_url":"https://api.github.com/repos/appcelerator/HAL/issues/42/events","html_url":"https://github.com/appcelerator/HAL/pull/42","id":67413350,"number":42,"title":"Fix behavior when overriding JSObjectGetPropertyCallback","user":{"login":"sgtcoolguy","id":3252,"avatar_url":"https://avatars.githubusercontent.com/u/3252?v=3","gravatar_id":"","url":"https://api.github.com/users/sgtcoolguy","html_url":"https://github.com/sgtcoolguy","followers_url":"https://api.github.com/users/sgtcoolguy/followers","following_url":"https://api.github.com/users/sgtcoolguy/following{/other_user}","gists_url":"https://api.github.com/users/sgtcoolguy/gists{/gist_id}","starred_url":"https://api.github.com/users/sgtcoolguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgtcoolguy/subscriptions","organizations_url":"https://api.github.com/users/sgtcoolguy/orgs","repos_url":"https://api.github.com/users/sgtcoolguy/repos","events_url":"https://api.github.com/users/sgtcoolguy/events{/privacy}","received_events_url":"https://api.github.com/users/sgtcoolguy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"infosia","id":1661068,"avatar_url":"https://avatars.githubusercontent.com/u/1661068?v=3","gravatar_id":"","url":"https://api.github.com/users/infosia","html_url":"https://github.com/infosia","followers_url":"https://api.github.com/users/infosia/followers","following_url":"https://api.github.com/users/infosia/following{/other_user}","gists_url":"https://api.github.com/users/infosia/gists{/gist_id}","starred_url":"https://api.github.com/users/infosia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infosia/subscriptions","organizations_url":"https://api.github.com/users/infosia/orgs","repos_url":"https://api.github.com/users/infosia/repos","events_url":"https://api.github.com/users/infosia/events{/privacy}","received_events_url":"https://api.github.com/users/infosia/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-04-09T17:39:34Z","updated_at":"2015-04-10T13:52:18Z","closed_at":"2015-04-10T13:52:18Z","pull_request":{"url":"https://api.github.com/repos/appcelerator/HAL/pulls/42","html_url":"https://github.com/appcelerator/HAL/pull/42","diff_url":"https://github.com/appcelerator/HAL/pull/42.diff","patch_url":"https://github.com/appcelerator/HAL/pull/42.patch"},"body":"If overriden callback returns a JSNull, treat as equivalent to C stye API returning NULL and forward request to static functions/properties and up prototype chain. Previously a JSNull was returned as a JSValueRef, meaning we didn't look at static properties/functions or up the prototype chain so we were effectively breaking the class's ability to look at it's own properties.\r\n\r\nThis is an important fix to allow us to eventually do a catch-all hook for NativeScript style proxy objects based on the metadata database. We can register a GetPropertyCallback that can return it's own proxy objects for native APIs on our GlobalObject class:\r\n\r\n```cpp\r\nJSValue getNativeProperty(const JSString& property_name) const;\r\n```\r\n\r\n```cpp\r\nJSValue GlobalObject::getNativeProperty(const JSString& property_name) const\r\n{\r\n\tauto prop_name = static_cast<std::string>(property_name);\r\n\tif (\"Windows\" == prop_name) {\r\n\t\t// TODO Yay, let's generate a proxy object based on the metadata\r\n\t}\r\n\treturn get_context().CreateNull();\r\n}\r\n```\r\n\r\nThis is a very simple and contrived example, but it means we could hook to the root namespaces of the underlying native APIs in our platform-specific GlobalObject subclass, and from there hook up dynamic proxies that use the metadata database to do their work."},"comment":{"url":"https://api.github.com/repos/appcelerator/HAL/issues/comments/91564599","html_url":"https://github.com/appcelerator/HAL/pull/42#issuecomment-91564599","issue_url":"https://api.github.com/repos/appcelerator/HAL/issues/42","id":91564599,"user":{"login":"sgtcoolguy","id":3252,"avatar_url":"https://avatars.githubusercontent.com/u/3252?v=3","gravatar_id":"","url":"https://api.github.com/users/sgtcoolguy","html_url":"https://github.com/sgtcoolguy","followers_url":"https://api.github.com/users/sgtcoolguy/followers","following_url":"https://api.github.com/users/sgtcoolguy/following{/other_user}","gists_url":"https://api.github.com/users/sgtcoolguy/gists{/gist_id}","starred_url":"https://api.github.com/users/sgtcoolguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgtcoolguy/subscriptions","organizations_url":"https://api.github.com/users/sgtcoolguy/orgs","repos_url":"https://api.github.com/users/sgtcoolguy/repos","events_url":"https://api.github.com/users/sgtcoolguy/events{/privacy}","received_events_url":"https://api.github.com/users/sgtcoolguy/received_events","type":"User","site_admin":false},"created_at":"2015-04-10T13:52:18Z","updated_at":"2015-04-10T13:52:18Z","body":"Closing as #43 has a better fix."}}