reactiverse / es4x

🚀 fast JavaScript 4 Eclipse Vert.x
https://reactiverse.io/es4x/
Apache License 2.0
884 stars 75 forks source link

PR: TLI Does not work #387

Closed frank-dspeed closed 4 years ago

frank-dspeed commented 4 years ago

es4x esm-index.js

import './sideEffectAsyncAwait.js'

results in

SyntaxError:./core-features/esm-index.js:1:62 Expected an operand but found import
(function (exports, require, module, __filename, __dirname) { import './sideEffectAsyncAwait.js'

es4x esm-index.mjs

import './sideEffectAsyncAwait.js'

results in

Error: sideEffectAsyncAwait
        at org.graalvm.polyglot.Context.eval(Context.java:345)
        at io.reactiverse.es4x.Runtime.eval(Runtime.java:150)
        at io.reactiverse.es4x.impl.MJSVerticleFactory$1.start(MJSVerticleFactory.java:53)
        at io.vertx.core.Verticle.start(Verticle.java:66)

Shared Example

sideEffectAsyncAwait.js

async function Await(msg) {
    const me = await Promise.resolve(msg)
    console.log(me)
}
Await('hi Await async').then(console.log)