{"action":"created","comment":{"url":"https://api.github.com/repos/devtools-html/debugger.html/pulls/comments/83213655","pull_request_review_id":4070138,"id":83213655,"diff_hunk":"@@ -41,14 +42,22 @@ define(function (require, exports, module) {\n       return getURLDisplayString(grip.preview.url);\n     },\n \n+    getDisplayValue: function (grip) {\n+      if (this.props.mode === \"tiny\") {\n+        return grip.isGlobal ? \"Global\" : \"Window\";\n+      } else {\n+        return this.getLocation(grip);\n+      }\n+    },","path":"public/js/lib/devtools/client/shared/components/reps/window.js","position":18,"original_position":18,"commit_id":"023e44c770e109244bb74ebad60c7e73947b840a","original_commit_id":"023e44c770e109244bb74ebad60c7e73947b840a","user":{"login":"janodvarko","id":37785,"avatar_url":"https://avatars.githubusercontent.com/u/37785?v=3","gravatar_id":"","url":"https://api.github.com/users/janodvarko","html_url":"https://github.com/janodvarko","followers_url":"https://api.github.com/users/janodvarko/followers","following_url":"https://api.github.com/users/janodvarko/following{/other_user}","gists_url":"https://api.github.com/users/janodvarko/gists{/gist_id}","starred_url":"https://api.github.com/users/janodvarko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janodvarko/subscriptions","organizations_url":"https://api.github.com/users/janodvarko/orgs","repos_url":"https://api.github.com/users/janodvarko/repos","events_url":"https://api.github.com/users/janodvarko/events{/privacy}","received_events_url":"https://api.github.com/users/janodvarko/received_events","type":"User","site_admin":false},"body":"Nice, that's exactly what 'modes' are for.","created_at":"2016-10-13T13:21:46Z","updated_at":"2016-10-13T13:21:46Z","html_url":"https://github.com/devtools-html/debugger.html/pull/912#discussion_r83213655","pull_request_url":"https://api.github.com/repos/devtools-html/debugger.html/pulls/912","_links":{"self":{"href":"https://api.github.com/repos/devtools-html/debugger.html/pulls/comments/83213655"},"html":{"href":"https://github.com/devtools-html/debugger.html/pull/912#discussion_r83213655"},"pull_request":{"href":"https://api.github.com/repos/devtools-html/debugger.html/pulls/912"}}},"pull_request":{"url":"https://api.github.com/repos/devtools-html/debugger.html/pulls/912","id":88714739,"html_url":"https://github.com/devtools-html/debugger.html/pull/912","diff_url":"https://github.com/devtools-html/debugger.html/pull/912.diff","patch_url":"https://github.com/devtools-html/debugger.html/pull/912.patch","issue_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/912","number":912,"state":"open","locked":false,"title":"Display Window or Global on Window class reps","user":{"login":"Zacqary","id":1445834,"avatar_url":"https://avatars.githubusercontent.com/u/1445834?v=3","gravatar_id":"","url":"https://api.github.com/users/Zacqary","html_url":"https://github.com/Zacqary","followers_url":"https://api.github.com/users/Zacqary/followers","following_url":"https://api.github.com/users/Zacqary/following{/other_user}","gists_url":"https://api.github.com/users/Zacqary/gists{/gist_id}","starred_url":"https://api.github.com/users/Zacqary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zacqary/subscriptions","organizations_url":"https://api.github.com/users/Zacqary/orgs","repos_url":"https://api.github.com/users/Zacqary/repos","events_url":"https://api.github.com/users/Zacqary/events{/privacy}","received_events_url":"https://api.github.com/users/Zacqary/received_events","type":"User","site_admin":false},"body":"Associated Issue: #884 \r\n\r\n### Summary of Changes\r\n\r\n* Window rep will display either `\"Window\"` or `\"Global\"` depending on whether its preview has a truthy `isGlobal` property or not\r\n* Top-level Window will override its preview to `{ kind: \"Window\", isGlobal: true }`\r\n\r\n### Notes\r\n\r\nThis feels like a hack to me, and I'm submitting this PR more to start a discussion than because I'm confident in its ability to fix the issue. I don't understand the code path that renders the reps very well, but this is what I was able to figure out.\r\n\r\nThe problem that I found is that the top-level Window — the one we want to say `Global` — has a `preview` with `{ kind: \"ObjectWithURL\" }` rather than `{ kind: \"Window\" }`. But, apparently, the `view` property in `e` is correctly marked as `{ kind: \"Window\" }`. I have no idea why it is, or where the `view` property is even coming from, because it's not present in `getBindingVariables`. It seems to be added at some step before the final render, but I wasn't able to track that down.\r\n\r\nSo that's why I'm not super confident in this fix. It operates under the assumption that if a scope of type `\"object\"` has a class of `\"Window\"`, then it must be the global `Window`. I don't know if this is always going to be true. It also doesn't fix the underlying problem of why the global `Window` is being generated with the wrong kind of preview in the first place, which I also wasn't able to track down.\r\n\r\n### Testing\r\n\r\n* [x] passes `npm test`\r\n* [x] passes `npm run lint`\r\n\r\n### Screenshots\r\n![screen shot 2016-10-10 at 2 56 46 pm](https://cloud.githubusercontent.com/assets/1445834/19247622/0f3b0d6e-8efa-11e6-8c55-79260f8c1c4a.png)","created_at":"2016-10-10T19:08:41Z","updated_at":"2016-10-13T13:21:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17963e11b2f5e35f32f926d1a6398e93d75f4269","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/devtools-html/debugger.html/pulls/912/commits","review_comments_url":"https://api.github.com/repos/devtools-html/debugger.html/pulls/912/comments","review_comment_url":"https://api.github.com/repos/devtools-html/debugger.html/pulls/comments{/number}","comments_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/912/comments","statuses_url":"https://api.github.com/repos/devtools-html/debugger.html/statuses/023e44c770e109244bb74ebad60c7e73947b840a","head":{"label":"Zacqary:window-scope-display","ref":"window-scope-display","sha":"023e44c770e109244bb74ebad60c7e73947b840a","user":{"login":"Zacqary","id":1445834,"avatar_url":"https://avatars.githubusercontent.com/u/1445834?v=3","gravatar_id":"","url":"https://api.github.com/users/Zacqary","html_url":"https://github.com/Zacqary","followers_url":"https://api.github.com/users/Zacqary/followers","following_url":"https://api.github.com/users/Zacqary/following{/other_user}","gists_url":"https://api.github.com/users/Zacqary/gists{/gist_id}","starred_url":"https://api.github.com/users/Zacqary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zacqary/subscriptions","organizations_url":"https://api.github.com/users/Zacqary/orgs","repos_url":"https://api.github.com/users/Zacqary/repos","events_url":"https://api.github.com/users/Zacqary/events{/privacy}","received_events_url":"https://api.github.com/users/Zacqary/received_events","type":"User","site_admin":false},"repo":{"id":70426068,"name":"debugger.html","full_name":"Zacqary/debugger.html","owner":{"login":"Zacqary","id":1445834,"avatar_url":"https://avatars.githubusercontent.com/u/1445834?v=3","gravatar_id":"","url":"https://api.github.com/users/Zacqary","html_url":"https://github.com/Zacqary","followers_url":"https://api.github.com/users/Zacqary/followers","following_url":"https://api.github.com/users/Zacqary/following{/other_user}","gists_url":"https://api.github.com/users/Zacqary/gists{/gist_id}","starred_url":"https://api.github.com/users/Zacqary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zacqary/subscriptions","organizations_url":"https://api.github.com/users/Zacqary/orgs","repos_url":"https://api.github.com/users/Zacqary/repos","events_url":"https://api.github.com/users/Zacqary/events{/privacy}","received_events_url":"https://api.github.com/users/Zacqary/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Zacqary/debugger.html","description":"The Firefox debugger that works anywhere","fork":true,"url":"https://api.github.com/repos/Zacqary/debugger.html","forks_url":"https://api.github.com/repos/Zacqary/debugger.html/forks","keys_url":"https://api.github.com/repos/Zacqary/debugger.html/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Zacqary/debugger.html/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Zacqary/debugger.html/teams","hooks_url":"https://api.github.com/repos/Zacqary/debugger.html/hooks","issue_events_url":"https://api.github.com/repos/Zacqary/debugger.html/issues/events{/number}","events_url":"https://api.github.com/repos/Zacqary/debugger.html/events","assignees_url":"https://api.github.com/repos/Zacqary/debugger.html/assignees{/user}","branches_url":"https://api.github.com/repos/Zacqary/debugger.html/branches{/branch}","tags_url":"https://api.github.com/repos/Zacqary/debugger.html/tags","blobs_url":"https://api.github.com/repos/Zacqary/debugger.html/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Zacqary/debugger.html/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Zacqary/debugger.html/git/refs{/sha}","trees_url":"https://api.github.com/repos/Zacqary/debugger.html/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Zacqary/debugger.html/statuses/{sha}","languages_url":"https://api.github.com/repos/Zacqary/debugger.html/languages","stargazers_url":"https://api.github.com/repos/Zacqary/debugger.html/stargazers","contributors_url":"https://api.github.com/repos/Zacqary/debugger.html/contributors","subscribers_url":"https://api.github.com/repos/Zacqary/debugger.html/subscribers","subscription_url":"https://api.github.com/repos/Zacqary/debugger.html/subscription","commits_url":"https://api.github.com/repos/Zacqary/debugger.html/commits{/sha}","git_commits_url":"https://api.github.com/repos/Zacqary/debugger.html/git/commits{/sha}","comments_url":"https://api.github.com/repos/Zacqary/debugger.html/comments{/number}","issue_comment_url":"https://api.github.com/repos/Zacqary/debugger.html/issues/comments{/number}","contents_url":"https://api.github.com/repos/Zacqary/debugger.html/contents/{+path}","compare_url":"https://api.github.com/repos/Zacqary/debugger.html/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Zacqary/debugger.html/merges","archive_url":"https://api.github.com/repos/Zacqary/debugger.html/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Zacqary/debugger.html/downloads","issues_url":"https://api.github.com/repos/Zacqary/debugger.html/issues{/number}","pulls_url":"https://api.github.com/repos/Zacqary/debugger.html/pulls{/number}","milestones_url":"https://api.github.com/repos/Zacqary/debugger.html/milestones{/number}","notifications_url":"https://api.github.com/repos/Zacqary/debugger.html/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Zacqary/debugger.html/labels{/name}","releases_url":"https://api.github.com/repos/Zacqary/debugger.html/releases{/id}","deployments_url":"https://api.github.com/repos/Zacqary/debugger.html/deployments","created_at":"2016-10-09T19:38:53Z","updated_at":"2016-10-09T19:38:55Z","pushed_at":"2016-10-11T22:01:27Z","git_url":"git://github.com/Zacqary/debugger.html.git","ssh_url":"git@github.com:Zacqary/debugger.html.git","clone_url":"https://github.com/Zacqary/debugger.html.git","svn_url":"https://github.com/Zacqary/debugger.html","homepage":"","size":4065,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"devtools-html:master","ref":"master","sha":"b21f030545cd2b769da43f52f09961114983afec","user":{"login":"devtools-html","id":19979421,"avatar_url":"https://avatars.githubusercontent.com/u/19979421?v=3","gravatar_id":"","url":"https://api.github.com/users/devtools-html","html_url":"https://github.com/devtools-html","followers_url":"https://api.github.com/users/devtools-html/followers","following_url":"https://api.github.com/users/devtools-html/following{/other_user}","gists_url":"https://api.github.com/users/devtools-html/gists{/gist_id}","starred_url":"https://api.github.com/users/devtools-html/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devtools-html/subscriptions","organizations_url":"https://api.github.com/users/devtools-html/orgs","repos_url":"https://api.github.com/users/devtools-html/repos","events_url":"https://api.github.com/users/devtools-html/events{/privacy}","received_events_url":"https://api.github.com/users/devtools-html/received_events","type":"Organization","site_admin":false},"repo":{"id":54585418,"name":"debugger.html","full_name":"devtools-html/debugger.html","owner":{"login":"devtools-html","id":19979421,"avatar_url":"https://avatars.githubusercontent.com/u/19979421?v=3","gravatar_id":"","url":"https://api.github.com/users/devtools-html","html_url":"https://github.com/devtools-html","followers_url":"https://api.github.com/users/devtools-html/followers","following_url":"https://api.github.com/users/devtools-html/following{/other_user}","gists_url":"https://api.github.com/users/devtools-html/gists{/gist_id}","starred_url":"https://api.github.com/users/devtools-html/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devtools-html/subscriptions","organizations_url":"https://api.github.com/users/devtools-html/orgs","repos_url":"https://api.github.com/users/devtools-html/repos","events_url":"https://api.github.com/users/devtools-html/events{/privacy}","received_events_url":"https://api.github.com/users/devtools-html/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/devtools-html/debugger.html","description":"The Firefox debugger that works anywhere","fork":false,"url":"https://api.github.com/repos/devtools-html/debugger.html","forks_url":"https://api.github.com/repos/devtools-html/debugger.html/forks","keys_url":"https://api.github.com/repos/devtools-html/debugger.html/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devtools-html/debugger.html/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devtools-html/debugger.html/teams","hooks_url":"https://api.github.com/repos/devtools-html/debugger.html/hooks","issue_events_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/events{/number}","events_url":"https://api.github.com/repos/devtools-html/debugger.html/events","assignees_url":"https://api.github.com/repos/devtools-html/debugger.html/assignees{/user}","branches_url":"https://api.github.com/repos/devtools-html/debugger.html/branches{/branch}","tags_url":"https://api.github.com/repos/devtools-html/debugger.html/tags","blobs_url":"https://api.github.com/repos/devtools-html/debugger.html/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devtools-html/debugger.html/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devtools-html/debugger.html/git/refs{/sha}","trees_url":"https://api.github.com/repos/devtools-html/debugger.html/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devtools-html/debugger.html/statuses/{sha}","languages_url":"https://api.github.com/repos/devtools-html/debugger.html/languages","stargazers_url":"https://api.github.com/repos/devtools-html/debugger.html/stargazers","contributors_url":"https://api.github.com/repos/devtools-html/debugger.html/contributors","subscribers_url":"https://api.github.com/repos/devtools-html/debugger.html/subscribers","subscription_url":"https://api.github.com/repos/devtools-html/debugger.html/subscription","commits_url":"https://api.github.com/repos/devtools-html/debugger.html/commits{/sha}","git_commits_url":"https://api.github.com/repos/devtools-html/debugger.html/git/commits{/sha}","comments_url":"https://api.github.com/repos/devtools-html/debugger.html/comments{/number}","issue_comment_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/comments{/number}","contents_url":"https://api.github.com/repos/devtools-html/debugger.html/contents/{+path}","compare_url":"https://api.github.com/repos/devtools-html/debugger.html/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devtools-html/debugger.html/merges","archive_url":"https://api.github.com/repos/devtools-html/debugger.html/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devtools-html/debugger.html/downloads","issues_url":"https://api.github.com/repos/devtools-html/debugger.html/issues{/number}","pulls_url":"https://api.github.com/repos/devtools-html/debugger.html/pulls{/number}","milestones_url":"https://api.github.com/repos/devtools-html/debugger.html/milestones{/number}","notifications_url":"https://api.github.com/repos/devtools-html/debugger.html/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devtools-html/debugger.html/labels{/name}","releases_url":"https://api.github.com/repos/devtools-html/debugger.html/releases{/id}","deployments_url":"https://api.github.com/repos/devtools-html/debugger.html/deployments","created_at":"2016-03-23T18:55:36Z","updated_at":"2016-10-13T08:37:49Z","pushed_at":"2016-10-13T02:27:55Z","git_url":"git://github.com/devtools-html/debugger.html.git","ssh_url":"git@github.com:devtools-html/debugger.html.git","clone_url":"https://github.com/devtools-html/debugger.html.git","svn_url":"https://github.com/devtools-html/debugger.html","homepage":"","size":19191,"stargazers_count":2129,"watchers_count":2129,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":125,"mirror_url":null,"open_issues_count":87,"forks":125,"open_issues":87,"watchers":2129,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/devtools-html/debugger.html/pulls/912"},"html":{"href":"https://github.com/devtools-html/debugger.html/pull/912"},"issue":{"href":"https://api.github.com/repos/devtools-html/debugger.html/issues/912"},"comments":{"href":"https://api.github.com/repos/devtools-html/debugger.html/issues/912/comments"},"review_comments":{"href":"https://api.github.com/repos/devtools-html/debugger.html/pulls/912/comments"},"review_comment":{"href":"https://api.github.com/repos/devtools-html/debugger.html/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/devtools-html/debugger.html/pulls/912/commits"},"statuses":{"href":"https://api.github.com/repos/devtools-html/debugger.html/statuses/023e44c770e109244bb74ebad60c7e73947b840a"}}}}
{"actor":{"display_login":"janodvarko"}}