Skip to content

Commit 445e91a

Browse files
authored
Merge pull request #3750 from BuckleScript/fix_4.06
fix 4.06 branch
2 parents 1b594f9 + 2089561 commit 445e91a

23 files changed

+87732
-88659
lines changed

jscomp/bsb_helper/bsb_arg.ml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,19 @@ let parse_exn (speclist : t) anonfun errmsg =
111111
incr current;
112112
| Int f when !current + 1 < l ->
113113
let arg = argv.(!current + 1) in
114-
begin try f (int_of_string arg)
115-
with Failure "int_of_string" ->
116-
raise (Stop (Wrong (s, arg, "an integer")))
114+
begin match int_of_string arg with
115+
| i -> f i
116+
| exception _
117+
->
118+
raise (Stop (Wrong (s, arg, "an integer")))
117119
end;
118120
incr current;
119121
| Set_int r when !current + 1 < l ->
120122
let arg = argv.(!current + 1) in
121-
begin try r := (int_of_string arg)
122-
with Failure "int_of_string" ->
123-
raise (Stop (Wrong (s, arg, "an integer")))
124-
end;
123+
r := (try int_of_string arg
124+
with _ ->
125+
raise (Stop (Wrong (s, arg, "an integer")))
126+
);
125127
incr current;
126128
| _ -> raise (Stop (Missing s))
127129
in

jscomp/core/js_implementation.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ let interface_mliast ppf fname outputprefix =
9999

100100
let get_lambda = fun
101101
#if OCAML_VERSION =~ ">4.03.0" then
102-
{code = lambda}
102+
{Lambda.code = lambda}
103103
#else
104104
lambda
105105
#end -> lambda

lib/4.02.3/bsb_helper.ml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,17 +1555,19 @@ let parse_exn (speclist : t) anonfun errmsg =
15551555
incr current;
15561556
| Int f when !current + 1 < l ->
15571557
let arg = argv.(!current + 1) in
1558-
begin try f (int_of_string arg)
1559-
with Failure "int_of_string" ->
1560-
raise (Stop (Wrong (s, arg, "an integer")))
1558+
begin match int_of_string arg with
1559+
| i -> f i
1560+
| exception _
1561+
->
1562+
raise (Stop (Wrong (s, arg, "an integer")))
15611563
end;
15621564
incr current;
15631565
| Set_int r when !current + 1 < l ->
15641566
let arg = argv.(!current + 1) in
1565-
begin try r := (int_of_string arg)
1566-
with Failure "int_of_string" ->
1567-
raise (Stop (Wrong (s, arg, "an integer")))
1568-
end;
1567+
r := (try int_of_string arg
1568+
with _ ->
1569+
raise (Stop (Wrong (s, arg, "an integer")))
1570+
);
15691571
incr current;
15701572
| _ -> raise (Stop (Missing s))
15711573
in

0 commit comments

Comments
 (0)