Skip to content

Commit

Permalink
refactor: remove option type from J.New (#1201)
Browse files Browse the repository at this point in the history
* refactor: remove option type from J.New

* don't match
  • Loading branch information
anmonteiro authored Oct 27, 2024
1 parent 5718a02 commit 7da3ddd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions jscomp/core/j.ml
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ and expression_desc =
All exported declarations have to be OCaml identifiers
2. Javascript dot (need to be preserved/or using quote)
*)
| New of { expr : expression; args : expression list option }
(* TODO: option remove *)
| New of { expr : expression; args : expression list }
| Var of vident
| Fun of {
method_ : bool;
Expand Down
3 changes: 1 addition & 2 deletions jscomp/core/js_dump.ml
Original file line number Diff line number Diff line change
Expand Up @@ -892,8 +892,7 @@ and expression_desc cxt ~(level : int) x : cxt =
string cxt L.new_;
space cxt;
let cxt = expression ~level:16 cxt e in
paren_group cxt 1 (fun _ ->
match el with Some el -> arguments cxt el | None -> cxt)))
paren_group cxt 1 (fun _ -> arguments cxt el)))
| Cond { pred = e; then_ = e1; else_ = e2 } ->
let action () =
let cxt = expression ~level:3 cxt e in
Expand Down
2 changes: 1 addition & 1 deletion jscomp/core/js_exp_make.ml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ let typeof ?loc ?comment (e : t) : t =
| _ -> make_expression ?loc ?comment (Typeof e)

let new_ ?loc ?comment e0 args : t =
make_expression ?loc ?comment (New { expr = e0; args = Some args })
make_expression ?loc ?comment (New { expr = e0; args })

let unit : t = make_expression Undefined

Expand Down

0 comments on commit 7da3ddd

Please sign in to comment.