Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the version ( j2v8 4.7.1 for linux) support ES6 import, new features? #279

Closed
megharao opened this issue Jun 15, 2017 · 4 comments
Closed

Comments

@megharao
Copy link

I want to load javascript which is using ES6 import and "new" features. Does j2v8 support ES6?

@matiwinnetou
Copy link
Contributor

It uses node 7.4.0 so one needs to check what exact;y V8 version is in this nodejs version.

@irbull
Copy link
Member

irbull commented Jun 15, 2017

It builds on V8 version 5.4.500.45. I don't know if this version supports import. If anyone has some time to try this out and post the answer, that would be greatly appreciated.

@matiwinnetou
Copy link
Contributor

matiwinnetou commented Jun 18, 2017

I am pretty sure: v8 5.4.x does support ES6 imports, in version 6 they already focus on rest spread operator... (kinda ES7)

https://v8project.blogspot.de/

@irbull
Copy link
Member

irbull commented Jun 19, 2017

I just tested it, and unfortunately the answer is no.

    @Test
    public void testImport() {
        String jsCode = "import * as foo from './foo'\n"
                + "let y = foo.square(5);\n"
                + "y;";
        System.out.println(v8.executeIntegerScript(jsCode));
    }

This fails with a compilation error on the symbol import. I also found this while searching the issue, which appears to state that import / module support is not yet available in V8 5.4.

As I've often said, we are bug for bug, feature for feature compatible with V8. We can do as much as V8, but no more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants