Skip to content

Commit 944f3e0

Browse files
committed
snapshot
1 parent 92ba998 commit 944f3e0

File tree

2 files changed

+50
-36
lines changed

2 files changed

+50
-36
lines changed

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -404623,25 +404623,32 @@ let app_exp_mapper
404623404623
]}
404624404624
*)
404625404625
| Some {op = "#="; loc; args = [obj; arg]} ->
404626-
begin match view_as_app obj ["##"] with
404627-
| Some { args = [obj; {
404628-
pexp_desc =
404629-
Pexp_ident {txt = Lident name}
404626+
let gen_assignment obj name name_loc =
404627+
sane_property_name_check name_loc name;
404628+
Exp.constraint_ ~loc
404629+
{ e with
404630+
pexp_desc =
404631+
Ast_uncurry_apply.method_apply loc self obj
404632+
(name ^ Literals.setter_suffix) [Nolabel,arg] }
404633+
(Ast_literal.type_unit ~loc ()) in
404634+
begin match obj.pexp_desc with
404635+
| Pexp_send (obj , {txt = name; loc = name_loc})
404636+
-> gen_assignment obj name name_loc
404637+
| _ ->
404638+
match view_as_app obj ["##"] with
404639+
| Some { args = [obj; {
404640+
pexp_desc =
404641+
Pexp_ident {txt = Lident name}
404630404642
| Pexp_constant (
404631-
Pconst_string
404632-
(name, None)); pexp_loc
404633-
}
404634-
]
404635-
}
404636-
->
404637-
sane_property_name_check pexp_loc name;
404638-
Exp.constraint_ ~loc
404639-
{ e with
404640-
pexp_desc =
404641-
Ast_uncurry_apply.method_apply loc self obj
404642-
(name ^ Literals.setter_suffix) [Nolabel,arg] }
404643-
(Ast_literal.type_unit ~loc ())
404644-
| _ -> assert false
404643+
Pconst_string
404644+
(name, None)); pexp_loc = name_loc
404645+
}
404646+
]
404647+
}
404648+
->
404649+
gen_assignment obj name name_loc
404650+
| _ ->
404651+
Location.raise_errorf ~loc "invalid #= assignment"
404645404652
end
404646404653
| Some { op = "|."; loc; } ->
404647404654
Location.raise_errorf ~loc

lib/4.06.1/whole_compiler.ml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -407665,25 +407665,32 @@ let app_exp_mapper
407665407665
]}
407666407666
*)
407667407667
| Some {op = "#="; loc; args = [obj; arg]} ->
407668-
begin match view_as_app obj ["##"] with
407669-
| Some { args = [obj; {
407670-
pexp_desc =
407671-
Pexp_ident {txt = Lident name}
407668+
let gen_assignment obj name name_loc =
407669+
sane_property_name_check name_loc name;
407670+
Exp.constraint_ ~loc
407671+
{ e with
407672+
pexp_desc =
407673+
Ast_uncurry_apply.method_apply loc self obj
407674+
(name ^ Literals.setter_suffix) [Nolabel,arg] }
407675+
(Ast_literal.type_unit ~loc ()) in
407676+
begin match obj.pexp_desc with
407677+
| Pexp_send (obj , {txt = name; loc = name_loc})
407678+
-> gen_assignment obj name name_loc
407679+
| _ ->
407680+
match view_as_app obj ["##"] with
407681+
| Some { args = [obj; {
407682+
pexp_desc =
407683+
Pexp_ident {txt = Lident name}
407672407684
| Pexp_constant (
407673-
Pconst_string
407674-
(name, None)); pexp_loc
407675-
}
407676-
]
407677-
}
407678-
->
407679-
sane_property_name_check pexp_loc name;
407680-
Exp.constraint_ ~loc
407681-
{ e with
407682-
pexp_desc =
407683-
Ast_uncurry_apply.method_apply loc self obj
407684-
(name ^ Literals.setter_suffix) [Nolabel,arg] }
407685-
(Ast_literal.type_unit ~loc ())
407686-
| _ -> assert false
407685+
Pconst_string
407686+
(name, None)); pexp_loc = name_loc
407687+
}
407688+
]
407689+
}
407690+
->
407691+
gen_assignment obj name name_loc
407692+
| _ ->
407693+
Location.raise_errorf ~loc "invalid #= assignment"
407687407694
end
407688407695
| Some { op = "|."; loc; } ->
407689407696
Location.raise_errorf ~loc

0 commit comments

Comments
 (0)