@fable-org/fable-library-js 2.1.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Array.js CHANGED
@@ -37,7 +37,7 @@ export function getSubArray(array, start, count) {
37
37
  }
38
38
  export function last(array) {
39
39
  if (array.length === 0) {
40
- throw new Exception("The input array was empty\\nParameter name: array");
40
+ throw new Exception("The input array was empty (Parameter \'array\')");
41
41
  }
42
42
  return item_2(array.length - 1, array);
43
43
  }
@@ -216,7 +216,7 @@ export function singleton(value, cons) {
216
216
  }
217
217
  export function initialize(count, initializer, cons) {
218
218
  if (count < 0) {
219
- throw new Exception("The input must be non-negative\\nParameter name: count");
219
+ throw new Exception("The input must be non-negative (Parameter \'count\')");
220
220
  }
221
221
  const result = Helpers_allocateArrayFromCons(cons, count);
222
222
  for (let i = 0; i <= (count - 1); i++) {
@@ -239,7 +239,7 @@ export function pairwise(array) {
239
239
  }
240
240
  export function replicate(count, initial, cons) {
241
241
  if (count < 0) {
242
- throw new Exception("The input must be non-negative\\nParameter name: count");
242
+ throw new Exception("The input must be non-negative (Parameter \'count\')");
243
243
  }
244
244
  const result = Helpers_allocateArrayFromCons(cons, count);
245
245
  for (let i = 0; i <= (result.length - 1); i++) {
@@ -275,7 +275,7 @@ export function scanBack(folder, array, state, cons) {
275
275
  }
276
276
  export function skip(count, array, cons) {
277
277
  if (count > array.length) {
278
- throw new Exception("count is greater than array length\\nParameter name: count");
278
+ throw new Exception("count is greater than array length (Parameter \'count\')");
279
279
  }
280
280
  if (count === array.length) {
281
281
  return Helpers_allocateArrayFromCons(cons, 0);
@@ -300,10 +300,10 @@ export function skipWhile(predicate, array, cons) {
300
300
  }
301
301
  export function take(count, array, cons) {
302
302
  if (count < 0) {
303
- throw new Exception("The input must be non-negative\\nParameter name: count");
303
+ throw new Exception("The input must be non-negative (Parameter \'count\')");
304
304
  }
305
305
  if (count > array.length) {
306
- throw new Exception("count is greater than array length\\nParameter name: count");
306
+ throw new Exception("count is greater than array length (Parameter \'count\')");
307
307
  }
308
308
  if (count === 0) {
309
309
  return Helpers_allocateArrayFromCons(cons, 0);
@@ -761,7 +761,7 @@ export function zip3(array1, array2, array3) {
761
761
  }
762
762
  export function chunkBySize(chunkSize, array) {
763
763
  if (chunkSize < 1) {
764
- throw new Exception("The input must be positive.\\nParameter name: size");
764
+ throw new Exception("The input must be positive. (Parameter \'size\')");
765
765
  }
766
766
  const result = [];
767
767
  if (array.length > 0) {
@@ -777,7 +777,7 @@ export function chunkBySize(chunkSize, array) {
777
777
  }
778
778
  export function splitAt(index, array) {
779
779
  if ((index < 0) ? true : (index > array.length)) {
780
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
780
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
781
781
  }
782
782
  return [array.slice(0, (0 + index)), array.slice(index)];
783
783
  }
@@ -886,9 +886,9 @@ export function exactlyOne(array) {
886
886
  case 1:
887
887
  return item_2(0, array);
888
888
  case 0:
889
- throw new Exception("The input sequence was empty\\nParameter name: array");
889
+ throw new Exception("The input sequence was empty (Parameter \'array\')");
890
890
  default:
891
- throw new Exception("Input array too long\\nParameter name: array");
891
+ throw new Exception("Input array too long (Parameter \'array\')");
892
892
  }
893
893
  }
894
894
  export function tryExactlyOne(array) {
@@ -901,7 +901,7 @@ export function tryExactlyOne(array) {
901
901
  }
902
902
  export function head(array) {
903
903
  if (array.length === 0) {
904
- throw new Exception("The input array was empty\\nParameter name: array");
904
+ throw new Exception("The input array was empty (Parameter \'array\')");
905
905
  }
906
906
  else {
907
907
  return item_2(0, array);
@@ -917,13 +917,13 @@ export function tryHead(array) {
917
917
  }
918
918
  export function tail(array) {
919
919
  if (array.length === 0) {
920
- throw new Exception("Not enough elements\\nParameter name: array");
920
+ throw new Exception("Not enough elements (Parameter \'array\')");
921
921
  }
922
922
  return array.slice(1);
923
923
  }
924
924
  export function item(index, array) {
925
925
  if ((index < 0) ? true : (index >= array.length)) {
926
- throw new Exception("Index was outside the bounds of the array.\\nParameter name: index");
926
+ throw new Exception("Index was outside the bounds of the array. (Parameter \'index\')");
927
927
  }
928
928
  else {
929
929
  return array[index];
@@ -931,7 +931,7 @@ export function item(index, array) {
931
931
  }
932
932
  export function setItem(array, index, value) {
933
933
  if ((index < 0) ? true : (index >= array.length)) {
934
- throw new Exception("Index was outside the bounds of the array.\\nParameter name: index");
934
+ throw new Exception("Index was outside the bounds of the array. (Parameter \'index\')");
935
935
  }
936
936
  else {
937
937
  array[index] = value;
@@ -1069,7 +1069,7 @@ export function min(xs, comparer) {
1069
1069
  }
1070
1070
  export function average(array, averager) {
1071
1071
  if (array.length === 0) {
1072
- throw new Exception("The input array was empty\\nParameter name: array");
1072
+ throw new Exception("The input array was empty (Parameter \'array\')");
1073
1073
  }
1074
1074
  let total = averager.GetZero();
1075
1075
  for (let i = 0; i <= (array.length - 1); i++) {
@@ -1079,7 +1079,7 @@ export function average(array, averager) {
1079
1079
  }
1080
1080
  export function averageBy(projection, array, averager) {
1081
1081
  if (array.length === 0) {
1082
- throw new Exception("The input array was empty\\nParameter name: array");
1082
+ throw new Exception("The input array was empty (Parameter \'array\')");
1083
1083
  }
1084
1084
  let total = averager.GetZero();
1085
1085
  for (let i = 0; i <= (array.length - 1); i++) {
@@ -1101,7 +1101,7 @@ export function windowed(windowSize, source) {
1101
1101
  }
1102
1102
  export function splitInto(chunks, array) {
1103
1103
  if (chunks < 1) {
1104
- throw new Exception("The input must be positive.\\nParameter name: chunks");
1104
+ throw new Exception("The input must be positive. (Parameter \'chunks\')");
1105
1105
  }
1106
1106
  const result = [];
1107
1107
  if (array.length > 0) {
@@ -1143,7 +1143,7 @@ export function transpose(arrays, cons) {
1143
1143
  export function insertAt(index, y, xs, cons) {
1144
1144
  const len = xs.length | 0;
1145
1145
  if ((index < 0) ? true : (index > len)) {
1146
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1146
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1147
1147
  }
1148
1148
  const target = Helpers_allocateArrayFromCons(cons, len + 1);
1149
1149
  for (let i = 0; i <= (index - 1); i++) {
@@ -1158,7 +1158,7 @@ export function insertAt(index, y, xs, cons) {
1158
1158
  export function insertManyAt(index, ys, xs, cons) {
1159
1159
  const len = xs.length | 0;
1160
1160
  if ((index < 0) ? true : (index > len)) {
1161
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1161
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1162
1162
  }
1163
1163
  const ys_1 = Array.from(ys);
1164
1164
  const len2 = ys_1.length | 0;
@@ -1179,7 +1179,7 @@ export function randomShuffleInPlaceBy(randomizer, xs) {
1179
1179
  for (let i = len - 1; i >= 1; i--) {
1180
1180
  const r = randomizer();
1181
1181
  if ((r < 0) ? true : (r >= 1)) {
1182
- throw new Exception((SR_Arg_ArgumentOutOfRangeException + "\\nParameter name: ") + "randomizer");
1182
+ throw new Exception(SR_Arg_ArgumentOutOfRangeException + " (Parameter \'randomizer\')");
1183
1183
  }
1184
1184
  const j = ~~(r * (i + 1)) | 0;
1185
1185
  const tmp = item_2(i, xs);
@@ -1206,12 +1206,12 @@ export function randomShuffle(xs) {
1206
1206
  }
1207
1207
  export function randomChoiceBy(randomizer, xs) {
1208
1208
  if (isEmpty(xs)) {
1209
- throw new Exception((SR_inputSequenceEmpty + "\\nParameter name: ") + "source");
1209
+ throw new Exception(SR_inputSequenceEmpty + " (Parameter \'source\')");
1210
1210
  }
1211
1211
  const len = xs.length | 0;
1212
1212
  const r = randomizer();
1213
1213
  if ((r < 0) ? true : (r >= 1)) {
1214
- throw new Exception((SR_Arg_ArgumentOutOfRangeException + "\\nParameter name: ") + "randomizer");
1214
+ throw new Exception(SR_Arg_ArgumentOutOfRangeException + " (Parameter \'randomizer\')");
1215
1215
  }
1216
1216
  return item_2(~~(r * len), xs);
1217
1217
  }
@@ -1223,16 +1223,16 @@ export function randomChoice(xs) {
1223
1223
  }
1224
1224
  export function randomChoicesBy(randomizer, count, xs, cons) {
1225
1225
  if (count < 0) {
1226
- throw new Exception((SR_inputMustBeNonNegative + "\\nParameter name: ") + "count");
1226
+ throw new Exception(SR_inputMustBeNonNegative + " (Parameter \'count\')");
1227
1227
  }
1228
1228
  if ((count > 0) && isEmpty(xs)) {
1229
- throw new Exception((SR_inputSequenceEmpty + "\\nParameter name: ") + "source");
1229
+ throw new Exception(SR_inputSequenceEmpty + " (Parameter \'source\')");
1230
1230
  }
1231
1231
  const len = xs.length | 0;
1232
1232
  return initialize(count, (_arg) => {
1233
1233
  const r = randomizer();
1234
1234
  if ((r < 0) ? true : (r >= 1)) {
1235
- throw new Exception((SR_Arg_ArgumentOutOfRangeException + "\\nParameter name: ") + "randomizer");
1235
+ throw new Exception(SR_Arg_ArgumentOutOfRangeException + " (Parameter \'randomizer\')");
1236
1236
  }
1237
1237
  return item_2(~~(r * len), xs);
1238
1238
  }, cons);
@@ -1245,20 +1245,20 @@ export function randomChoices(count, xs, cons) {
1245
1245
  }
1246
1246
  export function randomSampleBy(randomizer, count, xs) {
1247
1247
  if (count < 0) {
1248
- throw new Exception((SR_inputMustBeNonNegative + "\\nParameter name: ") + "count");
1248
+ throw new Exception(SR_inputMustBeNonNegative + " (Parameter \'count\')");
1249
1249
  }
1250
1250
  const arr = copy(xs);
1251
1251
  const len = arr.length | 0;
1252
1252
  if ((len === 0) && (count > 0)) {
1253
- throw new Exception((SR_inputSequenceEmpty + "\\nParameter name: ") + "source");
1253
+ throw new Exception(SR_inputSequenceEmpty + " (Parameter \'source\')");
1254
1254
  }
1255
1255
  if (count > len) {
1256
- throw new Exception((SR_notEnoughElements + "\\nParameter name: ") + "count");
1256
+ throw new Exception(SR_notEnoughElements + " (Parameter \'count\')");
1257
1257
  }
1258
1258
  for (let i = 0; i <= (count - 1); i++) {
1259
1259
  const r = randomizer();
1260
1260
  if ((r < 0) ? true : (r >= 1)) {
1261
- throw new Exception((SR_Arg_ArgumentOutOfRangeException + "\\nParameter name: ") + "randomizer");
1261
+ throw new Exception(SR_Arg_ArgumentOutOfRangeException + " (Parameter \'randomizer\')");
1262
1262
  }
1263
1263
  const j = (i + ~~(r * (len - i))) | 0;
1264
1264
  const tmp = item_2(i, arr);
@@ -1275,7 +1275,7 @@ export function randomSample(count, xs) {
1275
1275
  }
1276
1276
  export function removeAt(index, xs) {
1277
1277
  if ((index < 0) ? true : (index >= xs.length)) {
1278
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1278
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1279
1279
  }
1280
1280
  let i = -1;
1281
1281
  return filter((_arg) => {
@@ -1307,14 +1307,14 @@ export function removeManyAt(index, count, xs) {
1307
1307
  }, xs);
1308
1308
  const status_1 = (((status === 0) && ((i + 1) === (index + count))) ? 1 : status) | 0;
1309
1309
  if (status_1 < 1) {
1310
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + ((status_1 < 0) ? "index" : "count"));
1310
+ throw new Exception(SR_indexOutOfBounds + ((" (Parameter \'" + ((status_1 < 0) ? "index" : "count")) + "\')"));
1311
1311
  }
1312
1312
  return ys;
1313
1313
  }
1314
1314
  export function updateAt(index, y, xs, cons) {
1315
1315
  const len = xs.length | 0;
1316
1316
  if ((index < 0) ? true : (index >= len)) {
1317
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1317
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1318
1318
  }
1319
1319
  const target = Helpers_allocateArrayFromCons(cons, len);
1320
1320
  for (let i = 0; i <= (len - 1); i++) {
@@ -1325,7 +1325,7 @@ export function updateAt(index, y, xs, cons) {
1325
1325
  export function resize(xs, newSize, zero, cons) {
1326
1326
  let array = undefined, array_1 = undefined, start_2 = undefined, count_2 = undefined;
1327
1327
  if (newSize < 0) {
1328
- throw new Exception("The input must be non-negative.\\nParameter name: newSize");
1328
+ throw new Exception("The input must be non-negative. (Parameter \'newSize\')");
1329
1329
  }
1330
1330
  const zero_1 = defaultArg(zero, defaultOf());
1331
1331
  if (Operators_IsNull(xs.contents)) {
package/CHANGELOG.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- last_commit_released: 15eb83ed36657f75073fb0e1b4cac677e24fc9bb
2
+ last_commit_released: c9b3ee2429a4688946c1936e27df730837428070
3
3
  updaters:
4
4
  - package.json:
5
5
  file: package.json
@@ -15,6 +15,14 @@ All notable changes to this project will be documented in this file.
15
15
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
16
16
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
17
17
 
18
+ ## 2.2.0 - 2026-06-24
19
+
20
+ ### 🚀 Features
21
+
22
+ * *(all)* Support Exception.InnerException across all targets (#4677) ([c9b3ee24](https://github.com/fable-compiler/Fable/commit/c9b3ee2429a4688946c1936e27df730837428070))
23
+
24
+ <strong><small>[View changes on Github](https://github.com/fable-compiler/Fable/compare/15eb83ed36657f75073fb0e1b4cac677e24fc9bb..c9b3ee2429a4688946c1936e27df730837428070)</small></strong>
25
+
18
26
  ## 2.1.1 - 2026-06-10
19
27
 
20
28
  ### 🐞 Bug Fixes
package/List.js CHANGED
@@ -222,7 +222,7 @@ export function FSharpList__get_Head(xs) {
222
222
  return xs.head;
223
223
  }
224
224
  else {
225
- throw new Exception((SR_inputWasEmpty + "\\nParameter name: ") + "list");
225
+ throw new Exception(SR_inputWasEmpty + " (Parameter \'list\')");
226
226
  }
227
227
  }
228
228
  export function FSharpList__get_Tail(xs) {
@@ -231,7 +231,7 @@ export function FSharpList__get_Tail(xs) {
231
231
  return value_1(matchValue);
232
232
  }
233
233
  else {
234
- throw new Exception((SR_inputWasEmpty + "\\nParameter name: ") + "list");
234
+ throw new Exception(SR_inputWasEmpty + " (Parameter \'list\')");
235
235
  }
236
236
  }
237
237
  export function FSharpList__get_Item_Z524259A4(xs, index) {
@@ -250,7 +250,7 @@ export function FSharpList__get_Item_Z524259A4(xs, index) {
250
250
  }
251
251
  }
252
252
  else {
253
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
253
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
254
254
  }
255
255
  break;
256
256
  }
@@ -926,7 +926,7 @@ export function exists2(f_mut, xs_mut, ys_mut) {
926
926
  continue exists2;
927
927
  }
928
928
  default:
929
- throw new Exception((SR_differentLengths + "\\nParameter name: ") + "list2");
929
+ throw new Exception(SR_differentLengths + " (Parameter \'list2\')");
930
930
  }
931
931
  break;
932
932
  }
@@ -1021,7 +1021,7 @@ export function skip(count_mut, xs_mut) {
1021
1021
  return xs;
1022
1022
  }
1023
1023
  else if (FSharpList__get_IsEmpty(xs)) {
1024
- throw new Exception((SR_notEnoughElements + "\\nParameter name: ") + "list");
1024
+ throw new Exception(SR_notEnoughElements + " (Parameter \'list\')");
1025
1025
  }
1026
1026
  else {
1027
1027
  count_mut = (count - 1);
@@ -1050,7 +1050,7 @@ export function skipWhile(predicate_mut, xs_mut) {
1050
1050
  }
1051
1051
  export function take(count, xs) {
1052
1052
  if (count < 0) {
1053
- throw new Exception((SR_inputMustBeNonNegative + "\\nParameter name: ") + "count");
1053
+ throw new Exception(SR_inputMustBeNonNegative + " (Parameter \'count\')");
1054
1054
  }
1055
1055
  const loop = (i_mut, acc_mut, xs_1_mut) => {
1056
1056
  loop: while (true) {
@@ -1060,7 +1060,7 @@ export function take(count, xs) {
1060
1060
  return acc;
1061
1061
  }
1062
1062
  else if (FSharpList__get_IsEmpty(xs_1)) {
1063
- throw new Exception((SR_notEnoughElements + "\\nParameter name: ") + "list");
1063
+ throw new Exception(SR_notEnoughElements + " (Parameter \'list\')");
1064
1064
  }
1065
1065
  else {
1066
1066
  i_mut = (i - 1);
@@ -1145,22 +1145,22 @@ export function getSlice(startIndex, endIndex, xs) {
1145
1145
  }
1146
1146
  export function splitAt(index, xs) {
1147
1147
  if (index < 0) {
1148
- throw new Exception((SR_inputMustBeNonNegative + "\\nParameter name: ") + "index");
1148
+ throw new Exception(SR_inputMustBeNonNegative + " (Parameter \'index\')");
1149
1149
  }
1150
1150
  if (index > FSharpList__get_Length(xs)) {
1151
- throw new Exception((SR_notEnoughElements + "\\nParameter name: ") + "index");
1151
+ throw new Exception(SR_notEnoughElements + " (Parameter \'index\')");
1152
1152
  }
1153
1153
  return [take(index, xs), skip(index, xs)];
1154
1154
  }
1155
1155
  export function exactlyOne(xs) {
1156
1156
  if (FSharpList__get_IsEmpty(xs)) {
1157
- throw new Exception((SR_inputSequenceEmpty + "\\nParameter name: ") + "list");
1157
+ throw new Exception(SR_inputSequenceEmpty + " (Parameter \'list\')");
1158
1158
  }
1159
1159
  else if (FSharpList__get_IsEmpty(FSharpList__get_Tail(xs))) {
1160
1160
  return FSharpList__get_Head(xs);
1161
1161
  }
1162
1162
  else {
1163
- throw new Exception((SR_inputSequenceTooLong + "\\nParameter name: ") + "list");
1163
+ throw new Exception(SR_inputSequenceTooLong + " (Parameter \'list\')");
1164
1164
  }
1165
1165
  }
1166
1166
  export function tryExactlyOne(xs) {
@@ -1200,7 +1200,7 @@ export function insertAt(index, y, xs) {
1200
1200
  }
1201
1201
  }, FSharpList_get_Empty(), xs);
1202
1202
  return reverse(isDone ? result : (((i + 1) === index) ? FSharpList_Cons_305B8EAC(y, result) : (() => {
1203
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1203
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1204
1204
  })()));
1205
1205
  }
1206
1206
  export function insertManyAt(index, ys, xs) {
@@ -1218,7 +1218,7 @@ export function insertManyAt(index, ys, xs) {
1218
1218
  }
1219
1219
  }, FSharpList_get_Empty(), xs);
1220
1220
  return reverse(isDone ? result : (((i + 1) === index) ? append(ys_1, result) : (() => {
1221
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1221
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1222
1222
  })()));
1223
1223
  }
1224
1224
  export function removeAt(index, xs) {
@@ -1235,7 +1235,7 @@ export function removeAt(index, xs) {
1235
1235
  }
1236
1236
  }, xs);
1237
1237
  if (!isDone) {
1238
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1238
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1239
1239
  }
1240
1240
  return ys;
1241
1241
  }
@@ -1263,7 +1263,7 @@ export function removeManyAt(index, count, xs) {
1263
1263
  }, xs);
1264
1264
  const status_1 = (((status === 0) && ((i + 1) === (index + count))) ? 1 : status) | 0;
1265
1265
  if (status_1 < 1) {
1266
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + ((status_1 < 0) ? "index" : "count"));
1266
+ throw new Exception(SR_indexOutOfBounds + ((" (Parameter \'" + ((status_1 < 0) ? "index" : "count")) + "\')"));
1267
1267
  }
1268
1268
  return ys;
1269
1269
  }
@@ -1279,7 +1279,7 @@ export function updateAt(index, y, xs) {
1279
1279
  }
1280
1280
  }, xs);
1281
1281
  if (!isDone) {
1282
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1282
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1283
1283
  }
1284
1284
  return ys;
1285
1285
  }
package/Seq.js CHANGED
@@ -505,14 +505,14 @@ export function exactlyOne(xs) {
505
505
  if (e["System.Collections.IEnumerator.MoveNext"]()) {
506
506
  const v = e["System.Collections.Generic.IEnumerator`1.get_Current"]();
507
507
  if (e["System.Collections.IEnumerator.MoveNext"]()) {
508
- throw new Exception((SR_inputSequenceTooLong + "\\nParameter name: ") + "source");
508
+ throw new Exception(SR_inputSequenceTooLong + " (Parameter \'source\')");
509
509
  }
510
510
  else {
511
511
  return v;
512
512
  }
513
513
  }
514
514
  else {
515
- throw new Exception((SR_inputSequenceEmpty + "\\nParameter name: ") + "source");
515
+ throw new Exception(SR_inputSequenceEmpty + " (Parameter \'source\')");
516
516
  }
517
517
  }
518
518
  finally {
@@ -692,7 +692,7 @@ export function tryHead(xs) {
692
692
  export function head(xs) {
693
693
  const matchValue = tryHead(xs);
694
694
  if (matchValue == null) {
695
- throw new Exception((SR_inputSequenceEmpty + "\\nParameter name: ") + "source");
695
+ throw new Exception(SR_inputSequenceEmpty + " (Parameter \'source\')");
696
696
  }
697
697
  else {
698
698
  return value_1(matchValue);
@@ -758,7 +758,7 @@ export function tryItem(index, xs) {
758
758
  export function item(index, xs) {
759
759
  const matchValue = tryItem(index, xs);
760
760
  if (matchValue == null) {
761
- throw new Exception((SR_notEnoughElements + "\\nParameter name: ") + "index");
761
+ throw new Exception(SR_notEnoughElements + " (Parameter \'index\')");
762
762
  }
763
763
  else {
764
764
  return value_1(matchValue);
@@ -811,7 +811,7 @@ export function tryLast(xs) {
811
811
  export function last(xs) {
812
812
  const matchValue = tryLast(xs);
813
813
  if (matchValue == null) {
814
- throw new Exception((SR_notEnoughElements + "\\nParameter name: ") + "source");
814
+ throw new Exception(SR_notEnoughElements + " (Parameter \'source\')");
815
815
  }
816
816
  else {
817
817
  return value_1(matchValue);
@@ -1092,7 +1092,7 @@ export function skip(count, source) {
1092
1092
  try {
1093
1093
  for (let _ = 1; _ <= count; _++) {
1094
1094
  if (!e["System.Collections.IEnumerator.MoveNext"]()) {
1095
- throw new Exception((SR_notEnoughElements + "\\nParameter name: ") + "source");
1095
+ throw new Exception(SR_notEnoughElements + " (Parameter \'source\')");
1096
1096
  }
1097
1097
  }
1098
1098
  return Enumerator_enumerateThenFinally(() => {
@@ -1125,7 +1125,7 @@ export function take(count, xs) {
1125
1125
  return some(e["System.Collections.Generic.IEnumerator`1.get_Current"]());
1126
1126
  }
1127
1127
  else {
1128
- throw new Exception((SR_notEnoughElements + "\\nParameter name: ") + "source");
1128
+ throw new Exception(SR_notEnoughElements + " (Parameter \'source\')");
1129
1129
  }
1130
1130
  }
1131
1131
  else {
@@ -1213,7 +1213,7 @@ export function average(xs, averager) {
1213
1213
  return averager.Add(acc, x);
1214
1214
  }, averager.GetZero(), xs);
1215
1215
  if (count === 0) {
1216
- throw new Exception((SR_inputSequenceEmpty + "\\nParameter name: ") + "source");
1216
+ throw new Exception(SR_inputSequenceEmpty + " (Parameter \'source\')");
1217
1217
  }
1218
1218
  else {
1219
1219
  return averager.DivideByInt(total, count);
@@ -1226,7 +1226,7 @@ export function averageBy(f, xs, averager) {
1226
1226
  return averager.Add(acc, f(x));
1227
1227
  }, averager.GetZero(), xs);
1228
1228
  if (count === 0) {
1229
- throw new Exception((SR_inputSequenceEmpty + "\\nParameter name: ") + "source");
1229
+ throw new Exception(SR_inputSequenceEmpty + " (Parameter \'source\')");
1230
1230
  }
1231
1231
  else {
1232
1232
  return averager.DivideByInt(total, count);
@@ -1241,7 +1241,7 @@ export function chunkBySize(chunkSize, xs) {
1241
1241
  export function insertAt(index, y, xs) {
1242
1242
  let isDone = false;
1243
1243
  if (index < 0) {
1244
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1244
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1245
1245
  }
1246
1246
  return generateIndexed(() => ofSeq(xs), (i, e) => {
1247
1247
  if ((isDone ? true : (i < index)) && e["System.Collections.IEnumerator.MoveNext"]()) {
@@ -1253,7 +1253,7 @@ export function insertAt(index, y, xs) {
1253
1253
  }
1254
1254
  else {
1255
1255
  if (!isDone) {
1256
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1256
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1257
1257
  }
1258
1258
  return undefined;
1259
1259
  }
@@ -1264,7 +1264,7 @@ export function insertAt(index, y, xs) {
1264
1264
  export function insertManyAt(index, ys, xs) {
1265
1265
  let status = -1;
1266
1266
  if (index < 0) {
1267
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1267
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1268
1268
  }
1269
1269
  return generateIndexed(() => [ofSeq(xs), ofSeq(ys)], (i, tupledArg) => {
1270
1270
  const e1 = tupledArg[0];
@@ -1291,7 +1291,7 @@ export function insertManyAt(index, ys, xs) {
1291
1291
  }
1292
1292
  else {
1293
1293
  if (status < 1) {
1294
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1294
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1295
1295
  }
1296
1296
  return undefined;
1297
1297
  }
@@ -1307,7 +1307,7 @@ export function insertManyAt(index, ys, xs) {
1307
1307
  export function removeAt(index, xs) {
1308
1308
  let isDone = false;
1309
1309
  if (index < 0) {
1310
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1310
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1311
1311
  }
1312
1312
  return generateIndexed(() => ofSeq(xs), (i, e) => {
1313
1313
  if ((isDone ? true : (i < index)) && e["System.Collections.IEnumerator.MoveNext"]()) {
@@ -1319,7 +1319,7 @@ export function removeAt(index, xs) {
1319
1319
  }
1320
1320
  else {
1321
1321
  if (!isDone) {
1322
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1322
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1323
1323
  }
1324
1324
  return undefined;
1325
1325
  }
@@ -1329,7 +1329,7 @@ export function removeAt(index, xs) {
1329
1329
  }
1330
1330
  export function removeManyAt(index, count, xs) {
1331
1331
  if (index < 0) {
1332
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1332
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1333
1333
  }
1334
1334
  return generateIndexed(() => ofSeq(xs), (i, e) => {
1335
1335
  if (i < index) {
@@ -1337,14 +1337,14 @@ export function removeManyAt(index, count, xs) {
1337
1337
  return some(e["System.Collections.Generic.IEnumerator`1.get_Current"]());
1338
1338
  }
1339
1339
  else {
1340
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1340
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1341
1341
  }
1342
1342
  }
1343
1343
  else {
1344
1344
  if (i === index) {
1345
1345
  for (let _ = 1; _ <= count; _++) {
1346
1346
  if (!e["System.Collections.IEnumerator.MoveNext"]()) {
1347
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "count");
1347
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'count\')");
1348
1348
  }
1349
1349
  }
1350
1350
  }
@@ -1357,7 +1357,7 @@ export function removeManyAt(index, count, xs) {
1357
1357
  export function updateAt(index, y, xs) {
1358
1358
  let isDone = false;
1359
1359
  if (index < 0) {
1360
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1360
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1361
1361
  }
1362
1362
  return generateIndexed(() => ofSeq(xs), (i, e) => {
1363
1363
  if ((isDone ? true : (i < index)) && e["System.Collections.IEnumerator.MoveNext"]()) {
@@ -1369,7 +1369,7 @@ export function updateAt(index, y, xs) {
1369
1369
  }
1370
1370
  else {
1371
1371
  if (!isDone) {
1372
- throw new Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index");
1372
+ throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
1373
1373
  }
1374
1374
  return undefined;
1375
1375
  }
package/System.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Exception } from "./Util.js";
1
+ import { defaultOf, Exception } from "./Util.js";
2
2
  import { class_type } from "./Reflection.js";
3
3
  import { SR_Arg_ArgumentOutOfRangeException, SR_ArgumentNull_Generic, SR_Arg_ArgumentException, SR_Arg_ParamName_Name, SR_Arg_TimeoutException, SR_Arg_StackOverflowException, SR_Arg_RankException, SR_Arg_OverflowException, SR_Arg_OutOfMemoryException, SR_Arg_NullReferenceException, SR_Arg_NotSupportedException, SR_Arg_NotImplementedException, SR_Arg_NotFiniteNumberException, SR_Arg_InvalidOperationException, SR_Arg_IndexOutOfRangeException, SR_Arg_FormatException, SR_Arg_DivideByZero, SR_Arg_ArithmeticException, SR_Arg_ApplicationException, SR_Arg_SystemException } from "./Global.js";
4
4
  import { isNullOrEmpty } from "./String.js";
@@ -227,29 +227,35 @@ export function TimeoutException_$ctor() {
227
227
  return TimeoutException_$ctor_Z721C83C5(SR_Arg_TimeoutException);
228
228
  }
229
229
  export class ArgumentException extends Exception {
230
- constructor(message, paramName) {
231
- super(isNullOrEmpty(paramName) ? message : (((message + SR_Arg_ParamName_Name) + paramName) + "\')"));
230
+ constructor(message, paramName, innerException) {
231
+ super(isNullOrEmpty(paramName) ? message : (((message + SR_Arg_ParamName_Name) + paramName) + "\')"), innerException);
232
232
  this.paramName = paramName;
233
233
  }
234
234
  }
235
235
  export function ArgumentException_$reflection() {
236
236
  return class_type("System.ArgumentException", undefined, ArgumentException, class_type("System.Exception"));
237
237
  }
238
- export function ArgumentException_$ctor_Z384F8060(message, paramName) {
239
- return new ArgumentException(message, paramName);
238
+ export function ArgumentException_$ctor_Z60A2B367(message, paramName, innerException) {
239
+ return new ArgumentException(message, paramName, innerException);
240
240
  }
241
241
  export function ArgumentException_$ctor() {
242
- return ArgumentException_$ctor_Z384F8060(SR_Arg_ArgumentException, "");
242
+ return ArgumentException_$ctor_Z60A2B367(SR_Arg_ArgumentException, "", defaultOf());
243
243
  }
244
244
  export function ArgumentException_$ctor_Z721C83C5(message) {
245
- return ArgumentException_$ctor_Z384F8060(message, "");
245
+ return ArgumentException_$ctor_Z60A2B367(message, "", defaultOf());
246
+ }
247
+ export function ArgumentException_$ctor_Z384F8060(message, paramName) {
248
+ return ArgumentException_$ctor_Z60A2B367(message, paramName, defaultOf());
249
+ }
250
+ export function ArgumentException_$ctor_68CE3CA2(message, innerException) {
251
+ return ArgumentException_$ctor_Z60A2B367(message, "", innerException);
246
252
  }
247
253
  export function ArgumentException__get_ParamName(_) {
248
254
  return _.paramName;
249
255
  }
250
256
  export class ArgumentNullException extends ArgumentException {
251
257
  constructor(paramName, message) {
252
- super(message, paramName);
258
+ super(message, paramName, defaultOf());
253
259
  }
254
260
  }
255
261
  export function ArgumentNullException_$reflection() {
@@ -266,7 +272,7 @@ export function ArgumentNullException_$ctor() {
266
272
  }
267
273
  export class ArgumentOutOfRangeException extends ArgumentException {
268
274
  constructor(paramName, message) {
269
- super(message, paramName);
275
+ super(message, paramName, defaultOf());
270
276
  }
271
277
  }
272
278
  export function ArgumentOutOfRangeException_$reflection() {
package/Util.js CHANGED
@@ -6,8 +6,9 @@ export const DateTimeKind = {
6
6
  };
7
7
  // Exception is intentionally not derived from Error, for performance reasons (see #2160)
8
8
  export class Exception {
9
- constructor(msg) {
9
+ constructor(msg, innerException) {
10
10
  this.message = msg ?? "";
11
+ this.innerException = innerException;
11
12
  }
12
13
  toString() {
13
14
  return this.message;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "type": "module",
5
5
  "name": "@fable-org/fable-library-js",
6
- "version": "2.1.1",
6
+ "version": "2.2.0",
7
7
  "description": "Core library used by F# projects compiled with fable.io",
8
8
  "author": "Fable Contributors",
9
9
  "license": "MIT",