debugger follows wrong branch in 'if'
Reported by
davidmax...@gmail.com,
Nov 5
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36 Steps to reproduce the problem: 1. open this in chrome https://output.jsbin.com/detiyaw 2. open dev tools -> sources; file detiyaw (ie the code in index.html) 3. put a breakpoint on line 22: > if (something) { 4. reload <ctrl-r> - it breaks as expect 5. in console, assign 'false' to something: > something = false < false 6. click step over What is the expected behavior? I expect it to take the 'else' branch and write 'something is false' to the console. What went wrong? It follow the 'true' branch and wrote 'something is true' to the console. Did this work before? N/A Chrome version: 70.0.3538.77 Channel: stable OS Version: Flash Version: If you put a 'debugger;' statement before the 'if', and change 'something' to false on that line, then it takes the 'else' branch.
,
Nov 6
Thanks for filling the issue... Tried to reproduce the issue on reported chrome version 70.0.3538.77 using Ubuntu 17.10. Attaching screenshot for reference. Steps: ----- 1. Launched reported chrome 2. Navigate to given link https://output.jsbin.com/detiyaw 3. Opened dev tools -> sources and clicked on detiyaw 4. Set break point at line 22 and reloaded <ctrl-r> page >> Observed something is true 5. clicked on step over >> Observed something is true As we have observed that on both the step 5 and step 6 >> Observed something is true @Reporter: Could you please check the attached screen cast and please let us know if anything missed from our end. Also verify this issue with fresh profile that is not having any extensions and apps or reset all the flags. Let us know whether issue still persists.
,
Nov 6
Did you miss my step 5 where you change the value of 'something' in the dev console? - should go between your step 4 and step 5. I'm not sure if you attached a screen cast - all I see is a couple of screenshots that are of too low resolution to make out much. I'll attach one of my own. In it, you can see: 1. the breakpoint on the 'if' statement 2. the console where I changed the value of 'something' to 'false' 3. the 'current' line after I have stepped over, which is the 'true' part of the 'if' statement 4. the current value of 'something' in the 'scope/block' area, which is 'false'. It clearly is following the wrong branch of the 'if' statement. It is like the 'if' condition has already been evaluated at the breakpoint, so changing the value of 'something' has no effect on which branch is taken. Note also my use of incognito mode (which should suffice for your suggestion of not having any extensions).
,
Nov 6
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 6
oops, forgot the screenshot...attaching now.
,
Nov 6
Note also, that you can change the value of 'something' using the item in the 'Block' list...it still follows the wrong branch of the 'if'. Double also, if you change 'let something...' to 'const something...' it allows you to change the value. While it is kind of nice to be able to change the value of a 'const' during debugging, I would have expected an error (I'm sure I've seen an error when attempting this in the past). All very strange behaviour and unexpected to the (web) developer, I think.
,
Nov 12
,
Nov 12
Able to reproduce the issue on reported chrome version #70.0.3538.77 and latest canary 72.0.3608.0 using Windows 10, Ubuntu 17.10 and Mac OS 10.14 by following steps as per comment#0. The behaviour is seen from old M-60builds (#60.0.3112.113). This is a non-regression issue, hence marking it as untriaged and requesting someone from the dev team to look into the issue. Thanks.!
,
Dec 5
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by viswa.karala@chromium.org
, Nov 6