Skip to content

Commit eecc3e7

Browse files
committed
change names for maintainability
1 parent 1e64a9e commit eecc3e7

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

jscomp/core/lam_convert.ml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ let prim = Lam.prim
3232
let lam_extension_id loc (head : Lam.t) =
3333
prim ~primitive:lam_caml_id ~args:[head] loc
3434

35+
let lazy_block_info : Lam_tag_info.t =
36+
Blk_record
37+
[|Literals.lazy_done;
38+
Literals.lazy_val|]
3539

3640
let unbox_extension info (args : Lam.t list) mutable_flag loc =
3741
prim ~primitive:(Pmakeblock (0,info,mutable_flag)) ~args loc
@@ -281,15 +285,15 @@ let lam_prim ~primitive:( p : Lambda.primitive) ~args loc : Lam.t =
281285
[ Lam.const Const_js_true ;
282286
result
283287
] in
284-
prim ~primitive:(Pmakeblock (tag,Blk_record [|"RE_LAZY_DONE";"value"|],Mutable)) ~args loc
288+
prim ~primitive:(Pmakeblock (tag,lazy_block_info,Mutable)) ~args loc
285289
| [computation] ->
286290
let args =
287291
[ Lam.const Const_js_false ;
288292
(* FIXME: arity 0 does not get proper supported*)
289293
prim ~primitive:(Pjs_fn_make 0) ~args:[Lam.function_ ~arity:1 ~params:[Ident.create "param"] ~body:computation]
290294
loc
291295
] in
292-
prim ~primitive:(Pmakeblock (tag,Blk_record [|"RE_LAZY_DONE";"value"|],Mutable)) ~args loc
296+
prim ~primitive:(Pmakeblock (tag,lazy_block_info,Mutable)) ~args loc
293297

294298
| _ -> assert false
295299
end

jscomp/ext/literals.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,7 @@ let polyvar_value = "VAL"
146146

147147
let cons = "::"
148148
let hd = "hd"
149-
let tl = "tl"
149+
let tl = "tl"
150+
151+
let lazy_done = "LAZY_DONE"
152+
let lazy_val = "VAL"

jscomp/ext/literals.mli

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,6 @@ val polyvar_value : string
144144

145145
val cons : string
146146
val hd : string
147-
val tl : string
147+
val tl : string
148+
val lazy_done : string
149+
val lazy_val : string

jscomp/stdlib-406/camlinternalLazy.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626

2727
(* Internals of forcing lazy values. *)
2828
type 'a t = {
29-
mutable tag : bool [@bs.as "RE_LAZY_DONE"] ;
29+
mutable tag : bool [@bs.as "LAZY_DONE"] ;
3030
(* Invariant: name *)
31-
mutable value : 'a (* its type is ['a] or [unit -> 'a ] *)
31+
mutable value : 'a [@bs.as "VAL"]
32+
(* its type is ['a] or [unit -> 'a ] *)
3233
}
3334

3435

0 commit comments

Comments
 (0)