Function in SVG global evaluated despite having side effects
Categories
(DevTools :: Console, defect, P3)
Tracking
(Not tracked)
People
(Reporter: gyorokpeter1, Unassigned)
Details
Attachments
(1 file)
1.14 KB,
application/x-zip-compressed
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0
Steps to reproduce:
Extract the attached .zip file and open test.html via a HTTP server (it doesn't work if opened via file://). Open the console with F12, make sure that "Instant Evaluation" is enabled, and start typing:
panelJs.a
Then type an opening parenthesis, delete it and type again.
Actual results:
The result preview appears and shows a different number each time, since the function changes a global variable every time it is called.
Expected results:
The function should not be called during preview because it has a side effect.
Comment 1•8 months ago
|
||
Reporter, can you please attach the mentioned .zip file. Thank you.
Reporter | ||
Comment 2•8 months ago
|
||
Comment 3•7 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::Console' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 4•7 months ago
|
||
simpler str:
- Go to https://ffx-devtools-svg-script-instant-evaluation.glitch.me/
- Open the console
- Type
panelJs.a()
expected result: no instant evaluation
actual result: instant evaluation is displayed, modifying the v
variable's value
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
Comment 5•6 months ago
|
||
I was able to reproduce the issue on Win11 x64 using Firefox build 128.0a1 and steps from comment#4.
Description
•