Merged
Conversation
Since node's inspect used by console.log strips one layer of proxys, wrap it in two. The inner one uses a simple shared handler. Fixes patriksimek#241. Also allow to connect a host object with a sandbox offset. This allowes to override the Buffer.prototype.inspect method with a saver, in sandbox one, fixes patriksimek#187 for now, however we should have a look if other objects expose a custom inspect method.
Collaborator
Author
|
I want to note here that I don't like the double wrapping, but I have no better idea to fix this. |
patriksimek
approved these changes
Sep 13, 2019
Owner
|
Thanks, I like the double-proxy solution. Pretty smart. |
Collaborator
Author
|
However, this is based on nodes internals, which may change. Should add a test to notice when they decide to unwrapp a object until there is no more proxy around it instead of only one. |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since node's inspect used by console.log strips one layer of proxys, wrap it in two.
The inner one uses a simple shared handler. Fixes #241.
Also allow to connect a host object with a sandbox object. This allowes to override the Buffer.prototype.inspect method with a safer, in sandbox one, fixes #187 for now, however we should have a look if other objects expose a custom inspect method.