Skip to content

Commit 503602b

Browse files
committed
make sure it is int32
1 parent 8af675c commit 503602b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/core/js_exp_make.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,7 @@ let int32_pow ?comment (e1 : t) (e2 : t) : J.expression =
16091609
match (e1.expression_desc, e2.expression_desc) with
16101610
| Number (Int {i = i1}), Number (Int {i = i2}) ->
16111611
to_int32 (int ?comment (Ext_int.int32_pow i1 i2))
1612-
| _ -> {comment; expression_desc = Bin (Pow, e1, e2)}
1612+
| _ -> to_int32 (float_pow ?comment e1 e2)
16131613

16141614
let rec int32_bxor ?comment (e1 : t) (e2 : t) : J.expression =
16151615
match (e1.expression_desc, e2.expression_desc) with

tests/tests/src/test_pervasive.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ function a17(prim) {
187187
}
188188

189189
function a18(prim0, prim1) {
190-
return prim0 ** prim1;
190+
return prim0 ** prim1 | 0;
191191
}
192192

193193
let f = Pervasives.$at;

0 commit comments

Comments
 (0)