Skip to content

Commit 35f60ef

Browse files
committed
No more cases of Unknown.
1 parent 9d91b5d commit 35f60ef

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

jscomp/core/lam_compile.ml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -521,17 +521,13 @@ and compile_cases ~is_tag cxt switch_exp table default names =
521521
match names with
522522
| None -> None
523523
| Some {Lam.blocks; consts} ->
524-
match (if is_tag then blocks.(i) else consts.(i)) with
525-
| s -> Some s
526-
| exception Invalid_argument _ -> Some "Unknown")
524+
Some (if is_tag then blocks.(i) else consts.(i)))
527525
(fun i ->
528526
let comment =
529527
match names with
530528
| None -> None
531529
| Some {Lam.blocks; consts} ->
532-
match (if is_tag then blocks.(i) else consts.(i)) with
533-
| s -> Some s
534-
| exception Invalid_argument _ -> Some "Unknown" in
530+
Some (if is_tag then blocks.(i) else consts.(i)) in
535531
{(E.small_int i) with comment})
536532
E.int_equal
537533
cxt

lib/4.02.3/unstable/js_compiler.ml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111197,17 +111197,13 @@ and compile_cases ~is_tag cxt switch_exp table default names =
111197111197
match names with
111198111198
| None -> None
111199111199
| Some {Lam.blocks; consts} ->
111200-
match (if is_tag then blocks.(i) else consts.(i)) with
111201-
| s -> Some s
111202-
| exception Invalid_argument _ -> Some "Unknown")
111200+
Some (if is_tag then blocks.(i) else consts.(i)))
111203111201
(fun i ->
111204111202
let comment =
111205111203
match names with
111206111204
| None -> None
111207111205
| Some {Lam.blocks; consts} ->
111208-
match (if is_tag then blocks.(i) else consts.(i)) with
111209-
| s -> Some s
111210-
| exception Invalid_argument _ -> Some "Unknown" in
111206+
Some (if is_tag then blocks.(i) else consts.(i)) in
111211111207
{(E.small_int i) with comment})
111212111208
E.int_equal
111213111209
cxt

lib/4.02.3/whole_compiler.ml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102311,17 +102311,13 @@ and compile_cases ~is_tag cxt switch_exp table default names =
102311102311
match names with
102312102312
| None -> None
102313102313
| Some {Lam.blocks; consts} ->
102314-
match (if is_tag then blocks.(i) else consts.(i)) with
102315-
| s -> Some s
102316-
| exception Invalid_argument _ -> Some "Unknown")
102314+
Some (if is_tag then blocks.(i) else consts.(i)))
102317102315
(fun i ->
102318102316
let comment =
102319102317
match names with
102320102318
| None -> None
102321102319
| Some {Lam.blocks; consts} ->
102322-
match (if is_tag then blocks.(i) else consts.(i)) with
102323-
| s -> Some s
102324-
| exception Invalid_argument _ -> Some "Unknown" in
102320+
Some (if is_tag then blocks.(i) else consts.(i)) in
102325102321
{(E.small_int i) with comment})
102326102322
E.int_equal
102327102323
cxt

0 commit comments

Comments
 (0)