Skip to content

Commit

Permalink
Clarify non-native @jstype support for Java 16 records
Browse files Browse the repository at this point in the history
Does not attempt to address native support - like enums, if this is to
be supported, it will likely require its own annotation and semantics.

Fixes google#6
  • Loading branch information
niloc132 committed Apr 7, 2024
1 parent 2b75d51 commit 90bcc64
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion java/jsinterop/annotations/JsType.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*
* <p>Marking an object with JsType is similar to marking each public member of the class with
* {@link JsProperty}/{@link JsMethod}/{@link JsConstructor} respectively. In order for this to work
* correctly the JavaScript name needs to be unique for each member. Some unobvious ways to cause
* correctly the JavaScript name needs to be unique for each member. Some nonobvious ways to cause
* name collisions are:
*
* <ul>
Expand All @@ -48,6 +48,9 @@
* <p>For native interfaces with no particular JavaScript type associated with them (e.g. structural
* types) it is recommended to use {@code namespace = JsPackage.GLOBAL} and {@code name = '?'}.
*
* <p>If a Java {@code record} is marked a "non-native" JsType public accessor methods are treated
* as though they are annotated with {@link JsProperty}.
*
* <p><b>Instanceof and Castability:</b>
*
* <p>If the JsType is native, the generated code will try to mimic Javascript semantics.
Expand Down

0 comments on commit 90bcc64

Please sign in to comment.