Skip to content

Commit f5e9b82

Browse files
committed
remove internal usage of %assert, since ocaml exception already produces good stacktrace
1 parent c31b572 commit f5e9b82

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Diff for: jscomp/others/belt_Array.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ external getUndefined: 'a array -> int -> 'a Js.undefined = "%array_unsafe_get"
2222
let get arr i =
2323
if i >= 0 && i < length arr then Some (getUnsafe arr i) else None
2424
let getExn arr i =
25-
[%assert i >= 0 && i < length arr] ;
25+
assert (i >= 0 && i < length arr) ;
2626
getUnsafe arr i
2727
let set arr i v =
2828
if i >= 0 && i < length arr then (setUnsafe arr i v; true) else false
2929

3030
let setExn arr i v =
31-
[%assert i >= 0 && i < length arr];
31+
assert (i >= 0 && i < length arr);
3232
setUnsafe arr i v
3333

3434

Diff for: jscomp/others/belt_internalAVLset.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ let rec checkInvariantInternal (v : _ t) =
287287
| Some n ->
288288
let {left = l; right = r} = n in
289289
let diff = height l - height r in
290-
[%assert diff <=2 && diff >= -2];
290+
assert (diff <=2 && diff >= -2);
291291
checkInvariantInternal l;
292292
checkInvariantInternal r
293293

Diff for: jscomp/others/belt_internalAVLtree.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ let rec checkInvariantInternal (v : _ t) =
370370
| Some n ->
371371
let l,r = n.left , n.right in
372372
let diff = treeHeight l - treeHeight r in
373-
[%assert diff <=2 && diff >= -2 ];
373+
assert (diff <=2 && diff >= -2 );
374374
checkInvariantInternal l;
375375
checkInvariantInternal r
376376

0 commit comments

Comments
 (0)