Skip to content

Commit 1e2c57d

Browse files
committed
Flow.the_native_string_of: add comment
1 parent edb11fa commit 1e2c57d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/lib/flow.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,11 @@ let the_string_of ~target info x =
415415
let the_native_string_of ~target info x =
416416
match the_const_of ~target info x with
417417
| Some (NativeString i) -> Some i
418-
| Some (String i) -> Some (Native_string.of_bytestring i)
418+
| Some (String i) ->
419+
(* This function is used to optimize the primitives that access
420+
object properties. These primitives are expected to work with
421+
OCaml string as well, considered as byte strings. *)
422+
Some (Native_string.of_bytestring i)
419423
| _ -> None
420424

421425
let the_block_contents_of info x =

0 commit comments

Comments
 (0)