New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 660951 link

Starred by 5 users

Issue metadata

Status: Duplicate
Merged: issue 552753
Owner:
Last visit > 30 days ago
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

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
 
Screen Shot 2016-10-31 at 1.42.43 PM.png
48.0 KB View Download
Cc: tkonch...@chromium.org
Labels: 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.

Screen Shot 2016-11-01 at 12.15.52 PM.png
494 KB View Download

Comment 2 by woxxom@gmail.com, Nov 1 2016

#1, you haven't expanded "this" in Locals panel which is what the bug report is about.
Owner: kozyatinskiy@chromium.org
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.
Labels: -Needs-Feedback M-56 OS-Linux OS-Windows
Status: Assigned (was: Unconfirmed)
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
Mergedinto: 552753
Status: Duplicate (was: Assigned)
Any update on that? Debugging is not complete without that.
Any update on this?

Sign in to add a comment