Skip to content

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

Closed

Description

@megharao

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

Activity

  1. matiwinnetou commented on Jun 15, 2017

    @matiwinnetou
    Contributor

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

  2. irbull commented on Jun 15, 2017

    @irbull
    Contributor

    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.

  3. matiwinnetou commented on Jun 18, 2017

    @matiwinnetou
    Contributor

    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/

  4. irbull commented on Jun 19, 2017

    @irbull
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      Sponsor
      SponsoredKunjungi sekarang
      Promo