You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
util: inspect without showProxy triggers traps in proxified proxies #61061
I traced this through util.inspect() and noticed that the failure happens
inside formatValue(), before formatRaw() is reached.
When showProxy is disabled, the inspected value can stop being treated as a
Proxy and later code ends up touching it in a way that triggers traps for nested
proxies.
I’m working on a small change to keep proxies opaque in this case and adding a
regression test. I’ll open a PR once it’s ready.
IIUC the consensus in #60964 is that inspect should mark proxies but still not trigger traps.
If #61029 lands, the expected outputs here would be Proxy({}) and Proxy(Proxy({})). The semverity must be kept in mind.
If #60964 gets fixed in more extreme way, making inspecting first proxy throw, it would be aligned with nested proxy and this issue would be technically resolved as works-as-intended.
Activity
azadgupta1 commentedon Dec 15, 2025
I traced this through
util.inspect()and noticed that the failure happensinside
formatValue(), beforeformatRaw()is reached.When
showProxyis disabled, the inspected value can stop being treated as aProxy and later code ends up touching it in a way that triggers traps for nested
proxies.
I’m working on a small change to keep proxies opaque in this case and adding a
regression test. I’ll open a PR once it’s ready.
benjamingr commentedon Dec 15, 2025
Isn't this kind of counter to #60964 ?
LiviaMedeiros commentedon Dec 15, 2025
IIUC the consensus in #60964 is that
inspectshould mark proxies but still not trigger traps.If #61029 lands, the expected outputs here would be
Proxy({})andProxy(Proxy({})). The semverity must be kept in mind.If #60964 gets fixed in more extreme way, making inspecting first proxy throw, it would be aligned with nested proxy and this issue would be technically resolved as works-as-intended.
BridgeAR commentedon Dec 15, 2025
Good catch @LiviaMedeiros. I agree about the proxy needing to be unwrapped.
util: fix nested proxy inspection