-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Proxies: console.log uses overridden proxy methods by default #12453
Comments
Just fyi, But I see your point, and I’m not sure whether this should be a bug or not myself. What’s the alternative to passing the error along? Just defaulting to displaying the Proxy target doesn’t seem quite right… |
To be honest, it makes sense to me that
Perhaps this is a question for the v8 folks? |
That latter behaviour is because (Ironically, one of the reasons |
Here's an example with the trap added:
At first glance, it seems like everything is working correctly in this example (that doesn't involve error throwing). Perhaps this is just an eccentricity of Node or even Javascript itself? (I'm not sure if the ECMA specification has anything to say about this.) |
There are really no consensus on what The way Chrome handles it is always displaying the proxied target in the short one-line view, and providing more information about the proxy once you expand it: Firefox on the other hand always displays the proxied values, and does not allow introspection of the internal slots of the proxy object: And in case of thrown errors, it just says FWIW the Console Standard does not say anything about the possibility of throwing either. |
Should this remain open? |
As far as I see it everything is working as it should. I am closing this therefore. |
Linking to #13784 - it's related in the sense that we currently lack a safe way to inspect JS values. |
Version: 8.0.0-pre
Platform: Darwin MACHINE_NAME.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
The following code sample throws an error, due to
console.log
using the proxy's overriddenget
- is it supposed to? (FWIW, Chrome's v8 does not throw an error and instead logs the target of theProxy
.)The text was updated successfully, but these errors were encountered: