New issue
Advanced search Search tips

Issue 747978 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 678456
Owner: ----
Closed: Jul 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Debugger: Scope this is different than actual value

Reported by nicolas....@gmail.com, Jul 24 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36

Steps to reproduce the problem:
1. Open the devtools
2. Type the following code:
class toto {
   bindEvent() {
     document.addEventListener('keyup', (event) => {
       debugger;
       console.log(this);
     });
   }
}
new toto().bindEvent();

3. select the html window and press a key

What is the expected behavior?
In the Scope debugger panel, when the breakpoint is reached, "this" should be "toto {}".

What went wrong?
"this" appears to be the document element.document.

But typing "this" in the Chrome console correctly returns "toto {}".

Did this work before? N/A 

Chrome version: 59.0.3071.115  Channel: stable
OS Version: 10.0
Flash Version:
 
chromebug.png
54.7 KB View Download
Labels: Needs-Bisect Needs-Triage-M59

Comment 2 by woxxom@gmail.com, Jul 25 2017

Duplicate of  issue 678456 .
Labels: -Needs-Bisect
Mergedinto: 678456
Status: Duplicate (was: Unconfirmed)
Seems similar to the  bug 678456 .Hence merging this into 678456.
Please feel free to undupe if not similar.

Thanks,

Sign in to add a comment