Skip to content

Commit d49a231

Browse files
committed
rename fn
1 parent e317fa0 commit d49a231

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

jscomp/ml/runtime_representation.ml

+13-13
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@ let tag_type_to_possible_values (tag_type : Ast_untagged_variants.tag_type) :
7676
| Untagged UnknownType -> Any
7777
| _ -> Any
7878

79-
let process_fields fields env type_expr_to_possible_values =
79+
let process_fields fields env to_runtime_representation =
8080
fields
8181
|> List.map (fun (label : Types.label_declaration) ->
8282
{
8383
optional = false (* TODO: Replicate existing rules*);
8484
key = label.ld_id.name (* TODO: @as attribute *);
85-
value = Known (type_expr_to_possible_values label.ld_type env);
85+
value = Known (to_runtime_representation label.ld_type env);
8686
})
8787

88-
let rec type_expr_to_possible_values (type_expr : Types.type_expr) (env : Env.t)
88+
let rec to_runtime_representation (type_expr : Types.type_expr) (env : Env.t)
8989
: runtime_js_value list =
9090
match type_expr.desc with
9191
(* Builtins *)
@@ -97,9 +97,9 @@ let rec type_expr_to_possible_values (type_expr : Types.type_expr) (env : Env.t)
9797
when Path.same p Predef.path_float || Path.same p Predef.path_int ->
9898
[Number {value = Unknown}]
9999
| Tconstr (p, [inner], _) when Path.same p Predef.path_option ->
100-
[UndefinedLiteral] @ type_expr_to_possible_values inner env
100+
[UndefinedLiteral] @ to_runtime_representation inner env
101101
| Tconstr (p, [inner], _) when Path.same p Predef.path_dict ->
102-
[Dict {value_type = type_expr_to_possible_values inner env}]
102+
[Dict {value_type = to_runtime_representation inner env}]
103103
(* Types needing lookup*)
104104
| Tconstr (_, _, _) -> (
105105
try
@@ -109,7 +109,7 @@ let rec type_expr_to_possible_values (type_expr : Types.type_expr) (env : Env.t)
109109
[
110110
Object
111111
{
112-
properties = process_fields fields env type_expr_to_possible_values;
112+
properties = process_fields fields env to_runtime_representation;
113113
can_have_unknown_properties = false;
114114
};
115115
]
@@ -152,7 +152,7 @@ let rec type_expr_to_possible_values (type_expr : Types.type_expr) (env : Env.t)
152152
key = "_" ^ string_of_int index;
153153
value =
154154
Known
155-
(type_expr_to_possible_values payload env);
155+
(to_runtime_representation payload env);
156156
}));
157157
can_have_unknown_properties = false;
158158
}
@@ -175,7 +175,7 @@ let rec type_expr_to_possible_values (type_expr : Types.type_expr) (env : Env.t)
175175
value = Known [tag_value];
176176
};
177177
]
178-
@ process_fields fields env type_expr_to_possible_values;
178+
@ process_fields fields env to_runtime_representation;
179179
can_have_unknown_properties = false;
180180
})
181181
with Not_found -> [Any])
@@ -200,7 +200,7 @@ let rec type_expr_to_possible_values (type_expr : Types.type_expr) (env : Env.t)
200200
{
201201
key = "VAL";
202202
optional = false;
203-
value = Known (type_expr_to_possible_values inner env);
203+
value = Known (to_runtime_representation inner env);
204204
};
205205
];
206206
};
@@ -232,11 +232,11 @@ let a_can_be_represented_as_b (a : runtime_js_value list)
232232
let log t1 t2 env =
233233
Printf.sprintf "Can be coerced: %b\n\nt1 dump: %s\n\nt2 dump: %s\n"
234234
(a_can_be_represented_as_b
235-
(type_expr_to_possible_values t1 env)
236-
(type_expr_to_possible_values t2 env))
237-
(type_expr_to_possible_values t1 env
235+
(to_runtime_representation t1 env)
236+
(to_runtime_representation t2 env))
237+
(to_runtime_representation t1 env
238238
|> List.map debug_print_runtime_value
239239
|> String.concat " | ")
240-
(type_expr_to_possible_values t2 env
240+
(to_runtime_representation t2 env
241241
|> List.map debug_print_runtime_value
242242
|> String.concat " | ")

0 commit comments

Comments
 (0)