Nashorn's CodeInstaller API has few problems:
- the type parameter <T> is unnecessary, as we only have one specialization for <ScriptEnvironment>
- accordingly, "T getOwner()" should be changed to "ScriptEnvironment getScriptEnvironment()". Better yet, "Context getContext()"
Nashorn's Compiler constructors are horrendous and it's not entirely clear which one is for what purpose. This could be somewhat remedied by:
- replacing them with static factory methods with descriptive names, and
- when CodeInstaller is passed, neither Context, ScriptEnvironment, nor ErrorManager need to be passed as they can all be reached through the CodeInstaller if we have the above proposed CodeInstaller.getContext(). In some cases (eval implementation), ErrorManager should still be passed as something other than Context.errMan is used.