Replies: 1 comment
-
I'm fairly certain we can't lift the requirement of immutable references to the inner captures of a closure, mainly because our current definition of boa/boa_engine/src/native_function.rs Lines 84 to 88 in f793a27 If we lifted that requirement, we would need to wrap our closures in a Having said that, one option to solve this would be to use |
Beta Was this translation helpful? Give feedback.
-
I've wrapped boa's context in a "Engine" struct because I want to add features similar to Deno's allow-env and allow-net. However, I'm encountering the following error when I call
NativeFunction::from_copy_closure_with_captures
as it seems to expect a non-mutable reference to my engine, which won't work because then I can't get a mutable boa context from it.Code for the require function:
It seems like &T needs to be &mut T 🤔
Beta Was this translation helpful? Give feedback.
All reactions