Closed matthiasbeyer closed 4 years ago
I know I am necroing an ancient issue, but currently, the way to do would be modifying your Scope manually. Probably in the (hopefully near) future, there will be a more handy interface.
There could be a big security issue when using Scope for this. Script users could read/temper with the application context through Scope, while these values are only meant for the internal use of rust-side functions.
If Rhai scripting language is ever to have effect on something else than itself, the input data should be provided separately from Scope or any script-user directly accessible data.
@JoshLambda not sure I follow you. The Scope
is a sandboxed environment. The script should not be able to affect anything outside of this Scope
except through registered functions.
Following usecase:
I have users input rhai script. I want some environment to be set up for every invocation of the script (Lets think of a global variable that should be available when the script is run).
How do I do that?