Typing in the console `a.__proto__` where a is a proxy with a recursive prototype hangs the browser
Categories
(DevTools :: Console, defect, P2)
Tracking
(firefox115 fixed)
Tracking | Status | |
---|---|---|
firefox115 | --- | fixed |
People
(Reporter: nicolo.ribaudo, Assigned: nchevobbe)
Details
(Whiteboard: [devtools:relnote])
Attachments
(1 file)
Thank you for helping make Firefox better. If you are reporting a defect, please complete the following:
What were you doing?
On any page, open the console and:
- Execute
const a = new Proxy({}, { getPrototypeOf: () => a });
- Type
a.__proto__
What happened?
The browser stops responding. Even if you close the tab and open a new tab, it will still hang. For example, opening again the devtools in a new tab will show an empty panel.
What should have happened?
Not hang
Anything else we should know?
I believe it's stuck in an infinite loop walking the prototype chain to get property names for autocompletion
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
In the JSPropertyProvider, we are walking up the prototype to retrieve properties.
For proxies with getPrototypeOf
trap, this means that we were returning erroneous
values, as the prototype chain of the proxy isn't altered by the trap.
Worse, it could lead to infinite loop if the trap was setting a circular reference.
To avoid this, when dealing with a proxy, we retrieve the prototype of the proxy
target.
Test cases are added to ensure we don't regress this.
Updated•2 years ago
|
Comment 3•2 years ago
|
||
Backed out for causing mochitests failures in test_jsterm_autocomplete.html.
- Backout link
- Push with failures
- Failure Log
- Failure line: TEST-UNEXPECTED-FAIL | devtools/shared/webconsole/test/chrome/test_jsterm_autocomplete.html | matches.length - got 14, expected 1
Comment 5•2 years ago
|
||
bugherder |
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Description
•