Issue metadata
Sign in to add a comment
|
Context is not correct inside of an arrow function
Reported by
alejandr...@gapps.fi,
Nov 14
|
||||||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 Steps to reproduce the problem: 1. Download the react project from here: https://github.com/lopezvit/react_tutorial It is very simple because it comes form a tutorial 2. Execute it with npm install && npm start (needs node installed) 3. When the browser window opens, open the devTools and delete one of the counters by pressing the "Delete" button. 4. When the debugger stops in the line with the debugger instruction, check the value of this.state: The debugger returns undefined, because the context is wrong, this is pointing to a different object. 5. You can move a couple of lines forward to see that the line gets executed perfectly, but if one were to trust the debugger, it should give an exception. What is the expected behavior? The debugger should interpret the correct behaviour of the arrow functions inside of classes. What went wrong? The debugger doesn't get the correct context, changing the value of the "this" object inside of the arrow function. Did this work before? N/A Chrome version: 70.0.3538.77 Channel: n/a OS Version: OS X 10.14.1 Flash Version: I have attached an image on how it looks when you put the mouse the way that I describe in the steps to reproduce.
,
Nov 14
,
Nov 15
Thanks for filing the issue.. As per comment#1 duping the issue into issue id: 900644 and marking it as a duplicate. Please feel free to undupe if it is not the case. |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by alejandr...@gapps.fi
, Nov 14