What's not working as expected? The more details about the problem the
better.
Not sure if it helps but the cached scripts are recreated if you edit
them and the state they had is lost, that's not something particular to
the GraalVM JavaScript engine though. If the script is not cached it
will always have a new state each time it is executed (e.g. standalone).
Best regards.