Comments (3)
Thank you for reaching out about this, could you please share a complete code example to illustrate the issue?
from graaljs.
This seems to be a misunderstanding of Polyglot API. What do you expect to happen when you invoke entrypoint.execute()
? Note that context.eval(source);
executes your script already (and prints nothing like vanilla Node.js). It returns the value of the executed script. It would be the value of the last statement in non-async code, for example 42
in the following case:
if (false) {
console.log('SKIPPED');
}
console.log('EXECUTED');
42;
and it is the promise that represents your asynchronous code in your case (because you used await
- which basically turned your script into an async
function). So, entrypoint.execute()
attempts to execute the promise as function. This fails because promises are not executable/callable/functions.
In other words, your test-case is equivalent to
var fun = async function() { /* your code */ }; var entryPoint = fun(); entryPoint();
You can verify that this code fails with TypeError: entryPoint is not a function
in both Node.js and graal-js
.
from graaljs.
@iamstolis I see your point, thank you for clarifying this.
from graaljs.
Related Issues (20)
- Temporal toLocaleString returns ISO string instead of localized text HOT 1
- Parallel ScriptEngine script compilation HOT 4
- Get (heap) memory usage information
- "ab".split(/(?:ab)*/) crashes graaljs HOT 1
- Losing double type when returning 1.0 from JS HOT 1
- Polyglot version compatibility check failed on GraalVM for JDK 22 Community 22.0.0
- Expose wrapPromise and Thenable in the GraalJS public API
- Polyglot options not working consistently with JS HOT 2
- No org.graalvm.js:js version 24.0.0 on Maven Central? HOT 4
- No language for id regex found, Supported languages are: [js] HOT 2
- Support for Node.js `http` and `fs` modules in GraalJS HOT 1
- Can not resolve NodeJS Promise Concurrently from Java Side HOT 6
- GraalJS should support Ahead-of-Time(AOT) compilation to Native binary like GraalPy.
- nodejs c-addon seems to leak HOT 1
- Provide the WinterCG minimum common API HOT 1
- Does not find values from the global context HOT 4
- 'GraalJSEngineFactory could not be instantiated' on JDK22 HOT 1
- Extending a Java class in Javascript without using Java.extend HOT 4
- Add instructions for enabling usage of Java
- Wildcards in classpath do not work anymore HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graaljs.