{"action":"created","issue":{"url":"https://api.github.com/repos/devtools-html/debugger.html/issues/6140","repository_url":"https://api.github.com/repos/devtools-html/debugger.html","labels_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/6140/labels{/name}","comments_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/6140/comments","events_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/6140/events","html_url":"https://github.com/devtools-html/debugger.html/issues/6140","id":318042127,"number":6140,"title":"Add a way to evaluate getter properties","user":{"login":"nchevobbe","id":578107,"avatar_url":"https://avatars3.githubusercontent.com/u/578107?v=4","gravatar_id":"","url":"https://api.github.com/users/nchevobbe","html_url":"https://github.com/nchevobbe","followers_url":"https://api.github.com/users/nchevobbe/followers","following_url":"https://api.github.com/users/nchevobbe/following{/other_user}","gists_url":"https://api.github.com/users/nchevobbe/gists{/gist_id}","starred_url":"https://api.github.com/users/nchevobbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nchevobbe/subscriptions","organizations_url":"https://api.github.com/users/nchevobbe/orgs","repos_url":"https://api.github.com/users/nchevobbe/repos","events_url":"https://api.github.com/users/nchevobbe/events{/privacy}","received_events_url":"https://api.github.com/users/nchevobbe/received_events","type":"User","site_admin":false},"labels":[{"id":914875827,"url":"https://api.github.com/repos/devtools-html/debugger.html/labels/available","name":"available","color":"ededed","default":false},{"id":669449515,"url":"https://api.github.com/repos/devtools-html/debugger.html/labels/not-available","name":"not-available","color":"d4c5f9","default":false},{"id":914836081,"url":"https://api.github.com/repos/devtools-html/debugger.html/labels/object-inspector","name":"object-inspector","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-04-26T13:57:58Z","updated_at":"2018-04-26T13:58:07Z","closed_at":null,"author_association":"MEMBER","body":"_From @nchevobbe on July 19, 2017 11:15_\n\nWhen https://github.com/devtools-html/devtools-core/issues/397 , we'll be able to show getters and setters in Reps/ObjectInspector.\r\nIt would be nice if we could provide a way for the user to quickly evaluate a property directly in-place in the ObjectInspector.\r\n\r\nWe could show a button, with a title warning the user of potential side-effects. This button would be shown only in ObjectInspector nodes (i.e. not for the roots).\r\n\r\nHere's a rough first approach of what it could look like : \r\n\r\n<img width=\"573\" alt=\"screen shot 2017-07-19 at 11 25 37\" src=\"https://user-images.githubusercontent.com/578107/28364151-3a64fba8-6c7b-11e7-9975-717a48c7614a.png\">\r\n\r\n---\r\n\r\nOn the technical side, I am not sure how to handle this for now (that's why I don't include it in #397 since it's a nice-to-have, not a critical feature).\r\nAt the moment, we don't have any actor reference for this property. We have them for the getter and the setter though, so maybe there's a way to fire the function with that reference (really not sure about this).\r\nWe may have to pass the parent reference and the property name to the new `Accessor` rep so we could evaluate the property.\n\n_Copied from original issue: devtools-html/devtools-core#510_"},"comment":{"url":"https://api.github.com/repos/devtools-html/debugger.html/issues/comments/384650573","html_url":"https://github.com/devtools-html/debugger.html/issues/6140#issuecomment-384650573","issue_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/6140","id":384650573,"user":{"login":"nchevobbe","id":578107,"avatar_url":"https://avatars3.githubusercontent.com/u/578107?v=4","gravatar_id":"","url":"https://api.github.com/users/nchevobbe","html_url":"https://github.com/nchevobbe","followers_url":"https://api.github.com/users/nchevobbe/followers","following_url":"https://api.github.com/users/nchevobbe/following{/other_user}","gists_url":"https://api.github.com/users/nchevobbe/gists{/gist_id}","starred_url":"https://api.github.com/users/nchevobbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nchevobbe/subscriptions","organizations_url":"https://api.github.com/users/nchevobbe/orgs","repos_url":"https://api.github.com/users/nchevobbe/repos","events_url":"https://api.github.com/users/nchevobbe/events{/privacy}","received_events_url":"https://api.github.com/users/nchevobbe/received_events","type":"User","site_admin":false},"created_at":"2018-04-26T13:58:06Z","updated_at":"2018-04-26T13:58:06Z","author_association":"MEMBER","body":"_From @Loirooriol on March 17, 2018 15:14_\n\n@inoyakaigor Not sure what your example is supposed to test, so I will use this one:\r\n\r\n```js\r\nvar obj = {get foo(){return this.hasOwnProperty(\"foo\")}};\r\nObject.create(obj);\r\n```\r\n\r\nChrome does not invoke unsafe getters by default, but you can click `(...)` to do so. The getter appears both in the owner and inheritor and you can invoke them independently, but the inheritor is always used as the receiver.\r\n\r\n![chrome](https://user-images.githubusercontent.com/7477678/37556829-abf57dd6-29fb-11e8-89dc-2aff227b4742.png)\r\n\r\nEdge invokes unsafe getters by default. The getter appears both in the owner and inheritor, using the respective object as the receiver.\r\n\r\n![edge](https://user-images.githubusercontent.com/7477678/37556843-f0f3e0f8-29fb-11e8-9f4f-6093cf6ba580.png)\r\n\r\nFirefox does not invoke unsafe getters by default, and does not provide any way to do so (yet). The getter appears only in the owner object.\r\n\r\n![firefox](https://user-images.githubusercontent.com/7477678/37556896-ccb036be-29fc-11e8-980e-faeba06526f8.png)\r\n\r\nSo I think the question is: should Firefox show inherited unsafe getters in the object inspector?\r\n\r\n - If so, then I think it makes sense to use the object where the user invokes the getter as the receiver.\r\n - If not, I think the common case will be that the getter will only appear in a prototype object, and it would expect to be called on a instance. So I would follow the `__proto__` chain in the object inspector and use the outermost object as the receiver.\r\n\r\n"}}
{"actor":{"display_login":"nchevobbe"}}