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
Ideally, it would be nice, but in practice, it is quite cumbersome to do.The TemplateContext.MemberRenamer can be changed at any time, and it would require to check this and rebuild a new set of builtin functions. Also builtin functions are cached (only created once) so that they don't generate a new one everytime with create a new template context.
That being said, It is true that a ScriptObject doesn't take as a parameter a template renamer, so it is making all ScriptObject that are using auto-import of methods not usable with a different renamer (as this is the case for builtin functions)
So at least a first step to improve this situation would be to allow to propagate a MemberRenamer at ScriptObject constructor time, to pass it the the Import call here:
And then add a new BuiltinFunctions constructor that could take a MemberRenamer and propagate it to the internal constructors (without using the internal DefaultBuiltins cache)
PR welcome (don't have enough spare time to work on this)
It would be nice if the default built-in functions would be aware of the
TemplateContext.MemberRenamer
. This would make it a bit more consistent.The text was updated successfully, but these errors were encountered: