-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(console): never invoke Proxy traps when logging a Proxy #25063
base: main
Are you sure you want to change the base?
Conversation
if (proxyDetails !== null && ctx.showProxy) { | ||
return `Proxy ` + formatValue(ctx, proxyDetails, recurseTimes); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this looks like a lot of changes, but I basically only hoisted out this proxyDetails !== null
branch and moved it to a few lines above. So it's only indentation changes from here on.
@@ -2118,30 +2166,6 @@ Deno.test(function inspectProxy() { | |||
)), | |||
`{ key: "value" }`, | |||
); | |||
assertEquals( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this test, because it was asserting that we did invoke proxy traps, even if we shouldn't.
bb126fa
to
1b87568
Compare
054d2b1
to
cff57ae
Compare
function createFilteredInspectProxy<TObject>(params: { | ||
object: TObject; | ||
keys: (keyof TObject)[]; | ||
evaluate: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When doing
console.log(someProxy)
the Proxy traps should never be invoked. We always did invoke them before which lead to unexpected errors. This aligns proxy logging in Deno with all other runtimes.Fixes #25054
Fixes #24980
Fixes #12926