Skip to content

Commit 91d4729

Browse files
committed
paren-less
1 parent 1bd5ba4 commit 91d4729

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

jscomp/core/js_dump.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,9 @@ and expression_desc cxt ~(level:int) f x : cxt =
680680
(match info with
681681
| Exp exp_info ->
682682
let raw_paren =
683-
not (match exp_info with Js_literal _ -> true | _ -> false || raw_snippet_exp_simple_enough s) in
683+
not (match exp_info with
684+
| Js_literal _ | Js_raw_json -> true
685+
| Js_function _ | Js_exp_unknown -> false || raw_snippet_exp_simple_enough s) in
684686
if raw_paren then P.string f L.lparen;
685687
P.string f s ;
686688
if raw_paren then P.string f L.rparen;

jscomp/core/js_raw_info.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ type exp =
4040
| RegExp of RegExp.t
4141
]}
4242
*)
43+
| Js_raw_json
4344
| Js_exp_unknown
4445

4546

jscomp/core/lam_compile_const.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ let translate_arg_cst (cst : External_arg_spec.cst) =
129129
E.str i
130130
| Arg_js_null -> E.nil
131131
| Arg_js_json s
132-
-> E.raw_js_code (Exp Js_exp_unknown) s
132+
-> E.raw_js_code (Exp Js_raw_json) s
133133

134134
| Arg_js_true -> E.bool true
135135
| Arg_js_false -> E.bool false

0 commit comments

Comments
 (0)