{"action":"created","issue":{"url":"https://api.github.com/repos/devtools-html/debugger.html/issues/5061","repository_url":"https://api.github.com/repos/devtools-html/debugger.html","labels_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/5061/labels{/name}","comments_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/5061/comments","events_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/5061/events","html_url":"https://github.com/devtools-html/debugger.html/issues/5061","id":287103299,"number":5061,"title":"[Scopes] Consolidate function scopes","user":{"login":"yurydelendik","id":1523410,"avatar_url":"https://avatars0.githubusercontent.com/u/1523410?v=4","gravatar_id":"","url":"https://api.github.com/users/yurydelendik","html_url":"https://github.com/yurydelendik","followers_url":"https://api.github.com/users/yurydelendik/followers","following_url":"https://api.github.com/users/yurydelendik/following{/other_user}","gists_url":"https://api.github.com/users/yurydelendik/gists{/gist_id}","starred_url":"https://api.github.com/users/yurydelendik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurydelendik/subscriptions","organizations_url":"https://api.github.com/users/yurydelendik/orgs","repos_url":"https://api.github.com/users/yurydelendik/repos","events_url":"https://api.github.com/users/yurydelendik/events{/privacy}","received_events_url":"https://api.github.com/users/yurydelendik/received_events","type":"User","site_admin":false},"labels":[{"id":346505996,"url":"https://api.github.com/repos/devtools-html/debugger.html/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-01-09T14:16:01Z","updated_at":"2018-02-13T22:36:12Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"STR:\r\n1. Navigate to  [es6](https://yurydelendik.github.io/old-man-sandbox/sorted-es6/test.es6.html) example\r\n2. Set breakpoint at line 94 of bundle.js\r\n3. Inspect environments/scopes\r\n\r\n```js\r\nfunction comparer(a, b) {\r\n  const ma = /.(\\d+)\\W*$/.exec(a);\r\n  const mb = /.(\\d+)\\W*$/.exec(b);\r\n  if (ma == null || mb == null || ma[1] == mb[1]) {\r\n  \treturn a < b ? -1 : a > b ? 1 : 0;\r\n  } else {\r\n    const na = +ma[1], nb = +mb[1];\r\n    return na < nb ? -1 : na > nb ? 1 : 0; // set breakpoint here\r\n  }\r\n}\r\n```\r\n\r\nThe function at the specified location contains 3 environments: \r\n\r\n1. function\r\n2. function body\r\n3. if-else.\r\n\r\n<img width=\"983\" alt=\"screen shot 2018-01-08 at 7 16 11 pm\" src=\"https://user-images.githubusercontent.com/1523410/34700489-0b22cbca-f4a9-11e7-9bac-7940f7e5aaba.png\">\r\n\r\nChrome has only 2 environments: function, if-else.\r\n\r\n<img width=\"1002\" alt=\"screen shot 2018-01-08 at 7 15 50 pm\" src=\"https://user-images.githubusercontent.com/1523410/34724749-a661664e-f514-11e7-97b2-5ae5ec9301fe.png\">\r\n\r\nDoes it make sense to consolidate the function & function body scopes into a single scope? \r\n\r\nScope content will change during stepping through since new environments may appear/disappear. In other words, it's expected to see scopes less granular on the debugger side, and grouped within function boundary.\r\n\r\n/cc @jimblandy "},"comment":{"url":"https://api.github.com/repos/devtools-html/debugger.html/issues/comments/365428961","html_url":"https://github.com/devtools-html/debugger.html/issues/5061#issuecomment-365428961","issue_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/5061","id":365428961,"user":{"login":"yurydelendik","id":1523410,"avatar_url":"https://avatars0.githubusercontent.com/u/1523410?v=4","gravatar_id":"","url":"https://api.github.com/users/yurydelendik","html_url":"https://github.com/yurydelendik","followers_url":"https://api.github.com/users/yurydelendik/followers","following_url":"https://api.github.com/users/yurydelendik/following{/other_user}","gists_url":"https://api.github.com/users/yurydelendik/gists{/gist_id}","starred_url":"https://api.github.com/users/yurydelendik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurydelendik/subscriptions","organizations_url":"https://api.github.com/users/yurydelendik/orgs","repos_url":"https://api.github.com/users/yurydelendik/repos","events_url":"https://api.github.com/users/yurydelendik/events{/privacy}","received_events_url":"https://api.github.com/users/yurydelendik/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T22:36:12Z","updated_at":"2018-02-13T22:36:12Z","author_association":"CONTRIBUTOR","body":"* (`for` might have `let`)\r\n* `catch` creates a scopes\r\n* all breaks with `with()`"}}
{"actor":{"display_login":"yurydelendik"}}