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.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;
|
|
@@ -8821,7 +8827,7 @@ var estree = /*#__PURE__*/Object.freeze({
|
|
|
8821
8827
|
__proto__: null
|
|
8822
8828
|
});
|
|
8823
8829
|
|
|
8824
|
-
var version$1 = "4.
|
|
8830
|
+
var version$1 = "4.4.0";
|
|
8825
8831
|
|
|
8826
8832
|
const version = version$1;
|
|
8827
8833
|
function parseScript(source, options) {
|
package/dist/meriyah.cjs.js
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;
|
|
@@ -8821,7 +8827,7 @@ var estree = /*#__PURE__*/Object.freeze({
|
|
|
8821
8827
|
__proto__: null
|
|
8822
8828
|
});
|
|
8823
8829
|
|
|
8824
|
-
var version$1 = "4.
|
|
8830
|
+
var version$1 = "4.4.0";
|
|
8825
8831
|
|
|
8826
8832
|
const version = version$1;
|
|
8827
8833
|
function parseScript(source, options) {
|