File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change 24
24
25
25
type outcome = Eval_false | Eval_true | Eval_unknown
26
26
27
- let rec id_is_for_sure_true_in_boolean (tbl : Lam_stats.ident_tbl ) id =
27
+ let id_is_for_sure_true_in_boolean (tbl : Lam_stats.ident_tbl ) id =
28
28
match Hash_ident. find_opt tbl id with
29
- | Some
30
- (Normal_optional
31
- ( Lprim {loc = _; primitive = Psome_not_nest ; args = [Lvar id']}
32
- | Lvar id' )) ->
33
- id_is_for_sure_true_in_boolean tbl id'
34
29
| Some
35
30
(Normal_optional
36
31
(Lconst (Const_js_false | Const_js_null | Const_js_undefined _ ))) ->
37
32
Eval_false
38
- | Some (Normal_optional _)
39
- | Some (ImmutableBlock _)
40
- | Some (MutableBlock _)
41
- | Some (Constant (Const_block _ | Const_js_true )) ->
42
- Eval_true
33
+ | Some (Constant Const_js_true) -> Eval_true
43
34
| Some (Constant (Const_int {i} )) -> if i = 0l then Eval_false else Eval_true
44
35
| Some (Constant (Const_js_false | Const_js_null | Const_js_undefined _ )) ->
45
36
Eval_false
46
37
| Some
47
- ( Constant _ | Module _ | FunctionId _ | Exception | Parameter | NA
38
+ ( Normal_optional _ | ImmutableBlock _ | MutableBlock _ | Constant _
39
+ | Module _ | FunctionId _ | Exception | Parameter | NA
48
40
| OptionalBlock (_, (Undefined | Null | Null_undefined )) )
49
41
| None ->
50
42
Eval_unknown
You can’t perform that action at this time.
0 commit comments