Originally filed: http://github.com/devtools-html/debugger.html/issues/5061 STR: 1. Navigate to [es6](https://yurydelendik.github.io/old-man-sandbox/sorted-es6/test.es6.html) example 2. Set breakpoint at line 94 of bundle.js 3. Inspect environments/scopes ```js function comparer(a, b) { const ma = /.(\d+)\W*$/.exec(a); const mb = /.(\d+)\W*$/.exec(b); if (ma == null || mb == null || ma[1] == mb[1]) { return a < b ? -1 : a > b ? 1 : 0; } else { const na = +ma[1], nb = +mb[1]; return na < nb ? -1 : na > nb ? 1 : 0; // set breakpoint here } } ``` The function at the specified location contains 3 environments: 1. function 2. function body 3. if-else. <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"> Chrome has only 2 environments: function, if-else. <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"> Does it make sense to consolidate the function & function body scopes into a single scope? Scope 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. /cc @jimblandy
Bug 1448166 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Originally filed: http://github.com/devtools-html/debugger.html/issues/5061 STR: 1. Navigate to [es6](https://yurydelendik.github.io/old-man-sandbox/sorted-es6/test.es6.html) example 2. Set breakpoint at line 94 of bundle.js 3. Inspect environments/scopes ```js function comparer(a, b) { const ma = /.(\d+)\W*$/.exec(a); const mb = /.(\d+)\W*$/.exec(b); if (ma == null || mb == null || ma[1] == mb[1]) { return a < b ? -1 : a > b ? 1 : 0; } else { const na = +ma[1], nb = +mb[1]; return na < nb ? -1 : na > nb ? 1 : 0; // set breakpoint here } } ``` The function at the specified location contains 3 environments: 1. function 2. function body 3. if-else. https://user-images.githubusercontent.com/1523410/34700489-0b22cbca-f4a9-11e7-9bac-7940f7e5aaba.png Chrome has only 2 environments: function, if-else. https://user-images.githubusercontent.com/1523410/34724749-a661664e-f514-11e7-97b2-5ae5ec9301fe.png Does it make sense to consolidate the function & function body scopes into a single scope? Scope 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. /cc @jimblandy