Skip to content

Upgrade exponentiation to unified operator #7153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 22, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
result into int32
  • Loading branch information
cometkim committed Mar 22, 2025
commit 63c03a9ad79a64d0e899679981b08df9445e16de
2 changes: 1 addition & 1 deletion compiler/core/js_exp_make.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@ let unchecked_int32_mul ?comment e1 e2 : J.expression =
let int32_pow ?comment (e1 : t) (e2 : t) : J.expression =
match (e1.expression_desc, e2.expression_desc) with
| Number (Int {i = i1}), Number (Int {i = i2}) ->
int ?comment (Ext_int.int32_pow i1 i2)
to_int32 (int ?comment (Ext_int.int32_pow i1 i2))
| _ -> {comment; expression_desc = Bin (Pow, e1, e2)}

let rec int32_bxor ?comment (e1 : t) (e2 : t) : J.expression =
Expand Down
2 changes: 1 addition & 1 deletion compiler/core/js_op.ml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ type int_op =
(* x / y | 0 *)
| Mod
(* x % y *)
| Pow
| Pow (* x ** y | 0 *)

(* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#Bitwise_operators
{[
Expand Down