Closed plafue closed 7 years ago
I think having an alternative constructor where you can add bindings directly would be a great thing to have. If I understand the use case correctly, you still want to be able to add bindings later on in the lifecycle of the ScriptEngine
, right? So having the addEngineScopeBindings
method is still necessary, even if there is a new alternative constructor?
Not really. At the time of this writing there's no requirement to modify the bindings beyond construction time. If you think it's cleaner to have an additional constructor for this purpose i'll rewrite the PR :+1:
I would prefer it that way, if it's not too much work. :)
Until now there was no possibility to modify the bindings of the underlying
ScriptEngine
. This way we can set up new bindings without exposing theScriptEngine
to the outside world. I'm open for suggestions how to make this more user friendly (e.g. alternative constructor?)