File tree 1 file changed +1
-5
lines changed
1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -768,12 +768,8 @@ and compile_untagged_cases ~cxt ~switch_exp ~default ~block_cases cases =
768
768
let switch ?default ?declaration e clauses =
769
769
let (not_typeof_clauses, typeof_clauses) = List. partition is_not_typeof clauses in
770
770
let rec build_if_chain remaining_clauses = (match remaining_clauses with
771
- | (Ast_untagged_variants. Untagged (InstanceType Array), {J. switch_body} ) :: rest ->
772
- S. if_ (E. is_array e)
773
- (switch_body)
774
- ~else_: ([build_if_chain rest])
775
771
| (Ast_untagged_variants. Untagged (InstanceType instanceType ), {J. switch_body} ) :: rest ->
776
- S. if_ (E. instanceof e ( E. js_global ( Ast_untagged_variants.Instance. to_string instanceType)))
772
+ S. if_ (E. emit_check ( IsInstanceOf ( instanceType, Expr e )))
777
773
(switch_body)
778
774
~else_: ([build_if_chain rest])
779
775
| _ -> S. string_switch ?default ?declaration (E. typeof e) typeof_clauses) in
You can’t perform that action at this time.
0 commit comments