Skip to content

Commit 199c274

Browse files
committed
Pick up changes from master
1 parent 21c86bd commit 199c274

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/user/JavaInteroperability.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Existing code accessing, e.g., `java.io.File`, should be rewritten to use the `J
6969
```js
7070
//GraalVM JavaScript compliant syntax
7171
var FileClass = Java.type("java.io.File");
72-
//Fails in GraalVM JavaScript
72+
//backwards-compatible syntax
7373
var FileClass = java.io.File;
7474
```
7575

@@ -78,6 +78,8 @@ However, explicitly accessing the required class with `Java.type` is preferred w
7878
1. It allows resolving the class in one step rather than trying to resolve each property as a class.
7979
2. `Java.type` immediately throws a `TypeError` if the class cannot be found or is not accessible, rather than silently treating an unresolved name as a package.
8080

81+
The `js.java-package-globals` flag can be used to deactivate the global fields of Java packages (set `false` to avoid creation of the fields; default is `true`).
82+
8183
### Constructing Java Objects
8284
Java objects can be constructed with JavaScript's `new` keyword:
8385

0 commit comments

Comments
 (0)