Skip to content

Commit bf96a2c

Browse files
committed
decouple deps on array
1 parent f479dcf commit bf96a2c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

jscomp/others/js_mapperRt.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

25+
external (.!()) : int array -> int -> int = "" [@@bs.get_index]
2526

2627
let raiseWhenNotFound x =
2728
if Js.testAny x then raise Not_found
@@ -30,7 +31,7 @@ let raiseWhenNotFound x =
3031
let rec fromIntAux (enum : int) i len xs =
3132
if i = len then None
3233
else
33-
let k = Js.Array2.unsafe_get xs i in
34+
let k = xs.!(i) in
3435
if k = enum then Some i
3536
else fromIntAux enum (i + 1) len xs
3637

@@ -40,7 +41,7 @@ let fromInt len (xs : int array) (enum : int ) : 'variant option =
4041
let rec fromIntAssertAux len (enum : int) i xs =
4142
if i = len then raise Not_found
4243
else
43-
let k = Js.Array2.unsafe_get xs i in
44+
let k = xs.!(i) in
4445
if k = enum then i
4546
else fromIntAssertAux len enum (i + 1) xs
4647

jscomp/others/release.ninja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ build others/js_json.cmj : cc_cmi others/js_json.ml | others/js_array2.cmj other
3030
build others/js_json.cmi : cc others/js_json.mli | others/js_dict.cmi others/js_null.cmi others/js_string.cmj others/js_types.cmi runtime
3131
build others/js_list.cmj : cc_cmi others/js_list.ml | others/js_array2.cmj others/js_list.cmi others/js_vector.cmj runtime
3232
build others/js_list.cmi : cc others/js_list.mli | others/js_vector.cmi runtime
33-
build others/js_mapperRt.cmj : cc_cmi others/js_mapperRt.ml | others/js_array2.cmj others/js_mapperRt.cmi runtime
33+
build others/js_mapperRt.cmj : cc_cmi others/js_mapperRt.ml | others/js_mapperRt.cmi runtime
3434
build others/js_mapperRt.cmi : cc others/js_mapperRt.mli | runtime
3535
build others/js_math.cmi others/js_math.cmj : cc others/js_math.ml | others/js_int.cmj runtime
3636
build others/js_null.cmj : cc_cmi others/js_null.ml | others/js_exn.cmj others/js_null.cmi runtime

0 commit comments

Comments
 (0)