how to help with ES6 features

Paulo Lopes pmlopes at gmail.com
Thu Apr 27 12:07:51 UTC 2017


I can make it work with nashorn. Currently it does run on nashorn jdk8 plus
I need a executor impl for the async part. Of course I'm using vert.x for
this ;) However this could be a runtime configuration and by default use a
simple ThreadPool as it exists on the JDK itself and allow (say with some
runtime config) to provide a custom executor.

The executor is basically the equivalent of the not yet standard:

setImmediate(function);

Or node's:

nextTick(function);

So in nashorn it can be just a java.lang.Runnable and a ThreadPoolExecutor.

Cheers,
Paulo


On Thu, Apr 27, 2017 at 1:49 PM, Hannes Wallnöfer <
hannes.wallnoefer at oracle.com> wrote:

> Hi Paulo,
>
> Excellent! I’d be happy to help you and sponsor this work.
>
> Do you think your existing code would work in Nashorn, or would it be a
> reimplementation based on that prototype? In any case, a link to the code
> would be nice to get an idea of what’s involved.
>
> Also, before contributing to OpenJDK you have to sign and send in the
> committer agreement as described in http://openjdk.java.net/contribute/ .
> If you aren’t a committer already we can help you with this.
>
> Hannes
>
>
> > Am 27.04.2017 um 13:16 schrieb Paulo Lopes <pmlopes at gmail.com>:
> >
> > Hi,
> >
> > For Vert.x javascript support I've prototyped the Promise API as per:
> >
> > https://developer.mozilla.org/en-US/docs/Web/JavaScript/
> Reference/Global_Objects/Promise
> > http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects
> >
> > I see that it is not in the complete list, If someone would "mentor" me
> with how to get it in nashorn, I'd gladly contribute the code.
> >
> > As an example here's some demo:
> >
> > https://gist.github.com/pmlopes/3d86f67943b3ffd9dd9aff73067de0a2
> >
> > And it has been tested to work with babel.js to allow transpiling
> `async` `await` to Promise API.
> >
> > Cheers,
> > Paulo
> >
> >
> > On Wed, Apr 26, 2017 at 4:38 PM, Hannes Wallnöfer <
> hannes.wallnoefer at oracle.com> wrote:
> > Here’s a list of things we have working and things we don’t:
> >
> > https://bugs.openjdk.java.net/browse/JDK-8066046
> >
> > ES6 support in the parser is pretty much complete, so some features are
> arrow functions are ‚almost‘ working, and others may not require too much
> effort.
> >
> > Hannes
> >
> >
> > > Am 26.04.2017 um 16:18 schrieb Karl Pietrzak <kap4020 at gmail.com>:
> > >
> > > On Wed, Apr 26, 2017 at 10:14 AM, Hannes Wallnöfer <
> > > hannes.wallnoefer at oracle.com> wrote:
> > >
> > >> ES6 support is still work in progress, we only support some of it, so
> > >> making it the default wouldn’t be a good idea.
> > >>
> > >
> > >
> > > Is there a feature I can help with?   If someone points me in the right
> > > direction, I can submit a patch.  I don't see anything in JIRA, really.
> >
> >
> >
> >
> > --
> > Paulo Lopes
> > www.jetdrone.com
>
>


-- 
Paulo Lopes
www.jetdrone.com


More information about the nashorn-dev mailing list