File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -744,21 +744,21 @@ and compile_untagged_cases cxt switch_exp table default =
744
744
let literal = function
745
745
| literal -> E. literal literal
746
746
in
747
- let add_runtime_type_check (literal : Lambda.literal ) x = match literal with
747
+ let add_runtime_type_check (literal : Lambda.literal ) x y = match literal with
748
748
| Block IntType
749
749
| Block StringType
750
750
| Block FloatType
751
- | Block Object -> E. typeof x
752
- | Block Array -> assert false
751
+ | Block Object -> E. string_equal ( E. typeof y) x
752
+ | Block Array -> E. instanceof x y
753
753
| Block Unknown ->
754
754
(* This should not happen because unknown must be the only non-literal case *)
755
755
assert false
756
756
| Bool _ | Float _ | Int _ | String _ | Null | Undefined -> x in
757
757
let mk_eq (i : Lambda.literal option ) x j y = match i, j with
758
- | Some literal , _ ->
759
- E. string_equal x ( add_runtime_type_check literal y)
758
+ | Some literal , _ -> (* XX *)
759
+ add_runtime_type_check literal x y
760
760
| _ , Some literal ->
761
- E. string_equal ( add_runtime_type_check literal x) y
761
+ add_runtime_type_check literal y x
762
762
| _ -> E. string_equal x y
763
763
in
764
764
let is_array (l , _ ) = l = Lambda. Block Array in
You can’t perform that action at this time.
0 commit comments