meriyah 4.3.8 → 4.4.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.
@@ -4369,7 +4369,9 @@
4369
4369
  !specDeviation) {
4370
4370
  report(parser, 28, KeywordDescTable[parser.token & 255]);
4371
4371
  }
4372
- consumeOpt(parser, context, 1074790417);
4372
+ if (!consumeOpt(parser, context, 1074790417)) {
4373
+ parser.onInsertedSemicolon?.(parser.startPos);
4374
+ }
4373
4375
  }
4374
4376
  function isValidStrictMode(parser, index, tokenPos, tokenValue) {
4375
4377
  if (index - tokenPos < 13 && tokenValue === 'use strict') {
@@ -4711,7 +4713,7 @@
4711
4713
  report(parser, 0);
4712
4714
  }
4713
4715
 
4714
- function create(source, sourceFile, onComment, onToken) {
4716
+ function create(source, sourceFile, onComment, onToken, onInsertedSemicolon) {
4715
4717
  return {
4716
4718
  source,
4717
4719
  flags: 0,
@@ -4737,12 +4739,14 @@
4737
4739
  destructible: 0,
4738
4740
  onComment,
4739
4741
  onToken,
4742
+ onInsertedSemicolon,
4740
4743
  leadingDecorators: []
4741
4744
  };
4742
4745
  }
4743
4746
  function parseSource(source, options, context) {
4744
4747
  let sourceFile = '';
4745
4748
  let onComment;
4749
+ let onInsertedSemicolon;
4746
4750
  let onToken;
4747
4751
  if (options != null) {
4748
4752
  if (options.module)
@@ -4780,11 +4784,13 @@
4780
4784
  if (options.onComment != null) {
4781
4785
  onComment = Array.isArray(options.onComment) ? pushComment(context, options.onComment) : options.onComment;
4782
4786
  }
4787
+ if (options.onInsertedSemicolon != null)
4788
+ onInsertedSemicolon = options.onInsertedSemicolon;
4783
4789
  if (options.onToken != null) {
4784
4790
  onToken = Array.isArray(options.onToken) ? pushToken(context, options.onToken) : options.onToken;
4785
4791
  }
4786
4792
  }
4787
- const parser = create(source, sourceFile, onComment, onToken);
4793
+ const parser = create(source, sourceFile, onComment, onToken, onInsertedSemicolon);
4788
4794
  if (context & 1)
4789
4795
  skipHashBang(parser);
4790
4796
  const scope = context & 64 ? createScope() : void 0;
@@ -5310,7 +5316,7 @@
5310
5316
  consume(parser, context | 32768, 67174411);
5311
5317
  const test = parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
5312
5318
  consume(parser, context | 32768, 16);
5313
- consumeOpt(parser, context, 1074790417);
5319
+ consumeOpt(parser, context | 32768, 1074790417);
5314
5320
  return finishNode(parser, context, start, line, column, {
5315
5321
  type: 'DoWhileStatement',
5316
5322
  body,
@@ -8823,7 +8829,7 @@
8823
8829
  __proto__: null
8824
8830
  });
8825
8831
 
8826
- var version$1 = "4.3.8";
8832
+ var version$1 = "4.4.0";
8827
8833
 
8828
8834
  const version = version$1;
8829
8835
  function parseScript(source, options) {