Skip to content

Commit 05116ef

Browse files
committed
doc: udpate
1 parent 1e0dd59 commit 05116ef

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,26 @@ QuickJSLoader.initConsoleLog(context);
103103
#### Java and JavaScript can directly convert to each other for the following basic types
104104
- `boolean`
105105
- `int`
106+
- `long`
106107
- `double`
107108
- `String`
108109
- `null`
109-
- `long`
110-
> Because there is no Long type corresponding to Java in JavaScript, the conversion of Long type is special. Long value can be directly transferred from Java to JavaScript, which will be converted to BigInt64.
111110

112111
#### Mutual conversion of JS object types
113112
- `JSObject` represents a JavaScript object
114113
- `JSFunction` represents a JavaScript function
115114
- `JSArray` represents a JavaScript Array
116115

116+
#### About Long type
117+
There is no Long type in JavaScript, the conversion of Long type is special.
118+
119+
- Java --> JavaScript
120+
- The Long value <= Number.MAX_SAFE_INTEGER, will be convert to Number type.
121+
- The Long value > Number.MAX_SAFE_INTEGER, will be convert to BigInt type.
122+
- Number.MIN_SAFE_INTEGER is the same to above.
123+
124+
- JavaScript --> Java: Number(Int64) or BigInt --> Long type
125+
117126
### Set Property
118127
Java
119128

0 commit comments

Comments
 (0)