File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 2
2
## Features/Changes
3
3
* Misc: Bump magic number for ocaml 5.1
4
4
* Misc: changes to stay compatible with the next version of ppx_expect
5
- * Runtime: support conversion of Uint8ClampedArray typed arrays to bigarrays.
6
-
5
+ * Runtime: support conversion of Uint8ClampedArray typed arrays to bigarrays (#1472 )
7
6
8
7
## Bug fixes
9
8
* Compiler: fix location for parsing errors when last token is a virtual semicolon
12
11
* Compiler: consise body should allow any expression but object literals
13
12
* Compiler: preserve [ new] without arguments [ new C] (vs [ new C()]
14
13
* Compiler: remove invalid rewriting of js (#1471 , #1469 )
14
+ * Runtime: fix int32 values returned from bigarrays when wrapping Uint32Array objects (#1472 )
15
15
16
16
# 5.2.0 (2023-04-28) - Lille
17
17
## Features/Changes
Original file line number Diff line number Diff line change @@ -895,5 +895,10 @@ function caml_ba_kind_of_typed_array(ta){
895
895
//Requires: caml_ba_create_unsafe
896
896
function caml_ba_from_typed_array ( ta ) {
897
897
var kind = caml_ba_kind_of_typed_array ( ta ) ;
898
+ var ta =
899
+ /* Needed to avoid unsigned setters overflowing
900
+ the range of OCaml [int32] values. */
901
+ ta instanceof Uint32Array ?
902
+ new Int32Array ( ta . buffer , ta . byteOffset , ta . length ) : ta ;
898
903
return caml_ba_create_unsafe ( kind , 0 , [ ta . length ] , ta ) ;
899
904
}
You can’t perform that action at this time.
0 commit comments