Closed JoCriSem closed 3 years ago
This returns a string type:
var answer = window.prompt(msg, "");
It seems that GraalVM does not convert string to int types in the array index - modelList[answer]
So you need to convert answer
to an int first:
answer = parseInt(answer);
This is a GraalVM thing, so there's nothing I can do about it. GraalVM support is experimental and will require some changes in one's JS code.
This is a GraalVM thing, so there's nothing I can do about it. GraalVM support is experimental and will require some changes in one's JS code.
I think we should make it clearer that GraalVM is not meant to be one-to-one compatible with existing scripts nor current API.
I think we should make it clearer that GraalVM is not meant to be one-to-one compatible with existing scripts nor current API.
Well, I tried to in the forum post (https://forum.archimatetool.com/index.php?topic=951.0). I imagine that even if we made this clearer in the wiki I'm not sure people will read it.
I did read that though. But was clueless on how to resolve this. It is working properly now. Thank you.
I imagine that even if we made this clearer in the wiki I'm not sure people will read it.
It might be worth displaying a red message on the Script Console each time a script is ran using GraalVM ;-)
Version of jArchi, Operating System
Archi 4.8.0 - jArchi 1.0.0 - MacOS 11.1
Actions taken
Changed Javascript engine from Nashorn ES6 to GraalVM, ran the below script.
Expected behaviour
Script execution successful, as with Nashorn ES6
Observed behaviour
received error: Script Error: javax.script.ScriptException: org.graalvm.polyglot.PolyglotException: TypeError: undefined has no such function "setAsCurrent"
Script executed