Skip to content

Commit e2cc008

Browse files
committed
[GR-21011] Add README.md.
PullRequest: js/1367
2 parents 5af0147 + 9e85944 commit e2cc008

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Join the chat at https://gitter.im/graalvm/graaljs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/graalvm/graaljs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1+
[![https://graalvm.slack.com](https://img.shields.io/badge/slack-join%20channel-active)](https://www.graalvm.org/slack-invitation/)
22

33
A high performance implementation of the JavaScript programming language.
44
Built on the GraalVM by Oracle Labs.

docs/user/JavaInterop.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ The method `Java.addToClasspath()` can be used to programmatically add to the cl
3030

3131
### Polyglot Context
3232
The preferred method of launching GraalVM JavaScript with Java interop support instance is via polyglot `Context`.
33-
For that, a new `org.graalvm.polyglot.Context` is built with the `hostAccess` option set:
33+
For that, a new `org.graalvm.polyglot.Context` is built with the `hostAccess` option allowing access and a `hostClassLookup` predicate defining the Java classes you allow access to:
3434

3535
```java
36-
Context context = Context.newBuilder("js").allowHostAccess(true).build();
36+
Context context = Context.newBuilder("js").
37+
allowHostAccess(HostAccess.ALL).
38+
allowHostClassLookup(className -> true). //allows access to all Java classes
39+
build();
3740
context.eval("js", jsSourceCode);
3841
```
3942

docs/user/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
GraalVM includes an ECMAScript compliant JavaScript engine. It is designed to be
2+
fully standard compliant, execute applications with high performance, and
3+
provide all the benefits from the GraalVM stack, including language
4+
interoperability and common tooling. With that engine, GraalVM can execute plain
5+
JavaScript code or run unmodified Node.js applications. Applications can import
6+
npm modules, including native ones.
7+
8+
This user documentation provides information on available GraalVM JavaScript
9+
engine configuration, Node.JS runtime, the `javax.script.ScriptEngine`
10+
implementation, multithreading support details, GraalVM JavaScript execution on
11+
a stock JVM like OpenJDK, possible embedding scenarios and other. To
12+
migrate the code previously targeted to the Nashorn or Rhino engines, migration
13+
guides are available.

0 commit comments

Comments
 (0)