Eager evaluation shouldn't log warnings to the console
Categories
(DevTools :: Console, defect, P2)
Tracking
(firefox75 verified)
Tracking | Status | |
---|---|---|
firefox75 | --- | verified |
People
(Reporter: Oriol, Assigned: nchevobbe)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
Open the console with eager evaluation and type
document.getElementById("")
It will eagerly evaluate to null
, as expected.
But the problem is that this warning will also appear:
Empty string passed to getElementById().
Eager evaluation is supposed to not have observable side effects.
But logging warnings to the console is an observable side-effect.
This shouldn't be happening.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
I wonder if we could set a different "URL" (see https://searchfox.org/mozilla-central/rev/5a10be606f2d76ef22f1f44565749490de991d35/devtools/server/actors/webconsole/eval-with-debugger.js#99-100) for eager evaluations, and then not show messages from this URL we would set.
I'm going to try to do this and see where it leads me to.
Assignee | ||
Comment 2•5 years ago
|
||
This patch is in 2 folds:
- The first one sets a specific url option in evalWithDebugger
when a eager evaluation is requested. - Then in console-service, we block any message that has this
specific sourceName, as it indicates it was triggered by the
eager evaluation.
A test is added to ensure this works as expected.
Comment 4•5 years ago
|
||
bugherder |
Comment 5•5 years ago
|
||
Verified with the scenario from comment 0; using 75.0a1 (2020-03-08) on Windows 10, macOS 10.15, Ubuntu 19.04.
Description
•