mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
usage
This commit is contained in:
parent
6632407c30
commit
4bf568f378
17
README.md
17
README.md
@ -18,4 +18,21 @@ Required Java Version
|
|||||||
----
|
----
|
||||||
JWebAssembly requires Java SE 8 or higher. It is tested with Java SE 8 on [travis-ci.org](https://travis-ci.org/i-net-software/jwebassembly).
|
JWebAssembly requires Java SE 8 or higher. It is tested with Java SE 8 on [travis-ci.org](https://travis-ci.org/i-net-software/jwebassembly).
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Exporting functions
|
||||||
|
To export a function to make it accessible from JavaScript you need add the annotation org.webassembly.annotation.Export
|
||||||
|
|
||||||
|
```java
|
||||||
|
import org.webassembly.annotation.Export;
|
||||||
|
|
||||||
|
@Export
|
||||||
|
public static int add( int a, int b ) {
|
||||||
|
return a + b;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Java Limits
|
||||||
|
In version 1 of WebAssembly you can compile only:
|
||||||
|
* static methods
|
||||||
|
* use the data types int, long float and double
|
||||||
|
Loading…
x
Reference in New Issue
Block a user