Skip to content

Commit ea85fc8

Browse files
committed
clean up
1 parent 46d6894 commit ea85fc8

File tree

14 files changed

+59
-25
lines changed

14 files changed

+59
-25
lines changed

jscomp/core/js_dump.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,11 +857,11 @@ and expression_desc cxt ~(level:int) f x : cxt =
857857
~level
858858
f
859859
(Object
860-
(("HASH",
860+
((Literals.polyvar_hash,
861861
if !Js_config.debug then hash
862862
else {hash with comment = Some name}
863863
) ::
864-
("value", value) ::
864+
(Literals.polyvar_value, value) ::
865865
if !Js_config.debug then
866866
["name", E.str name]
867867
else []

jscomp/core/js_exp_make.ml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,28 +403,26 @@ let record_access (e : t) (name : string) (pos : int32) =
403403

404404
let poly_var_tag_access (e : t) =
405405
match e.expression_desc with
406-
| Array (l,_) (* Float i -- should not appear here *)
407406
| Caml_block (l,_, _, _) when no_side_effect e
408407
->
409408
(match l with
410409
| x ::_ -> x
411410
| [] ->
412411
assert false
413412
)
414-
| _ -> { expression_desc = Static_index (e, "HASH", Some 0l); comment = None}
413+
| _ -> { expression_desc = Static_index (e, Literals.polyvar_hash, Some 0l); comment = None}
415414

416415

417416
let poly_var_value_access (e : t) =
418417
match e.expression_desc with
419-
| Array (l,_)
420418
| Caml_block (l,_, _, _) when no_side_effect e
421419
->
422420
(match l with
423421
| _ :: v :: _ -> v
424422
| _ ->
425423
assert false
426424
)
427-
| _ -> { expression_desc = Static_index (e, "value", Some 1l); comment = None}
425+
| _ -> { expression_desc = Static_index (e, Literals.polyvar_value, Some 1l); comment = None}
428426

429427
let extension_access (e : t) name (pos : int32) : t =
430428
match e.expression_desc with

jscomp/ext/literals.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,6 @@ let sourcedirs_meta = ".sourcedirs.json"
140140
let ns_sep_char = '-'
141141
let ns_sep = "-"
142142
let exception_id = "RE_EXN_ID"
143+
144+
let polyvar_hash = "HASH"
145+
let polyvar_value = "value"

jscomp/ext/literals.mli

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,6 @@ val ns_sep_char : char
138138
val ns_sep : string
139139

140140
val exception_id : string
141+
142+
val polyvar_hash : string
143+
val polyvar_value : string

jscomp/runtime/caml_option.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ let option_get (x : 'a option) =
7575
else Obj.magic (valFromOption (Obj.repr x))
7676

7777

78-
type poly = {hash : int [@bs.as "HASH"]; value : Obj.t }
78+
type poly = {hash : int [@bs.as "HASH" (* Literals.polyvar_hash*)]; value : Obj.t }
7979

8080
(** [input] is optional polymorphic variant *)
8181
let option_unwrap (x : poly option) =

lib/4.06.1/bsb.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4567,6 +4567,8 @@ val ns_sep : string
45674567

45684568
val exception_id : string
45694569

4570+
val polyvar_hash : string
4571+
val polyvar_value : string
45704572
end = struct
45714573
#1 "literals.ml"
45724574
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -4712,6 +4714,8 @@ let ns_sep_char = '-'
47124714
let ns_sep = "-"
47134715
let exception_id = "RE_EXN_ID"
47144716

4717+
let polyvar_hash = "HASH"
4718+
let polyvar_value = "value"
47154719
end
47164720
module Ext_path : sig
47174721
#1 "ext_path.mli"

lib/4.06.1/bsb_helper.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3183,6 +3183,8 @@ val ns_sep : string
31833183

31843184
val exception_id : string
31853185

3186+
val polyvar_hash : string
3187+
val polyvar_value : string
31863188
end = struct
31873189
#1 "literals.ml"
31883190
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -3328,6 +3330,8 @@ let ns_sep_char = '-'
33283330
let ns_sep = "-"
33293331
let exception_id = "RE_EXN_ID"
33303332

3333+
let polyvar_hash = "HASH"
3334+
let polyvar_value = "value"
33313335
end
33323336
module Bsb_db_decode : sig
33333337
#1 "bsb_db_decode.mli"

lib/4.06.1/unstable/all_ounit_tests.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4035,6 +4035,8 @@ val ns_sep : string
40354035

40364036
val exception_id : string
40374037

4038+
val polyvar_hash : string
4039+
val polyvar_value : string
40384040
end = struct
40394041
#1 "literals.ml"
40404042
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -4180,6 +4182,8 @@ let ns_sep_char = '-'
41804182
let ns_sep = "-"
41814183
let exception_id = "RE_EXN_ID"
41824184

4185+
let polyvar_hash = "HASH"
4186+
let polyvar_value = "value"
41834187
end
41844188
module Ounit_cmd_util : sig
41854189
#1 "ounit_cmd_util.mli"

lib/4.06.1/unstable/bsb_native.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4567,6 +4567,8 @@ val ns_sep : string
45674567

45684568
val exception_id : string
45694569

4570+
val polyvar_hash : string
4571+
val polyvar_value : string
45704572
end = struct
45714573
#1 "literals.ml"
45724574
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -4712,6 +4714,8 @@ let ns_sep_char = '-'
47124714
let ns_sep = "-"
47134715
let exception_id = "RE_EXN_ID"
47144716

4717+
let polyvar_hash = "HASH"
4718+
let polyvar_value = "value"
47154719
end
47164720
module Ext_path : sig
47174721
#1 "ext_path.mli"

lib/4.06.1/unstable/bspack.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10074,6 +10074,8 @@ val ns_sep : string
1007410074

1007510075
val exception_id : string
1007610076

10077+
val polyvar_hash : string
10078+
val polyvar_value : string
1007710079
end = struct
1007810080
#1 "literals.ml"
1007910081
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -10219,6 +10221,8 @@ let ns_sep_char = '-'
1021910221
let ns_sep = "-"
1022010222
let exception_id = "RE_EXN_ID"
1022110223

10224+
let polyvar_hash = "HASH"
10225+
let polyvar_value = "value"
1022210226
end
1022310227
module Ext_path : sig
1022410228
#1 "ext_path.mli"

0 commit comments

Comments
 (0)