Archi Forum

Archi Plug-ins => jArchi => Topic started by: rchevallier on September 28, 2022, 10:52:03 AM

Title: Version of ECMAscript in GraalVM for jArchi ?
Post by: rchevallier on September 28, 2022, 10:52:03 AM
Hello

What version of ECMAScript is defined in GraalVM for jArchi (cf https://www.graalvm.org/dev/reference-manual/js/JavaScriptCompatibility/) ?

I'm asking because the engine doesn't seem to support the # prefix for private members of a class, although it is recognized:

Script Error: javax.script.ScriptException: org.graalvm.polyglot.PolyglotException: SyntaxError: test.ajs:128:11 Unexpected token: private_ident
    static #hexToRGB (hex) {
           ^
Title: Re: Version of ECMAscript in GraalVM for jArchi ?
Post by: Phil Beauvoir on September 28, 2022, 11:13:08 AM
I don't know to be honest. Do you have an example of JS using the #?
Title: Re: Version of ECMAscript in GraalVM for jArchi ?
Post by: Phil Beauvoir on September 28, 2022, 11:17:28 AM
I think those are part of ECMAScript 2022

https://blog.saeloun.com/2021/10/14/ecmascript-private-fields.html

That version of GraalVM is from 2000. I'll check latest version.
Title: Re: Version of ECMAscript in GraalVM for jArchi ?
Post by: Phil Beauvoir on September 28, 2022, 12:25:42 PM
I tested with the latest version of GraalVM and it does support private member access with #. I'll put together a new build of jArchi with it. Bear in mind that as it's a new version of GraalVM it might have some hidden changes.
Title: Re: Version of ECMAscript in GraalVM for jArchi ?
Post by: rchevallier on September 28, 2022, 16:11:27 PM
Thanks for your quick reply

It's not critical to have the latest version, but always interesting to understand on which ECMAscript standard we shall write code for. I can test the beta if you want

I suggest to add the GraalVM ES supported version to the README of JArchi release