meriyah 6.0.6 → 6.1.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 +32 -11
- package/README.md +7 -10
- package/dist/meriyah.cjs +236 -259
- package/dist/meriyah.min.mjs +1 -1
- package/dist/meriyah.mjs +237 -259
- package/dist/meriyah.umd.js +236 -259
- package/dist/meriyah.umd.min.js +1 -1
- package/dist/{src → types}/chars.d.ts +0 -1
- package/dist/{src → types}/common.d.ts +2 -3
- package/dist/{src → types}/errors.d.ts +4 -5
- package/dist/{src → types}/estree.d.ts +16 -18
- package/dist/{src → types}/lexer/charClassifier.d.ts +0 -1
- package/dist/{src → types}/lexer/comments.d.ts +1 -2
- package/dist/{src → types}/lexer/common.d.ts +1 -2
- package/dist/{src → types}/lexer/decodeHTML.d.ts +0 -1
- package/dist/{src → types}/lexer/identifier.d.ts +1 -2
- package/dist/{src → types}/lexer/index.d.ts +3 -4
- package/dist/{src → types}/lexer/jsx.d.ts +1 -2
- package/dist/{src → types}/lexer/numeric.d.ts +1 -2
- package/dist/{src → types}/lexer/regexp.d.ts +1 -2
- package/dist/{src → types}/lexer/scan.d.ts +1 -2
- package/dist/{src → types}/lexer/string.d.ts +1 -2
- package/dist/{src → types}/lexer/template.d.ts +1 -2
- package/dist/{src → types}/meriyah.d.ts +6 -6
- package/dist/{src → types}/parser.d.ts +6 -7
- package/dist/{src → types}/token.d.ts +4 -5
- package/dist/types/unicode.d.ts +3 -0
- package/package.json +31 -30
- package/dist/src/chars.d.ts.map +0 -1
- package/dist/src/common.d.ts.map +0 -1
- package/dist/src/errors.d.ts.map +0 -1
- package/dist/src/estree.d.ts.map +0 -1
- package/dist/src/lexer/charClassifier.d.ts.map +0 -1
- package/dist/src/lexer/comments.d.ts.map +0 -1
- package/dist/src/lexer/common.d.ts.map +0 -1
- package/dist/src/lexer/decodeHTML.d.ts.map +0 -1
- package/dist/src/lexer/identifier.d.ts.map +0 -1
- package/dist/src/lexer/index.d.ts.map +0 -1
- package/dist/src/lexer/jsx.d.ts.map +0 -1
- package/dist/src/lexer/numeric.d.ts.map +0 -1
- package/dist/src/lexer/regexp.d.ts.map +0 -1
- package/dist/src/lexer/scan.d.ts.map +0 -1
- package/dist/src/lexer/string.d.ts.map +0 -1
- package/dist/src/lexer/template.d.ts.map +0 -1
- package/dist/src/meriyah.d.ts.map +0 -1
- package/dist/src/parser.d.ts.map +0 -1
- package/dist/src/token.d.ts.map +0 -1
- package/dist/src/unicode.d.ts +0 -6
- package/dist/src/unicode.d.ts.map +0 -1
package/dist/meriyah.mjs
CHANGED
|
@@ -175,29 +175,21 @@ const errorMessages = {
|
|
|
175
175
|
[174]: "The only valid meta property for import is 'import.meta'",
|
|
176
176
|
[175]: "'import.meta' must not contain escaped characters",
|
|
177
177
|
[176]: 'cannot use "await" as identifier inside an async function',
|
|
178
|
-
[177]: 'cannot use "await" in static blocks'
|
|
178
|
+
[177]: 'cannot use "await" in static blocks',
|
|
179
179
|
};
|
|
180
180
|
class ParseError extends SyntaxError {
|
|
181
181
|
constructor(start, startLine, startColumn, end, endLine, endColumn, type, ...params) {
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
startColumn +
|
|
186
|
-
'-' +
|
|
187
|
-
endLine +
|
|
188
|
-
':' +
|
|
189
|
-
endColumn +
|
|
190
|
-
']: ' +
|
|
191
|
-
errorMessages[type].replace(/%(\d+)/g, (_, i) => params[i]);
|
|
192
|
-
super(`${message}`);
|
|
182
|
+
const description = errorMessages[type].replace(/%(\d+)/g, (_, i) => params[i]);
|
|
183
|
+
const message = '[' + startLine + ':' + startColumn + '-' + endLine + ':' + endColumn + ']: ' + description;
|
|
184
|
+
super(message);
|
|
193
185
|
this.start = start;
|
|
194
186
|
this.end = end;
|
|
195
187
|
this.range = [start, end];
|
|
196
188
|
this.loc = {
|
|
197
189
|
start: { line: startLine, column: startColumn },
|
|
198
|
-
end: { line: endLine, column: endColumn }
|
|
190
|
+
end: { line: endLine, column: endColumn },
|
|
199
191
|
};
|
|
200
|
-
this.description =
|
|
192
|
+
this.description = description;
|
|
201
193
|
}
|
|
202
194
|
}
|
|
203
195
|
function report(parser, type, ...params) {
|
|
@@ -213,12 +205,6 @@ function reportScannerError(tokenIndex, tokenLine, tokenColumn, index, line, col
|
|
|
213
205
|
throw new ParseError(tokenIndex, tokenLine, tokenColumn, index, line, column, type);
|
|
214
206
|
}
|
|
215
207
|
|
|
216
|
-
function isIDContinue(code) {
|
|
217
|
-
return (unicodeLookup[(code >>> 5) + 0] >>> code & 31 & 1) !== 0;
|
|
218
|
-
}
|
|
219
|
-
function isIDStart(code) {
|
|
220
|
-
return (unicodeLookup[(code >>> 5) + 34816] >>> code & 31 & 1) !== 0;
|
|
221
|
-
}
|
|
222
208
|
const unicodeLookup = ((compressed, lookup) => {
|
|
223
209
|
const result = new Uint32Array(104448);
|
|
224
210
|
let index = 0;
|
|
@@ -242,6 +228,8 @@ const unicodeLookup = ((compressed, lookup) => {
|
|
|
242
228
|
}
|
|
243
229
|
return result;
|
|
244
230
|
})([-1, 2, 26, 2, 27, 2, 5, -1, 0, 77595648, 3, 44, 2, 3, 0, 14, 2, 63, 2, 64, 3, 0, 3, 0, 3168796671, 0, 4294956992, 2, 1, 2, 0, 2, 41, 3, 0, 4, 0, 4294966523, 3, 0, 4, 2, 16, 2, 65, 2, 0, 0, 4294836735, 0, 3221225471, 0, 4294901942, 2, 66, 0, 134152192, 3, 0, 2, 0, 4294951935, 3, 0, 2, 0, 2683305983, 0, 2684354047, 2, 18, 2, 0, 0, 4294961151, 3, 0, 2, 2, 19, 2, 0, 0, 608174079, 2, 0, 2, 60, 2, 7, 2, 6, 0, 4286611199, 3, 0, 2, 2, 1, 3, 0, 3, 0, 4294901711, 2, 40, 0, 4089839103, 0, 2961209759, 0, 1342439375, 0, 4294543342, 0, 3547201023, 0, 1577204103, 0, 4194240, 0, 4294688750, 2, 2, 0, 80831, 0, 4261478351, 0, 4294549486, 2, 2, 0, 2967484831, 0, 196559, 0, 3594373100, 0, 3288319768, 0, 8469959, 2, 203, 2, 3, 0, 4093640191, 0, 660618719, 0, 65487, 0, 4294828015, 0, 4092591615, 0, 1616920031, 0, 982991, 2, 3, 2, 0, 0, 2163244511, 0, 4227923919, 0, 4236247022, 2, 71, 0, 4284449919, 0, 851904, 2, 4, 2, 12, 0, 67076095, -1, 2, 72, 0, 1073741743, 0, 4093607775, -1, 0, 50331649, 0, 3265266687, 2, 33, 0, 4294844415, 0, 4278190047, 2, 20, 2, 137, -1, 3, 0, 2, 2, 23, 2, 0, 2, 10, 2, 0, 2, 15, 2, 22, 3, 0, 10, 2, 74, 2, 0, 2, 75, 2, 76, 2, 77, 2, 0, 2, 78, 2, 0, 2, 11, 0, 261632, 2, 25, 3, 0, 2, 2, 13, 2, 4, 3, 0, 18, 2, 79, 2, 5, 3, 0, 2, 2, 80, 0, 2151677951, 2, 29, 2, 9, 0, 909311, 3, 0, 2, 0, 814743551, 2, 49, 0, 67090432, 3, 0, 2, 2, 42, 2, 0, 2, 6, 2, 0, 2, 30, 2, 8, 0, 268374015, 2, 110, 2, 51, 2, 0, 2, 81, 0, 134153215, -1, 2, 7, 2, 0, 2, 8, 0, 2684354559, 0, 67044351, 0, 3221160064, 2, 17, -1, 3, 0, 2, 2, 53, 0, 1046528, 3, 0, 3, 2, 9, 2, 0, 2, 54, 0, 4294960127, 2, 10, 2, 6, 2, 11, 0, 4294377472, 2, 12, 3, 0, 16, 2, 13, 2, 0, 2, 82, 2, 10, 2, 0, 2, 83, 2, 84, 2, 85, 2, 210, 2, 55, 0, 1048577, 2, 86, 2, 14, -1, 2, 14, 0, 131042, 2, 87, 2, 88, 2, 89, 2, 0, 2, 34, -83, 3, 0, 7, 0, 1046559, 2, 0, 2, 15, 2, 0, 0, 2147516671, 2, 21, 3, 90, 2, 2, 0, -16, 2, 91, 0, 524222462, 2, 4, 2, 0, 0, 4269801471, 2, 4, 3, 0, 2, 2, 28, 2, 16, 3, 0, 2, 2, 17, 2, 0, -1, 2, 18, -16, 3, 0, 206, -2, 3, 0, 692, 2, 73, -1, 2, 18, 2, 10, 3, 0, 8, 2, 93, 2, 133, 2, 0, 0, 3220242431, 3, 0, 3, 2, 19, 2, 94, 2, 95, 3, 0, 2, 2, 96, 2, 0, 2, 97, 2, 46, 2, 0, 0, 4351, 2, 0, 2, 9, 3, 0, 2, 0, 67043391, 0, 3909091327, 2, 0, 2, 24, 2, 9, 2, 20, 3, 0, 2, 0, 67076097, 2, 8, 2, 0, 2, 21, 0, 67059711, 0, 4236247039, 3, 0, 2, 0, 939524103, 0, 8191999, 2, 101, 2, 102, 2, 22, 2, 23, 3, 0, 3, 0, 67057663, 3, 0, 349, 2, 103, 2, 104, 2, 7, -264, 3, 0, 11, 2, 24, 3, 0, 2, 2, 32, -1, 0, 3774349439, 2, 105, 2, 106, 3, 0, 2, 2, 19, 2, 107, 3, 0, 10, 2, 10, 2, 18, 2, 0, 2, 47, 2, 0, 2, 31, 2, 108, 2, 25, 0, 1638399, 2, 183, 2, 109, 3, 0, 3, 2, 20, 2, 26, 2, 27, 2, 5, 2, 28, 2, 0, 2, 8, 2, 111, -1, 2, 112, 2, 113, 2, 114, -1, 3, 0, 3, 2, 12, -2, 2, 0, 2, 29, -3, 2, 163, -4, 2, 20, 2, 0, 2, 36, 0, 1, 2, 0, 2, 67, 2, 6, 2, 12, 2, 10, 2, 0, 2, 115, -1, 3, 0, 4, 2, 10, 2, 23, 2, 116, 2, 7, 2, 0, 2, 117, 2, 0, 2, 118, 2, 119, 2, 120, 2, 0, 2, 9, 3, 0, 9, 2, 21, 2, 30, 2, 31, 2, 121, 2, 122, -2, 2, 123, 2, 124, 2, 30, 2, 21, 2, 8, -2, 2, 125, 2, 30, 2, 32, -2, 2, 0, 2, 39, -2, 0, 4277137519, 0, 2269118463, -1, 3, 20, 2, -1, 2, 33, 2, 38, 2, 0, 3, 30, 2, 2, 35, 2, 19, -3, 3, 0, 2, 2, 34, -1, 2, 0, 2, 35, 2, 0, 2, 35, 2, 0, 2, 48, 2, 0, 0, 4294950463, 2, 37, -7, 2, 0, 0, 203775, 2, 57, 2, 167, 2, 20, 2, 43, 2, 36, 2, 18, 2, 37, 2, 18, 2, 126, 2, 21, 3, 0, 2, 2, 38, 0, 2151677888, 2, 0, 2, 12, 0, 4294901764, 2, 144, 2, 0, 2, 58, 2, 56, 0, 5242879, 3, 0, 2, 0, 402644511, -1, 2, 128, 2, 39, 0, 3, -1, 2, 129, 2, 130, 2, 0, 0, 67045375, 2, 40, 0, 4226678271, 0, 3766565279, 0, 2039759, 2, 132, 2, 41, 0, 1046437, 0, 6, 3, 0, 2, 0, 3288270847, 0, 3, 3, 0, 2, 0, 67043519, -5, 2, 0, 0, 4282384383, 0, 1056964609, -1, 3, 0, 2, 0, 67043345, -1, 2, 0, 2, 42, 2, 23, 2, 50, 2, 11, 2, 61, 2, 38, -5, 2, 0, 2, 12, -3, 3, 0, 2, 0, 2147484671, 2, 134, 0, 4190109695, 2, 52, -2, 2, 135, 0, 4244635647, 0, 27, 2, 0, 2, 8, 2, 43, 2, 0, 2, 68, 2, 18, 2, 0, 2, 42, -6, 2, 0, 2, 45, 2, 59, 2, 44, 2, 45, 2, 46, 2, 47, 0, 8388351, -2, 2, 136, 0, 3028287487, 2, 48, 2, 138, 0, 33259519, 2, 49, -9, 2, 21, 0, 4294836223, 0, 3355443199, 0, 134152199, -2, 2, 69, -2, 3, 0, 28, 2, 32, -3, 3, 0, 3, 2, 17, 3, 0, 6, 2, 50, -81, 2, 18, 3, 0, 2, 2, 36, 3, 0, 33, 2, 25, 2, 30, 3, 0, 124, 2, 12, 3, 0, 18, 2, 38, -213, 2, 0, 2, 32, -54, 3, 0, 17, 2, 42, 2, 8, 2, 23, 2, 0, 2, 8, 2, 23, 2, 51, 2, 0, 2, 21, 2, 52, 2, 139, 2, 25, -13, 2, 0, 2, 53, -6, 3, 0, 2, -4, 3, 0, 2, 0, 4294936575, 2, 0, 0, 4294934783, -2, 0, 196635, 3, 0, 191, 2, 54, 3, 0, 38, 2, 30, 2, 55, 2, 34, -278, 2, 140, 3, 0, 9, 2, 141, 2, 142, 2, 56, 3, 0, 11, 2, 7, -72, 3, 0, 3, 2, 143, 0, 1677656575, -130, 2, 26, -16, 2, 0, 2, 24, 2, 38, -16, 0, 4161266656, 0, 4071, 2, 205, -4, 2, 57, -13, 3, 0, 2, 2, 58, 2, 0, 2, 145, 2, 146, 2, 62, 2, 0, 2, 147, 2, 148, 2, 149, 3, 0, 10, 2, 150, 2, 151, 2, 22, 3, 58, 2, 3, 152, 2, 3, 59, 2, 0, 4294954999, 2, 0, -16, 2, 0, 2, 92, 2, 0, 0, 2105343, 0, 4160749584, 2, 177, -34, 2, 8, 2, 154, -6, 0, 4194303871, 0, 4294903771, 2, 0, 2, 60, 2, 100, -3, 2, 0, 0, 1073684479, 0, 17407, -9, 2, 18, 2, 17, 2, 0, 2, 32, -14, 2, 18, 2, 32, -6, 2, 18, 2, 12, -15, 2, 155, 3, 0, 6, 0, 8323103, -1, 3, 0, 2, 2, 61, -37, 2, 62, 2, 156, 2, 157, 2, 158, 2, 159, 2, 160, -105, 2, 26, -32, 3, 0, 1335, -1, 3, 0, 129, 2, 32, 3, 0, 6, 2, 10, 3, 0, 180, 2, 161, 3, 0, 233, 2, 162, 3, 0, 18, 2, 10, -77, 3, 0, 16, 2, 10, -47, 3, 0, 154, 2, 6, 3, 0, 130, 2, 25, -22250, 3, 0, 7, 2, 25, -6130, 3, 5, 2, -1, 0, 69207040, 3, 44, 2, 3, 0, 14, 2, 63, 2, 64, -3, 0, 3168731136, 0, 4294956864, 2, 1, 2, 0, 2, 41, 3, 0, 4, 0, 4294966275, 3, 0, 4, 2, 16, 2, 65, 2, 0, 2, 34, -1, 2, 18, 2, 66, -1, 2, 0, 0, 2047, 0, 4294885376, 3, 0, 2, 0, 3145727, 0, 2617294944, 0, 4294770688, 2, 25, 2, 67, 3, 0, 2, 0, 131135, 2, 98, 0, 70256639, 0, 71303167, 0, 272, 2, 42, 2, 6, 0, 32511, 2, 0, 2, 49, -1, 2, 99, 2, 68, 0, 4278255616, 0, 4294836227, 0, 4294549473, 0, 600178175, 0, 2952806400, 0, 268632067, 0, 4294543328, 0, 57540095, 0, 1577058304, 0, 1835008, 0, 4294688736, 2, 70, 2, 69, 0, 33554435, 2, 131, 2, 70, 2, 164, 0, 131075, 0, 3594373096, 0, 67094296, 2, 69, -1, 0, 4294828000, 0, 603979263, 0, 654311424, 0, 3, 0, 4294828001, 0, 602930687, 2, 171, 0, 393219, 0, 4294828016, 0, 671088639, 0, 2154840064, 0, 4227858435, 0, 4236247008, 2, 71, 2, 38, -1, 2, 4, 0, 917503, 2, 38, -1, 2, 72, 0, 537788335, 0, 4026531935, -1, 0, 1, -1, 2, 33, 2, 73, 0, 7936, -3, 2, 0, 0, 2147485695, 0, 1010761728, 0, 4292984930, 0, 16387, 2, 0, 2, 15, 2, 22, 3, 0, 10, 2, 74, 2, 0, 2, 75, 2, 76, 2, 77, 2, 0, 2, 78, 2, 0, 2, 12, -1, 2, 25, 3, 0, 2, 2, 13, 2, 4, 3, 0, 18, 2, 79, 2, 5, 3, 0, 2, 2, 80, 0, 2147745791, 3, 19, 2, 0, 122879, 2, 0, 2, 9, 0, 276824064, -2, 3, 0, 2, 2, 42, 2, 0, 0, 4294903295, 2, 0, 2, 30, 2, 8, -1, 2, 18, 2, 51, 2, 0, 2, 81, 2, 49, -1, 2, 21, 2, 0, 2, 29, -2, 0, 128, -2, 2, 28, 2, 9, 0, 8160, -1, 2, 127, 0, 4227907585, 2, 0, 2, 37, 2, 0, 2, 50, 2, 184, 2, 10, 2, 6, 2, 11, -1, 0, 74440192, 3, 0, 6, -2, 3, 0, 8, 2, 13, 2, 0, 2, 82, 2, 10, 2, 0, 2, 83, 2, 84, 2, 85, -3, 2, 86, 2, 14, -3, 2, 87, 2, 88, 2, 89, 2, 0, 2, 34, -83, 3, 0, 7, 0, 817183, 2, 0, 2, 15, 2, 0, 0, 33023, 2, 21, 3, 90, 2, -17, 2, 91, 0, 524157950, 2, 4, 2, 0, 2, 92, 2, 4, 2, 0, 2, 22, 2, 28, 2, 16, 3, 0, 2, 2, 17, 2, 0, -1, 2, 18, -16, 3, 0, 206, -2, 3, 0, 692, 2, 73, -1, 2, 18, 2, 10, 3, 0, 8, 2, 93, 0, 3072, 2, 0, 0, 2147516415, 2, 10, 3, 0, 2, 2, 25, 2, 94, 2, 95, 3, 0, 2, 2, 96, 2, 0, 2, 97, 2, 46, 0, 4294965179, 0, 7, 2, 0, 2, 9, 2, 95, 2, 9, -1, 0, 1761345536, 2, 98, 0, 4294901823, 2, 38, 2, 20, 2, 99, 2, 35, 2, 100, 0, 2080440287, 2, 0, 2, 34, 2, 153, 0, 3296722943, 2, 0, 0, 1046675455, 0, 939524101, 0, 1837055, 2, 101, 2, 102, 2, 22, 2, 23, 3, 0, 3, 0, 7, 3, 0, 349, 2, 103, 2, 104, 2, 7, -264, 3, 0, 11, 2, 24, 3, 0, 2, 2, 32, -1, 0, 2700607615, 2, 105, 2, 106, 3, 0, 2, 2, 19, 2, 107, 3, 0, 10, 2, 10, 2, 18, 2, 0, 2, 47, 2, 0, 2, 31, 2, 108, -3, 2, 109, 3, 0, 3, 2, 20, -1, 3, 5, 2, 2, 110, 2, 0, 2, 8, 2, 111, -1, 2, 112, 2, 113, 2, 114, -1, 3, 0, 3, 2, 12, -2, 2, 0, 2, 29, -8, 2, 20, 2, 0, 2, 36, -1, 2, 0, 2, 67, 2, 6, 2, 30, 2, 10, 2, 0, 2, 115, -1, 3, 0, 4, 2, 10, 2, 18, 2, 116, 2, 7, 2, 0, 2, 117, 2, 0, 2, 118, 2, 119, 2, 120, 2, 0, 2, 9, 3, 0, 9, 2, 21, 2, 30, 2, 31, 2, 121, 2, 122, -2, 2, 123, 2, 124, 2, 30, 2, 21, 2, 8, -2, 2, 125, 2, 30, 2, 32, -2, 2, 0, 2, 39, -2, 0, 4277075969, 2, 30, -1, 3, 20, 2, -1, 2, 33, 2, 126, 2, 0, 3, 30, 2, 2, 35, 2, 19, -3, 3, 0, 2, 2, 34, -1, 2, 0, 2, 35, 2, 0, 2, 35, 2, 0, 2, 50, 2, 98, 0, 4294934591, 2, 37, -7, 2, 0, 0, 197631, 2, 57, -1, 2, 20, 2, 43, 2, 37, 2, 18, 0, 3, 2, 18, 2, 126, 2, 21, 2, 127, 2, 54, -1, 0, 2490368, 2, 127, 2, 25, 2, 18, 2, 34, 2, 127, 2, 38, 0, 4294901904, 0, 4718591, 2, 127, 2, 35, 0, 335544350, -1, 2, 128, 0, 2147487743, 0, 1, -1, 2, 129, 2, 130, 2, 8, -1, 2, 131, 2, 70, 0, 3758161920, 0, 3, 2, 132, 0, 12582911, 0, 655360, -1, 2, 0, 2, 29, 0, 2147485568, 0, 3, 2, 0, 2, 25, 0, 176, -5, 2, 0, 2, 17, 2, 192, -1, 2, 0, 2, 25, 2, 209, -1, 2, 0, 0, 16779263, -2, 2, 12, -1, 2, 38, -5, 2, 0, 2, 133, -3, 3, 0, 2, 2, 55, 2, 134, 0, 2147549183, 0, 2, -2, 2, 135, 2, 36, 0, 10, 0, 4294965249, 0, 67633151, 0, 4026597376, 2, 0, 0, 536871935, 2, 18, 2, 0, 2, 42, -6, 2, 0, 0, 1, 2, 59, 2, 17, 0, 1, 2, 46, 2, 25, -3, 2, 136, 2, 36, 2, 137, 2, 138, 0, 16778239, -10, 2, 35, 0, 4294836212, 2, 9, -3, 2, 69, -2, 3, 0, 28, 2, 32, -3, 3, 0, 3, 2, 17, 3, 0, 6, 2, 50, -81, 2, 18, 3, 0, 2, 2, 36, 3, 0, 33, 2, 25, 0, 126, 3, 0, 124, 2, 12, 3, 0, 18, 2, 38, -213, 2, 10, -55, 3, 0, 17, 2, 42, 2, 8, 2, 18, 2, 0, 2, 8, 2, 18, 2, 60, 2, 0, 2, 25, 2, 50, 2, 139, 2, 25, -13, 2, 0, 2, 73, -6, 3, 0, 2, -4, 3, 0, 2, 0, 67583, -1, 2, 107, -2, 0, 11, 3, 0, 191, 2, 54, 3, 0, 38, 2, 30, 2, 55, 2, 34, -278, 2, 140, 3, 0, 9, 2, 141, 2, 142, 2, 56, 3, 0, 11, 2, 7, -72, 3, 0, 3, 2, 143, 2, 144, -187, 3, 0, 2, 2, 58, 2, 0, 2, 145, 2, 146, 2, 62, 2, 0, 2, 147, 2, 148, 2, 149, 3, 0, 10, 2, 150, 2, 151, 2, 22, 3, 58, 2, 3, 152, 2, 3, 59, 2, 2, 153, -57, 2, 8, 2, 154, -7, 2, 18, 2, 0, 2, 60, -4, 2, 0, 0, 1065361407, 0, 16384, -9, 2, 18, 2, 60, 2, 0, 2, 133, -14, 2, 18, 2, 133, -6, 2, 18, 0, 81919, -15, 2, 155, 3, 0, 6, 2, 126, -1, 3, 0, 2, 0, 2063, -37, 2, 62, 2, 156, 2, 157, 2, 158, 2, 159, 2, 160, -138, 3, 0, 1335, -1, 3, 0, 129, 2, 32, 3, 0, 6, 2, 10, 3, 0, 180, 2, 161, 3, 0, 233, 2, 162, 3, 0, 18, 2, 10, -77, 3, 0, 16, 2, 10, -47, 3, 0, 154, 2, 6, 3, 0, 130, 2, 25, -28386, 2, 0, 0, 1, -1, 2, 55, 2, 0, 0, 8193, -21, 2, 201, 0, 10255, 0, 4, -11, 2, 69, 2, 182, -1, 0, 71680, -1, 2, 174, 0, 4292900864, 0, 268435519, -5, 2, 163, -1, 2, 173, -1, 0, 6144, -2, 2, 46, -1, 2, 168, -1, 0, 2147532800, 2, 164, 2, 170, 0, 8355840, -2, 0, 4, -4, 2, 198, 0, 205128192, 0, 1333757536, 0, 2147483696, 0, 423953, 0, 747766272, 0, 2717763192, 0, 4286578751, 0, 278545, 2, 165, 0, 4294886464, 0, 33292336, 0, 417809, 2, 165, 0, 1327482464, 0, 4278190128, 0, 700594195, 0, 1006647527, 0, 4286497336, 0, 4160749631, 2, 166, 0, 201327104, 0, 3634348576, 0, 8323120, 2, 166, 0, 202375680, 0, 2678047264, 0, 4293984304, 2, 166, -1, 0, 983584, 0, 48, 0, 58720273, 0, 3489923072, 0, 10517376, 0, 4293066815, 0, 1, 2, 213, 2, 167, 2, 0, 0, 2089, 0, 3221225552, 0, 201359520, 2, 0, -2, 0, 256, 0, 122880, 0, 16777216, 2, 163, 0, 4160757760, 2, 0, -6, 2, 179, -11, 0, 3263218176, -1, 0, 49664, 0, 2160197632, 0, 8388802, -1, 0, 12713984, -1, 2, 168, 2, 186, 2, 187, -2, 2, 175, -20, 0, 3758096385, -2, 2, 169, 2, 195, 2, 94, 2, 180, 0, 4294057984, -2, 2, 176, 2, 172, 0, 4227874816, -2, 2, 169, -1, 2, 170, -1, 2, 181, 2, 55, 0, 4026593280, 0, 14, 0, 4292919296, -1, 2, 178, 0, 939588608, -1, 0, 805306368, -1, 2, 55, 2, 171, 2, 172, 2, 173, 2, 211, 2, 0, -2, 0, 8192, -4, 0, 267386880, -1, 0, 117440512, 0, 7168, -1, 2, 170, 2, 168, 2, 174, 2, 188, -16, 2, 175, -1, 0, 1426112704, 2, 176, -1, 2, 196, 0, 271581216, 0, 2149777408, 2, 25, 2, 174, 2, 55, 0, 851967, 2, 189, -1, 2, 177, 2, 190, -4, 2, 178, -20, 2, 98, 2, 208, -56, 0, 3145728, 2, 191, -10, 0, 32505856, -1, 2, 179, -1, 0, 2147385088, 2, 94, 1, 2155905152, 2, -3, 2, 176, 2, 0, 0, 67108864, -2, 2, 180, -6, 2, 181, 2, 25, 0, 1, -1, 0, 1, -1, 2, 182, -3, 2, 126, 2, 69, -2, 2, 100, -2, 0, 32704, 2, 55, -915, 2, 183, -1, 2, 207, -10, 2, 194, -5, 2, 185, -6, 0, 3759456256, 2, 19, -1, 2, 184, -1, 2, 185, -2, 0, 4227874752, -3, 0, 2146435072, 2, 186, -2, 0, 1006649344, 2, 55, -1, 2, 94, 0, 201375744, -3, 0, 134217720, 2, 94, 0, 4286677377, 0, 32896, -1, 2, 178, -3, 0, 4227907584, -349, 0, 65520, 0, 1920, 2, 167, 3, 0, 264, -11, 2, 173, -2, 2, 187, 2, 0, 0, 520617856, 0, 2692743168, 0, 36, -3, 0, 524280, -13, 2, 193, -1, 0, 4294934272, 2, 25, 2, 187, -1, 2, 215, 0, 2158720, -3, 2, 186, 0, 1, -4, 2, 55, 0, 3808625411, 0, 3489628288, 0, 4096, 0, 1207959680, 0, 3221274624, 2, 0, -3, 2, 188, 0, 120, 0, 7340032, -2, 2, 189, 2, 4, 2, 25, 2, 176, 3, 0, 4, 2, 186, -1, 2, 190, 2, 167, -1, 0, 8176, 2, 170, 2, 188, 0, 1073741824, -1, 0, 4290773232, 2, 0, -4, 2, 176, 2, 197, 0, 15728640, 2, 167, -1, 2, 174, -1, 0, 134250480, 0, 4720640, 0, 3825467396, -1, 2, 180, -9, 2, 94, 2, 181, 0, 4294967040, 2, 137, 0, 4160880640, 3, 0, 2, 0, 704, 0, 1849688064, 2, 191, -1, 2, 55, 0, 4294901887, 2, 0, 0, 130547712, 0, 1879048192, 2, 212, 3, 0, 2, -1, 2, 192, 2, 193, -1, 0, 17829776, 0, 2025848832, 0, 4261477888, -2, 2, 0, -1, 0, 4286580608, -1, 0, 29360128, 2, 200, 0, 16252928, 0, 3791388672, 2, 130, 3, 0, 2, -2, 2, 206, 2, 0, -1, 2, 107, -1, 0, 66584576, -1, 2, 199, -1, 0, 448, 0, 4294918080, 3, 0, 6, 2, 55, -1, 0, 4294755328, 0, 4294967267, 2, 7, -1, 2, 174, 2, 187, 2, 25, 2, 98, 2, 25, 2, 194, 2, 94, -2, 0, 245760, 2, 195, -1, 2, 163, 2, 202, 0, 4227923456, -1, 2, 196, 2, 174, 2, 94, -3, 0, 4292870145, 0, 262144, -1, 2, 95, 2, 0, 0, 1073758848, 2, 197, -1, 0, 4227921920, 2, 198, 0, 68289024, 0, 528402016, 0, 4292927536, 0, 46080, 2, 191, 0, 4265609306, 0, 4294967289, -2, 0, 268435456, 2, 95, -2, 2, 199, 3, 0, 5, -1, 2, 200, 2, 176, 2, 0, -2, 0, 4227923936, 2, 67, -1, 2, 187, 2, 197, 2, 99, 2, 168, 2, 178, 2, 204, 3, 0, 5, -1, 2, 167, 3, 0, 3, -2, 0, 2146959360, 0, 9440640, 0, 104857600, 0, 4227923840, 3, 0, 2, 0, 768, 2, 201, 2, 28, -2, 2, 174, -2, 2, 202, -1, 2, 169, 2, 98, 3, 0, 5, -1, 0, 4227923964, 0, 512, 0, 8388608, 2, 203, 2, 183, 2, 193, 0, 4286578944, 3, 0, 2, 0, 1152, 0, 1266679808, 2, 199, 0, 576, 0, 4261707776, 2, 98, 3, 0, 9, 2, 169, 0, 131072, 0, 939524096, 2, 188, 3, 0, 2, 2, 16, -1, 0, 2147221504, -28, 2, 187, 3, 0, 3, -3, 0, 4292902912, -6, 2, 99, 3, 0, 81, 2, 25, -2, 2, 107, -33, 2, 18, 2, 181, -124, 2, 188, -18, 2, 204, 3, 0, 213, -1, 2, 187, 3, 0, 54, -17, 2, 169, 2, 55, 2, 205, -1, 2, 55, 2, 197, 0, 4290822144, -2, 0, 67174336, 0, 520093700, 2, 18, 3, 0, 13, -1, 2, 187, 3, 0, 6, -2, 2, 188, 3, 0, 3, -2, 0, 30720, -1, 0, 32512, 3, 0, 2, 0, 4294770656, -191, 2, 185, -38, 2, 181, 2, 8, 2, 206, 3, 0, 278, 0, 2417033215, -9, 0, 4294705144, 0, 4292411391, 0, 65295, -11, 2, 167, 3, 0, 72, -3, 0, 3758159872, 0, 201391616, 3, 0, 123, -7, 2, 187, -13, 2, 180, 3, 0, 2, -1, 2, 173, 2, 207, -3, 2, 99, 2, 0, -7, 2, 181, -1, 0, 384, -1, 0, 133693440, -3, 2, 208, -2, 2, 110, 3, 0, 3, 3, 180, 2, -2, 2, 94, 2, 169, 3, 0, 4, -2, 2, 196, -1, 2, 163, 0, 335552923, 2, 209, -1, 0, 538974272, 0, 2214592512, 0, 132000, -10, 0, 192, -8, 2, 210, -21, 0, 134213632, 2, 162, 3, 0, 34, 2, 55, 0, 4294965279, 3, 0, 6, 0, 100663424, 0, 63524, -1, 2, 214, 2, 152, 3, 0, 3, -1, 0, 3221282816, 0, 4294917120, 3, 0, 9, 2, 25, 2, 211, -1, 2, 212, 3, 0, 14, 2, 25, 2, 187, 3, 0, 6, 2, 25, 2, 213, 3, 0, 15, 0, 2147520640, -6, 0, 4286578784, 2, 0, -2, 0, 1006694400, 3, 0, 24, 2, 36, -1, 0, 4292870144, 3, 0, 2, 0, 1, 2, 176, 3, 0, 6, 2, 209, 0, 4110942569, 0, 1432950139, 0, 2701658217, 0, 4026532864, 0, 4026532881, 2, 0, 2, 47, 3, 0, 8, -1, 2, 178, -2, 2, 180, 0, 98304, 0, 65537, 2, 181, -5, 2, 214, 2, 0, 2, 37, 2, 202, 2, 167, 0, 4294770176, 2, 110, 3, 0, 4, -30, 2, 192, 0, 3758153728, -3, 0, 125829120, -2, 2, 187, 0, 4294897664, 2, 178, -1, 2, 199, -1, 2, 174, 0, 4026580992, 2, 95, 2, 0, -10, 2, 180, 0, 3758145536, 0, 31744, -1, 0, 1610628992, 0, 4261477376, -4, 2, 215, -2, 2, 187, 3, 0, 32, -1335, 2, 0, -129, 2, 187, -6, 2, 176, -180, 0, 65532, -233, 2, 177, -18, 2, 176, 3, 0, 77, -16, 2, 176, 3, 0, 47, -154, 2, 170, -130, 2, 18, 3, 0, 22250, -7, 2, 18, 3, 0, 6128], [4294967295, 4294967291, 4092460543, 4294828031, 4294967294, 134217726, 4294903807, 268435455, 2147483647, 1048575, 1073741823, 3892314111, 134217727, 1061158911, 536805376, 4294910143, 4294901759, 32767, 4294901760, 262143, 536870911, 8388607, 4160749567, 4294902783, 4294918143, 65535, 67043328, 2281701374, 4294967264, 2097151, 4194303, 255, 67108863, 4294967039, 511, 524287, 131071, 63, 127, 3238002687, 4294549487, 4290772991, 33554431, 4294901888, 4286578687, 67043329, 4294705152, 4294770687, 67043583, 1023, 15, 2047999, 67043343, 67051519, 16777215, 2147483648, 4294902000, 28, 4292870143, 4294966783, 16383, 67047423, 4294967279, 262083, 20511, 41943039, 493567, 4294959104, 603979775, 65536, 602799615, 805044223, 4294965206, 8191, 1031749119, 4294917631, 2134769663, 4286578493, 4282253311, 4294942719, 33540095, 4294905855, 2868854591, 1608515583, 265232348, 534519807, 2147614720, 1060109444, 4093640016, 17376, 2139062143, 224, 4169138175, 4294909951, 4286578688, 4294967292, 4294965759, 535511039, 4294966272, 4294967280, 32768, 8289918, 4294934399, 4294901775, 4294965375, 1602223615, 4294967259, 4294443008, 268369920, 4292804608, 4294967232, 486341884, 4294963199, 3087007615, 1073692671, 4128527, 4279238655, 4294902015, 4160684047, 4290246655, 469499899, 4294967231, 134086655, 4294966591, 2445279231, 3670015, 31, 4294967288, 4294705151, 3221208447, 4294902271, 4294549472, 4294921215, 4095, 4285526655, 4294966527, 4294966143, 64, 4294966719, 3774873592, 1877934080, 262151, 2555904, 536807423, 67043839, 3758096383, 3959414372, 3755993023, 2080374783, 4294835295, 4294967103, 4160749565, 4294934527, 4087, 2016, 2147446655, 184024726, 2862017156, 1593309078, 268434431, 268434414, 4294901763, 4294901761, 536870912, 2952790016, 202506752, 139264, 4026531840, 402653184, 4261412864, 63488, 1610612736, 4227922944, 49152, 65280, 3233808384, 3221225472, 65534, 61440, 57152, 4293918720, 4290772992, 25165824, 57344, 4227915776, 4278190080, 3758096384, 4227858432, 4160749568, 3758129152, 4294836224, 4194304, 251658240, 196608, 4294963200, 2143289344, 2097152, 64512, 417808, 4227923712, 12582912, 50331648, 65528, 65472, 4294967168, 15360, 4294966784, 65408, 4294965248, 16, 12288, 4294934528, 2080374784, 2013265920, 4294950912, 524288]);
|
|
231
|
+
const isIDContinue = (code) => (unicodeLookup[(code >>> 5) + 0] >>> code & 31 & 1) !== 0;
|
|
232
|
+
const isIDStart = (code) => (unicodeLookup[(code >>> 5) + 34816] >>> code & 31 & 1) !== 0;
|
|
245
233
|
|
|
246
234
|
function advanceChar(parser) {
|
|
247
235
|
parser.column++;
|
|
@@ -752,12 +740,12 @@ function skipSingleLineComment(parser, source, state, type, start, line, column)
|
|
|
752
740
|
const loc = {
|
|
753
741
|
start: {
|
|
754
742
|
line,
|
|
755
|
-
column
|
|
743
|
+
column,
|
|
756
744
|
},
|
|
757
745
|
end: {
|
|
758
746
|
line: parser.tokenLine,
|
|
759
|
-
column: parser.tokenColumn
|
|
760
|
-
}
|
|
747
|
+
column: parser.tokenColumn,
|
|
748
|
+
},
|
|
761
749
|
};
|
|
762
750
|
parser.onComment(CommentTypes[type & 0xff], source.slice(index, parser.tokenIndex), start, parser.tokenIndex, loc);
|
|
763
751
|
}
|
|
@@ -779,12 +767,12 @@ function skipMultiLineComment(parser, source, state) {
|
|
|
779
767
|
const loc = {
|
|
780
768
|
start: {
|
|
781
769
|
line: parser.tokenLine,
|
|
782
|
-
column: parser.tokenColumn
|
|
770
|
+
column: parser.tokenColumn,
|
|
783
771
|
},
|
|
784
772
|
end: {
|
|
785
773
|
line: parser.line,
|
|
786
|
-
column: parser.column
|
|
787
|
-
}
|
|
774
|
+
column: parser.column,
|
|
775
|
+
},
|
|
788
776
|
};
|
|
789
777
|
parser.onComment(CommentTypes[1 & 0xff], source.slice(index, parser.index - 2), index - 2, parser.index, loc);
|
|
790
778
|
}
|
|
@@ -1796,7 +1784,7 @@ const TokenLookup = [
|
|
|
1796
1784
|
8389702,
|
|
1797
1785
|
1074790415,
|
|
1798
1786
|
16842799,
|
|
1799
|
-
128
|
|
1787
|
+
128,
|
|
1800
1788
|
];
|
|
1801
1789
|
function nextToken(parser, context) {
|
|
1802
1790
|
parser.flags = (parser.flags | 1) ^ 1;
|
|
@@ -4253,7 +4241,7 @@ const entities = {
|
|
|
4253
4241
|
zopf: '\uD835\uDD6B',
|
|
4254
4242
|
zscr: '\uD835\uDCCF',
|
|
4255
4243
|
zwj: '\u200D',
|
|
4256
|
-
zwnj: '\u200C'
|
|
4244
|
+
zwnj: '\u200C',
|
|
4257
4245
|
};
|
|
4258
4246
|
const decodeMap = {
|
|
4259
4247
|
'0': 65533,
|
|
@@ -4283,7 +4271,7 @@ const decodeMap = {
|
|
|
4283
4271
|
'155': 8250,
|
|
4284
4272
|
'156': 339,
|
|
4285
4273
|
'158': 382,
|
|
4286
|
-
'159': 376
|
|
4274
|
+
'159': 376,
|
|
4287
4275
|
};
|
|
4288
4276
|
function decodeHTMLStrict(text) {
|
|
4289
4277
|
return text.replace(/&(?:[a-zA-Z]+|#[xX][\da-fA-F]+|#\d+);/g, (key) => {
|
|
@@ -4549,12 +4537,12 @@ function finishNode(parser, context, start, line, column, node) {
|
|
|
4549
4537
|
node.loc = {
|
|
4550
4538
|
start: {
|
|
4551
4539
|
line,
|
|
4552
|
-
column
|
|
4540
|
+
column,
|
|
4553
4541
|
},
|
|
4554
4542
|
end: {
|
|
4555
4543
|
line: parser.startLine,
|
|
4556
|
-
column: parser.startColumn
|
|
4557
|
-
}
|
|
4544
|
+
column: parser.startColumn,
|
|
4545
|
+
},
|
|
4558
4546
|
};
|
|
4559
4547
|
if (parser.sourceFile) {
|
|
4560
4548
|
node.loc.source = parser.sourceFile;
|
|
@@ -4587,26 +4575,26 @@ function recordScopeError(parser, type, ...params) {
|
|
|
4587
4575
|
column,
|
|
4588
4576
|
tokenIndex,
|
|
4589
4577
|
tokenLine,
|
|
4590
|
-
tokenColumn
|
|
4578
|
+
tokenColumn,
|
|
4591
4579
|
};
|
|
4592
4580
|
}
|
|
4593
4581
|
function createScope() {
|
|
4594
4582
|
return {
|
|
4595
4583
|
parent: void 0,
|
|
4596
|
-
type: 2
|
|
4584
|
+
type: 2,
|
|
4597
4585
|
};
|
|
4598
4586
|
}
|
|
4599
4587
|
function addChildScope(parent, type) {
|
|
4600
4588
|
return {
|
|
4601
4589
|
parent,
|
|
4602
4590
|
type,
|
|
4603
|
-
scopeError: void 0
|
|
4591
|
+
scopeError: void 0,
|
|
4604
4592
|
};
|
|
4605
4593
|
}
|
|
4606
4594
|
function addChildPrivateScope(parent) {
|
|
4607
4595
|
return {
|
|
4608
4596
|
parent,
|
|
4609
|
-
refs: Object.create(null)
|
|
4597
|
+
refs: Object.create(null),
|
|
4610
4598
|
};
|
|
4611
4599
|
}
|
|
4612
4600
|
function addVarOrBlock(parser, context, scope, name, kind, origin) {
|
|
@@ -4693,7 +4681,7 @@ function addPrivateIdentifierRef(parser, scope, name) {
|
|
|
4693
4681
|
scope.refs[name].push({
|
|
4694
4682
|
index: parser.tokenIndex,
|
|
4695
4683
|
line: parser.tokenLine,
|
|
4696
|
-
column: parser.tokenColumn
|
|
4684
|
+
column: parser.tokenColumn,
|
|
4697
4685
|
});
|
|
4698
4686
|
}
|
|
4699
4687
|
function isPrivateIdentifierDefined(name, scope) {
|
|
@@ -4728,7 +4716,7 @@ function pushComment(context, array) {
|
|
|
4728
4716
|
return function (type, value, start, end, loc) {
|
|
4729
4717
|
const comment = {
|
|
4730
4718
|
type,
|
|
4731
|
-
value
|
|
4719
|
+
value,
|
|
4732
4720
|
};
|
|
4733
4721
|
if (context & 2) {
|
|
4734
4722
|
comment.start = start;
|
|
@@ -4744,7 +4732,7 @@ function pushComment(context, array) {
|
|
|
4744
4732
|
function pushToken(context, array) {
|
|
4745
4733
|
return function (token, start, end, loc) {
|
|
4746
4734
|
const tokens = {
|
|
4747
|
-
token
|
|
4735
|
+
token,
|
|
4748
4736
|
};
|
|
4749
4737
|
if (context & 2) {
|
|
4750
4738
|
tokens.start = start;
|
|
@@ -4804,12 +4792,12 @@ function create(source, sourceFile, onComment, onToken, onInsertedSemicolon) {
|
|
|
4804
4792
|
const loc = {
|
|
4805
4793
|
start: {
|
|
4806
4794
|
line: this.tokenLine,
|
|
4807
|
-
column: this.tokenColumn
|
|
4795
|
+
column: this.tokenColumn,
|
|
4808
4796
|
},
|
|
4809
4797
|
end: {
|
|
4810
4798
|
line: this.line,
|
|
4811
|
-
column: this.column
|
|
4812
|
-
}
|
|
4799
|
+
column: this.column,
|
|
4800
|
+
},
|
|
4813
4801
|
};
|
|
4814
4802
|
if (!replaceLast && lastOnToken) {
|
|
4815
4803
|
onToken(...lastOnToken);
|
|
@@ -4835,7 +4823,7 @@ function create(source, sourceFile, onComment, onToken, onInsertedSemicolon) {
|
|
|
4835
4823
|
onComment,
|
|
4836
4824
|
onToken,
|
|
4837
4825
|
onInsertedSemicolon,
|
|
4838
|
-
leadingDecorators: []
|
|
4826
|
+
leadingDecorators: [],
|
|
4839
4827
|
};
|
|
4840
4828
|
}
|
|
4841
4829
|
function parseSource(source, options, context) {
|
|
@@ -4900,7 +4888,7 @@ function parseSource(source, options, context) {
|
|
|
4900
4888
|
const node = {
|
|
4901
4889
|
type: 'Program',
|
|
4902
4890
|
sourceType,
|
|
4903
|
-
body
|
|
4891
|
+
body,
|
|
4904
4892
|
};
|
|
4905
4893
|
if (context & 2) {
|
|
4906
4894
|
node.start = 0;
|
|
@@ -4910,7 +4898,7 @@ function parseSource(source, options, context) {
|
|
|
4910
4898
|
if (context & 4) {
|
|
4911
4899
|
node.loc = {
|
|
4912
4900
|
start: { line: 1, column: 0 },
|
|
4913
|
-
end: { line: parser.line, column: parser.column }
|
|
4901
|
+
end: { line: parser.line, column: parser.column },
|
|
4914
4902
|
};
|
|
4915
4903
|
if (parser.sourceFile)
|
|
4916
4904
|
node.loc.source = sourceFile;
|
|
@@ -5078,7 +5066,7 @@ function parseExpressionOrLabelledStatement(parser, context, scope, privateScope
|
|
|
5078
5066
|
}
|
|
5079
5067
|
return parseExpressionStatement(parser, context, expr, start, line, column);
|
|
5080
5068
|
}
|
|
5081
|
-
function parseBlock(parser, context, scope, privateScope, labels, start, line, column) {
|
|
5069
|
+
function parseBlock(parser, context, scope, privateScope, labels, start, line, column, type = 'BlockStatement') {
|
|
5082
5070
|
const body = [];
|
|
5083
5071
|
consume(parser, context | 8192, 2162700);
|
|
5084
5072
|
while (parser.getToken() !== 1074790415) {
|
|
@@ -5086,8 +5074,8 @@ function parseBlock(parser, context, scope, privateScope, labels, start, line, c
|
|
|
5086
5074
|
}
|
|
5087
5075
|
consume(parser, context | 8192, 1074790415);
|
|
5088
5076
|
return finishNode(parser, context, start, line, column, {
|
|
5089
|
-
type
|
|
5090
|
-
body
|
|
5077
|
+
type,
|
|
5078
|
+
body,
|
|
5091
5079
|
});
|
|
5092
5080
|
}
|
|
5093
5081
|
function parseReturnStatement(parser, context, privateScope, start, line, column) {
|
|
@@ -5100,14 +5088,14 @@ function parseReturnStatement(parser, context, privateScope, start, line, column
|
|
|
5100
5088
|
matchOrInsertSemicolon(parser, context | 8192);
|
|
5101
5089
|
return finishNode(parser, context, start, line, column, {
|
|
5102
5090
|
type: 'ReturnStatement',
|
|
5103
|
-
argument
|
|
5091
|
+
argument,
|
|
5104
5092
|
});
|
|
5105
5093
|
}
|
|
5106
5094
|
function parseExpressionStatement(parser, context, expression, start, line, column) {
|
|
5107
5095
|
matchOrInsertSemicolon(parser, context | 8192);
|
|
5108
5096
|
return finishNode(parser, context, start, line, column, {
|
|
5109
5097
|
type: 'ExpressionStatement',
|
|
5110
|
-
expression
|
|
5098
|
+
expression,
|
|
5111
5099
|
});
|
|
5112
5100
|
}
|
|
5113
5101
|
function parseLabelledStatement(parser, context, scope, privateScope, origin, labels, value, expr, token, allowFuncDecl, start, line, column) {
|
|
@@ -5123,7 +5111,7 @@ function parseLabelledStatement(parser, context, scope, privateScope, origin, la
|
|
|
5123
5111
|
return finishNode(parser, context, start, line, column, {
|
|
5124
5112
|
type: 'LabeledStatement',
|
|
5125
5113
|
label: expr,
|
|
5126
|
-
body
|
|
5114
|
+
body,
|
|
5127
5115
|
});
|
|
5128
5116
|
}
|
|
5129
5117
|
function parseAsyncArrowOrAsyncFunctionDeclaration(parser, context, scope, privateScope, origin, labels, allowFuncDecl, start, line, column) {
|
|
@@ -5185,17 +5173,17 @@ function parseDirective(parser, context, expression, token, start, line, column)
|
|
|
5185
5173
|
? finishNode(parser, context, start, line, column, {
|
|
5186
5174
|
type: 'ExpressionStatement',
|
|
5187
5175
|
expression,
|
|
5188
|
-
directive: parser.source.slice(start + 1, endIndex - 1)
|
|
5176
|
+
directive: parser.source.slice(start + 1, endIndex - 1),
|
|
5189
5177
|
})
|
|
5190
5178
|
: finishNode(parser, context, start, line, column, {
|
|
5191
5179
|
type: 'ExpressionStatement',
|
|
5192
|
-
expression
|
|
5180
|
+
expression,
|
|
5193
5181
|
});
|
|
5194
5182
|
}
|
|
5195
5183
|
function parseEmptyStatement(parser, context, start, line, column) {
|
|
5196
5184
|
nextToken(parser, context | 8192);
|
|
5197
5185
|
return finishNode(parser, context, start, line, column, {
|
|
5198
|
-
type: 'EmptyStatement'
|
|
5186
|
+
type: 'EmptyStatement',
|
|
5199
5187
|
});
|
|
5200
5188
|
}
|
|
5201
5189
|
function parseThrowStatement(parser, context, privateScope, start, line, column) {
|
|
@@ -5206,7 +5194,7 @@ function parseThrowStatement(parser, context, privateScope, start, line, column)
|
|
|
5206
5194
|
matchOrInsertSemicolon(parser, context | 8192);
|
|
5207
5195
|
return finishNode(parser, context, start, line, column, {
|
|
5208
5196
|
type: 'ThrowStatement',
|
|
5209
|
-
argument
|
|
5197
|
+
argument,
|
|
5210
5198
|
});
|
|
5211
5199
|
}
|
|
5212
5200
|
function parseIfStatement(parser, context, scope, privateScope, labels, start, line, column) {
|
|
@@ -5225,7 +5213,7 @@ function parseIfStatement(parser, context, scope, privateScope, labels, start, l
|
|
|
5225
5213
|
type: 'IfStatement',
|
|
5226
5214
|
test,
|
|
5227
5215
|
consequent,
|
|
5228
|
-
alternate
|
|
5216
|
+
alternate,
|
|
5229
5217
|
});
|
|
5230
5218
|
}
|
|
5231
5219
|
function parseConsequentOrAlternative(parser, context, scope, privateScope, labels, start, line, column) {
|
|
@@ -5263,20 +5251,20 @@ function parseSwitchStatement(parser, context, scope, privateScope, labels, star
|
|
|
5263
5251
|
parser.getToken() !== 1074790415 &&
|
|
5264
5252
|
parser.getToken() !== 20561) {
|
|
5265
5253
|
consequent.push(parseStatementListItem(parser, context | 1024, scope, privateScope, 2, {
|
|
5266
|
-
$: labels
|
|
5254
|
+
$: labels,
|
|
5267
5255
|
}));
|
|
5268
5256
|
}
|
|
5269
5257
|
cases.push(finishNode(parser, context, tokenIndex, tokenLine, tokenColumn, {
|
|
5270
5258
|
type: 'SwitchCase',
|
|
5271
5259
|
test,
|
|
5272
|
-
consequent
|
|
5260
|
+
consequent,
|
|
5273
5261
|
}));
|
|
5274
5262
|
}
|
|
5275
5263
|
consume(parser, context | 8192, 1074790415);
|
|
5276
5264
|
return finishNode(parser, context, start, line, column, {
|
|
5277
5265
|
type: 'SwitchStatement',
|
|
5278
5266
|
discriminant,
|
|
5279
|
-
cases
|
|
5267
|
+
cases,
|
|
5280
5268
|
});
|
|
5281
5269
|
}
|
|
5282
5270
|
function parseWhileStatement(parser, context, scope, privateScope, labels, start, line, column) {
|
|
@@ -5288,7 +5276,7 @@ function parseWhileStatement(parser, context, scope, privateScope, labels, start
|
|
|
5288
5276
|
return finishNode(parser, context, start, line, column, {
|
|
5289
5277
|
type: 'WhileStatement',
|
|
5290
5278
|
test,
|
|
5291
|
-
body
|
|
5279
|
+
body,
|
|
5292
5280
|
});
|
|
5293
5281
|
}
|
|
5294
5282
|
function parseIterationStatementBody(parser, context, scope, privateScope, labels) {
|
|
@@ -5308,7 +5296,7 @@ function parseContinueStatement(parser, context, labels, start, line, column) {
|
|
|
5308
5296
|
matchOrInsertSemicolon(parser, context | 8192);
|
|
5309
5297
|
return finishNode(parser, context, start, line, column, {
|
|
5310
5298
|
type: 'ContinueStatement',
|
|
5311
|
-
label
|
|
5299
|
+
label,
|
|
5312
5300
|
});
|
|
5313
5301
|
}
|
|
5314
5302
|
function parseBreakStatement(parser, context, labels, start, line, column) {
|
|
@@ -5326,7 +5314,7 @@ function parseBreakStatement(parser, context, labels, start, line, column) {
|
|
|
5326
5314
|
matchOrInsertSemicolon(parser, context | 8192);
|
|
5327
5315
|
return finishNode(parser, context, start, line, column, {
|
|
5328
5316
|
type: 'BreakStatement',
|
|
5329
|
-
label
|
|
5317
|
+
label,
|
|
5330
5318
|
});
|
|
5331
5319
|
}
|
|
5332
5320
|
function parseWithStatement(parser, context, scope, privateScope, labels, start, line, column) {
|
|
@@ -5340,14 +5328,14 @@ function parseWithStatement(parser, context, scope, privateScope, labels, start,
|
|
|
5340
5328
|
return finishNode(parser, context, start, line, column, {
|
|
5341
5329
|
type: 'WithStatement',
|
|
5342
5330
|
object,
|
|
5343
|
-
body
|
|
5331
|
+
body,
|
|
5344
5332
|
});
|
|
5345
5333
|
}
|
|
5346
5334
|
function parseDebuggerStatement(parser, context, start, line, column) {
|
|
5347
5335
|
nextToken(parser, context | 8192);
|
|
5348
5336
|
matchOrInsertSemicolon(parser, context | 8192);
|
|
5349
5337
|
return finishNode(parser, context, start, line, column, {
|
|
5350
|
-
type: 'DebuggerStatement'
|
|
5338
|
+
type: 'DebuggerStatement',
|
|
5351
5339
|
});
|
|
5352
5340
|
}
|
|
5353
5341
|
function parseTryStatement(parser, context, scope, privateScope, labels, start, line, column) {
|
|
@@ -5362,7 +5350,8 @@ function parseTryStatement(parser, context, scope, privateScope, labels, start,
|
|
|
5362
5350
|
if (parser.getToken() === 20566) {
|
|
5363
5351
|
nextToken(parser, context | 8192);
|
|
5364
5352
|
const finalizerScope = firstScope ? addChildScope(scope, 4) : void 0;
|
|
5365
|
-
|
|
5353
|
+
const block = parseBlock(parser, context, finalizerScope, privateScope, { $: labels }, parser.tokenIndex, parser.tokenLine, parser.tokenColumn);
|
|
5354
|
+
finalizer = block;
|
|
5366
5355
|
}
|
|
5367
5356
|
if (!handler && !finalizer) {
|
|
5368
5357
|
report(parser, 88);
|
|
@@ -5371,7 +5360,7 @@ function parseTryStatement(parser, context, scope, privateScope, labels, start,
|
|
|
5371
5360
|
type: 'TryStatement',
|
|
5372
5361
|
block,
|
|
5373
5362
|
handler,
|
|
5374
|
-
finalizer
|
|
5363
|
+
finalizer,
|
|
5375
5364
|
});
|
|
5376
5365
|
}
|
|
5377
5366
|
function parseCatchBlock(parser, context, scope, privateScope, labels, start, line, column) {
|
|
@@ -5397,7 +5386,7 @@ function parseCatchBlock(parser, context, scope, privateScope, labels, start, li
|
|
|
5397
5386
|
return finishNode(parser, context, start, line, column, {
|
|
5398
5387
|
type: 'CatchClause',
|
|
5399
5388
|
param,
|
|
5400
|
-
body
|
|
5389
|
+
body,
|
|
5401
5390
|
});
|
|
5402
5391
|
}
|
|
5403
5392
|
function parseStaticBlock(parser, context, scope, privateScope, start, line, column) {
|
|
@@ -5410,11 +5399,7 @@ function parseStaticBlock(parser, context, scope, privateScope, start, line, col
|
|
|
5410
5399
|
524288 |
|
|
5411
5400
|
268435456 |
|
|
5412
5401
|
16777216;
|
|
5413
|
-
|
|
5414
|
-
return finishNode(parser, context, start, line, column, {
|
|
5415
|
-
type: 'StaticBlock',
|
|
5416
|
-
body
|
|
5417
|
-
});
|
|
5402
|
+
return parseBlock(parser, context, scope, privateScope, {}, start, line, column, 'StaticBlock');
|
|
5418
5403
|
}
|
|
5419
5404
|
function parseDoWhileStatement(parser, context, scope, privateScope, labels, start, line, column) {
|
|
5420
5405
|
nextToken(parser, context | 8192);
|
|
@@ -5427,7 +5412,7 @@ function parseDoWhileStatement(parser, context, scope, privateScope, labels, sta
|
|
|
5427
5412
|
return finishNode(parser, context, start, line, column, {
|
|
5428
5413
|
type: 'DoWhileStatement',
|
|
5429
5414
|
body,
|
|
5430
|
-
test
|
|
5415
|
+
test,
|
|
5431
5416
|
});
|
|
5432
5417
|
}
|
|
5433
5418
|
function parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateScope, origin, start, line, column) {
|
|
@@ -5440,7 +5425,7 @@ function parseLetIdentOrVarDeclarationStatement(parser, context, scope, privateS
|
|
|
5440
5425
|
return finishNode(parser, context, start, line, column, {
|
|
5441
5426
|
type: 'VariableDeclaration',
|
|
5442
5427
|
kind: 'let',
|
|
5443
|
-
declarations
|
|
5428
|
+
declarations,
|
|
5444
5429
|
});
|
|
5445
5430
|
}
|
|
5446
5431
|
parser.assignable = 1;
|
|
@@ -5472,7 +5457,7 @@ function parseLexicalDeclaration(parser, context, scope, privateScope, kind, ori
|
|
|
5472
5457
|
return finishNode(parser, context, start, line, column, {
|
|
5473
5458
|
type: 'VariableDeclaration',
|
|
5474
5459
|
kind: kind & 8 ? 'let' : 'const',
|
|
5475
|
-
declarations
|
|
5460
|
+
declarations,
|
|
5476
5461
|
});
|
|
5477
5462
|
}
|
|
5478
5463
|
function parseVariableStatement(parser, context, scope, privateScope, origin, start, line, column) {
|
|
@@ -5482,13 +5467,13 @@ function parseVariableStatement(parser, context, scope, privateScope, origin, st
|
|
|
5482
5467
|
return finishNode(parser, context, start, line, column, {
|
|
5483
5468
|
type: 'VariableDeclaration',
|
|
5484
5469
|
kind: 'var',
|
|
5485
|
-
declarations
|
|
5470
|
+
declarations,
|
|
5486
5471
|
});
|
|
5487
5472
|
}
|
|
5488
5473
|
function parseVariableDeclarationList(parser, context, scope, privateScope, kind, origin) {
|
|
5489
5474
|
let bindingCount = 1;
|
|
5490
5475
|
const list = [
|
|
5491
|
-
parseVariableDeclaration(parser, context, scope, privateScope, kind, origin)
|
|
5476
|
+
parseVariableDeclaration(parser, context, scope, privateScope, kind, origin),
|
|
5492
5477
|
];
|
|
5493
5478
|
while (consumeOpt(parser, context, 18)) {
|
|
5494
5479
|
bindingCount++;
|
|
@@ -5522,7 +5507,7 @@ function parseVariableDeclaration(parser, context, scope, privateScope, kind, or
|
|
|
5522
5507
|
return finishNode(parser, context, tokenIndex, tokenLine, tokenColumn, {
|
|
5523
5508
|
type: 'VariableDeclarator',
|
|
5524
5509
|
id,
|
|
5525
|
-
init
|
|
5510
|
+
init,
|
|
5526
5511
|
});
|
|
5527
5512
|
}
|
|
5528
5513
|
function parseForStatement(parser, context, scope, privateScope, labels, start, line, column) {
|
|
@@ -5554,7 +5539,7 @@ function parseForStatement(parser, context, scope, privateScope, labels, start,
|
|
|
5554
5539
|
init = finishNode(parser, context, tokenIndex, tokenLine, tokenColumn, {
|
|
5555
5540
|
type: 'VariableDeclaration',
|
|
5556
5541
|
kind: 'let',
|
|
5557
|
-
declarations: parseVariableDeclarationList(parser, context | 33554432, scope, privateScope, 8, 32)
|
|
5542
|
+
declarations: parseVariableDeclarationList(parser, context | 33554432, scope, privateScope, 8, 32),
|
|
5558
5543
|
});
|
|
5559
5544
|
}
|
|
5560
5545
|
parser.assignable = 1;
|
|
@@ -5576,12 +5561,12 @@ function parseForStatement(parser, context, scope, privateScope, labels, start,
|
|
|
5576
5561
|
? {
|
|
5577
5562
|
type: 'VariableDeclaration',
|
|
5578
5563
|
kind: 'var',
|
|
5579
|
-
declarations: parseVariableDeclarationList(parser, context | 33554432, scope, privateScope, 4, 32)
|
|
5564
|
+
declarations: parseVariableDeclarationList(parser, context | 33554432, scope, privateScope, 4, 32),
|
|
5580
5565
|
}
|
|
5581
5566
|
: {
|
|
5582
5567
|
type: 'VariableDeclaration',
|
|
5583
5568
|
kind: 'const',
|
|
5584
|
-
declarations: parseVariableDeclarationList(parser, context | 33554432, scope, privateScope, 16, 32)
|
|
5569
|
+
declarations: parseVariableDeclarationList(parser, context | 33554432, scope, privateScope, 16, 32),
|
|
5585
5570
|
});
|
|
5586
5571
|
parser.assignable = 1;
|
|
5587
5572
|
}
|
|
@@ -5620,7 +5605,7 @@ function parseForStatement(parser, context, scope, privateScope, labels, start,
|
|
|
5620
5605
|
left: init,
|
|
5621
5606
|
right,
|
|
5622
5607
|
body,
|
|
5623
|
-
await: forAwait
|
|
5608
|
+
await: forAwait,
|
|
5624
5609
|
});
|
|
5625
5610
|
}
|
|
5626
5611
|
if (parser.assignable & 2)
|
|
@@ -5636,7 +5621,7 @@ function parseForStatement(parser, context, scope, privateScope, labels, start,
|
|
|
5636
5621
|
type: 'ForInStatement',
|
|
5637
5622
|
body,
|
|
5638
5623
|
left: init,
|
|
5639
|
-
right
|
|
5624
|
+
right,
|
|
5640
5625
|
});
|
|
5641
5626
|
}
|
|
5642
5627
|
if (forAwait)
|
|
@@ -5662,7 +5647,7 @@ function parseForStatement(parser, context, scope, privateScope, labels, start,
|
|
|
5662
5647
|
init,
|
|
5663
5648
|
test,
|
|
5664
5649
|
update,
|
|
5665
|
-
body
|
|
5650
|
+
body,
|
|
5666
5651
|
});
|
|
5667
5652
|
}
|
|
5668
5653
|
function parseRestrictedIdentifier(parser, context, scope) {
|
|
@@ -5691,8 +5676,8 @@ function parseImportDeclaration(parser, context, scope) {
|
|
|
5691
5676
|
specifiers = [
|
|
5692
5677
|
finishNode(parser, context, tokenIndex, tokenLine, tokenColumn, {
|
|
5693
5678
|
type: 'ImportDefaultSpecifier',
|
|
5694
|
-
local
|
|
5695
|
-
})
|
|
5679
|
+
local,
|
|
5680
|
+
}),
|
|
5696
5681
|
];
|
|
5697
5682
|
if (consumeOpt(parser, context, 18)) {
|
|
5698
5683
|
switch (parser.getToken()) {
|
|
@@ -5725,14 +5710,13 @@ function parseImportDeclaration(parser, context, scope) {
|
|
|
5725
5710
|
}
|
|
5726
5711
|
source = parseModuleSpecifier(parser, context);
|
|
5727
5712
|
}
|
|
5713
|
+
const attributes = parseImportAttributes(parser, context, specifiers);
|
|
5728
5714
|
const node = {
|
|
5729
5715
|
type: 'ImportDeclaration',
|
|
5730
5716
|
specifiers,
|
|
5731
|
-
source
|
|
5717
|
+
source,
|
|
5718
|
+
attributes,
|
|
5732
5719
|
};
|
|
5733
|
-
if (context & 1) {
|
|
5734
|
-
node.attributes = parseImportAttributes(parser, context, specifiers);
|
|
5735
|
-
}
|
|
5736
5720
|
matchOrInsertSemicolon(parser, context | 8192);
|
|
5737
5721
|
return finishNode(parser, context, start, line, column, node);
|
|
5738
5722
|
}
|
|
@@ -5745,7 +5729,7 @@ function parseImportNamespaceSpecifier(parser, context, scope) {
|
|
|
5745
5729
|
}
|
|
5746
5730
|
return finishNode(parser, context, tokenIndex, tokenLine, tokenColumn, {
|
|
5747
5731
|
type: 'ImportNamespaceSpecifier',
|
|
5748
|
-
local: parseRestrictedIdentifier(parser, context, scope)
|
|
5732
|
+
local: parseRestrictedIdentifier(parser, context, scope),
|
|
5749
5733
|
});
|
|
5750
5734
|
}
|
|
5751
5735
|
function parseModuleSpecifier(parser, context) {
|
|
@@ -5784,7 +5768,7 @@ function parseImportSpecifierOrNamedImports(parser, context, scope, specifiers)
|
|
|
5784
5768
|
specifiers.push(finishNode(parser, context, tokenIndex, tokenLine, tokenColumn, {
|
|
5785
5769
|
type: 'ImportSpecifier',
|
|
5786
5770
|
local,
|
|
5787
|
-
imported
|
|
5771
|
+
imported,
|
|
5788
5772
|
}));
|
|
5789
5773
|
if (parser.getToken() !== 1074790415)
|
|
5790
5774
|
consume(parser, context, 18);
|
|
@@ -5795,7 +5779,7 @@ function parseImportSpecifierOrNamedImports(parser, context, scope, specifiers)
|
|
|
5795
5779
|
function parseImportMetaDeclaration(parser, context, start, line, column) {
|
|
5796
5780
|
let expr = parseImportMetaExpression(parser, context, finishNode(parser, context, start, line, column, {
|
|
5797
5781
|
type: 'Identifier',
|
|
5798
|
-
name: 'import'
|
|
5782
|
+
name: 'import',
|
|
5799
5783
|
}), start, line, column);
|
|
5800
5784
|
expr = parseMemberOrUpdateExpression(parser, context, undefined, expr, 0, 0, start, line, column);
|
|
5801
5785
|
expr = parseAssignmentExpression(parser, context, undefined, 0, 0, start, line, column, expr);
|
|
@@ -5820,7 +5804,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5820
5804
|
const specifiers = [];
|
|
5821
5805
|
let declaration = null;
|
|
5822
5806
|
let source = null;
|
|
5823
|
-
let attributes =
|
|
5807
|
+
let attributes = [];
|
|
5824
5808
|
if (consumeOpt(parser, context | 8192, 20561)) {
|
|
5825
5809
|
switch (parser.getToken()) {
|
|
5826
5810
|
case 86104: {
|
|
@@ -5863,7 +5847,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5863
5847
|
declareUnboundVariable(parser, 'default');
|
|
5864
5848
|
return finishNode(parser, context, start, line, column, {
|
|
5865
5849
|
type: 'ExportDefaultDeclaration',
|
|
5866
|
-
declaration
|
|
5850
|
+
declaration,
|
|
5867
5851
|
});
|
|
5868
5852
|
}
|
|
5869
5853
|
switch (parser.getToken()) {
|
|
@@ -5880,14 +5864,13 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5880
5864
|
if (parser.getToken() !== 134283267)
|
|
5881
5865
|
report(parser, 105, 'Export');
|
|
5882
5866
|
source = parseLiteral(parser, context);
|
|
5867
|
+
const attributes = parseImportAttributes(parser, context);
|
|
5883
5868
|
const node = {
|
|
5884
5869
|
type: 'ExportAllDeclaration',
|
|
5885
5870
|
source,
|
|
5886
|
-
exported
|
|
5871
|
+
exported,
|
|
5872
|
+
attributes,
|
|
5887
5873
|
};
|
|
5888
|
-
if (context & 1) {
|
|
5889
|
-
node.attributes = parseImportAttributes(parser, context);
|
|
5890
|
-
}
|
|
5891
5874
|
matchOrInsertSemicolon(parser, context | 8192);
|
|
5892
5875
|
return finishNode(parser, context, start, line, column, node);
|
|
5893
5876
|
}
|
|
@@ -5924,7 +5907,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5924
5907
|
specifiers.push(finishNode(parser, context, tokenIndex, tokenLine, tokenColumn, {
|
|
5925
5908
|
type: 'ExportSpecifier',
|
|
5926
5909
|
local,
|
|
5927
|
-
exported
|
|
5910
|
+
exported,
|
|
5928
5911
|
}));
|
|
5929
5912
|
if (parser.getToken() !== 1074790415)
|
|
5930
5913
|
consume(parser, context, 18);
|
|
@@ -5934,9 +5917,7 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5934
5917
|
if (parser.getToken() !== 134283267)
|
|
5935
5918
|
report(parser, 105, 'Export');
|
|
5936
5919
|
source = parseLiteral(parser, context);
|
|
5937
|
-
|
|
5938
|
-
attributes = parseImportAttributes(parser, context, specifiers);
|
|
5939
|
-
}
|
|
5920
|
+
attributes = parseImportAttributes(parser, context, specifiers);
|
|
5940
5921
|
if (scope) {
|
|
5941
5922
|
tmpExportedNames.forEach((n) => declareUnboundVariable(parser, n));
|
|
5942
5923
|
}
|
|
@@ -5983,11 +5964,9 @@ function parseExportDeclaration(parser, context, scope) {
|
|
|
5983
5964
|
type: 'ExportNamedDeclaration',
|
|
5984
5965
|
declaration,
|
|
5985
5966
|
specifiers,
|
|
5986
|
-
source
|
|
5967
|
+
source,
|
|
5968
|
+
attributes: attributes,
|
|
5987
5969
|
};
|
|
5988
|
-
if (attributes) {
|
|
5989
|
-
node.attributes = attributes;
|
|
5990
|
-
}
|
|
5991
5970
|
return finishNode(parser, context, start, line, column, node);
|
|
5992
5971
|
}
|
|
5993
5972
|
function parseExpression(parser, context, privateScope, canAssign, inGroup, start, line, column) {
|
|
@@ -6002,7 +5981,7 @@ function parseSequenceExpression(parser, context, privateScope, inGroup, start,
|
|
|
6002
5981
|
}
|
|
6003
5982
|
return finishNode(parser, context, start, line, column, {
|
|
6004
5983
|
type: 'SequenceExpression',
|
|
6005
|
-
expressions
|
|
5984
|
+
expressions,
|
|
6006
5985
|
});
|
|
6007
5986
|
}
|
|
6008
5987
|
function parseExpressions(parser, context, privateScope, inGroup, canAssign, start, line, column) {
|
|
@@ -6027,13 +6006,13 @@ function parseAssignmentExpression(parser, context, privateScope, inGroup, isPat
|
|
|
6027
6006
|
? {
|
|
6028
6007
|
type: 'AssignmentPattern',
|
|
6029
6008
|
left,
|
|
6030
|
-
right
|
|
6009
|
+
right,
|
|
6031
6010
|
}
|
|
6032
6011
|
: {
|
|
6033
6012
|
type: 'AssignmentExpression',
|
|
6034
6013
|
left,
|
|
6035
6014
|
operator: KeywordDescTable[token & 255],
|
|
6036
|
-
right
|
|
6015
|
+
right,
|
|
6037
6016
|
});
|
|
6038
6017
|
}
|
|
6039
6018
|
if ((token & 8388608) === 8388608) {
|
|
@@ -6052,13 +6031,13 @@ function parseAssignmentExpressionOrPattern(parser, context, privateScope, inGro
|
|
|
6052
6031
|
? {
|
|
6053
6032
|
type: 'AssignmentPattern',
|
|
6054
6033
|
left,
|
|
6055
|
-
right
|
|
6034
|
+
right,
|
|
6056
6035
|
}
|
|
6057
6036
|
: {
|
|
6058
6037
|
type: 'AssignmentExpression',
|
|
6059
6038
|
left,
|
|
6060
6039
|
operator: KeywordDescTable[token & 255],
|
|
6061
|
-
right
|
|
6040
|
+
right,
|
|
6062
6041
|
});
|
|
6063
6042
|
parser.assignable = 2;
|
|
6064
6043
|
return left;
|
|
@@ -6073,28 +6052,28 @@ function parseConditionalExpression(parser, context, privateScope, test, start,
|
|
|
6073
6052
|
type: 'ConditionalExpression',
|
|
6074
6053
|
test,
|
|
6075
6054
|
consequent,
|
|
6076
|
-
alternate
|
|
6055
|
+
alternate,
|
|
6077
6056
|
});
|
|
6078
6057
|
}
|
|
6079
|
-
function parseBinaryExpression(parser, context, privateScope, inGroup, start, line, column,
|
|
6058
|
+
function parseBinaryExpression(parser, context, privateScope, inGroup, start, line, column, minPrecedence, operator, left) {
|
|
6080
6059
|
const bit = -((context & 33554432) > 0) & 8673330;
|
|
6081
6060
|
let t;
|
|
6082
|
-
let
|
|
6061
|
+
let precedence;
|
|
6083
6062
|
parser.assignable = 2;
|
|
6084
6063
|
while (parser.getToken() & 8388608) {
|
|
6085
6064
|
t = parser.getToken();
|
|
6086
|
-
|
|
6065
|
+
precedence = t & 3840;
|
|
6087
6066
|
if ((t & 524288 && operator & 268435456) || (operator & 524288 && t & 268435456)) {
|
|
6088
6067
|
report(parser, 165);
|
|
6089
6068
|
}
|
|
6090
|
-
if (
|
|
6069
|
+
if (precedence + ((t === 8391735) << 8) - ((bit === t) << 12) <= minPrecedence)
|
|
6091
6070
|
break;
|
|
6092
6071
|
nextToken(parser, context | 8192);
|
|
6093
6072
|
left = finishNode(parser, context, start, line, column, {
|
|
6094
6073
|
type: t & 524288 || t & 268435456 ? 'LogicalExpression' : 'BinaryExpression',
|
|
6095
6074
|
left,
|
|
6096
|
-
right: parseBinaryExpression(parser, context, privateScope, inGroup, parser.tokenIndex, parser.tokenLine, parser.tokenColumn,
|
|
6097
|
-
operator: KeywordDescTable[t & 255]
|
|
6075
|
+
right: parseBinaryExpression(parser, context, privateScope, inGroup, parser.tokenIndex, parser.tokenLine, parser.tokenColumn, precedence, t, parseLeftHandSideExpression(parser, context, privateScope, 0, inGroup, 1, parser.tokenIndex, parser.tokenLine, parser.tokenColumn)),
|
|
6076
|
+
operator: KeywordDescTable[t & 255],
|
|
6098
6077
|
});
|
|
6099
6078
|
}
|
|
6100
6079
|
if (parser.getToken() === 1077936155)
|
|
@@ -6122,7 +6101,7 @@ function parseUnaryExpression(parser, context, privateScope, isLHS, start, line,
|
|
|
6122
6101
|
type: 'UnaryExpression',
|
|
6123
6102
|
operator: KeywordDescTable[unaryOperator & 255],
|
|
6124
6103
|
argument: arg,
|
|
6125
|
-
prefix: true
|
|
6104
|
+
prefix: true,
|
|
6126
6105
|
});
|
|
6127
6106
|
}
|
|
6128
6107
|
function parseAsyncExpression(parser, context, privateScope, inGroup, isLHS, canAssign, inNew, start, line, column) {
|
|
@@ -6183,7 +6162,7 @@ function parseYieldExpressionOrIdentifier(parser, context, privateScope, inGroup
|
|
|
6183
6162
|
return finishNode(parser, context, start, line, column, {
|
|
6184
6163
|
type: 'YieldExpression',
|
|
6185
6164
|
argument,
|
|
6186
|
-
delegate
|
|
6165
|
+
delegate,
|
|
6187
6166
|
});
|
|
6188
6167
|
}
|
|
6189
6168
|
if (context & 256)
|
|
@@ -6195,8 +6174,8 @@ function parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew,
|
|
|
6195
6174
|
parser.destructible |= 128;
|
|
6196
6175
|
if (context & 268435456)
|
|
6197
6176
|
report(parser, 177);
|
|
6198
|
-
const
|
|
6199
|
-
const isIdentifier =
|
|
6177
|
+
const possibleIdentifierOrArrowFunc = parseIdentifierOrArrow(parser, context, privateScope, start, line, column);
|
|
6178
|
+
const isIdentifier = possibleIdentifierOrArrowFunc.type === 'ArrowFunctionExpression' ||
|
|
6200
6179
|
(parser.getToken() & 65536) === 0;
|
|
6201
6180
|
if (isIdentifier) {
|
|
6202
6181
|
if (context & 524288)
|
|
@@ -6205,7 +6184,7 @@ function parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew,
|
|
|
6205
6184
|
reportMessageAt(start, line, column, parser.startIndex, parser.startLine, parser.startColumn, 110);
|
|
6206
6185
|
if (context & 2097152 && context & 524288)
|
|
6207
6186
|
reportMessageAt(start, line, column, parser.startIndex, parser.startLine, parser.startColumn, 110);
|
|
6208
|
-
return
|
|
6187
|
+
return possibleIdentifierOrArrowFunc;
|
|
6209
6188
|
}
|
|
6210
6189
|
if (context & 2097152) {
|
|
6211
6190
|
reportMessageAt(start, line, column, parser.startIndex, parser.startLine, parser.startColumn, 31);
|
|
@@ -6219,12 +6198,12 @@ function parseAwaitExpressionOrIdentifier(parser, context, privateScope, inNew,
|
|
|
6219
6198
|
parser.assignable = 2;
|
|
6220
6199
|
return finishNode(parser, context, start, line, column, {
|
|
6221
6200
|
type: 'AwaitExpression',
|
|
6222
|
-
argument
|
|
6201
|
+
argument,
|
|
6223
6202
|
});
|
|
6224
6203
|
}
|
|
6225
6204
|
if (context & 512)
|
|
6226
6205
|
reportMessageAt(start, line, column, parser.startIndex, parser.startLine, parser.startColumn, 98);
|
|
6227
|
-
return
|
|
6206
|
+
return possibleIdentifierOrArrowFunc;
|
|
6228
6207
|
}
|
|
6229
6208
|
function parseFunctionBody(parser, context, scope, privateScope, origin, funcNameToken, scopeError) {
|
|
6230
6209
|
const { tokenIndex, tokenLine, tokenColumn } = parser;
|
|
@@ -6279,7 +6258,7 @@ function parseFunctionBody(parser, context, scope, privateScope, origin, funcNam
|
|
|
6279
6258
|
report(parser, 26);
|
|
6280
6259
|
return finishNode(parser, context, tokenIndex, tokenLine, tokenColumn, {
|
|
6281
6260
|
type: 'BlockStatement',
|
|
6282
|
-
body
|
|
6261
|
+
body,
|
|
6283
6262
|
});
|
|
6284
6263
|
}
|
|
6285
6264
|
function parseSuperExpression(parser, context, start, line, column) {
|
|
@@ -6319,7 +6298,7 @@ function parseUpdateExpression(parser, context, expr, start, line, column) {
|
|
|
6319
6298
|
type: 'UpdateExpression',
|
|
6320
6299
|
argument: expr,
|
|
6321
6300
|
operator: KeywordDescTable[token & 255],
|
|
6322
|
-
prefix: false
|
|
6301
|
+
prefix: false,
|
|
6323
6302
|
});
|
|
6324
6303
|
}
|
|
6325
6304
|
function parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGroup, inChain, start, line, column) {
|
|
@@ -6340,7 +6319,7 @@ function parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGr
|
|
|
6340
6319
|
type: 'MemberExpression',
|
|
6341
6320
|
object: expr,
|
|
6342
6321
|
computed: false,
|
|
6343
|
-
property
|
|
6322
|
+
property,
|
|
6344
6323
|
});
|
|
6345
6324
|
break;
|
|
6346
6325
|
}
|
|
@@ -6359,7 +6338,7 @@ function parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGr
|
|
|
6359
6338
|
type: 'MemberExpression',
|
|
6360
6339
|
object: expr,
|
|
6361
6340
|
computed: true,
|
|
6362
|
-
property
|
|
6341
|
+
property,
|
|
6363
6342
|
});
|
|
6364
6343
|
if (restoreHasOptionalChaining) {
|
|
6365
6344
|
parser.flags |= 2048;
|
|
@@ -6381,7 +6360,7 @@ function parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGr
|
|
|
6381
6360
|
expr = finishNode(parser, context, start, line, column, {
|
|
6382
6361
|
type: 'CallExpression',
|
|
6383
6362
|
callee: expr,
|
|
6384
|
-
arguments: args
|
|
6363
|
+
arguments: args,
|
|
6385
6364
|
});
|
|
6386
6365
|
if (restoreHasOptionalChaining) {
|
|
6387
6366
|
parser.flags |= 2048;
|
|
@@ -6405,7 +6384,7 @@ function parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGr
|
|
|
6405
6384
|
tag: expr,
|
|
6406
6385
|
quasi: parser.getToken() === 67174408
|
|
6407
6386
|
? parseTemplate(parser, context | 16384, privateScope)
|
|
6408
|
-
: parseTemplateLiteral(parser, context, parser.tokenIndex, parser.tokenLine, parser.tokenColumn)
|
|
6387
|
+
: parseTemplateLiteral(parser, context, parser.tokenIndex, parser.tokenLine, parser.tokenColumn),
|
|
6409
6388
|
});
|
|
6410
6389
|
}
|
|
6411
6390
|
expr = parseMemberOrUpdateExpression(parser, context, privateScope, expr, 0, 1, start, line, column);
|
|
@@ -6414,7 +6393,7 @@ function parseMemberOrUpdateExpression(parser, context, privateScope, expr, inGr
|
|
|
6414
6393
|
parser.flags = (parser.flags | 2048) ^ 2048;
|
|
6415
6394
|
expr = finishNode(parser, context, start, line, column, {
|
|
6416
6395
|
type: 'ChainExpression',
|
|
6417
|
-
expression: expr
|
|
6396
|
+
expression: expr,
|
|
6418
6397
|
});
|
|
6419
6398
|
}
|
|
6420
6399
|
return expr;
|
|
@@ -6439,7 +6418,7 @@ function parseOptionalChain(parser, context, privateScope, expr, start, line, co
|
|
|
6439
6418
|
object: expr,
|
|
6440
6419
|
computed: true,
|
|
6441
6420
|
optional: true,
|
|
6442
|
-
property
|
|
6421
|
+
property,
|
|
6443
6422
|
});
|
|
6444
6423
|
}
|
|
6445
6424
|
else if (parser.getToken() === 67174411) {
|
|
@@ -6449,7 +6428,7 @@ function parseOptionalChain(parser, context, privateScope, expr, start, line, co
|
|
|
6449
6428
|
type: 'CallExpression',
|
|
6450
6429
|
callee: expr,
|
|
6451
6430
|
arguments: args,
|
|
6452
|
-
optional: true
|
|
6431
|
+
optional: true,
|
|
6453
6432
|
});
|
|
6454
6433
|
}
|
|
6455
6434
|
else {
|
|
@@ -6460,7 +6439,7 @@ function parseOptionalChain(parser, context, privateScope, expr, start, line, co
|
|
|
6460
6439
|
object: expr,
|
|
6461
6440
|
computed: false,
|
|
6462
6441
|
optional: true,
|
|
6463
|
-
property
|
|
6442
|
+
property,
|
|
6464
6443
|
});
|
|
6465
6444
|
}
|
|
6466
6445
|
if (restoreHasOptionalChaining) {
|
|
@@ -6495,7 +6474,7 @@ function parseUpdateExpressionPrefixed(parser, context, privateScope, inNew, isL
|
|
|
6495
6474
|
type: 'UpdateExpression',
|
|
6496
6475
|
argument: arg,
|
|
6497
6476
|
operator: KeywordDescTable[token & 255],
|
|
6498
|
-
prefix: true
|
|
6477
|
+
prefix: true,
|
|
6499
6478
|
});
|
|
6500
6479
|
}
|
|
6501
6480
|
function parsePrimaryExpression(parser, context, privateScope, kind, inNew, canAssign, inGroup, isLHS, start, line, column) {
|
|
@@ -6620,7 +6599,7 @@ function parseImportMetaExpression(parser, context, meta, start, line, column) {
|
|
|
6620
6599
|
return finishNode(parser, context, start, line, column, {
|
|
6621
6600
|
type: 'MetaProperty',
|
|
6622
6601
|
meta,
|
|
6623
|
-
property: parseIdentifier(parser, context)
|
|
6602
|
+
property: parseIdentifier(parser, context),
|
|
6624
6603
|
});
|
|
6625
6604
|
}
|
|
6626
6605
|
function parseImportExpression(parser, context, privateScope, inGroup, start, line, column) {
|
|
@@ -6628,22 +6607,20 @@ function parseImportExpression(parser, context, privateScope, inGroup, start, li
|
|
|
6628
6607
|
if (parser.getToken() === 14)
|
|
6629
6608
|
report(parser, 143);
|
|
6630
6609
|
const source = parseExpression(parser, context, privateScope, 1, inGroup, parser.tokenIndex, parser.tokenLine, parser.tokenColumn);
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
if (parser.getToken() === 18) {
|
|
6638
|
-
consume(parser, context, 18);
|
|
6639
|
-
if (parser.getToken() !== 16) {
|
|
6640
|
-
const expContext = (context | 33554432) ^ 33554432;
|
|
6641
|
-
options = parseExpression(parser, expContext, privateScope, 1, inGroup, parser.tokenIndex, parser.tokenLine, parser.tokenColumn);
|
|
6642
|
-
}
|
|
6610
|
+
let options = null;
|
|
6611
|
+
if (parser.getToken() === 18) {
|
|
6612
|
+
consume(parser, context, 18);
|
|
6613
|
+
if (parser.getToken() !== 16) {
|
|
6614
|
+
const expContext = (context | 33554432) ^ 33554432;
|
|
6615
|
+
options = parseExpression(parser, expContext, privateScope, 1, inGroup, parser.tokenIndex, parser.tokenLine, parser.tokenColumn);
|
|
6643
6616
|
}
|
|
6644
|
-
node.options = options;
|
|
6645
6617
|
consumeOpt(parser, context, 18);
|
|
6646
6618
|
}
|
|
6619
|
+
const node = {
|
|
6620
|
+
type: 'ImportExpression',
|
|
6621
|
+
source,
|
|
6622
|
+
options,
|
|
6623
|
+
};
|
|
6647
6624
|
consume(parser, context, 16);
|
|
6648
6625
|
return finishNode(parser, context, start, line, column, node);
|
|
6649
6626
|
}
|
|
@@ -6683,7 +6660,7 @@ function parseImportAttributes(parser, context, specifiers = null) {
|
|
|
6683
6660
|
attributes.push(finishNode(parser, context, start, line, column, {
|
|
6684
6661
|
type: 'ImportAttribute',
|
|
6685
6662
|
key,
|
|
6686
|
-
value
|
|
6663
|
+
value,
|
|
6687
6664
|
}));
|
|
6688
6665
|
if (parser.getToken() !== 1074790415) {
|
|
6689
6666
|
consume(parser, context, 18);
|
|
@@ -6738,30 +6715,27 @@ function parseBigIntLiteral(parser, context, start, line, column) {
|
|
|
6738
6715
|
const { tokenRaw, tokenValue } = parser;
|
|
6739
6716
|
nextToken(parser, context);
|
|
6740
6717
|
parser.assignable = 2;
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
value: tokenValue,
|
|
6751
|
-
bigint: tokenRaw.slice(0, -1)
|
|
6752
|
-
});
|
|
6718
|
+
const node = {
|
|
6719
|
+
type: 'Literal',
|
|
6720
|
+
value: tokenValue,
|
|
6721
|
+
bigint: String(tokenValue),
|
|
6722
|
+
};
|
|
6723
|
+
if (context & 128) {
|
|
6724
|
+
node.raw = tokenRaw;
|
|
6725
|
+
}
|
|
6726
|
+
return finishNode(parser, context, start, line, column, node);
|
|
6753
6727
|
}
|
|
6754
6728
|
function parseTemplateLiteral(parser, context, start, line, column) {
|
|
6755
6729
|
parser.assignable = 2;
|
|
6756
6730
|
const { tokenValue, tokenRaw, tokenIndex, tokenLine, tokenColumn } = parser;
|
|
6757
6731
|
consume(parser, context, 67174409);
|
|
6758
6732
|
const quasis = [
|
|
6759
|
-
parseTemplateElement(parser, context, tokenValue, tokenRaw, tokenIndex, tokenLine, tokenColumn, true)
|
|
6733
|
+
parseTemplateElement(parser, context, tokenValue, tokenRaw, tokenIndex, tokenLine, tokenColumn, true),
|
|
6760
6734
|
];
|
|
6761
6735
|
return finishNode(parser, context, start, line, column, {
|
|
6762
6736
|
type: 'TemplateLiteral',
|
|
6763
6737
|
expressions: [],
|
|
6764
|
-
quasis
|
|
6738
|
+
quasis,
|
|
6765
6739
|
});
|
|
6766
6740
|
}
|
|
6767
6741
|
function parseTemplate(parser, context, privateScope) {
|
|
@@ -6769,10 +6743,10 @@ function parseTemplate(parser, context, privateScope) {
|
|
|
6769
6743
|
const { tokenValue, tokenRaw, tokenIndex, tokenLine, tokenColumn } = parser;
|
|
6770
6744
|
consume(parser, (context & -16385) | 8192, 67174408);
|
|
6771
6745
|
const quasis = [
|
|
6772
|
-
parseTemplateElement(parser, context, tokenValue, tokenRaw, tokenIndex, tokenLine, tokenColumn, false)
|
|
6746
|
+
parseTemplateElement(parser, context, tokenValue, tokenRaw, tokenIndex, tokenLine, tokenColumn, false),
|
|
6773
6747
|
];
|
|
6774
6748
|
const expressions = [
|
|
6775
|
-
parseExpressions(parser, context & -16385, privateScope, 0, 1, parser.tokenIndex, parser.tokenLine, parser.tokenColumn)
|
|
6749
|
+
parseExpressions(parser, context & -16385, privateScope, 0, 1, parser.tokenIndex, parser.tokenLine, parser.tokenColumn),
|
|
6776
6750
|
];
|
|
6777
6751
|
if (parser.getToken() !== 1074790415)
|
|
6778
6752
|
report(parser, 83);
|
|
@@ -6792,7 +6766,7 @@ function parseTemplate(parser, context, privateScope) {
|
|
|
6792
6766
|
return finishNode(parser, context, tokenIndex, tokenLine, tokenColumn, {
|
|
6793
6767
|
type: 'TemplateLiteral',
|
|
6794
6768
|
expressions,
|
|
6795
|
-
quasis
|
|
6769
|
+
quasis,
|
|
6796
6770
|
});
|
|
6797
6771
|
}
|
|
6798
6772
|
function parseTemplateElement(parser, context, cooked, raw, start, line, col, tail) {
|
|
@@ -6800,9 +6774,9 @@ function parseTemplateElement(parser, context, cooked, raw, start, line, col, ta
|
|
|
6800
6774
|
type: 'TemplateElement',
|
|
6801
6775
|
value: {
|
|
6802
6776
|
cooked,
|
|
6803
|
-
raw
|
|
6777
|
+
raw,
|
|
6804
6778
|
},
|
|
6805
|
-
tail
|
|
6779
|
+
tail,
|
|
6806
6780
|
});
|
|
6807
6781
|
const tailSize = tail ? 1 : 2;
|
|
6808
6782
|
if (context & 2) {
|
|
@@ -6824,7 +6798,7 @@ function parseSpreadElement(parser, context, privateScope, start, line, column)
|
|
|
6824
6798
|
parser.assignable = 1;
|
|
6825
6799
|
return finishNode(parser, context, start, line, column, {
|
|
6826
6800
|
type: 'SpreadElement',
|
|
6827
|
-
argument
|
|
6801
|
+
argument,
|
|
6828
6802
|
});
|
|
6829
6803
|
}
|
|
6830
6804
|
function parseArguments(parser, context, privateScope, inGroup) {
|
|
@@ -6856,7 +6830,7 @@ function parseIdentifier(parser, context) {
|
|
|
6856
6830
|
nextToken(parser, context | (allowRegex ? 8192 : 0));
|
|
6857
6831
|
return finishNode(parser, context, tokenIndex, tokenLine, tokenColumn, {
|
|
6858
6832
|
type: 'Identifier',
|
|
6859
|
-
name: tokenValue
|
|
6833
|
+
name: tokenValue,
|
|
6860
6834
|
});
|
|
6861
6835
|
}
|
|
6862
6836
|
function parseLiteral(parser, context) {
|
|
@@ -6870,11 +6844,11 @@ function parseLiteral(parser, context) {
|
|
|
6870
6844
|
? {
|
|
6871
6845
|
type: 'Literal',
|
|
6872
6846
|
value: tokenValue,
|
|
6873
|
-
raw: tokenRaw
|
|
6847
|
+
raw: tokenRaw,
|
|
6874
6848
|
}
|
|
6875
6849
|
: {
|
|
6876
6850
|
type: 'Literal',
|
|
6877
|
-
value: tokenValue
|
|
6851
|
+
value: tokenValue,
|
|
6878
6852
|
});
|
|
6879
6853
|
}
|
|
6880
6854
|
function parseNullOrTrueOrFalseLiteral(parser, context, start, line, column) {
|
|
@@ -6886,11 +6860,11 @@ function parseNullOrTrueOrFalseLiteral(parser, context, start, line, column) {
|
|
|
6886
6860
|
? {
|
|
6887
6861
|
type: 'Literal',
|
|
6888
6862
|
value,
|
|
6889
|
-
raw
|
|
6863
|
+
raw,
|
|
6890
6864
|
}
|
|
6891
6865
|
: {
|
|
6892
6866
|
type: 'Literal',
|
|
6893
|
-
value
|
|
6867
|
+
value,
|
|
6894
6868
|
});
|
|
6895
6869
|
}
|
|
6896
6870
|
function parseThisExpression(parser, context) {
|
|
@@ -6898,7 +6872,7 @@ function parseThisExpression(parser, context) {
|
|
|
6898
6872
|
nextToken(parser, context);
|
|
6899
6873
|
parser.assignable = 2;
|
|
6900
6874
|
return finishNode(parser, context, tokenIndex, tokenLine, tokenColumn, {
|
|
6901
|
-
type: 'ThisExpression'
|
|
6875
|
+
type: 'ThisExpression',
|
|
6902
6876
|
});
|
|
6903
6877
|
}
|
|
6904
6878
|
function parseFunctionDeclaration(parser, context, scope, privateScope, origin, allowGen, flags, isAsync, start, line, column) {
|
|
@@ -6938,30 +6912,32 @@ function parseFunctionDeclaration(parser, context, scope, privateScope, origin,
|
|
|
6938
6912
|
report(parser, 30, KeywordDescTable[parser.getToken() & 255]);
|
|
6939
6913
|
}
|
|
6940
6914
|
}
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6915
|
+
{
|
|
6916
|
+
const modifierFlags = 65536 |
|
|
6917
|
+
131072 |
|
|
6918
|
+
262144 |
|
|
6919
|
+
524288 |
|
|
6920
|
+
2097152 |
|
|
6921
|
+
4194304;
|
|
6922
|
+
context =
|
|
6923
|
+
((context | modifierFlags) ^ modifierFlags) |
|
|
6924
|
+
16777216 |
|
|
6925
|
+
(isAsync ? 524288 : 0) |
|
|
6926
|
+
(isGenerator ? 262144 : 0) |
|
|
6927
|
+
(isGenerator ? 0 : 67108864);
|
|
6928
|
+
}
|
|
6953
6929
|
if (scope)
|
|
6954
6930
|
functionScope = addChildScope(functionScope, 512);
|
|
6955
6931
|
const params = parseFormalParametersOrFormalList(parser, (context | 2097152) & -268435457, functionScope, privateScope, 0, 1);
|
|
6956
|
-
const
|
|
6957
|
-
const body = parseFunctionBody(parser, ((context |
|
|
6932
|
+
const modifierFlags = 2048 | 1024 | 32768 | 268435456;
|
|
6933
|
+
const body = parseFunctionBody(parser, ((context | modifierFlags) ^ modifierFlags) | 8388608 | 1048576, scope ? addChildScope(functionScope, 128) : functionScope, privateScope, 8, funcNameToken, functionScope?.scopeError);
|
|
6958
6934
|
return finishNode(parser, context, start, line, column, {
|
|
6959
6935
|
type: 'FunctionDeclaration',
|
|
6960
6936
|
id,
|
|
6961
6937
|
params,
|
|
6962
6938
|
body,
|
|
6963
6939
|
async: isAsync === 1,
|
|
6964
|
-
generator: isGenerator === 1
|
|
6940
|
+
generator: isGenerator === 1,
|
|
6965
6941
|
});
|
|
6966
6942
|
}
|
|
6967
6943
|
function parseFunctionExpression(parser, context, privateScope, isAsync, inGroup, start, line, column) {
|
|
@@ -7003,7 +6979,7 @@ function parseFunctionExpression(parser, context, privateScope, isAsync, inGroup
|
|
|
7003
6979
|
params,
|
|
7004
6980
|
body,
|
|
7005
6981
|
async: isAsync === 1,
|
|
7006
|
-
generator: isGenerator === 1
|
|
6982
|
+
generator: isGenerator === 1,
|
|
7007
6983
|
});
|
|
7008
6984
|
}
|
|
7009
6985
|
function parseArrayLiteral(parser, context, privateScope, skipInitializer, inGroup, start, line, column) {
|
|
@@ -7042,13 +7018,13 @@ function parseArrayExpressionOrPattern(parser, context, scope, privateScope, ski
|
|
|
7042
7018
|
? {
|
|
7043
7019
|
type: 'AssignmentPattern',
|
|
7044
7020
|
left,
|
|
7045
|
-
right
|
|
7021
|
+
right,
|
|
7046
7022
|
}
|
|
7047
7023
|
: {
|
|
7048
7024
|
type: 'AssignmentExpression',
|
|
7049
7025
|
operator: '=',
|
|
7050
7026
|
left,
|
|
7051
|
-
right
|
|
7027
|
+
right,
|
|
7052
7028
|
});
|
|
7053
7029
|
destructible |=
|
|
7054
7030
|
parser.destructible & 256
|
|
@@ -7159,7 +7135,7 @@ function parseArrayExpressionOrPattern(parser, context, scope, privateScope, ski
|
|
|
7159
7135
|
consume(parser, context, 20);
|
|
7160
7136
|
const node = finishNode(parser, context, start, line, column, {
|
|
7161
7137
|
type: isPattern ? 'ArrayPattern' : 'ArrayExpression',
|
|
7162
|
-
elements
|
|
7138
|
+
elements,
|
|
7163
7139
|
});
|
|
7164
7140
|
if (!skipInitializer && parser.getToken() & 4194304) {
|
|
7165
7141
|
return parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, line, column, node);
|
|
@@ -7186,13 +7162,13 @@ function parseArrayOrObjectAssignmentPattern(parser, context, privateScope, dest
|
|
|
7186
7162
|
? {
|
|
7187
7163
|
type: 'AssignmentPattern',
|
|
7188
7164
|
left: node,
|
|
7189
|
-
right
|
|
7165
|
+
right,
|
|
7190
7166
|
}
|
|
7191
7167
|
: {
|
|
7192
7168
|
type: 'AssignmentExpression',
|
|
7193
7169
|
left: node,
|
|
7194
7170
|
operator: '=',
|
|
7195
|
-
right
|
|
7171
|
+
right,
|
|
7196
7172
|
});
|
|
7197
7173
|
}
|
|
7198
7174
|
function parseSpreadOrRestElement(parser, context, scope, privateScope, closingToken, kind, origin, isAsync, inGroup, isPattern, start, line, column) {
|
|
@@ -7289,7 +7265,7 @@ function parseSpreadOrRestElement(parser, context, scope, privateScope, closingT
|
|
|
7289
7265
|
report(parser, 161);
|
|
7290
7266
|
return finishNode(parser, context, start, line, column, {
|
|
7291
7267
|
type: isPattern ? 'RestElement' : 'SpreadElement',
|
|
7292
|
-
argument: argument
|
|
7268
|
+
argument: argument,
|
|
7293
7269
|
});
|
|
7294
7270
|
}
|
|
7295
7271
|
if (parser.getToken() !== closingToken) {
|
|
@@ -7304,13 +7280,13 @@ function parseSpreadOrRestElement(parser, context, scope, privateScope, closingT
|
|
|
7304
7280
|
? {
|
|
7305
7281
|
type: 'AssignmentPattern',
|
|
7306
7282
|
left: argument,
|
|
7307
|
-
right
|
|
7283
|
+
right,
|
|
7308
7284
|
}
|
|
7309
7285
|
: {
|
|
7310
7286
|
type: 'AssignmentExpression',
|
|
7311
7287
|
left: argument,
|
|
7312
7288
|
operator: '=',
|
|
7313
|
-
right
|
|
7289
|
+
right,
|
|
7314
7290
|
});
|
|
7315
7291
|
destructible = 16;
|
|
7316
7292
|
}
|
|
@@ -7321,7 +7297,7 @@ function parseSpreadOrRestElement(parser, context, scope, privateScope, closingT
|
|
|
7321
7297
|
parser.destructible = destructible;
|
|
7322
7298
|
return finishNode(parser, context, start, line, column, {
|
|
7323
7299
|
type: isPattern ? 'RestElement' : 'SpreadElement',
|
|
7324
|
-
argument: argument
|
|
7300
|
+
argument: argument,
|
|
7325
7301
|
});
|
|
7326
7302
|
}
|
|
7327
7303
|
function parseMethodDefinition(parser, context, privateScope, kind, inGroup, start, line, column) {
|
|
@@ -7350,7 +7326,7 @@ function parseMethodDefinition(parser, context, privateScope, kind, inGroup, sta
|
|
|
7350
7326
|
body,
|
|
7351
7327
|
async: (kind & 16) > 0,
|
|
7352
7328
|
generator: (kind & 8) > 0,
|
|
7353
|
-
id: null
|
|
7329
|
+
id: null,
|
|
7354
7330
|
});
|
|
7355
7331
|
}
|
|
7356
7332
|
function parseObjectLiteral(parser, context, privateScope, skipInitializer, inGroup, start, line, column) {
|
|
@@ -7409,7 +7385,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, privateScope, skipI
|
|
|
7409
7385
|
value = finishNode(parser, context, tokenIndex, tokenLine, tokenColumn, {
|
|
7410
7386
|
type: 'AssignmentPattern',
|
|
7411
7387
|
left: context & 134217728 ? Object.assign({}, key) : key,
|
|
7412
|
-
right
|
|
7388
|
+
right,
|
|
7413
7389
|
});
|
|
7414
7390
|
}
|
|
7415
7391
|
else {
|
|
@@ -7870,7 +7846,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, privateScope, skipI
|
|
|
7870
7846
|
kind: !(state & 768) ? 'init' : state & 512 ? 'set' : 'get',
|
|
7871
7847
|
computed: (state & 2) > 0,
|
|
7872
7848
|
method: (state & 1) > 0,
|
|
7873
|
-
shorthand: (state & 4) > 0
|
|
7849
|
+
shorthand: (state & 4) > 0,
|
|
7874
7850
|
}));
|
|
7875
7851
|
}
|
|
7876
7852
|
destructible |= parser.destructible;
|
|
@@ -7883,7 +7859,7 @@ function parseObjectLiteralOrPattern(parser, context, scope, privateScope, skipI
|
|
|
7883
7859
|
destructible |= 64;
|
|
7884
7860
|
const node = finishNode(parser, context, start, line, column, {
|
|
7885
7861
|
type: isPattern ? 'ObjectPattern' : 'ObjectExpression',
|
|
7886
|
-
properties
|
|
7862
|
+
properties,
|
|
7887
7863
|
});
|
|
7888
7864
|
if (!skipInitializer && parser.getToken() & 4194304) {
|
|
7889
7865
|
return parseArrayOrObjectAssignmentPattern(parser, context, privateScope, destructible, inGroup, isPattern, start, line, column, node);
|
|
@@ -7946,7 +7922,7 @@ function parseMethodFormals(parser, context, scope, privateScope, kind, type, in
|
|
|
7946
7922
|
left = finishNode(parser, context, tokenIndex, tokenLine, tokenColumn, {
|
|
7947
7923
|
type: 'AssignmentPattern',
|
|
7948
7924
|
left: left,
|
|
7949
|
-
right
|
|
7925
|
+
right,
|
|
7950
7926
|
});
|
|
7951
7927
|
}
|
|
7952
7928
|
setterArgs++;
|
|
@@ -8071,12 +8047,17 @@ function parseParenthesizedExpression(parser, context, privateScope, canAssign,
|
|
|
8071
8047
|
parser.assignable = 2;
|
|
8072
8048
|
expr = finishNode(parser, context, iStart, lStart, cStart, {
|
|
8073
8049
|
type: 'SequenceExpression',
|
|
8074
|
-
expressions
|
|
8050
|
+
expressions,
|
|
8075
8051
|
});
|
|
8076
8052
|
}
|
|
8077
8053
|
consume(parser, context, 16);
|
|
8078
8054
|
parser.destructible = destructible;
|
|
8079
|
-
return
|
|
8055
|
+
return context & 32
|
|
8056
|
+
? finishNode(parser, context, piStart, plStart, pcStart, {
|
|
8057
|
+
type: 'ParenthesizedExpression',
|
|
8058
|
+
expression: expr,
|
|
8059
|
+
})
|
|
8060
|
+
: expr;
|
|
8080
8061
|
}
|
|
8081
8062
|
if (isSequence && (parser.getToken() === 16 || parser.getToken() === 18)) {
|
|
8082
8063
|
expressions.push(expr);
|
|
@@ -8096,7 +8077,7 @@ function parseParenthesizedExpression(parser, context, privateScope, canAssign,
|
|
|
8096
8077
|
parser.assignable = 2;
|
|
8097
8078
|
expr = finishNode(parser, context, iStart, lStart, cStart, {
|
|
8098
8079
|
type: 'SequenceExpression',
|
|
8099
|
-
expressions
|
|
8080
|
+
expressions,
|
|
8100
8081
|
});
|
|
8101
8082
|
}
|
|
8102
8083
|
consume(parser, context, 16);
|
|
@@ -8132,7 +8113,7 @@ function parseParenthesizedExpression(parser, context, privateScope, canAssign,
|
|
|
8132
8113
|
return context & 32
|
|
8133
8114
|
? finishNode(parser, context, piStart, plStart, pcStart, {
|
|
8134
8115
|
type: 'ParenthesizedExpression',
|
|
8135
|
-
expression: expr
|
|
8116
|
+
expression: expr,
|
|
8136
8117
|
})
|
|
8137
8118
|
: expr;
|
|
8138
8119
|
}
|
|
@@ -8225,7 +8206,8 @@ function parseArrowFunctionExpression(parser, context, scope, privateScope, para
|
|
|
8225
8206
|
params,
|
|
8226
8207
|
body,
|
|
8227
8208
|
async: isAsync === 1,
|
|
8228
|
-
expression
|
|
8209
|
+
expression,
|
|
8210
|
+
generator: false,
|
|
8229
8211
|
});
|
|
8230
8212
|
}
|
|
8231
8213
|
function parseFormalParametersOrFormalList(parser, context, scope, privateScope, inGroup, kind) {
|
|
@@ -8276,7 +8258,7 @@ function parseFormalParametersOrFormalList(parser, context, scope, privateScope,
|
|
|
8276
8258
|
left = finishNode(parser, context, tokenIndex, tokenLine, tokenColumn, {
|
|
8277
8259
|
type: 'AssignmentPattern',
|
|
8278
8260
|
left,
|
|
8279
|
-
right
|
|
8261
|
+
right,
|
|
8280
8262
|
});
|
|
8281
8263
|
}
|
|
8282
8264
|
params.push(left);
|
|
@@ -8294,18 +8276,18 @@ function parseFormalParametersOrFormalList(parser, context, scope, privateScope,
|
|
|
8294
8276
|
consume(parser, context, 16);
|
|
8295
8277
|
return params;
|
|
8296
8278
|
}
|
|
8297
|
-
function
|
|
8279
|
+
function parseMemberExpressionNoCall(parser, context, privateScope, expr, inGroup, start, line, column) {
|
|
8298
8280
|
const token = parser.getToken();
|
|
8299
8281
|
if (token & 67108864) {
|
|
8300
8282
|
if (token === 67108877) {
|
|
8301
8283
|
nextToken(parser, context | 67108864);
|
|
8302
8284
|
parser.assignable = 1;
|
|
8303
8285
|
const property = parsePropertyOrPrivatePropertyName(parser, context, privateScope);
|
|
8304
|
-
return
|
|
8286
|
+
return parseMemberExpressionNoCall(parser, context, privateScope, finishNode(parser, context, start, line, column, {
|
|
8305
8287
|
type: 'MemberExpression',
|
|
8306
8288
|
object: expr,
|
|
8307
8289
|
computed: false,
|
|
8308
|
-
property
|
|
8290
|
+
property,
|
|
8309
8291
|
}), 0, start, line, column);
|
|
8310
8292
|
}
|
|
8311
8293
|
else if (token === 69271571) {
|
|
@@ -8314,21 +8296,21 @@ function parseMembeExpressionNoCall(parser, context, privateScope, expr, inGroup
|
|
|
8314
8296
|
const property = parseExpressions(parser, context, privateScope, inGroup, 1, tokenIndex, tokenLine, tokenColumn);
|
|
8315
8297
|
consume(parser, context, 20);
|
|
8316
8298
|
parser.assignable = 1;
|
|
8317
|
-
return
|
|
8299
|
+
return parseMemberExpressionNoCall(parser, context, privateScope, finishNode(parser, context, start, line, column, {
|
|
8318
8300
|
type: 'MemberExpression',
|
|
8319
8301
|
object: expr,
|
|
8320
8302
|
computed: true,
|
|
8321
|
-
property
|
|
8303
|
+
property,
|
|
8322
8304
|
}), 0, start, line, column);
|
|
8323
8305
|
}
|
|
8324
8306
|
else if (token === 67174408 || token === 67174409) {
|
|
8325
8307
|
parser.assignable = 2;
|
|
8326
|
-
return
|
|
8308
|
+
return parseMemberExpressionNoCall(parser, context, privateScope, finishNode(parser, context, start, line, column, {
|
|
8327
8309
|
type: 'TaggedTemplateExpression',
|
|
8328
8310
|
tag: expr,
|
|
8329
8311
|
quasi: parser.getToken() === 67174408
|
|
8330
8312
|
? parseTemplate(parser, context | 16384, privateScope)
|
|
8331
|
-
: parseTemplateLiteral(parser, context | 16384, parser.tokenIndex, parser.tokenLine, parser.tokenColumn)
|
|
8313
|
+
: parseTemplateLiteral(parser, context | 16384, parser.tokenIndex, parser.tokenLine, parser.tokenColumn),
|
|
8332
8314
|
}), 0, start, line, column);
|
|
8333
8315
|
}
|
|
8334
8316
|
}
|
|
@@ -8352,12 +8334,12 @@ function parseNewExpression(parser, context, privateScope, inGroup, start, line,
|
|
|
8352
8334
|
context = (context | 33554432) ^ 33554432;
|
|
8353
8335
|
if (parser.getToken() === 67108990)
|
|
8354
8336
|
report(parser, 168);
|
|
8355
|
-
const callee =
|
|
8337
|
+
const callee = parseMemberExpressionNoCall(parser, context, privateScope, expr, inGroup, tokenIndex, tokenLine, tokenColumn);
|
|
8356
8338
|
parser.assignable = 2;
|
|
8357
8339
|
return finishNode(parser, context, start, line, column, {
|
|
8358
8340
|
type: 'NewExpression',
|
|
8359
8341
|
callee,
|
|
8360
|
-
arguments: parser.getToken() === 67174411 ? parseArguments(parser, context, privateScope, inGroup) : []
|
|
8342
|
+
arguments: parser.getToken() === 67174411 ? parseArguments(parser, context, privateScope, inGroup) : [],
|
|
8361
8343
|
});
|
|
8362
8344
|
}
|
|
8363
8345
|
function parseMetaProperty(parser, context, meta, start, line, column) {
|
|
@@ -8365,7 +8347,7 @@ function parseMetaProperty(parser, context, meta, start, line, column) {
|
|
|
8365
8347
|
return finishNode(parser, context, start, line, column, {
|
|
8366
8348
|
type: 'MetaProperty',
|
|
8367
8349
|
meta,
|
|
8368
|
-
property
|
|
8350
|
+
property,
|
|
8369
8351
|
});
|
|
8370
8352
|
}
|
|
8371
8353
|
function parseAsyncArrowAfterIdent(parser, context, privateScope, canAssign, start, line, column) {
|
|
@@ -8393,7 +8375,7 @@ function parseAsyncArrowOrCallExpression(parser, context, privateScope, callee,
|
|
|
8393
8375
|
return finishNode(parser, context, start, line, column, {
|
|
8394
8376
|
type: 'CallExpression',
|
|
8395
8377
|
callee,
|
|
8396
|
-
arguments: []
|
|
8378
|
+
arguments: [],
|
|
8397
8379
|
});
|
|
8398
8380
|
}
|
|
8399
8381
|
let destructible = 0;
|
|
@@ -8475,7 +8457,7 @@ function parseAsyncArrowOrCallExpression(parser, context, privateScope, callee,
|
|
|
8475
8457
|
return finishNode(parser, context, start, line, column, {
|
|
8476
8458
|
type: 'CallExpression',
|
|
8477
8459
|
callee,
|
|
8478
|
-
arguments: params
|
|
8460
|
+
arguments: params,
|
|
8479
8461
|
});
|
|
8480
8462
|
}
|
|
8481
8463
|
params.push(expr);
|
|
@@ -8512,7 +8494,7 @@ function parseAsyncArrowOrCallExpression(parser, context, privateScope, callee,
|
|
|
8512
8494
|
return finishNode(parser, context, start, line, column, {
|
|
8513
8495
|
type: 'CallExpression',
|
|
8514
8496
|
callee,
|
|
8515
|
-
arguments: params
|
|
8497
|
+
arguments: params,
|
|
8516
8498
|
});
|
|
8517
8499
|
}
|
|
8518
8500
|
function parseRegExpLiteral(parser, context, start, line, column) {
|
|
@@ -8524,12 +8506,12 @@ function parseRegExpLiteral(parser, context, start, line, column) {
|
|
|
8524
8506
|
type: 'Literal',
|
|
8525
8507
|
value: tokenValue,
|
|
8526
8508
|
regex: tokenRegExp,
|
|
8527
|
-
raw: tokenRaw
|
|
8509
|
+
raw: tokenRaw,
|
|
8528
8510
|
})
|
|
8529
8511
|
: finishNode(parser, context, start, line, column, {
|
|
8530
8512
|
type: 'Literal',
|
|
8531
8513
|
value: tokenValue,
|
|
8532
|
-
regex: tokenRegExp
|
|
8514
|
+
regex: tokenRegExp,
|
|
8533
8515
|
});
|
|
8534
8516
|
}
|
|
8535
8517
|
function parseClassDeclaration(parser, context, scope, privateScope, flags, start, line, column) {
|
|
@@ -8584,7 +8566,7 @@ function parseClassDeclaration(parser, context, scope, privateScope, flags, star
|
|
|
8584
8566
|
id,
|
|
8585
8567
|
superClass,
|
|
8586
8568
|
body,
|
|
8587
|
-
...(context & 1 ? { decorators } : null)
|
|
8569
|
+
...(context & 1 ? { decorators } : null),
|
|
8588
8570
|
});
|
|
8589
8571
|
}
|
|
8590
8572
|
function parseClassExpression(parser, context, privateScope, inGroup, start, line, column) {
|
|
@@ -8621,7 +8603,7 @@ function parseClassExpression(parser, context, privateScope, inGroup, start, lin
|
|
|
8621
8603
|
id,
|
|
8622
8604
|
superClass,
|
|
8623
8605
|
body,
|
|
8624
|
-
...(context & 1 ? { decorators } : null)
|
|
8606
|
+
...(context & 1 ? { decorators } : null),
|
|
8625
8607
|
});
|
|
8626
8608
|
}
|
|
8627
8609
|
function parseDecorators(parser, context, privateScope) {
|
|
@@ -8639,7 +8621,7 @@ function parseDecoratorList(parser, context, privateScope, start, line, column)
|
|
|
8639
8621
|
expression = parseMemberOrUpdateExpression(parser, context, privateScope, expression, 0, 0, start, line, column);
|
|
8640
8622
|
return finishNode(parser, context, start, line, column, {
|
|
8641
8623
|
type: 'Decorator',
|
|
8642
|
-
expression
|
|
8624
|
+
expression,
|
|
8643
8625
|
});
|
|
8644
8626
|
}
|
|
8645
8627
|
function parseClassBody(parser, context, inheritedContext, scope, parentScope, kind, origin, inGroup) {
|
|
@@ -8674,7 +8656,7 @@ function parseClassBody(parser, context, inheritedContext, scope, parentScope, k
|
|
|
8674
8656
|
parser.flags = (parser.flags & -33) | hasConstr;
|
|
8675
8657
|
return finishNode(parser, context, tokenIndex, tokenLine, tokenColumn, {
|
|
8676
8658
|
type: 'ClassBody',
|
|
8677
|
-
body
|
|
8659
|
+
body,
|
|
8678
8660
|
});
|
|
8679
8661
|
}
|
|
8680
8662
|
function parseClassElementList(parser, context, scope, privateScope, inheritedContext, type, decorators, isStatic, inGroup, start, line, column) {
|
|
@@ -8747,7 +8729,7 @@ function parseClassElementList(parser, context, scope, privateScope, inheritedCo
|
|
|
8747
8729
|
kind |= 128;
|
|
8748
8730
|
}
|
|
8749
8731
|
else if (isStatic && token === 2162700) {
|
|
8750
|
-
return parseStaticBlock(parser, context | 4096, scope, privateScope,
|
|
8732
|
+
return parseStaticBlock(parser, context | 4096, scope, privateScope, start, line, column);
|
|
8751
8733
|
}
|
|
8752
8734
|
else if (token === -2147483527) {
|
|
8753
8735
|
key = parseIdentifier(parser, context);
|
|
@@ -8818,7 +8800,7 @@ function parseClassElementList(parser, context, scope, privateScope, inheritedCo
|
|
|
8818
8800
|
computed: (kind & 2) > 0,
|
|
8819
8801
|
key,
|
|
8820
8802
|
value,
|
|
8821
|
-
...(context & 1 ? { decorators } : null)
|
|
8803
|
+
...(context & 1 ? { decorators } : null),
|
|
8822
8804
|
});
|
|
8823
8805
|
}
|
|
8824
8806
|
function parsePrivateIdentifier(parser, context, privateScope, kind, start, line, column) {
|
|
@@ -8839,7 +8821,7 @@ function parsePrivateIdentifier(parser, context, privateScope, kind, start, line
|
|
|
8839
8821
|
nextToken(parser, context);
|
|
8840
8822
|
return finishNode(parser, context, start, line, column, {
|
|
8841
8823
|
type: 'PrivateIdentifier',
|
|
8842
|
-
name: tokenValue
|
|
8824
|
+
name: tokenValue,
|
|
8843
8825
|
});
|
|
8844
8826
|
}
|
|
8845
8827
|
function parsePropertyDefinition(parser, context, privateScope, key, state, decorators, start, line, column) {
|
|
@@ -8876,7 +8858,7 @@ function parsePropertyDefinition(parser, context, privateScope, key, state, deco
|
|
|
8876
8858
|
value,
|
|
8877
8859
|
static: (state & 32) > 0,
|
|
8878
8860
|
computed: (state & 2) > 0,
|
|
8879
|
-
...(context & 1 ? { decorators } : null)
|
|
8861
|
+
...(context & 1 ? { decorators } : null),
|
|
8880
8862
|
});
|
|
8881
8863
|
}
|
|
8882
8864
|
function parseBindingPattern(parser, context, scope, privateScope, type, origin, start, line, column) {
|
|
@@ -8929,7 +8911,7 @@ function parseAndClassifyIdentifier(parser, context, scope, kind, origin, start,
|
|
|
8929
8911
|
addVarOrBlock(parser, context, scope, tokenValue, kind, origin);
|
|
8930
8912
|
return finishNode(parser, context, start, line, column, {
|
|
8931
8913
|
type: 'Identifier',
|
|
8932
|
-
name: tokenValue
|
|
8914
|
+
name: tokenValue,
|
|
8933
8915
|
});
|
|
8934
8916
|
}
|
|
8935
8917
|
function parseJSXRootElementOrFragment(parser, context, privateScope, inJSXChild, start, line, column) {
|
|
@@ -8942,7 +8924,7 @@ function parseJSXRootElementOrFragment(parser, context, privateScope, inJSXChild
|
|
|
8942
8924
|
type: 'JSXFragment',
|
|
8943
8925
|
openingFragment,
|
|
8944
8926
|
children,
|
|
8945
|
-
closingFragment
|
|
8927
|
+
closingFragment,
|
|
8946
8928
|
});
|
|
8947
8929
|
}
|
|
8948
8930
|
if (parser.getToken() === 8457014)
|
|
@@ -8960,13 +8942,13 @@ function parseJSXRootElementOrFragment(parser, context, privateScope, inJSXChild
|
|
|
8960
8942
|
type: 'JSXElement',
|
|
8961
8943
|
children,
|
|
8962
8944
|
openingElement,
|
|
8963
|
-
closingElement
|
|
8945
|
+
closingElement,
|
|
8964
8946
|
});
|
|
8965
8947
|
}
|
|
8966
8948
|
function parseOpeningFragment(parser, context, start, line, column) {
|
|
8967
8949
|
nextJSXToken(parser, context);
|
|
8968
8950
|
return finishNode(parser, context, start, line, column, {
|
|
8969
|
-
type: 'JSXOpeningFragment'
|
|
8951
|
+
type: 'JSXOpeningFragment',
|
|
8970
8952
|
});
|
|
8971
8953
|
}
|
|
8972
8954
|
function parseJSXClosingElement(parser, context, inJSXChild, start, line, column) {
|
|
@@ -8983,7 +8965,7 @@ function parseJSXClosingElement(parser, context, inJSXChild, start, line, column
|
|
|
8983
8965
|
}
|
|
8984
8966
|
return finishNode(parser, context, start, line, column, {
|
|
8985
8967
|
type: 'JSXClosingElement',
|
|
8986
|
-
name
|
|
8968
|
+
name,
|
|
8987
8969
|
});
|
|
8988
8970
|
}
|
|
8989
8971
|
function parseJSXClosingFragment(parser, context, inJSXChild, start, line, column) {
|
|
@@ -8998,7 +8980,7 @@ function parseJSXClosingFragment(parser, context, inJSXChild, start, line, colum
|
|
|
8998
8980
|
nextToken(parser, context);
|
|
8999
8981
|
}
|
|
9000
8982
|
return finishNode(parser, context, start, line, column, {
|
|
9001
|
-
type: 'JSXClosingFragment'
|
|
8983
|
+
type: 'JSXClosingFragment',
|
|
9002
8984
|
});
|
|
9003
8985
|
}
|
|
9004
8986
|
function parseJSXChildrenAndClosingElement(parser, context, privateScope, inJSXChild) {
|
|
@@ -9051,7 +9033,7 @@ function parseJSXText(parser, context, start, line, column) {
|
|
|
9051
9033
|
nextToken(parser, context);
|
|
9052
9034
|
const node = {
|
|
9053
9035
|
type: 'JSXText',
|
|
9054
|
-
value: parser.tokenValue
|
|
9036
|
+
value: parser.tokenValue,
|
|
9055
9037
|
};
|
|
9056
9038
|
if (context & 128) {
|
|
9057
9039
|
node.raw = parser.tokenRaw;
|
|
@@ -9080,7 +9062,7 @@ function parseJSXOpeningElementOrSelfCloseElement(parser, context, privateScope,
|
|
|
9080
9062
|
type: 'JSXOpeningElement',
|
|
9081
9063
|
name: tagName,
|
|
9082
9064
|
attributes,
|
|
9083
|
-
selfClosing
|
|
9065
|
+
selfClosing,
|
|
9084
9066
|
});
|
|
9085
9067
|
}
|
|
9086
9068
|
function parseJSXElementName(parser, context, start, line, column) {
|
|
@@ -9099,7 +9081,7 @@ function parseJSXMemberExpression(parser, context, object, start, line, column)
|
|
|
9099
9081
|
return finishNode(parser, context, start, line, column, {
|
|
9100
9082
|
type: 'JSXMemberExpression',
|
|
9101
9083
|
object,
|
|
9102
|
-
property
|
|
9084
|
+
property,
|
|
9103
9085
|
});
|
|
9104
9086
|
}
|
|
9105
9087
|
function parseJSXAttributes(parser, context, privateScope) {
|
|
@@ -9118,7 +9100,7 @@ function parseJSXSpreadAttribute(parser, context, privateScope, start, line, col
|
|
|
9118
9100
|
consume(parser, context, 1074790415);
|
|
9119
9101
|
return finishNode(parser, context, start, line, column, {
|
|
9120
9102
|
type: 'JSXSpreadAttribute',
|
|
9121
|
-
argument: expression
|
|
9103
|
+
argument: expression,
|
|
9122
9104
|
});
|
|
9123
9105
|
}
|
|
9124
9106
|
function parseJsxAttribute(parser, context, privateScope, start, line, column) {
|
|
@@ -9150,7 +9132,7 @@ function parseJsxAttribute(parser, context, privateScope, start, line, column) {
|
|
|
9150
9132
|
return finishNode(parser, context, start, line, column, {
|
|
9151
9133
|
type: 'JSXAttribute',
|
|
9152
9134
|
value,
|
|
9153
|
-
name
|
|
9135
|
+
name,
|
|
9154
9136
|
});
|
|
9155
9137
|
}
|
|
9156
9138
|
function parseJSXNamespacedName(parser, context, namespace, start, line, column) {
|
|
@@ -9159,7 +9141,7 @@ function parseJSXNamespacedName(parser, context, namespace, start, line, column)
|
|
|
9159
9141
|
return finishNode(parser, context, start, line, column, {
|
|
9160
9142
|
type: 'JSXNamespacedName',
|
|
9161
9143
|
namespace,
|
|
9162
|
-
name
|
|
9144
|
+
name,
|
|
9163
9145
|
});
|
|
9164
9146
|
}
|
|
9165
9147
|
function parseJSXExpressionContainer(parser, context, privateScope, inJSXChild, isAttr, start, line, column) {
|
|
@@ -9187,7 +9169,7 @@ function parseJSXExpressionContainer(parser, context, privateScope, inJSXChild,
|
|
|
9187
9169
|
}
|
|
9188
9170
|
return finishNode(parser, context, start, line, column, {
|
|
9189
9171
|
type: 'JSXExpressionContainer',
|
|
9190
|
-
expression
|
|
9172
|
+
expression,
|
|
9191
9173
|
});
|
|
9192
9174
|
}
|
|
9193
9175
|
function parseJSXSpreadChild(parser, context, privateScope, start, line, column) {
|
|
@@ -9196,7 +9178,7 @@ function parseJSXSpreadChild(parser, context, privateScope, start, line, column)
|
|
|
9196
9178
|
consume(parser, context, 1074790415);
|
|
9197
9179
|
return finishNode(parser, context, start, line, column, {
|
|
9198
9180
|
type: 'JSXSpreadChild',
|
|
9199
|
-
expression
|
|
9181
|
+
expression,
|
|
9200
9182
|
});
|
|
9201
9183
|
}
|
|
9202
9184
|
function parseJSXEmptyExpression(parser, context, start, line, column) {
|
|
@@ -9204,7 +9186,7 @@ function parseJSXEmptyExpression(parser, context, start, line, column) {
|
|
|
9204
9186
|
parser.startLine = parser.tokenLine;
|
|
9205
9187
|
parser.startColumn = parser.tokenColumn;
|
|
9206
9188
|
return finishNode(parser, context, start, line, column, {
|
|
9207
|
-
type: 'JSXEmptyExpression'
|
|
9189
|
+
type: 'JSXEmptyExpression',
|
|
9208
9190
|
});
|
|
9209
9191
|
}
|
|
9210
9192
|
function parseJSXIdentifier(parser, context, start, line, column) {
|
|
@@ -9215,15 +9197,11 @@ function parseJSXIdentifier(parser, context, start, line, column) {
|
|
|
9215
9197
|
nextToken(parser, context);
|
|
9216
9198
|
return finishNode(parser, context, start, line, column, {
|
|
9217
9199
|
type: 'JSXIdentifier',
|
|
9218
|
-
name: tokenValue
|
|
9200
|
+
name: tokenValue,
|
|
9219
9201
|
});
|
|
9220
9202
|
}
|
|
9221
9203
|
|
|
9222
|
-
var
|
|
9223
|
-
__proto__: null
|
|
9224
|
-
});
|
|
9225
|
-
|
|
9226
|
-
var version$1 = "6.0.6";
|
|
9204
|
+
var version$1 = "6.1.0";
|
|
9227
9205
|
|
|
9228
9206
|
const version = version$1;
|
|
9229
9207
|
function parseScript(source, options) {
|
|
@@ -9236,4 +9214,4 @@ function parse(source, options) {
|
|
|
9236
9214
|
return parseSource(source, options, 0);
|
|
9237
9215
|
}
|
|
9238
9216
|
|
|
9239
|
-
export {
|
|
9217
|
+
export { parse, parseModule, parseScript, version };
|