Skip to content

Commit ee2386d

Browse files
cristianocclaude
andcommitted
Correct the hoisted export_name doc comment
The field stores the flattened name before JS identifier conversion, not the emitted export name; the previous wording caused a consumer to use it verbatim. Signed-Off-By: Cristiano Calcagno <ccrisccris@gmail.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PCtQiaDijUqA2fujQXvKUw
1 parent b96dea0 commit ee2386d

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

compiler/core/js_cmj_format.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ type keyed_cmj_values = keyed_cmj_value array
4848
type hoisted_export = {
4949
path: string list; (** Exact source-level module path segments. *)
5050
export_name: string;
51-
(** Flat compiler identifier used for the public JS export. *)
51+
(** Flattened compiler name for the export, before JS identifier
52+
conversion: the emitted export applies [Ext_ident.convert] to it
53+
(a hoisted [Operator.\"+"] is stored as [Operator$+] and exported
54+
as [Operator$$plus]), and so must any consumer that reconstructs
55+
the JS export name. *)
5256
}
5357

5458
type t = {

compiler/core/js_cmj_format.mli

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ type keyed_cmj_value = {
6363
type hoisted_export = {
6464
path: string list; (** Exact source-level module path segments. *)
6565
export_name: string;
66-
(** Flat compiler identifier used for the public JS export. *)
66+
(** Flattened compiler name for the export, before JS identifier
67+
conversion: the emitted export applies [Ext_ident.convert] to it
68+
(a hoisted [Operator.\"+"] is stored as [Operator$+] and exported
69+
as [Operator$$plus]), and so must any consumer that reconstructs
70+
the JS export name. *)
6771
}
6872

6973
type t = {

0 commit comments

Comments
 (0)