Skip to content

Commit 9ebf5b7

Browse files
author
Hongbo Zhang
committed
fix test cases
1 parent 4477d9c commit 9ebf5b7

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

jscomp/lam.ml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,13 @@ let lam_prim ~primitive:(p : Lambda.primitive) ~args : t =
676676
| Pbigstring_set_16 x -> prim ~primitive:(Pbigstring_set_16 x) ~args
677677
| Pbigstring_set_32 x -> prim ~primitive:(Pbigstring_set_32 x) ~args
678678
| Pbigstring_set_64 x -> prim ~primitive:(Pbigstring_set_64 x) ~args
679-
| Pctconst x -> prim ~primitive:(Pctconst x) ~args
679+
| Pctconst x ->
680+
begin match x with
681+
| Word_size ->
682+
Lift.int 32 (* TODO: documentation*)
683+
| _ -> prim ~primitive:(Pctconst x) ~args
684+
end
685+
680686
| Pbbswap x -> prim ~primitive:(Pbbswap x) ~args
681687
| Pcvtbint (a,b) -> prim ~primitive:(Pcvtbint (a,b)) ~args
682688
| Pbintcomp (a,b) -> prim ~primitive:(Pbintcomp (a,b)) ~args

jscomp/test/string_bound_get_test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ function u_b() {
1111
return Caml_string.get(v, -1);
1212
}
1313

14-
var u_d = Caml_string.get("ghos", -1);
14+
function u_d() {
15+
return Caml_string.get("ghos", -1);
16+
}
1517

1618
var u_e = new Array(32);
1719

jscomp/test/string_bound_get_test.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let u_a = v.[0]
66
let u_b () = v.[-1]
77
let u_c = "ghos".[0]
88

9-
let u_d = "ghos".[-1]
9+
let u_d () = "ghos".[-1]
1010

1111
let u_e = Bytes.create 32
1212

lib/js/sys.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ var match_001 = /* array */[];
88

99
var big_endian = /* false */0;
1010

11-
var word_size = 64;
12-
1311
var unix = /* true */1;
1412

1513
var win32 = /* false */0;
@@ -38,6 +36,8 @@ var executable_name = "cmd";
3836

3937
var os_type = "Unix";
4038

39+
var word_size = 32;
40+
4141
var sigabrt = -1;
4242

4343
var sigalrm = -2;

0 commit comments

Comments
 (0)