oxc-parser 0.72.3 → 0.73.2

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.
@@ -13,8 +13,8 @@ const textDecoder = new TextDecoder('utf-8', { ignoreBOM: true }),
13
13
 
14
14
  function deserialize(buffer, sourceTextInput, sourceLenInput) {
15
15
  uint8 = buffer;
16
- uint32 = new Uint32Array(buffer.buffer, buffer.byteOffset);
17
- float64 = new Float64Array(buffer.buffer, buffer.byteOffset);
16
+ uint32 = buffer.uint32;
17
+ float64 = buffer.float64;
18
18
 
19
19
  sourceText = sourceTextInput;
20
20
  sourceLen = sourceLenInput;
@@ -956,27 +956,14 @@ function deserializeClassBody(pos) {
956
956
  }
957
957
 
958
958
  function deserializeMethodDefinition(pos) {
959
- const kind = deserializeMethodDefinitionKind(pos + 57);
960
- let key = deserializePropertyKey(pos + 32);
961
- if (kind === 'constructor') {
962
- key = {
963
- type: 'Identifier',
964
- start: key.start,
965
- end: key.end,
966
- decorators: [],
967
- name: 'constructor',
968
- optional: false,
969
- typeAnnotation: null,
970
- };
971
- }
972
959
  return {
973
960
  type: deserializeMethodDefinitionType(pos + 56),
974
961
  start: deserializeU32(pos),
975
962
  end: deserializeU32(pos + 4),
976
963
  decorators: deserializeVecDecorator(pos + 8),
977
- key,
964
+ key: deserializePropertyKey(pos + 32),
978
965
  value: deserializeBoxFunction(pos + 48),
979
- kind,
966
+ kind: deserializeMethodDefinitionKind(pos + 57),
980
967
  computed: deserializeBool(pos + 58),
981
968
  static: deserializeBool(pos + 59),
982
969
  override: deserializeBool(pos + 60),
@@ -1223,14 +1210,13 @@ function deserializeStringLiteral(pos) {
1223
1210
  }
1224
1211
 
1225
1212
  function deserializeBigIntLiteral(pos) {
1226
- const raw = deserializeStr(pos + 8),
1227
- bigint = raw.slice(0, -1).replace(/_/g, '');
1213
+ const bigint = deserializeStr(pos + 8);
1228
1214
  return {
1229
1215
  type: 'Literal',
1230
1216
  start: deserializeU32(pos),
1231
1217
  end: deserializeU32(pos + 4),
1232
1218
  value: BigInt(bigint),
1233
- raw,
1219
+ raw: deserializeOptionStr(pos + 24),
1234
1220
  bigint,
1235
1221
  };
1236
1222
  }
@@ -4197,10 +4183,10 @@ function deserializeStr(pos) {
4197
4183
 
4198
4184
  function deserializeVecComment(pos) {
4199
4185
  const arr = [],
4200
- pos32 = pos >> 2,
4201
- len = uint32[pos32 + 2];
4186
+ pos32 = pos >> 2;
4202
4187
  pos = uint32[pos32];
4203
- for (let i = 0; i < len; i++) {
4188
+ const endPos = pos + uint32[pos32 + 2] * 16;
4189
+ while (pos !== endPos) {
4204
4190
  arr.push(deserializeComment(pos));
4205
4191
  pos += 16;
4206
4192
  }
@@ -4214,10 +4200,10 @@ function deserializeOptionHashbang(pos) {
4214
4200
 
4215
4201
  function deserializeVecDirective(pos) {
4216
4202
  const arr = [],
4217
- pos32 = pos >> 2,
4218
- len = uint32[pos32 + 2];
4203
+ pos32 = pos >> 2;
4219
4204
  pos = uint32[pos32];
4220
- for (let i = 0; i < len; i++) {
4205
+ const endPos = pos + uint32[pos32 + 2] * 72;
4206
+ while (pos !== endPos) {
4221
4207
  arr.push(deserializeDirective(pos));
4222
4208
  pos += 72;
4223
4209
  }
@@ -4226,21 +4212,16 @@ function deserializeVecDirective(pos) {
4226
4212
 
4227
4213
  function deserializeVecStatement(pos) {
4228
4214
  const arr = [],
4229
- pos32 = pos >> 2,
4230
- len = uint32[pos32 + 2];
4215
+ pos32 = pos >> 2;
4231
4216
  pos = uint32[pos32];
4232
- for (let i = 0; i < len; i++) {
4217
+ const endPos = pos + uint32[pos32 + 2] * 16;
4218
+ while (pos !== endPos) {
4233
4219
  arr.push(deserializeStatement(pos));
4234
4220
  pos += 16;
4235
4221
  }
4236
4222
  return arr;
4237
4223
  }
4238
4224
 
4239
- function deserializeOptionScopeId(pos) {
4240
- if (uint32[pos >> 2] === 0) return null;
4241
- return deserializeScopeId(pos);
4242
- }
4243
-
4244
4225
  function deserializeBoxBooleanLiteral(pos) {
4245
4226
  return deserializeBooleanLiteral(uint32[pos >> 2]);
4246
4227
  }
@@ -4401,22 +4382,12 @@ function deserializeBoxV8IntrinsicExpression(pos) {
4401
4382
  return deserializeV8IntrinsicExpression(uint32[pos >> 2]);
4402
4383
  }
4403
4384
 
4404
- function deserializeOptionReferenceId(pos) {
4405
- if (uint32[pos >> 2] === 0) return null;
4406
- return deserializeReferenceId(pos);
4407
- }
4408
-
4409
- function deserializeOptionSymbolId(pos) {
4410
- if (uint32[pos >> 2] === 0) return null;
4411
- return deserializeSymbolId(pos);
4412
- }
4413
-
4414
4385
  function deserializeVecArrayExpressionElement(pos) {
4415
4386
  const arr = [],
4416
- pos32 = pos >> 2,
4417
- len = uint32[pos32 + 2];
4387
+ pos32 = pos >> 2;
4418
4388
  pos = uint32[pos32];
4419
- for (let i = 0; i < len; i++) {
4389
+ const endPos = pos + uint32[pos32 + 2] * 16;
4390
+ while (pos !== endPos) {
4420
4391
  arr.push(deserializeArrayExpressionElement(pos));
4421
4392
  pos += 16;
4422
4393
  }
@@ -4429,10 +4400,10 @@ function deserializeBoxSpreadElement(pos) {
4429
4400
 
4430
4401
  function deserializeVecObjectPropertyKind(pos) {
4431
4402
  const arr = [],
4432
- pos32 = pos >> 2,
4433
- len = uint32[pos32 + 2];
4403
+ pos32 = pos >> 2;
4434
4404
  pos = uint32[pos32];
4435
- for (let i = 0; i < len; i++) {
4405
+ const endPos = pos + uint32[pos32 + 2] * 16;
4406
+ while (pos !== endPos) {
4436
4407
  arr.push(deserializeObjectPropertyKind(pos));
4437
4408
  pos += 16;
4438
4409
  }
@@ -4457,10 +4428,10 @@ function deserializeBoxPrivateIdentifier(pos) {
4457
4428
 
4458
4429
  function deserializeVecTemplateElement(pos) {
4459
4430
  const arr = [],
4460
- pos32 = pos >> 2,
4461
- len = uint32[pos32 + 2];
4431
+ pos32 = pos >> 2;
4462
4432
  pos = uint32[pos32];
4463
- for (let i = 0; i < len; i++) {
4433
+ const endPos = pos + uint32[pos32 + 2] * 48;
4434
+ while (pos !== endPos) {
4464
4435
  arr.push(deserializeTemplateElement(pos));
4465
4436
  pos += 48;
4466
4437
  }
@@ -4469,10 +4440,10 @@ function deserializeVecTemplateElement(pos) {
4469
4440
 
4470
4441
  function deserializeVecExpression(pos) {
4471
4442
  const arr = [],
4472
- pos32 = pos >> 2,
4473
- len = uint32[pos32 + 2];
4443
+ pos32 = pos >> 2;
4474
4444
  pos = uint32[pos32];
4475
- for (let i = 0; i < len; i++) {
4445
+ const endPos = pos + uint32[pos32 + 2] * 16;
4446
+ while (pos !== endPos) {
4476
4447
  arr.push(deserializeExpression(pos));
4477
4448
  pos += 16;
4478
4449
  }
@@ -4507,10 +4478,10 @@ function deserializeBoxPrivateFieldExpression(pos) {
4507
4478
 
4508
4479
  function deserializeVecArgument(pos) {
4509
4480
  const arr = [],
4510
- pos32 = pos >> 2,
4511
- len = uint32[pos32 + 2];
4481
+ pos32 = pos >> 2;
4512
4482
  pos = uint32[pos32];
4513
- for (let i = 0; i < len; i++) {
4483
+ const endPos = pos + uint32[pos32 + 2] * 16;
4484
+ while (pos !== endPos) {
4514
4485
  arr.push(deserializeArgument(pos));
4515
4486
  pos += 16;
4516
4487
  }
@@ -4532,10 +4503,10 @@ function deserializeOptionAssignmentTargetMaybeDefault(pos) {
4532
4503
 
4533
4504
  function deserializeVecOptionAssignmentTargetMaybeDefault(pos) {
4534
4505
  const arr = [],
4535
- pos32 = pos >> 2,
4536
- len = uint32[pos32 + 2];
4506
+ pos32 = pos >> 2;
4537
4507
  pos = uint32[pos32];
4538
- for (let i = 0; i < len; i++) {
4508
+ const endPos = pos + uint32[pos32 + 2] * 16;
4509
+ while (pos !== endPos) {
4539
4510
  arr.push(deserializeOptionAssignmentTargetMaybeDefault(pos));
4540
4511
  pos += 16;
4541
4512
  }
@@ -4549,10 +4520,10 @@ function deserializeOptionAssignmentTargetRest(pos) {
4549
4520
 
4550
4521
  function deserializeVecAssignmentTargetProperty(pos) {
4551
4522
  const arr = [],
4552
- pos32 = pos >> 2,
4553
- len = uint32[pos32 + 2];
4523
+ pos32 = pos >> 2;
4554
4524
  pos = uint32[pos32];
4555
- for (let i = 0; i < len; i++) {
4525
+ const endPos = pos + uint32[pos32 + 2] * 16;
4526
+ while (pos !== endPos) {
4556
4527
  arr.push(deserializeAssignmentTargetProperty(pos));
4557
4528
  pos += 16;
4558
4529
  }
@@ -4674,10 +4645,10 @@ function deserializeBoxTSImportEqualsDeclaration(pos) {
4674
4645
 
4675
4646
  function deserializeVecVariableDeclarator(pos) {
4676
4647
  const arr = [],
4677
- pos32 = pos >> 2,
4678
- len = uint32[pos32 + 2];
4648
+ pos32 = pos >> 2;
4679
4649
  pos = uint32[pos32];
4680
- for (let i = 0; i < len; i++) {
4650
+ const endPos = pos + uint32[pos32 + 2] * 64;
4651
+ while (pos !== endPos) {
4681
4652
  arr.push(deserializeVariableDeclarator(pos));
4682
4653
  pos += 64;
4683
4654
  }
@@ -4701,10 +4672,10 @@ function deserializeOptionLabelIdentifier(pos) {
4701
4672
 
4702
4673
  function deserializeVecSwitchCase(pos) {
4703
4674
  const arr = [],
4704
- pos32 = pos >> 2,
4705
- len = uint32[pos32 + 2];
4675
+ pos32 = pos >> 2;
4706
4676
  pos = uint32[pos32];
4707
- for (let i = 0; i < len; i++) {
4677
+ const endPos = pos + uint32[pos32 + 2] * 48;
4678
+ while (pos !== endPos) {
4708
4679
  arr.push(deserializeSwitchCase(pos));
4709
4680
  pos += 48;
4710
4681
  }
@@ -4757,10 +4728,10 @@ function deserializeBoxAssignmentPattern(pos) {
4757
4728
 
4758
4729
  function deserializeVecBindingProperty(pos) {
4759
4730
  const arr = [],
4760
- pos32 = pos >> 2,
4761
- len = uint32[pos32 + 2];
4731
+ pos32 = pos >> 2;
4762
4732
  pos = uint32[pos32];
4763
- for (let i = 0; i < len; i++) {
4733
+ const endPos = pos + uint32[pos32 + 2] * 64;
4734
+ while (pos !== endPos) {
4764
4735
  arr.push(deserializeBindingProperty(pos));
4765
4736
  pos += 64;
4766
4737
  }
@@ -4783,10 +4754,10 @@ function deserializeOptionBindingPattern(pos) {
4783
4754
 
4784
4755
  function deserializeVecOptionBindingPattern(pos) {
4785
4756
  const arr = [],
4786
- pos32 = pos >> 2,
4787
- len = uint32[pos32 + 2];
4757
+ pos32 = pos >> 2;
4788
4758
  pos = uint32[pos32];
4789
- for (let i = 0; i < len; i++) {
4759
+ const endPos = pos + uint32[pos32 + 2] * 32;
4760
+ while (pos !== endPos) {
4790
4761
  arr.push(deserializeOptionBindingPattern(pos));
4791
4762
  pos += 32;
4792
4763
  }
@@ -4831,10 +4802,10 @@ function deserializeOptionBoxFunctionBody(pos) {
4831
4802
 
4832
4803
  function deserializeVecFormalParameter(pos) {
4833
4804
  const arr = [],
4834
- pos32 = pos >> 2,
4835
- len = uint32[pos32 + 2];
4805
+ pos32 = pos >> 2;
4836
4806
  pos = uint32[pos32];
4837
- for (let i = 0; i < len; i++) {
4807
+ const endPos = pos + uint32[pos32 + 2] * 72;
4808
+ while (pos !== endPos) {
4838
4809
  arr.push(deserializeFormalParameter(pos));
4839
4810
  pos += 72;
4840
4811
  }
@@ -4843,10 +4814,10 @@ function deserializeVecFormalParameter(pos) {
4843
4814
 
4844
4815
  function deserializeVecDecorator(pos) {
4845
4816
  const arr = [],
4846
- pos32 = pos >> 2,
4847
- len = uint32[pos32 + 2];
4817
+ pos32 = pos >> 2;
4848
4818
  pos = uint32[pos32];
4849
- for (let i = 0; i < len; i++) {
4819
+ const endPos = pos + uint32[pos32 + 2] * 24;
4820
+ while (pos !== endPos) {
4850
4821
  arr.push(deserializeDecorator(pos));
4851
4822
  pos += 24;
4852
4823
  }
@@ -4860,10 +4831,10 @@ function deserializeOptionTSAccessibility(pos) {
4860
4831
 
4861
4832
  function deserializeVecTSClassImplements(pos) {
4862
4833
  const arr = [],
4863
- pos32 = pos >> 2,
4864
- len = uint32[pos32 + 2];
4834
+ pos32 = pos >> 2;
4865
4835
  pos = uint32[pos32];
4866
- for (let i = 0; i < len; i++) {
4836
+ const endPos = pos + uint32[pos32 + 2] * 32;
4837
+ while (pos !== endPos) {
4867
4838
  arr.push(deserializeTSClassImplements(pos));
4868
4839
  pos += 32;
4869
4840
  }
@@ -4876,10 +4847,10 @@ function deserializeBoxClassBody(pos) {
4876
4847
 
4877
4848
  function deserializeVecClassElement(pos) {
4878
4849
  const arr = [],
4879
- pos32 = pos >> 2,
4880
- len = uint32[pos32 + 2];
4850
+ pos32 = pos >> 2;
4881
4851
  pos = uint32[pos32];
4882
- for (let i = 0; i < len; i++) {
4852
+ const endPos = pos + uint32[pos32 + 2] * 16;
4853
+ while (pos !== endPos) {
4883
4854
  arr.push(deserializeClassElement(pos));
4884
4855
  pos += 16;
4885
4856
  }
@@ -4937,10 +4908,10 @@ function deserializeOptionImportPhase(pos) {
4937
4908
 
4938
4909
  function deserializeVecImportDeclarationSpecifier(pos) {
4939
4910
  const arr = [],
4940
- pos32 = pos >> 2,
4941
- len = uint32[pos32 + 2];
4911
+ pos32 = pos >> 2;
4942
4912
  pos = uint32[pos32];
4943
- for (let i = 0; i < len; i++) {
4913
+ const endPos = pos + uint32[pos32 + 2] * 16;
4914
+ while (pos !== endPos) {
4944
4915
  arr.push(deserializeImportDeclarationSpecifier(pos));
4945
4916
  pos += 16;
4946
4917
  }
@@ -4975,10 +4946,10 @@ function deserializeBoxImportNamespaceSpecifier(pos) {
4975
4946
 
4976
4947
  function deserializeVecImportAttribute(pos) {
4977
4948
  const arr = [],
4978
- pos32 = pos >> 2,
4979
- len = uint32[pos32 + 2];
4949
+ pos32 = pos >> 2;
4980
4950
  pos = uint32[pos32];
4981
- for (let i = 0; i < len; i++) {
4951
+ const endPos = pos + uint32[pos32 + 2] * 112;
4952
+ while (pos !== endPos) {
4982
4953
  arr.push(deserializeImportAttribute(pos));
4983
4954
  pos += 112;
4984
4955
  }
@@ -4992,10 +4963,10 @@ function deserializeOptionDeclaration(pos) {
4992
4963
 
4993
4964
  function deserializeVecExportSpecifier(pos) {
4994
4965
  const arr = [],
4995
- pos32 = pos >> 2,
4996
- len = uint32[pos32 + 2];
4966
+ pos32 = pos >> 2;
4997
4967
  pos = uint32[pos32];
4998
- for (let i = 0; i < len; i++) {
4968
+ const endPos = pos + uint32[pos32 + 2] * 128;
4969
+ while (pos !== endPos) {
4999
4970
  arr.push(deserializeExportSpecifier(pos));
5000
4971
  pos += 128;
5001
4972
  }
@@ -5016,15 +4987,6 @@ function deserializeF64(pos) {
5016
4987
  return float64[pos >> 3];
5017
4988
  }
5018
4989
 
5019
- function deserializeBoxPattern(pos) {
5020
- return deserializePattern(uint32[pos >> 2]);
5021
- }
5022
-
5023
- function deserializeOptionBoxPattern(pos) {
5024
- if (uint32[pos >> 2] === 0 && uint32[(pos + 4) >> 2] === 0) return null;
5025
- return deserializeBoxPattern(pos);
5026
- }
5027
-
5028
4990
  function deserializeU8(pos) {
5029
4991
  return uint8[pos];
5030
4992
  }
@@ -5035,10 +4997,10 @@ function deserializeBoxJSXOpeningElement(pos) {
5035
4997
 
5036
4998
  function deserializeVecJSXChild(pos) {
5037
4999
  const arr = [],
5038
- pos32 = pos >> 2,
5039
- len = uint32[pos32 + 2];
5000
+ pos32 = pos >> 2;
5040
5001
  pos = uint32[pos32];
5041
- for (let i = 0; i < len; i++) {
5002
+ const endPos = pos + uint32[pos32 + 2] * 16;
5003
+ while (pos !== endPos) {
5042
5004
  arr.push(deserializeJSXChild(pos));
5043
5005
  pos += 16;
5044
5006
  }
@@ -5056,10 +5018,10 @@ function deserializeOptionBoxJSXClosingElement(pos) {
5056
5018
 
5057
5019
  function deserializeVecJSXAttributeItem(pos) {
5058
5020
  const arr = [],
5059
- pos32 = pos >> 2,
5060
- len = uint32[pos32 + 2];
5021
+ pos32 = pos >> 2;
5061
5022
  pos = uint32[pos32];
5062
- for (let i = 0; i < len; i++) {
5023
+ const endPos = pos + uint32[pos32 + 2] * 16;
5024
+ while (pos !== endPos) {
5063
5025
  arr.push(deserializeJSXAttributeItem(pos));
5064
5026
  pos += 16;
5065
5027
  }
@@ -5105,10 +5067,10 @@ function deserializeBoxJSXSpreadChild(pos) {
5105
5067
 
5106
5068
  function deserializeVecTSEnumMember(pos) {
5107
5069
  const arr = [],
5108
- pos32 = pos >> 2,
5109
- len = uint32[pos32 + 2];
5070
+ pos32 = pos >> 2;
5110
5071
  pos = uint32[pos32];
5111
- for (let i = 0; i < len; i++) {
5072
+ const endPos = pos + uint32[pos32 + 2] * 40;
5073
+ while (pos !== endPos) {
5112
5074
  arr.push(deserializeTSEnumMember(pos));
5113
5075
  pos += 40;
5114
5076
  }
@@ -5265,10 +5227,10 @@ function deserializeBoxJSDocUnknownType(pos) {
5265
5227
 
5266
5228
  function deserializeVecTSType(pos) {
5267
5229
  const arr = [],
5268
- pos32 = pos >> 2,
5269
- len = uint32[pos32 + 2];
5230
+ pos32 = pos >> 2;
5270
5231
  pos = uint32[pos32];
5271
- for (let i = 0; i < len; i++) {
5232
+ const endPos = pos + uint32[pos32 + 2] * 16;
5233
+ while (pos !== endPos) {
5272
5234
  arr.push(deserializeTSType(pos));
5273
5235
  pos += 16;
5274
5236
  }
@@ -5277,10 +5239,10 @@ function deserializeVecTSType(pos) {
5277
5239
 
5278
5240
  function deserializeVecTSTupleElement(pos) {
5279
5241
  const arr = [],
5280
- pos32 = pos >> 2,
5281
- len = uint32[pos32 + 2];
5242
+ pos32 = pos >> 2;
5282
5243
  pos = uint32[pos32];
5283
- for (let i = 0; i < len; i++) {
5244
+ const endPos = pos + uint32[pos32 + 2] * 16;
5245
+ while (pos !== endPos) {
5284
5246
  arr.push(deserializeTSTupleElement(pos));
5285
5247
  pos += 16;
5286
5248
  }
@@ -5306,10 +5268,10 @@ function deserializeOptionTSType(pos) {
5306
5268
 
5307
5269
  function deserializeVecTSTypeParameter(pos) {
5308
5270
  const arr = [],
5309
- pos32 = pos >> 2,
5310
- len = uint32[pos32 + 2];
5271
+ pos32 = pos >> 2;
5311
5272
  pos = uint32[pos32];
5312
- for (let i = 0; i < len; i++) {
5273
+ const endPos = pos + uint32[pos32 + 2] * 80;
5274
+ while (pos !== endPos) {
5313
5275
  arr.push(deserializeTSTypeParameter(pos));
5314
5276
  pos += 80;
5315
5277
  }
@@ -5318,10 +5280,10 @@ function deserializeVecTSTypeParameter(pos) {
5318
5280
 
5319
5281
  function deserializeVecTSInterfaceHeritage(pos) {
5320
5282
  const arr = [],
5321
- pos32 = pos >> 2,
5322
- len = uint32[pos32 + 2];
5283
+ pos32 = pos >> 2;
5323
5284
  pos = uint32[pos32];
5324
- for (let i = 0; i < len; i++) {
5285
+ const endPos = pos + uint32[pos32 + 2] * 32;
5286
+ while (pos !== endPos) {
5325
5287
  arr.push(deserializeTSInterfaceHeritage(pos));
5326
5288
  pos += 32;
5327
5289
  }
@@ -5334,10 +5296,10 @@ function deserializeBoxTSInterfaceBody(pos) {
5334
5296
 
5335
5297
  function deserializeVecTSSignature(pos) {
5336
5298
  const arr = [],
5337
- pos32 = pos >> 2,
5338
- len = uint32[pos32 + 2];
5299
+ pos32 = pos >> 2;
5339
5300
  pos = uint32[pos32];
5340
- for (let i = 0; i < len; i++) {
5301
+ const endPos = pos + uint32[pos32 + 2] * 16;
5302
+ while (pos !== endPos) {
5341
5303
  arr.push(deserializeTSSignature(pos));
5342
5304
  pos += 16;
5343
5305
  }
@@ -5362,10 +5324,10 @@ function deserializeBoxTSMethodSignature(pos) {
5362
5324
 
5363
5325
  function deserializeVecTSIndexSignatureName(pos) {
5364
5326
  const arr = [],
5365
- pos32 = pos >> 2,
5366
- len = uint32[pos32 + 2];
5327
+ pos32 = pos >> 2;
5367
5328
  pos = uint32[pos32];
5368
- for (let i = 0; i < len; i++) {
5329
+ const endPos = pos + uint32[pos32 + 2] * 32;
5330
+ while (pos !== endPos) {
5369
5331
  arr.push(deserializeTSIndexSignatureName(pos));
5370
5332
  pos += 32;
5371
5333
  }
@@ -5413,74 +5375,6 @@ function deserializeOptionNameSpan(pos) {
5413
5375
  return deserializeNameSpan(pos);
5414
5376
  }
5415
5377
 
5416
- function deserializeVecAlternative(pos) {
5417
- const arr = [],
5418
- pos32 = pos >> 2,
5419
- len = uint32[pos32 + 2];
5420
- pos = uint32[pos32];
5421
- for (let i = 0; i < len; i++) {
5422
- arr.push(deserializeAlternative(pos));
5423
- pos += 32;
5424
- }
5425
- return arr;
5426
- }
5427
-
5428
- function deserializeVecTerm(pos) {
5429
- const arr = [],
5430
- pos32 = pos >> 2,
5431
- len = uint32[pos32 + 2];
5432
- pos = uint32[pos32];
5433
- for (let i = 0; i < len; i++) {
5434
- arr.push(deserializeTerm(pos));
5435
- pos += 16;
5436
- }
5437
- return arr;
5438
- }
5439
-
5440
- function deserializeBoxBoundaryAssertion(pos) {
5441
- return deserializeBoundaryAssertion(uint32[pos >> 2]);
5442
- }
5443
-
5444
- function deserializeBoxLookAroundAssertion(pos) {
5445
- return deserializeLookAroundAssertion(uint32[pos >> 2]);
5446
- }
5447
-
5448
- function deserializeBoxQuantifier(pos) {
5449
- return deserializeQuantifier(uint32[pos >> 2]);
5450
- }
5451
-
5452
- function deserializeBoxCharacter(pos) {
5453
- return deserializeCharacter(uint32[pos >> 2]);
5454
- }
5455
-
5456
- function deserializeBoxCharacterClassEscape(pos) {
5457
- return deserializeCharacterClassEscape(uint32[pos >> 2]);
5458
- }
5459
-
5460
- function deserializeBoxUnicodePropertyEscape(pos) {
5461
- return deserializeUnicodePropertyEscape(uint32[pos >> 2]);
5462
- }
5463
-
5464
- function deserializeBoxCharacterClass(pos) {
5465
- return deserializeCharacterClass(uint32[pos >> 2]);
5466
- }
5467
-
5468
- function deserializeBoxCapturingGroup(pos) {
5469
- return deserializeCapturingGroup(uint32[pos >> 2]);
5470
- }
5471
-
5472
- function deserializeBoxIgnoreGroup(pos) {
5473
- return deserializeIgnoreGroup(uint32[pos >> 2]);
5474
- }
5475
-
5476
- function deserializeBoxIndexedReference(pos) {
5477
- return deserializeIndexedReference(uint32[pos >> 2]);
5478
- }
5479
-
5480
- function deserializeBoxNamedReference(pos) {
5481
- return deserializeNamedReference(uint32[pos >> 2]);
5482
- }
5483
-
5484
5378
  function deserializeU64(pos) {
5485
5379
  const pos32 = pos >> 2;
5486
5380
  return uint32[pos32] + uint32[pos32 + 1] * 4294967296;
@@ -5491,61 +5385,12 @@ function deserializeOptionU64(pos) {
5491
5385
  return deserializeU64(pos + 8);
5492
5386
  }
5493
5387
 
5494
- function deserializeVecCharacterClassContents(pos) {
5495
- const arr = [],
5496
- pos32 = pos >> 2,
5497
- len = uint32[pos32 + 2];
5498
- pos = uint32[pos32];
5499
- for (let i = 0; i < len; i++) {
5500
- arr.push(deserializeCharacterClassContents(pos));
5501
- pos += 16;
5502
- }
5503
- return arr;
5504
- }
5505
-
5506
- function deserializeBoxCharacterClassRange(pos) {
5507
- return deserializeCharacterClassRange(uint32[pos >> 2]);
5508
- }
5509
-
5510
- function deserializeBoxClassStringDisjunction(pos) {
5511
- return deserializeClassStringDisjunction(uint32[pos >> 2]);
5512
- }
5513
-
5514
- function deserializeVecClassString(pos) {
5515
- const arr = [],
5516
- pos32 = pos >> 2,
5517
- len = uint32[pos32 + 2];
5518
- pos = uint32[pos32];
5519
- for (let i = 0; i < len; i++) {
5520
- arr.push(deserializeClassString(pos));
5521
- pos += 40;
5522
- }
5523
- return arr;
5524
- }
5525
-
5526
- function deserializeVecCharacter(pos) {
5527
- const arr = [],
5528
- pos32 = pos >> 2,
5529
- len = uint32[pos32 + 2];
5530
- pos = uint32[pos32];
5531
- for (let i = 0; i < len; i++) {
5532
- arr.push(deserializeCharacter(pos));
5533
- pos += 16;
5534
- }
5535
- return arr;
5536
- }
5537
-
5538
- function deserializeOptionModifiers(pos) {
5539
- if (uint8[pos] === 0) return null;
5540
- return deserializeModifiers(pos + 8);
5541
- }
5542
-
5543
5388
  function deserializeVecError(pos) {
5544
5389
  const arr = [],
5545
- pos32 = pos >> 2,
5546
- len = uint32[pos32 + 2];
5390
+ pos32 = pos >> 2;
5547
5391
  pos = uint32[pos32];
5548
- for (let i = 0; i < len; i++) {
5392
+ const endPos = pos + uint32[pos32 + 2] * 80;
5393
+ while (pos !== endPos) {
5549
5394
  arr.push(deserializeError(pos));
5550
5395
  pos += 80;
5551
5396
  }
@@ -5554,10 +5399,10 @@ function deserializeVecError(pos) {
5554
5399
 
5555
5400
  function deserializeVecErrorLabel(pos) {
5556
5401
  const arr = [],
5557
- pos32 = pos >> 2,
5558
- len = uint32[pos32 + 2];
5402
+ pos32 = pos >> 2;
5559
5403
  pos = uint32[pos32];
5560
- for (let i = 0; i < len; i++) {
5404
+ const endPos = pos + uint32[pos32 + 2] * 24;
5405
+ while (pos !== endPos) {
5561
5406
  arr.push(deserializeErrorLabel(pos));
5562
5407
  pos += 24;
5563
5408
  }
@@ -5566,10 +5411,10 @@ function deserializeVecErrorLabel(pos) {
5566
5411
 
5567
5412
  function deserializeVecStaticImport(pos) {
5568
5413
  const arr = [],
5569
- pos32 = pos >> 2,
5570
- len = uint32[pos32 + 2];
5414
+ pos32 = pos >> 2;
5571
5415
  pos = uint32[pos32];
5572
- for (let i = 0; i < len; i++) {
5416
+ const endPos = pos + uint32[pos32 + 2] * 56;
5417
+ while (pos !== endPos) {
5573
5418
  arr.push(deserializeStaticImport(pos));
5574
5419
  pos += 56;
5575
5420
  }
@@ -5578,10 +5423,10 @@ function deserializeVecStaticImport(pos) {
5578
5423
 
5579
5424
  function deserializeVecStaticExport(pos) {
5580
5425
  const arr = [],
5581
- pos32 = pos >> 2,
5582
- len = uint32[pos32 + 2];
5426
+ pos32 = pos >> 2;
5583
5427
  pos = uint32[pos32];
5584
- for (let i = 0; i < len; i++) {
5428
+ const endPos = pos + uint32[pos32 + 2] * 32;
5429
+ while (pos !== endPos) {
5585
5430
  arr.push(deserializeStaticExport(pos));
5586
5431
  pos += 32;
5587
5432
  }
@@ -5590,10 +5435,10 @@ function deserializeVecStaticExport(pos) {
5590
5435
 
5591
5436
  function deserializeVecDynamicImport(pos) {
5592
5437
  const arr = [],
5593
- pos32 = pos >> 2,
5594
- len = uint32[pos32 + 2];
5438
+ pos32 = pos >> 2;
5595
5439
  pos = uint32[pos32];
5596
- for (let i = 0; i < len; i++) {
5440
+ const endPos = pos + uint32[pos32 + 2] * 16;
5441
+ while (pos !== endPos) {
5597
5442
  arr.push(deserializeDynamicImport(pos));
5598
5443
  pos += 16;
5599
5444
  }
@@ -5602,10 +5447,10 @@ function deserializeVecDynamicImport(pos) {
5602
5447
 
5603
5448
  function deserializeVecSpan(pos) {
5604
5449
  const arr = [],
5605
- pos32 = pos >> 2,
5606
- len = uint32[pos32 + 2];
5450
+ pos32 = pos >> 2;
5607
5451
  pos = uint32[pos32];
5608
- for (let i = 0; i < len; i++) {
5452
+ const endPos = pos + uint32[pos32 + 2] * 8;
5453
+ while (pos !== endPos) {
5609
5454
  arr.push(deserializeSpan(pos));
5610
5455
  pos += 8;
5611
5456
  }
@@ -5614,10 +5459,10 @@ function deserializeVecSpan(pos) {
5614
5459
 
5615
5460
  function deserializeVecImportEntry(pos) {
5616
5461
  const arr = [],
5617
- pos32 = pos >> 2,
5618
- len = uint32[pos32 + 2];
5462
+ pos32 = pos >> 2;
5619
5463
  pos = uint32[pos32];
5620
- for (let i = 0; i < len; i++) {
5464
+ const endPos = pos + uint32[pos32 + 2] * 96;
5465
+ while (pos !== endPos) {
5621
5466
  arr.push(deserializeImportEntry(pos));
5622
5467
  pos += 96;
5623
5468
  }
@@ -5626,10 +5471,10 @@ function deserializeVecImportEntry(pos) {
5626
5471
 
5627
5472
  function deserializeVecExportEntry(pos) {
5628
5473
  const arr = [],
5629
- pos32 = pos >> 2,
5630
- len = uint32[pos32 + 2];
5474
+ pos32 = pos >> 2;
5631
5475
  pos = uint32[pos32];
5632
- for (let i = 0; i < len; i++) {
5476
+ const endPos = pos + uint32[pos32 + 2] * 144;
5477
+ while (pos !== endPos) {
5633
5478
  arr.push(deserializeExportEntry(pos));
5634
5479
  pos += 144;
5635
5480
  }