Commit Graph

6 Commits

Author SHA1 Message Date
P0nk
46c2d92082 refactor: use Invocable instead of ScriptEngine in script managers
- Make fields final
- Inject event script variable earlier
- Remove redundant fields
2021-04-18 11:26:05 +02:00
P0nk
a18a1cb8ce Replace NashornScriptEngine with implicit GraalJSScriptEngine
GraalJSScriptEngine implements Invocable, which is why casting to it works.
However, this is just a quick and ugly fix to make it compile.
A better solution would be to cast it once, immediately after `eval`,
and from then on only handle it as Invocable.

Scripts still need to be fixed. They are still using Rhino and Nashorn-specific
ways of importing packages.
Usages of "importPackage" and "Packages" need to be replaced with
the Graal specific "Java.type".
2021-04-17 15:12:19 +02:00
P0nk
5730b3b42d cleanup: use implicit generic type with diamond operator 2021-04-08 07:42:10 +02:00
P0nk
ed5a444753 cleanup: remove unnecessary unboxing 2021-04-07 23:52:58 +02:00
P0nk
6253169e35 cleanup: replace anonymous inner class with lambda 2021-04-07 23:45:28 +02:00
P0nk
813643036b Switch to Maven file structure 2021-03-30 21:56:34 +02:00