cached console.* parameters are displayed with their state at the time the console opens, not when the console.* call was made
Categories
(DevTools :: Console, defect, P3)
Tracking
(Not tracked)
People
(Reporter: peter.mlich, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; rv:94.0) Gecko/20100101 Firefox/94.0
Steps to reproduce:
<script>
var list;
list = [1,2,3];
console.log(list);
console.log(JSON.stringify(list));
list[list.length] = 4;
/*
13:08:41.910 Array(4) [ 1, 2, 3, 4 ]
13:08:41.910 [1,2,3]
*/
</script>
Actual results:
Array(4) [ 1, 2, 3, 4 ]
show fake values of array, array in there time not have this values
Expected results:
Array(4) [ 1, 2, 3]
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::Console' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 2•3 years ago
|
||
More detailed STR:
- Navigate to
data:text/html,<meta charset=utf8><script>var list = ["at init time"];console.log(list);console.log(JSON.stringify(list));list.push("added after log")</script>
- Open the console
Expected result:
the 2 console.logs are the same (["at init time"]
)
Actual result:
the console.log
of the variable, without stringifying, also has the item added after (["at init time", "added after log"]
);
Note that if you reload the page, the logs are the same then.
This is a known issue (I thought we had a bug for that, but I can't find it)
I testing function for checkboxes. Run after click on checkbox, not on program init.
list = [1,2,3]; // checked
findinlist(box, list) // write nod found
when not found, add
when found, remove
console write
time0: value = 4
time1: state array before 1,2,3,4
time2: finding state = false
time3: state array after 1,2,3,4
I found, this is may be normal console working. Link on array. But, i think, this is critical error. Not usable, because not show real snapshoot in time, which write before message.
But, in program init its this conduct too bad. If you add time stamp, state but respond state in time. Or, you not do logging in console.log.
I lose 1h for find error in console.log... Shit firefox developers. I before use Alert for tracing program or innerHTML, because need log of lot of states of cycle or sometnig on one paper.
Comment 4•9 months ago
|
||
Unfortunately this is an old time known issue.
But I'd like to do something about this.
Description
•