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.
package/dist/meriyah.cjs CHANGED
@@ -4367,7 +4367,9 @@ function matchOrInsertSemicolon(parser, context, specDeviation) {
4367
4367
  !specDeviation) {
4368
4368
  report(parser, 28, KeywordDescTable[parser.token & 255]);
4369
4369
  }
4370
- consumeOpt(parser, context, 1074790417);
4370
+ if (!consumeOpt(parser, context, 1074790417)) {
4371
+ parser.onInsertedSemicolon?.(parser.startPos);
4372
+ }
4371
4373
  }
4372
4374
  function isValidStrictMode(parser, index, tokenPos, tokenValue) {
4373
4375
  if (index - tokenPos < 13 && tokenValue === 'use strict') {
@@ -4709,7 +4711,7 @@ function classifyIdentifier(parser, context, t, isArrow) {
4709
4711
  report(parser, 0);
4710
4712
  }
4711
4713
 
4712
- function create(source, sourceFile, onComment, onToken) {
4714
+ function create(source, sourceFile, onComment, onToken, onInsertedSemicolon) {
4713
4715
  return {
4714
4716
  source,
4715
4717
  flags: 0,
@@ -4735,12 +4737,14 @@ function create(source, sourceFile, onComment, onToken) {
4735
4737
  destructible: 0,
4736
4738
  onComment,
4737
4739
  onToken,
4740
+ onInsertedSemicolon,
4738
4741
  leadingDecorators: []
4739
4742
  };
4740
4743
  }
4741
4744
  function parseSource(source, options, context) {
4742
4745
  let sourceFile = '';
4743
4746
  let onComment;
4747
+ let onInsertedSemicolon;
4744
4748
  let onToken;
4745
4749
  if (options != null) {
4746
4750
  if (options.module)
@@ -4778,11 +4782,13 @@ function parseSource(source, options, context) {
4778
4782
  if (options.onComment != null) {
4779
4783
  onComment = Array.isArray(options.onComment) ? pushComment(context, options.onComment) : options.onComment;
4780
4784
  }
4785
+ if (options.onInsertedSemicolon != null)
4786
+ onInsertedSemicolon = options.onInsertedSemicolon;
4781
4787
  if (options.onToken != null) {
4782
4788
  onToken = Array.isArray(options.onToken) ? pushToken(context, options.onToken) : options.onToken;
4783
4789
  }
4784
4790
  }
4785
- const parser = create(source, sourceFile, onComment, onToken);
4791
+ const parser = create(source, sourceFile, onComment, onToken, onInsertedSemicolon);
4786
4792
  if (context & 1)
4787
4793
  skipHashBang(parser);
4788
4794
  const scope = context & 64 ? createScope() : void 0;
@@ -5308,7 +5314,7 @@ function parseDoWhileStatement(parser, context, scope, labels, start, line, colu
5308
5314
  consume(parser, context | 32768, 67174411);
5309
5315
  const test = parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
5310
5316
  consume(parser, context | 32768, 16);
5311
- consumeOpt(parser, context, 1074790417);
5317
+ consumeOpt(parser, context | 32768, 1074790417);
5312
5318
  return finishNode(parser, context, start, line, column, {
5313
5319
  type: 'DoWhileStatement',
5314
5320
  body,
@@ -8821,7 +8827,7 @@ var estree = /*#__PURE__*/Object.freeze({
8821
8827
  __proto__: null
8822
8828
  });
8823
8829
 
8824
- var version$1 = "4.3.8";
8830
+ var version$1 = "4.4.0";
8825
8831
 
8826
8832
  const version = version$1;
8827
8833
  function parseScript(source, options) {
@@ -4367,7 +4367,9 @@ function matchOrInsertSemicolon(parser, context, specDeviation) {
4367
4367
  !specDeviation) {
4368
4368
  report(parser, 28, KeywordDescTable[parser.token & 255]);
4369
4369
  }
4370
- consumeOpt(parser, context, 1074790417);
4370
+ if (!consumeOpt(parser, context, 1074790417)) {
4371
+ parser.onInsertedSemicolon?.(parser.startPos);
4372
+ }
4371
4373
  }
4372
4374
  function isValidStrictMode(parser, index, tokenPos, tokenValue) {
4373
4375
  if (index - tokenPos < 13 && tokenValue === 'use strict') {
@@ -4709,7 +4711,7 @@ function classifyIdentifier(parser, context, t, isArrow) {
4709
4711
  report(parser, 0);
4710
4712
  }
4711
4713
 
4712
- function create(source, sourceFile, onComment, onToken) {
4714
+ function create(source, sourceFile, onComment, onToken, onInsertedSemicolon) {
4713
4715
  return {
4714
4716
  source,
4715
4717
  flags: 0,
@@ -4735,12 +4737,14 @@ function create(source, sourceFile, onComment, onToken) {
4735
4737
  destructible: 0,
4736
4738
  onComment,
4737
4739
  onToken,
4740
+ onInsertedSemicolon,
4738
4741
  leadingDecorators: []
4739
4742
  };
4740
4743
  }
4741
4744
  function parseSource(source, options, context) {
4742
4745
  let sourceFile = '';
4743
4746
  let onComment;
4747
+ let onInsertedSemicolon;
4744
4748
  let onToken;
4745
4749
  if (options != null) {
4746
4750
  if (options.module)
@@ -4778,11 +4782,13 @@ function parseSource(source, options, context) {
4778
4782
  if (options.onComment != null) {
4779
4783
  onComment = Array.isArray(options.onComment) ? pushComment(context, options.onComment) : options.onComment;
4780
4784
  }
4785
+ if (options.onInsertedSemicolon != null)
4786
+ onInsertedSemicolon = options.onInsertedSemicolon;
4781
4787
  if (options.onToken != null) {
4782
4788
  onToken = Array.isArray(options.onToken) ? pushToken(context, options.onToken) : options.onToken;
4783
4789
  }
4784
4790
  }
4785
- const parser = create(source, sourceFile, onComment, onToken);
4791
+ const parser = create(source, sourceFile, onComment, onToken, onInsertedSemicolon);
4786
4792
  if (context & 1)
4787
4793
  skipHashBang(parser);
4788
4794
  const scope = context & 64 ? createScope() : void 0;
@@ -5308,7 +5314,7 @@ function parseDoWhileStatement(parser, context, scope, labels, start, line, colu
5308
5314
  consume(parser, context | 32768, 67174411);
5309
5315
  const test = parseExpressions(parser, context, 0, 1, parser.tokenPos, parser.linePos, parser.colPos);
5310
5316
  consume(parser, context | 32768, 16);
5311
- consumeOpt(parser, context, 1074790417);
5317
+ consumeOpt(parser, context | 32768, 1074790417);
5312
5318
  return finishNode(parser, context, start, line, column, {
5313
5319
  type: 'DoWhileStatement',
5314
5320
  body,
@@ -8821,7 +8827,7 @@ var estree = /*#__PURE__*/Object.freeze({
8821
8827
  __proto__: null
8822
8828
  });
8823
8829
 
8824
- var version$1 = "4.3.8";
8830
+ var version$1 = "4.4.0";
8825
8831
 
8826
8832
  const version = version$1;
8827
8833
  function parseScript(source, options) {