meriyah 4.3.9 → 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.
@@ -4363,7 +4363,9 @@ function matchOrInsertSemicolon(parser, context, specDeviation) {
4363
4363
  !specDeviation) {
4364
4364
  report(parser, 28, KeywordDescTable[parser.token & 255]);
4365
4365
  }
4366
- consumeOpt(parser, context, 1074790417);
4366
+ if (!consumeOpt(parser, context, 1074790417)) {
4367
+ parser.onInsertedSemicolon?.(parser.startPos);
4368
+ }
4367
4369
  }
4368
4370
  function isValidStrictMode(parser, index, tokenPos, tokenValue) {
4369
4371
  if (index - tokenPos < 13 && tokenValue === 'use strict') {
@@ -4705,7 +4707,7 @@ function classifyIdentifier(parser, context, t, isArrow) {
4705
4707
  report(parser, 0);
4706
4708
  }
4707
4709
 
4708
- function create(source, sourceFile, onComment, onToken) {
4710
+ function create(source, sourceFile, onComment, onToken, onInsertedSemicolon) {
4709
4711
  return {
4710
4712
  source,
4711
4713
  flags: 0,
@@ -4731,12 +4733,14 @@ function create(source, sourceFile, onComment, onToken) {
4731
4733
  destructible: 0,
4732
4734
  onComment,
4733
4735
  onToken,
4736
+ onInsertedSemicolon,
4734
4737
  leadingDecorators: []
4735
4738
  };
4736
4739
  }
4737
4740
  function parseSource(source, options, context) {
4738
4741
  let sourceFile = '';
4739
4742
  let onComment;
4743
+ let onInsertedSemicolon;
4740
4744
  let onToken;
4741
4745
  if (options != null) {
4742
4746
  if (options.module)
@@ -4774,11 +4778,13 @@ function parseSource(source, options, context) {
4774
4778
  if (options.onComment != null) {
4775
4779
  onComment = Array.isArray(options.onComment) ? pushComment(context, options.onComment) : options.onComment;
4776
4780
  }
4781
+ if (options.onInsertedSemicolon != null)
4782
+ onInsertedSemicolon = options.onInsertedSemicolon;
4777
4783
  if (options.onToken != null) {
4778
4784
  onToken = Array.isArray(options.onToken) ? pushToken(context, options.onToken) : options.onToken;
4779
4785
  }
4780
4786
  }
4781
- const parser = create(source, sourceFile, onComment, onToken);
4787
+ const parser = create(source, sourceFile, onComment, onToken, onInsertedSemicolon);
4782
4788
  if (context & 1)
4783
4789
  skipHashBang(parser);
4784
4790
  const scope = context & 64 ? createScope() : void 0;
@@ -8817,7 +8823,7 @@ var estree = /*#__PURE__*/Object.freeze({
8817
8823
  __proto__: null
8818
8824
  });
8819
8825
 
8820
- var version$1 = "4.3.9";
8826
+ var version$1 = "4.4.0";
8821
8827
 
8822
8828
  const version = version$1;
8823
8829
  function parseScript(source, options) {