Skip to content

Commit cb52d6b

Browse files
committed
clean up object handling
1 parent 615629b commit cb52d6b

File tree

3 files changed

+12
-24
lines changed

3 files changed

+12
-24
lines changed

jscomp/core/lam_convert.ml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -816,13 +816,11 @@ let convert (exports : Set_ident.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
816816
Lam.for_ id (convert_aux from_) (convert_aux to_) dir (convert_aux loop)
817817
| Lassign (id, body) ->
818818
Lam.assign id (convert_aux body)
819-
| Lsend (kind, _,b,ls, _loc) ->
819+
| Lsend (Public(Some name), _, obj, _, _loc) ->
820820
(* Format.fprintf Format.err_formatter "%a@." Printlambda.lambda b ; *)
821-
(match convert_aux b with
821+
(match convert_aux obj with
822822
| Lprim {primitive = Pjs_unsafe_downgrade _; args;loc}
823823
->
824-
begin match kind, ls with
825-
| Public (Some name), [] ->
826824
let setter = Ext_string.ends_with name Literals.setter_suffix in
827825
let property =
828826
if setter then
@@ -831,12 +829,10 @@ let convert (exports : Set_ident.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
831829
(String.length name - Literals.setter_suffix_len))
832830
else Lam_methname.translate name in
833831
prim ~primitive:(Pjs_unsafe_downgrade {name = property; setter})
834-
~args loc
835-
| _ -> assert false
836-
end
832+
~args loc
837833
| _ ->
838834
assert false)
839-
835+
| Lsend _ -> assert false
840836
| Levent _ ->
841837
(* disabled by upstream*)
842838
assert false

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -395140,13 +395140,11 @@ let convert (exports : Set_ident.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
395140395140
Lam.for_ id (convert_aux from_) (convert_aux to_) dir (convert_aux loop)
395141395141
| Lassign (id, body) ->
395142395142
Lam.assign id (convert_aux body)
395143-
| Lsend (kind, _,b,ls, _loc) ->
395143+
| Lsend (Public(Some name), _, obj, _, _loc) ->
395144395144
(* Format.fprintf Format.err_formatter "%a@." Printlambda.lambda b ; *)
395145-
(match convert_aux b with
395145+
(match convert_aux obj with
395146395146
| Lprim {primitive = Pjs_unsafe_downgrade _; args;loc}
395147395147
->
395148-
begin match kind, ls with
395149-
| Public (Some name), [] ->
395150395148
let setter = Ext_string.ends_with name Literals.setter_suffix in
395151395149
let property =
395152395150
if setter then
@@ -395155,12 +395153,10 @@ let convert (exports : Set_ident.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
395155395153
(String.length name - Literals.setter_suffix_len))
395156395154
else Lam_methname.translate name in
395157395155
prim ~primitive:(Pjs_unsafe_downgrade {name = property; setter})
395158-
~args loc
395159-
| _ -> assert false
395160-
end
395156+
~args loc
395161395157
| _ ->
395162395158
assert false)
395163-
395159+
| Lsend _ -> assert false
395164395160
| Levent _ ->
395165395161
(* disabled by upstream*)
395166395162
assert false

lib/4.06.1/whole_compiler.ml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -398210,13 +398210,11 @@ let convert (exports : Set_ident.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
398210398210
Lam.for_ id (convert_aux from_) (convert_aux to_) dir (convert_aux loop)
398211398211
| Lassign (id, body) ->
398212398212
Lam.assign id (convert_aux body)
398213-
| Lsend (kind, _,b,ls, _loc) ->
398213+
| Lsend (Public(Some name), _, obj, _, _loc) ->
398214398214
(* Format.fprintf Format.err_formatter "%a@." Printlambda.lambda b ; *)
398215-
(match convert_aux b with
398215+
(match convert_aux obj with
398216398216
| Lprim {primitive = Pjs_unsafe_downgrade _; args;loc}
398217398217
->
398218-
begin match kind, ls with
398219-
| Public (Some name), [] ->
398220398218
let setter = Ext_string.ends_with name Literals.setter_suffix in
398221398219
let property =
398222398220
if setter then
@@ -398225,12 +398223,10 @@ let convert (exports : Set_ident.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
398225398223
(String.length name - Literals.setter_suffix_len))
398226398224
else Lam_methname.translate name in
398227398225
prim ~primitive:(Pjs_unsafe_downgrade {name = property; setter})
398228-
~args loc
398229-
| _ -> assert false
398230-
end
398226+
~args loc
398231398227
| _ ->
398232398228
assert false)
398233-
398229+
| Lsend _ -> assert false
398234398230
| Levent _ ->
398235398231
(* disabled by upstream*)
398236398232
assert false

0 commit comments

Comments
 (0)