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.
- package/CHANGELOG.md +9 -0
- package/README.md +13 -3
- package/dist/meriyah.amd.js +10 -4
- package/dist/meriyah.amd.min.js +1 -1
- package/dist/meriyah.cjs +10 -4
- package/dist/meriyah.cjs.js +10 -4
- package/dist/meriyah.cjs.min.js +1 -1
- package/dist/meriyah.esm.js +10 -4
- package/dist/meriyah.esm.min.js +1 -1
- package/dist/meriyah.esm.min.mjs +1 -1
- package/dist/meriyah.esm.mjs +10 -4
- package/dist/meriyah.iife.js +10 -4
- package/dist/meriyah.iife.min.js +1 -1
- package/dist/meriyah.min.cjs +1 -1
- package/dist/meriyah.system.js +10 -4
- package/dist/meriyah.system.min.js +1 -1
- package/dist/meriyah.umd.cjs +10 -4
- package/dist/meriyah.umd.es5.js +11 -4
- package/dist/meriyah.umd.es5.min.js +1 -1
- package/dist/meriyah.umd.js +10 -4
- package/dist/meriyah.umd.min.cjs +1 -1
- package/dist/meriyah.umd.min.js +1 -1
- package/dist/src/common.d.ts +2 -0
- package/dist/src/common.d.ts.map +1 -1
- package/dist/src/parser.d.ts +3 -2
- package/dist/src/parser.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common.ts +11 -1
- package/src/parser.ts +15 -4
package/dist/meriyah.esm.mjs
CHANGED
|
@@ -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.
|
|
8826
|
+
var version$1 = "4.4.0";
|
|
8821
8827
|
|
|
8822
8828
|
const version = version$1;
|
|
8823
8829
|
function parseScript(source, options) {
|
package/dist/meriyah.iife.js
CHANGED
|
@@ -4366,7 +4366,9 @@ var meriyah = (function (exports) {
|
|
|
4366
4366
|
!specDeviation) {
|
|
4367
4367
|
report(parser, 28, KeywordDescTable[parser.token & 255]);
|
|
4368
4368
|
}
|
|
4369
|
-
consumeOpt(parser, context, 1074790417)
|
|
4369
|
+
if (!consumeOpt(parser, context, 1074790417)) {
|
|
4370
|
+
parser.onInsertedSemicolon?.(parser.startPos);
|
|
4371
|
+
}
|
|
4370
4372
|
}
|
|
4371
4373
|
function isValidStrictMode(parser, index, tokenPos, tokenValue) {
|
|
4372
4374
|
if (index - tokenPos < 13 && tokenValue === 'use strict') {
|
|
@@ -4708,7 +4710,7 @@ var meriyah = (function (exports) {
|
|
|
4708
4710
|
report(parser, 0);
|
|
4709
4711
|
}
|
|
4710
4712
|
|
|
4711
|
-
function create(source, sourceFile, onComment, onToken) {
|
|
4713
|
+
function create(source, sourceFile, onComment, onToken, onInsertedSemicolon) {
|
|
4712
4714
|
return {
|
|
4713
4715
|
source,
|
|
4714
4716
|
flags: 0,
|
|
@@ -4734,12 +4736,14 @@ var meriyah = (function (exports) {
|
|
|
4734
4736
|
destructible: 0,
|
|
4735
4737
|
onComment,
|
|
4736
4738
|
onToken,
|
|
4739
|
+
onInsertedSemicolon,
|
|
4737
4740
|
leadingDecorators: []
|
|
4738
4741
|
};
|
|
4739
4742
|
}
|
|
4740
4743
|
function parseSource(source, options, context) {
|
|
4741
4744
|
let sourceFile = '';
|
|
4742
4745
|
let onComment;
|
|
4746
|
+
let onInsertedSemicolon;
|
|
4743
4747
|
let onToken;
|
|
4744
4748
|
if (options != null) {
|
|
4745
4749
|
if (options.module)
|
|
@@ -4777,11 +4781,13 @@ var meriyah = (function (exports) {
|
|
|
4777
4781
|
if (options.onComment != null) {
|
|
4778
4782
|
onComment = Array.isArray(options.onComment) ? pushComment(context, options.onComment) : options.onComment;
|
|
4779
4783
|
}
|
|
4784
|
+
if (options.onInsertedSemicolon != null)
|
|
4785
|
+
onInsertedSemicolon = options.onInsertedSemicolon;
|
|
4780
4786
|
if (options.onToken != null) {
|
|
4781
4787
|
onToken = Array.isArray(options.onToken) ? pushToken(context, options.onToken) : options.onToken;
|
|
4782
4788
|
}
|
|
4783
4789
|
}
|
|
4784
|
-
const parser = create(source, sourceFile, onComment, onToken);
|
|
4790
|
+
const parser = create(source, sourceFile, onComment, onToken, onInsertedSemicolon);
|
|
4785
4791
|
if (context & 1)
|
|
4786
4792
|
skipHashBang(parser);
|
|
4787
4793
|
const scope = context & 64 ? createScope() : void 0;
|
|
@@ -8820,7 +8826,7 @@ var meriyah = (function (exports) {
|
|
|
8820
8826
|
__proto__: null
|
|
8821
8827
|
});
|
|
8822
8828
|
|
|
8823
|
-
var version$1 = "4.
|
|
8829
|
+
var version$1 = "4.4.0";
|
|
8824
8830
|
|
|
8825
8831
|
const version = version$1;
|
|
8826
8832
|
function parseScript(source, options) {
|