Skip to content

Commit e1d0104

Browse files
committed
Update runtime JS output
1 parent 6237510 commit e1d0104

File tree

10 files changed

+66
-18
lines changed

10 files changed

+66
-18
lines changed

lib/es6/Belt_List.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function head(x) {
1111

1212
}
1313

14-
function headExn(x) {
14+
function headOrThrow(x) {
1515
if (x !== 0) {
1616
return x.hd;
1717
}
@@ -28,7 +28,7 @@ function tail(x) {
2828

2929
}
3030

31-
function tailExn(x) {
31+
function tailOrThrow(x) {
3232
if (x !== 0) {
3333
return x.tl;
3434
}
@@ -67,7 +67,7 @@ function get(x, n) {
6767
}
6868
}
6969

70-
function getExn(x, n) {
70+
function getOrThrow(x, n) {
7171
if (n < 0) {
7272
throw {
7373
RE_EXN_ID: "Not_found",
@@ -1286,6 +1286,12 @@ function zip(l1, l2) {
12861286

12871287
let size = length;
12881288

1289+
let headExn = headOrThrow;
1290+
1291+
let tailExn = tailOrThrow;
1292+
1293+
let getExn = getOrThrow;
1294+
12891295
let makeByU = makeBy;
12901296

12911297
let mapU = map;
@@ -1357,11 +1363,14 @@ export {
13571363
size,
13581364
head,
13591365
headExn,
1366+
headOrThrow,
13601367
tail,
13611368
tailExn,
1369+
tailOrThrow,
13621370
add,
13631371
get,
13641372
getExn,
1373+
getOrThrow,
13651374
make,
13661375
makeByU,
13671376
makeBy,

lib/es6/Belt_MutableQueue.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function peekUndefined(q) {
4949

5050
}
5151

52-
function peekExn(q) {
52+
function peekOrThrow(q) {
5353
let v = q.first;
5454
if (v !== undefined) {
5555
return v.content;
@@ -76,7 +76,7 @@ function pop(q) {
7676
}
7777
}
7878

79-
function popExn(q) {
79+
function popOrThrow(q) {
8080
let x = q.first;
8181
if (x !== undefined) {
8282
let next = x.next;
@@ -260,6 +260,10 @@ function fromArray(arr) {
260260
return q;
261261
}
262262

263+
let peekExn = peekOrThrow;
264+
265+
let popExn = popOrThrow;
266+
263267
let mapU = map;
264268

265269
let forEachU = forEach;
@@ -275,9 +279,11 @@ export {
275279
peek,
276280
peekUndefined,
277281
peekExn,
282+
peekOrThrow,
278283
pop,
279284
popUndefined,
280285
popExn,
286+
popOrThrow,
281287
copy,
282288
size,
283289
mapU,

lib/es6/Belt_Option.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function forEach(opt, f) {
1616

1717
}
1818

19-
function getExn(x) {
19+
function getOrThrow(x) {
2020
if (x !== undefined) {
2121
return Primitive_option.valFromOption(x);
2222
}
@@ -102,6 +102,8 @@ let keepU = keep;
102102

103103
let forEachU = forEach;
104104

105+
let getExn = getOrThrow;
106+
105107
let mapWithDefaultU = mapWithDefault;
106108

107109
let mapU = map;
@@ -118,6 +120,7 @@ export {
118120
forEachU,
119121
forEach,
120122
getExn,
123+
getOrThrow,
121124
mapWithDefaultU,
122125
mapWithDefault,
123126
mapU,

lib/es6/Belt_Result.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22

33

4-
function getExn(x) {
4+
function getOrThrow(x) {
55
if (x.TAG === "Ok") {
66
return x._0;
77
}
@@ -86,6 +86,8 @@ function cmp(a, b, f) {
8686
}
8787
}
8888

89+
let getExn = getOrThrow;
90+
8991
let mapWithDefaultU = mapWithDefault;
9092

9193
let mapU = map;
@@ -98,6 +100,7 @@ let cmpU = cmp;
98100

99101
export {
100102
getExn,
103+
getOrThrow,
101104
mapWithDefaultU,
102105
mapWithDefault,
103106
mapU,

lib/es6/Belt_Set.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ function getUndefined(m, e) {
196196
return Belt_SetDict.getUndefined(m.data, e, m.cmp);
197197
}
198198

199-
function getExn(m, e) {
200-
return Belt_SetDict.getExn(m.data, e, m.cmp);
199+
function getOrThrow(m, e) {
200+
return Belt_SetDict.getOrThrow(m.data, e, m.cmp);
201201
}
202202

203203
function has(m, e) {
@@ -251,6 +251,8 @@ let keepU = keep;
251251

252252
let partitionU = partition;
253253

254+
let getExn = getOrThrow;
255+
254256
export {
255257
Int,
256258
$$String,
@@ -292,6 +294,7 @@ export {
292294
get,
293295
getUndefined,
294296
getExn,
297+
getOrThrow,
295298
split,
296299
checkInvariantInternal,
297300
getData,

lib/js/Belt_List.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function head(x) {
1111

1212
}
1313

14-
function headExn(x) {
14+
function headOrThrow(x) {
1515
if (x !== 0) {
1616
return x.hd;
1717
}
@@ -28,7 +28,7 @@ function tail(x) {
2828

2929
}
3030

31-
function tailExn(x) {
31+
function tailOrThrow(x) {
3232
if (x !== 0) {
3333
return x.tl;
3434
}
@@ -67,7 +67,7 @@ function get(x, n) {
6767
}
6868
}
6969

70-
function getExn(x, n) {
70+
function getOrThrow(x, n) {
7171
if (n < 0) {
7272
throw {
7373
RE_EXN_ID: "Not_found",
@@ -1286,6 +1286,12 @@ function zip(l1, l2) {
12861286

12871287
let size = length;
12881288

1289+
let headExn = headOrThrow;
1290+
1291+
let tailExn = tailOrThrow;
1292+
1293+
let getExn = getOrThrow;
1294+
12891295
let makeByU = makeBy;
12901296

12911297
let mapU = map;
@@ -1356,11 +1362,14 @@ exports.length = length;
13561362
exports.size = size;
13571363
exports.head = head;
13581364
exports.headExn = headExn;
1365+
exports.headOrThrow = headOrThrow;
13591366
exports.tail = tail;
13601367
exports.tailExn = tailExn;
1368+
exports.tailOrThrow = tailOrThrow;
13611369
exports.add = add;
13621370
exports.get = get;
13631371
exports.getExn = getExn;
1372+
exports.getOrThrow = getOrThrow;
13641373
exports.make = make;
13651374
exports.makeByU = makeByU;
13661375
exports.makeBy = makeBy;

lib/js/Belt_MutableQueue.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function peekUndefined(q) {
4949

5050
}
5151

52-
function peekExn(q) {
52+
function peekOrThrow(q) {
5353
let v = q.first;
5454
if (v !== undefined) {
5555
return v.content;
@@ -76,7 +76,7 @@ function pop(q) {
7676
}
7777
}
7878

79-
function popExn(q) {
79+
function popOrThrow(q) {
8080
let x = q.first;
8181
if (x !== undefined) {
8282
let next = x.next;
@@ -260,6 +260,10 @@ function fromArray(arr) {
260260
return q;
261261
}
262262

263+
let peekExn = peekOrThrow;
264+
265+
let popExn = popOrThrow;
266+
263267
let mapU = map;
264268

265269
let forEachU = forEach;
@@ -274,9 +278,11 @@ exports.add = add;
274278
exports.peek = peek;
275279
exports.peekUndefined = peekUndefined;
276280
exports.peekExn = peekExn;
281+
exports.peekOrThrow = peekOrThrow;
277282
exports.pop = pop;
278283
exports.popUndefined = popUndefined;
279284
exports.popExn = popExn;
285+
exports.popOrThrow = popOrThrow;
280286
exports.copy = copy;
281287
exports.size = size;
282288
exports.mapU = mapU;

lib/js/Belt_Option.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function forEach(opt, f) {
1616

1717
}
1818

19-
function getExn(x) {
19+
function getOrThrow(x) {
2020
if (x !== undefined) {
2121
return Primitive_option.valFromOption(x);
2222
}
@@ -102,6 +102,8 @@ let keepU = keep;
102102

103103
let forEachU = forEach;
104104

105+
let getExn = getOrThrow;
106+
105107
let mapWithDefaultU = mapWithDefault;
106108

107109
let mapU = map;
@@ -117,6 +119,7 @@ exports.keep = keep;
117119
exports.forEachU = forEachU;
118120
exports.forEach = forEach;
119121
exports.getExn = getExn;
122+
exports.getOrThrow = getOrThrow;
120123
exports.mapWithDefaultU = mapWithDefaultU;
121124
exports.mapWithDefault = mapWithDefault;
122125
exports.mapU = mapU;

lib/js/Belt_Result.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33

4-
function getExn(x) {
4+
function getOrThrow(x) {
55
if (x.TAG === "Ok") {
66
return x._0;
77
}
@@ -86,6 +86,8 @@ function cmp(a, b, f) {
8686
}
8787
}
8888

89+
let getExn = getOrThrow;
90+
8991
let mapWithDefaultU = mapWithDefault;
9092

9193
let mapU = map;
@@ -97,6 +99,7 @@ let eqU = eq;
9799
let cmpU = cmp;
98100

99101
exports.getExn = getExn;
102+
exports.getOrThrow = getOrThrow;
100103
exports.mapWithDefaultU = mapWithDefaultU;
101104
exports.mapWithDefault = mapWithDefault;
102105
exports.mapU = mapU;

lib/js/Belt_Set.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ function getUndefined(m, e) {
196196
return Belt_SetDict.getUndefined(m.data, e, m.cmp);
197197
}
198198

199-
function getExn(m, e) {
200-
return Belt_SetDict.getExn(m.data, e, m.cmp);
199+
function getOrThrow(m, e) {
200+
return Belt_SetDict.getOrThrow(m.data, e, m.cmp);
201201
}
202202

203203
function has(m, e) {
@@ -251,6 +251,8 @@ let keepU = keep;
251251

252252
let partitionU = partition;
253253

254+
let getExn = getOrThrow;
255+
254256
exports.Int = Int;
255257
exports.$$String = $$String;
256258
exports.Dict = Dict;
@@ -291,6 +293,7 @@ exports.maxUndefined = maxUndefined;
291293
exports.get = get;
292294
exports.getUndefined = getUndefined;
293295
exports.getExn = getExn;
296+
exports.getOrThrow = getOrThrow;
294297
exports.split = split;
295298
exports.checkInvariantInternal = checkInvariantInternal;
296299
exports.getData = getData;

0 commit comments

Comments
 (0)