Console output mismatch.
Reported by
romul1...@gmail.com,
May 16 2018
|
||||||
Issue description
Chrome Version (from the about:version page): Version 65.0.3325.181 (Official Build) Built on Ubuntu , running on LinuxMint 18.2 (64-bit)
Is this the most recent version: no
OS + version: Linux Mint 18
CPU architecture (32-bit / 64-bit): 64
Window manager: Cinnamon 3.0
URLs (if relevant):
Behavior in Linux Firefox: Same shit
Behavior in Windows Chrome (if you have access to it):
What steps will reproduce the problem?
(1) i change object, add attr obj.selected = !obj.selected
(2) run if (obj.selected = false) {} // i know, this is mistake, i'm prodigy
(3) check this in console
What is the expected result?
selected: false in preview and selected false in tree.
What happens instead?
selected: true in preview and selected false in tree.
my code:
lang.selected = !lang.selected;
console.log(lang);
if (lang.selected = false) { }
,
May 16 2018
This is a duplicate of issue 690113 . >Logged objects show snapshots. >When clicking the expand arrow the first time, it evaluates the contents, as hinted by the 'i' icon. In other words, the object preview correctly reflects the state of the object at the moment console.log was invoked in your code. However, when you expand the object, its current value is shown, not the original one. This is a known peculiarity of devtools which you can circumvent by deep-cloning the object e.g. console.log(JSON.parse(JSON.stringify(obj))) or by using a specialized deepCopy() function from the framework/library of your app. The reason devtools acts this way is to avoid unpredictable slowdowns which would ensue if devtools cloned the objects internally for each console invocation.
,
May 16 2018
,
May 17 2018
,
May 17 2018
,
May 17 2018
thank you for advance
,
May 22 2018
Thanks for filing the issue! Tested the issue on chrome #65.0.3325.181,Stable #66.0.3359.181 & Canary 68.0.3436.0 in Linux Debian Rodete and was able to reproduce the issue. This is a Non-Regression issue since seeing this from M60 #60.0.3072.0, Making the status to Untriaged so that the issue would get addressed. Note : Able to reproduce the issue in MAC 10.12 and win 10.Please find the screen shot for reference. Thank you!
,
May 30 2018
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by romul1...@gmail.com
, May 16 2018i check this behavior with other options: var a = {'b': 3, 'd': 4, 'c': true}; console.log(a); a.c = false; a.d = 1 a.b = 53.1 KB
3.1 KB View Download