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
[8:23 PM] Jedel: I see. We currently haven't exposed the Proxy builtin as a public API. However, we're implementing safe wrappers for every object type to make them easier to use in use cases like yours
[8:25 PM] Jedel: If you want, you can open an issue in our repo and we'll work on implementing a safe wrapper for Proxy
[8:30 PM] mikroskeem: hm, I'm not sure if that is the best approach to simply create a rust wrapper for Proxy object
[8:30 PM] mikroskeem: but then again I'm not familiar with Boa internals at all
[8:30 PM] Jedel: The difference would be that a wrapper for Proxy would make it possible to pass native functions as proxy handlers
[8:31 PM] Jedel: whereas a Proxy object inside JS uses JS functions
My use-case would be defining an proxy in native code, e.g to emulate process.env[key] for code I cannot control.
Simply put, instead of evaluating this before running vendor code:
This Pull Request fixes/closes#2075.
It changes the following:
- Implements a `ProxyBuilder` struct to be able to create `Proxy` objects from native function traps.
- Documents `ProxyBuilder` and adjusts some documentation.
- Fixes a clippy lint.
As per discussion in Discord:
My use-case would be defining an proxy in native code, e.g to emulate
process.env[key]
for code I cannot control.Simply put, instead of evaluating this before running vendor code:
could be replaced with 100% Rust counterpart.
The text was updated successfully, but these errors were encountered: