Scope pane shows wrong 'this' value when debugging arrow function via call/apply
Reported by
roblour...@gmail.com,
Oct 31 2016
|
||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36
Steps to reproduce the problem:
Code like this:
```
(function() {
console.log(`parentScope: ${this.fake}`);
(() => {
console.log(`childScope: ${this.fake}`);
debugger;
}).call({ innerFake: "innerFakeValue" });
}).call({ fake: "fakeValue" });
```
Debug this code with Chrome DevTools. At 'debugger', check the value of 'this' in the Scope pane, and evaluate 'this' in the console.
What is the expected behavior?
At 'debugger', 'this' is { fake: 'fakeValue' }
What went wrong?
In the Scope pane, 'this' is shown as being { innerFake: 'innerFakeValue' }. Since you can't override 'this' in an arrow function with call/apply, this is wrong.
Did this work before? N/A
Chrome version: 54.0.2840.71 Channel: stable
OS Version: OS X 10.12.1
Flash Version: Shockwave Flash 23.0 r0
From https://github.com/Microsoft/vscode/issues/13967
,
Nov 1 2016
#1, you haven't expanded "this" in Locals panel which is what the bug report is about.
,
Nov 1 2016
,
Nov 1 2016
Right, sorry for not being clear, it's correct when you evaluate/hover. It's incorrect in the Locals panel. It's very strange that these would be different - that's the bug.
,
Nov 2 2016
thanks for the feedback. Able to reproduce the issue on mac 10.11.6 chrome version 54.0.2840.71 and canary - Please find the screenshot This is a non regression issue existing since M45 45.0.2454.101 to latest canary 56.0.2906.0 Issue can be seen on win and Linux as well
,
Dec 2 2016
,
Jul 26 2017
Any update on that? Debugging is not complete without that.
,
Sep 7
Any update on this? |
||||
►
Sign in to add a comment |
||||
Comment 1 by tkonch...@chromium.org
, Nov 1 2016Labels: Needs-Feedback
Unable to reproduce the issue on mac 10.11.6 chrome version 54.0.2840.71 and canary - At 'debugger', 'this' is { fake: 'fakeValue' } is displayed Please find the screenshot Could you please let me know if i am missing something here in reproducing the issue.494 KB
494 KB View Download