gyosjs 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gyos.auto.esm.js +20 -2
- package/dist/gyos.auto.esm.js.map +1 -1
- package/dist/gyos.auto.js +20 -2
- package/dist/gyos.auto.js.map +1 -1
- package/dist/gyos.auto.min.js +2 -2
- package/dist/gyos.csp.auto.esm.js +116 -178
- package/dist/gyos.csp.auto.esm.js.map +1 -1
- package/dist/gyos.csp.auto.js +116 -178
- package/dist/gyos.csp.auto.js.map +1 -1
- package/dist/gyos.csp.auto.min.js +2 -2
- package/dist/gyos.csp.esm.js +116 -178
- package/dist/gyos.csp.esm.js.map +1 -1
- package/dist/gyos.csp.js +116 -178
- package/dist/gyos.csp.js.map +1 -1
- package/dist/gyos.csp.min.js +2 -2
- package/dist/gyos.esm.js +20 -2
- package/dist/gyos.esm.js.map +1 -1
- package/dist/gyos.js +20 -2
- package/dist/gyos.js.map +1 -1
- package/dist/gyos.min.js +2 -2
- package/dist/template/process.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/runtime/install-csp.d.ts +0 -2
- package/dist/runtime/install-csp.d.ts.map +0 -1
- package/dist/runtime/install-standard.d.ts +0 -2
- package/dist/runtime/install-standard.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* GyosJS v0.3.
|
|
2
|
+
* GyosJS v0.3.2
|
|
3
3
|
* (c) 2026
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
@@ -5183,6 +5183,10 @@ function processStructuralDirectives(elements, scope) {
|
|
|
5183
5183
|
const structuralElements = [];
|
|
5184
5184
|
const root = elements[0];
|
|
5185
5185
|
elements.forEach(el => {
|
|
5186
|
+
// Await branches are detached and parsed only after their alias scope exists.
|
|
5187
|
+
// Do not evaluate nested structural expressions during the parent scan.
|
|
5188
|
+
if (isAwaitBranchDescendant(el))
|
|
5189
|
+
return;
|
|
5186
5190
|
const hasIf = el.hasAttribute('*if');
|
|
5187
5191
|
const hasFor = el.hasAttribute('*for');
|
|
5188
5192
|
const hasSwitch = el.hasAttribute('*switch');
|
|
@@ -5227,6 +5231,20 @@ function processStructuralDirectives(elements, scope) {
|
|
|
5227
5231
|
}
|
|
5228
5232
|
});
|
|
5229
5233
|
}
|
|
5234
|
+
function isAwaitBranchDescendant(element) {
|
|
5235
|
+
let child = element;
|
|
5236
|
+
let parent = element.parentElement;
|
|
5237
|
+
while (parent && parent !== document.body) {
|
|
5238
|
+
if (parent.hasAttribute('*await') && (child.hasAttribute('*pending') ||
|
|
5239
|
+
child.hasAttribute('*then') ||
|
|
5240
|
+
child.hasAttribute('*catch'))) {
|
|
5241
|
+
return true;
|
|
5242
|
+
}
|
|
5243
|
+
child = parent;
|
|
5244
|
+
parent = parent.parentElement;
|
|
5245
|
+
}
|
|
5246
|
+
return false;
|
|
5247
|
+
}
|
|
5230
5248
|
const elementBelongsToAnotherScope = (el, scope) => {
|
|
5231
5249
|
const owner = getScopeFromElement(el);
|
|
5232
5250
|
return Boolean(owner && owner !== scope);
|
|
@@ -8537,20 +8555,20 @@ const Gyos = {
|
|
|
8537
8555
|
portalCreate,
|
|
8538
8556
|
portalDestroy,
|
|
8539
8557
|
setCspNonce,
|
|
8540
|
-
version: '0.3.
|
|
8558
|
+
version: '0.3.2'
|
|
8541
8559
|
};
|
|
8542
8560
|
|
|
8543
8561
|
// This file was generated. Do not modify manually!
|
|
8544
|
-
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1,
|
|
8562
|
+
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
8545
8563
|
|
|
8546
8564
|
// This file was generated. Do not modify manually!
|
|
8547
|
-
var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25,
|
|
8565
|
+
var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
|
|
8548
8566
|
|
|
8549
8567
|
// This file was generated. Do not modify manually!
|
|
8550
|
-
var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\
|
|
8568
|
+
var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65";
|
|
8551
8569
|
|
|
8552
8570
|
// This file was generated. Do not modify manually!
|
|
8553
|
-
var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\
|
|
8571
|
+
var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7cd\ua7d0\ua7d1\ua7d3\ua7d5-\ua7dc\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
|
|
8554
8572
|
|
|
8555
8573
|
// These are a run-length and offset encoded representation of the
|
|
8556
8574
|
// >0xffff code points that are a valid part of identifiers. The
|
|
@@ -8875,12 +8893,9 @@ var defaultOptions = {
|
|
|
8875
8893
|
// for new syntax features.
|
|
8876
8894
|
ecmaVersion: null,
|
|
8877
8895
|
// `sourceType` indicates the mode the code should be parsed in.
|
|
8878
|
-
// Can be either `"script"
|
|
8896
|
+
// Can be either `"script"` or `"module"`. This influences global
|
|
8879
8897
|
// strict mode and parsing of `import` and `export` declarations.
|
|
8880
8898
|
sourceType: "script",
|
|
8881
|
-
// When set to true, enable strict parsing mode even if `sourceType`
|
|
8882
|
-
// is `"script"`.
|
|
8883
|
-
strict: false,
|
|
8884
8899
|
// `onInsertedSemicolon` can be a callback that will be called when
|
|
8885
8900
|
// a semicolon is automatically inserted. It will be passed the
|
|
8886
8901
|
// position of the inserted semicolon as an offset, and if
|
|
@@ -8922,11 +8937,6 @@ var defaultOptions = {
|
|
|
8922
8937
|
// line being 1-based and column 0-based) will be attached to the
|
|
8923
8938
|
// nodes.
|
|
8924
8939
|
locations: false,
|
|
8925
|
-
// Pass an optional `{line, column}` object to use for the start of
|
|
8926
|
-
// the parse. This is mostly useful when using `parseExpressionAt`
|
|
8927
|
-
// with `locations: true`, to prevent the parser from having to
|
|
8928
|
-
// determine the line position at the start position.
|
|
8929
|
-
startLocation: null,
|
|
8930
8940
|
// A function can be passed as `onToken` option, which will
|
|
8931
8941
|
// cause Acorn to call that function with object in the same
|
|
8932
8942
|
// format as tokens returned from `tokenizer().getToken()`. Note
|
|
@@ -9007,9 +9017,6 @@ function getOptions(opts) {
|
|
|
9007
9017
|
if (isArray(options.onComment))
|
|
9008
9018
|
{ options.onComment = pushComment(options, options.onComment); }
|
|
9009
9019
|
|
|
9010
|
-
if (options.sourceType === "commonjs" && options.allowAwaitOutsideFunction)
|
|
9011
|
-
{ throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs") }
|
|
9012
|
-
|
|
9013
9020
|
return options
|
|
9014
9021
|
}
|
|
9015
9022
|
|
|
@@ -9041,7 +9048,6 @@ var
|
|
|
9041
9048
|
SCOPE_DIRECT_SUPER = 128,
|
|
9042
9049
|
SCOPE_CLASS_STATIC_BLOCK = 256,
|
|
9043
9050
|
SCOPE_CLASS_FIELD_INIT = 512,
|
|
9044
|
-
SCOPE_SWITCH = 1024,
|
|
9045
9051
|
SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
|
|
9046
9052
|
|
|
9047
9053
|
function functionFlags(async, generator) {
|
|
@@ -9080,17 +9086,13 @@ var Parser = function Parser(options, input, startPos) {
|
|
|
9080
9086
|
// Set up token state
|
|
9081
9087
|
|
|
9082
9088
|
// The current position of the tokenizer in the input.
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
if (options.startLocation) {
|
|
9086
|
-
this.lineStart = this.pos - options.startLocation.column;
|
|
9087
|
-
this.curLine = options.startLocation.line;
|
|
9088
|
-
} else if (startPos) {
|
|
9089
|
+
if (startPos) {
|
|
9090
|
+
this.pos = startPos;
|
|
9089
9091
|
this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
|
|
9090
|
-
|
|
9091
|
-
{ this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; }
|
|
9092
|
+
this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
|
|
9092
9093
|
} else {
|
|
9093
|
-
this.lineStart = 0;
|
|
9094
|
+
this.pos = this.lineStart = 0;
|
|
9095
|
+
this.curLine = 1;
|
|
9094
9096
|
}
|
|
9095
9097
|
|
|
9096
9098
|
// Properties of the current token:
|
|
@@ -9116,7 +9118,7 @@ var Parser = function Parser(options, input, startPos) {
|
|
|
9116
9118
|
|
|
9117
9119
|
// Figure out if it's a module code.
|
|
9118
9120
|
this.inModule = options.sourceType === "module";
|
|
9119
|
-
this.strict = this.inModule ||
|
|
9121
|
+
this.strict = this.inModule || this.strictDirective(this.pos);
|
|
9120
9122
|
|
|
9121
9123
|
// Used to signify the start of a potential arrow function
|
|
9122
9124
|
this.potentialArrowAt = -1;
|
|
@@ -9135,12 +9137,7 @@ var Parser = function Parser(options, input, startPos) {
|
|
|
9135
9137
|
|
|
9136
9138
|
// Scope tracking for duplicate variable names (see scope.js)
|
|
9137
9139
|
this.scopeStack = [];
|
|
9138
|
-
this.enterScope(
|
|
9139
|
-
this.options.sourceType === "commonjs"
|
|
9140
|
-
// In commonjs, the top-level scope behaves like a function scope
|
|
9141
|
-
? SCOPE_FUNCTION
|
|
9142
|
-
: SCOPE_TOP
|
|
9143
|
-
);
|
|
9140
|
+
this.enterScope(SCOPE_TOP);
|
|
9144
9141
|
|
|
9145
9142
|
// For RegExp validation
|
|
9146
9143
|
this.regexpState = null;
|
|
@@ -9151,14 +9148,12 @@ var Parser = function Parser(options, input, startPos) {
|
|
|
9151
9148
|
this.privateNameStack = [];
|
|
9152
9149
|
};
|
|
9153
9150
|
|
|
9154
|
-
var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },
|
|
9151
|
+
var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },inClassStaticBlock: { configurable: true } };
|
|
9155
9152
|
|
|
9156
9153
|
Parser.prototype.parse = function parse () {
|
|
9157
|
-
var this$1$1 = this;
|
|
9158
|
-
|
|
9159
9154
|
var node = this.options.program || this.startNode();
|
|
9160
9155
|
this.nextToken();
|
|
9161
|
-
return this.
|
|
9156
|
+
return this.parseTopLevel(node)
|
|
9162
9157
|
};
|
|
9163
9158
|
|
|
9164
9159
|
prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };
|
|
@@ -9177,12 +9172,6 @@ prototypeAccessors.canAwait.get = function () {
|
|
|
9177
9172
|
return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction
|
|
9178
9173
|
};
|
|
9179
9174
|
|
|
9180
|
-
prototypeAccessors.allowReturn.get = function () {
|
|
9181
|
-
if (this.inFunction) { return true }
|
|
9182
|
-
if (this.options.allowReturnOutsideFunction && this.currentVarScope().flags & SCOPE_TOP) { return true }
|
|
9183
|
-
return false
|
|
9184
|
-
};
|
|
9185
|
-
|
|
9186
9175
|
prototypeAccessors.allowSuper.get = function () {
|
|
9187
9176
|
var ref = this.currentThisScope();
|
|
9188
9177
|
var flags = ref.flags;
|
|
@@ -9203,14 +9192,6 @@ prototypeAccessors.allowNewDotTarget.get = function () {
|
|
|
9203
9192
|
return false
|
|
9204
9193
|
};
|
|
9205
9194
|
|
|
9206
|
-
prototypeAccessors.allowUsing.get = function () {
|
|
9207
|
-
var ref = this.currentScope();
|
|
9208
|
-
var flags = ref.flags;
|
|
9209
|
-
if (flags & SCOPE_SWITCH) { return false }
|
|
9210
|
-
if (!this.inModule && flags & SCOPE_TOP) { return false }
|
|
9211
|
-
return true
|
|
9212
|
-
};
|
|
9213
|
-
|
|
9214
9195
|
prototypeAccessors.inClassStaticBlock.get = function () {
|
|
9215
9196
|
return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0
|
|
9216
9197
|
};
|
|
@@ -9297,17 +9278,6 @@ pp$9.eatContextual = function(name) {
|
|
|
9297
9278
|
return true
|
|
9298
9279
|
};
|
|
9299
9280
|
|
|
9300
|
-
pp$9.catchStackOverflow = function(f) {
|
|
9301
|
-
try {
|
|
9302
|
-
return f()
|
|
9303
|
-
} catch (e) {
|
|
9304
|
-
if (e instanceof Error && (/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message) || /\btoo much recursion\b/i.test(e.message)))
|
|
9305
|
-
{ this.raise(this.start, "Not enough stack space to parse input"); }
|
|
9306
|
-
else
|
|
9307
|
-
{ throw e }
|
|
9308
|
-
}
|
|
9309
|
-
};
|
|
9310
|
-
|
|
9311
9281
|
// Asserts that following token is given contextual keyword.
|
|
9312
9282
|
|
|
9313
9283
|
pp$9.expectContextual = function(name) {
|
|
@@ -9411,10 +9381,10 @@ var pp$8 = Parser.prototype;
|
|
|
9411
9381
|
// to its body instead of creating a new node.
|
|
9412
9382
|
|
|
9413
9383
|
pp$8.parseTopLevel = function(node) {
|
|
9414
|
-
var exports
|
|
9384
|
+
var exports = Object.create(null);
|
|
9415
9385
|
if (!node.body) { node.body = []; }
|
|
9416
9386
|
while (this.type !== types$1.eof) {
|
|
9417
|
-
var stmt = this.parseStatement(null, true, exports
|
|
9387
|
+
var stmt = this.parseStatement(null, true, exports);
|
|
9418
9388
|
node.body.push(stmt);
|
|
9419
9389
|
}
|
|
9420
9390
|
if (this.inModule)
|
|
@@ -9426,7 +9396,7 @@ pp$8.parseTopLevel = function(node) {
|
|
|
9426
9396
|
} }
|
|
9427
9397
|
this.adaptDirectivePrologue(node.body);
|
|
9428
9398
|
this.next();
|
|
9429
|
-
node.sourceType = this.options.sourceType
|
|
9399
|
+
node.sourceType = this.options.sourceType;
|
|
9430
9400
|
return this.finishNode(node, "Program")
|
|
9431
9401
|
};
|
|
9432
9402
|
|
|
@@ -9436,7 +9406,7 @@ pp$8.isLet = function(context) {
|
|
|
9436
9406
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false }
|
|
9437
9407
|
skipWhiteSpace.lastIndex = this.pos;
|
|
9438
9408
|
var skip = skipWhiteSpace.exec(this.input);
|
|
9439
|
-
var next = this.pos + skip[0].length, nextCh = this.
|
|
9409
|
+
var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
|
|
9440
9410
|
// For ambiguous cases, determine if a LexicalDeclaration (or only a
|
|
9441
9411
|
// Statement) is allowed here. If context is not empty then only a Statement
|
|
9442
9412
|
// is allowed. However, `let [` is an explicit negative lookahead for
|
|
@@ -9444,13 +9414,12 @@ pp$8.isLet = function(context) {
|
|
|
9444
9414
|
if (nextCh === 91 || nextCh === 92) { return true } // '[', '\'
|
|
9445
9415
|
if (context) { return false }
|
|
9446
9416
|
|
|
9447
|
-
if (nextCh === 123) { return true } // '{'
|
|
9448
|
-
if (isIdentifierStart(nextCh)) {
|
|
9449
|
-
var
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
var ident = this.input.slice(start, next);
|
|
9417
|
+
if (nextCh === 123 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '{', astral
|
|
9418
|
+
if (isIdentifierStart(nextCh, true)) {
|
|
9419
|
+
var pos = next + 1;
|
|
9420
|
+
while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { ++pos; }
|
|
9421
|
+
if (nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true }
|
|
9422
|
+
var ident = this.input.slice(next, pos);
|
|
9454
9423
|
if (!keywordRelationalOperator.test(ident)) { return true }
|
|
9455
9424
|
}
|
|
9456
9425
|
return false
|
|
@@ -9469,7 +9438,7 @@ pp$8.isAsyncFunction = function() {
|
|
|
9469
9438
|
return !lineBreak.test(this.input.slice(this.pos, next)) &&
|
|
9470
9439
|
this.input.slice(next, next + 8) === "function" &&
|
|
9471
9440
|
(next + 8 === this.input.length ||
|
|
9472
|
-
!(isIdentifierChar(after = this.
|
|
9441
|
+
!(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00))
|
|
9473
9442
|
};
|
|
9474
9443
|
|
|
9475
9444
|
pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
|
|
@@ -9483,39 +9452,28 @@ pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
|
|
|
9483
9452
|
if (lineBreak.test(this.input.slice(this.pos, next))) { return false }
|
|
9484
9453
|
|
|
9485
9454
|
if (isAwaitUsing) {
|
|
9486
|
-
var
|
|
9487
|
-
if (this.input.slice(next,
|
|
9488
|
-
|
|
9489
|
-
isIdentifierChar(after = this.
|
|
9490
|
-
after
|
|
9455
|
+
var awaitEndPos = next + 5 /* await */, after;
|
|
9456
|
+
if (this.input.slice(next, awaitEndPos) !== "using" ||
|
|
9457
|
+
awaitEndPos === this.input.length ||
|
|
9458
|
+
isIdentifierChar(after = this.input.charCodeAt(awaitEndPos)) ||
|
|
9459
|
+
(after > 0xd7ff && after < 0xdc00)
|
|
9491
9460
|
) { return false }
|
|
9492
9461
|
|
|
9493
|
-
skipWhiteSpace.lastIndex =
|
|
9462
|
+
skipWhiteSpace.lastIndex = awaitEndPos;
|
|
9494
9463
|
var skipAfterUsing = skipWhiteSpace.exec(this.input);
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
while (isIdentifierChar(ch = this.fullCharCodeAt(next)))
|
|
9504
|
-
if (ch === 92) { return true }
|
|
9505
|
-
var id = this.input.slice(idStart, next);
|
|
9506
|
-
if (keywordRelationalOperator.test(id)) { return false }
|
|
9507
|
-
if (isFor && !isAwaitUsing && id === "of") {
|
|
9508
|
-
// Look ahead for using declaration with initializer, i.e., `for (using of = ...)`
|
|
9509
|
-
skipWhiteSpace.lastIndex = next;
|
|
9510
|
-
var skipAfterOf = skipWhiteSpace.exec(this.input);
|
|
9511
|
-
next = next + skipAfterOf[0].length;
|
|
9512
|
-
if (this.input.charCodeAt(next) !== 61 /* '=' */ ||
|
|
9513
|
-
// Check for ==, === and => operators
|
|
9514
|
-
(ch = this.input.charCodeAt(next + 1)) === 61 /* '=' */ || ch === 62 /* '>' */) {
|
|
9515
|
-
return false
|
|
9464
|
+
if (skipAfterUsing && lineBreak.test(this.input.slice(awaitEndPos, awaitEndPos + skipAfterUsing[0].length))) { return false }
|
|
9465
|
+
}
|
|
9466
|
+
|
|
9467
|
+
if (isFor) {
|
|
9468
|
+
var ofEndPos = next + 2 /* of */, after$1;
|
|
9469
|
+
if (this.input.slice(next, ofEndPos) === "of") {
|
|
9470
|
+
if (ofEndPos === this.input.length ||
|
|
9471
|
+
(!isIdentifierChar(after$1 = this.input.charCodeAt(ofEndPos)) && !(after$1 > 0xd7ff && after$1 < 0xdc00))) { return false }
|
|
9516
9472
|
}
|
|
9517
9473
|
}
|
|
9518
|
-
|
|
9474
|
+
|
|
9475
|
+
var ch = this.input.charCodeAt(next);
|
|
9476
|
+
return isIdentifierStart(ch, true) || ch === 92 // '\'
|
|
9519
9477
|
};
|
|
9520
9478
|
|
|
9521
9479
|
pp$8.isAwaitUsing = function(isFor) {
|
|
@@ -9533,7 +9491,7 @@ pp$8.isUsing = function(isFor) {
|
|
|
9533
9491
|
// `if (foo) /blah/.exec(foo)`, where looking at the previous token
|
|
9534
9492
|
// does not help.
|
|
9535
9493
|
|
|
9536
|
-
pp$8.parseStatement = function(context, topLevel, exports
|
|
9494
|
+
pp$8.parseStatement = function(context, topLevel, exports) {
|
|
9537
9495
|
var starttype = this.type, node = this.startNode(), kind;
|
|
9538
9496
|
|
|
9539
9497
|
if (this.isLet(context)) {
|
|
@@ -9588,7 +9546,7 @@ pp$8.parseStatement = function(context, topLevel, exports$1) {
|
|
|
9588
9546
|
if (!this.inModule)
|
|
9589
9547
|
{ this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); }
|
|
9590
9548
|
}
|
|
9591
|
-
return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports
|
|
9549
|
+
return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports)
|
|
9592
9550
|
|
|
9593
9551
|
// If the statement does not start with a statement keyword or a
|
|
9594
9552
|
// brace, it's an ExpressionStatement or LabeledStatement. We
|
|
@@ -9604,12 +9562,8 @@ pp$8.parseStatement = function(context, topLevel, exports$1) {
|
|
|
9604
9562
|
|
|
9605
9563
|
var usingKind = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
|
|
9606
9564
|
if (usingKind) {
|
|
9607
|
-
if (
|
|
9608
|
-
this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script`
|
|
9609
|
-
}
|
|
9610
|
-
if (context) {
|
|
9611
|
-
// Cases like `for (;;) using x = ...;`, `if (true) await using x = ...;`, etc. are not allowed.
|
|
9612
|
-
this.raise(this.start, "Using declaration is not allowed in single-statement positions");
|
|
9565
|
+
if (topLevel && this.options.sourceType === "script") {
|
|
9566
|
+
this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script`");
|
|
9613
9567
|
}
|
|
9614
9568
|
if (usingKind === "await using") {
|
|
9615
9569
|
if (!this.canAwait) {
|
|
@@ -9706,12 +9660,7 @@ pp$8.parseForStatement = function(node) {
|
|
|
9706
9660
|
if (usingKind) {
|
|
9707
9661
|
var init$2 = this.startNode();
|
|
9708
9662
|
this.next();
|
|
9709
|
-
if (usingKind === "await using") {
|
|
9710
|
-
if (!this.canAwait) {
|
|
9711
|
-
this.raise(this.start, "Await using cannot appear outside of async function");
|
|
9712
|
-
}
|
|
9713
|
-
this.next();
|
|
9714
|
-
}
|
|
9663
|
+
if (usingKind === "await using") { this.next(); }
|
|
9715
9664
|
this.parseVar(init$2, true, usingKind);
|
|
9716
9665
|
this.finishNode(init$2, "VariableDeclaration");
|
|
9717
9666
|
return this.parseForAfterInit(node, init$2, awaitAt)
|
|
@@ -9744,12 +9693,11 @@ pp$8.parseForStatement = function(node) {
|
|
|
9744
9693
|
// Helper method to parse for loop after variable initialization
|
|
9745
9694
|
pp$8.parseForAfterInit = function(node, init, awaitAt) {
|
|
9746
9695
|
if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init.declarations.length === 1) {
|
|
9747
|
-
if (this.
|
|
9748
|
-
if (
|
|
9749
|
-
|
|
9750
|
-
}
|
|
9751
|
-
|
|
9752
|
-
} else if (this.options.ecmaVersion >= 9) { node.await = awaitAt > -1; }
|
|
9696
|
+
if (this.options.ecmaVersion >= 9) {
|
|
9697
|
+
if (this.type === types$1._in) {
|
|
9698
|
+
if (awaitAt > -1) { this.unexpected(awaitAt); }
|
|
9699
|
+
} else { node.await = awaitAt > -1; }
|
|
9700
|
+
}
|
|
9753
9701
|
return this.parseForIn(node, init)
|
|
9754
9702
|
}
|
|
9755
9703
|
if (awaitAt > -1) { this.unexpected(awaitAt); }
|
|
@@ -9771,7 +9719,7 @@ pp$8.parseIfStatement = function(node) {
|
|
|
9771
9719
|
};
|
|
9772
9720
|
|
|
9773
9721
|
pp$8.parseReturnStatement = function(node) {
|
|
9774
|
-
if (!this.
|
|
9722
|
+
if (!this.inFunction && !this.options.allowReturnOutsideFunction)
|
|
9775
9723
|
{ this.raise(this.start, "'return' outside of function"); }
|
|
9776
9724
|
this.next();
|
|
9777
9725
|
|
|
@@ -9790,7 +9738,7 @@ pp$8.parseSwitchStatement = function(node) {
|
|
|
9790
9738
|
node.cases = [];
|
|
9791
9739
|
this.expect(types$1.braceL);
|
|
9792
9740
|
this.labels.push(switchLabel);
|
|
9793
|
-
this.enterScope(
|
|
9741
|
+
this.enterScope(0);
|
|
9794
9742
|
|
|
9795
9743
|
// Statements under must be grouped (by label) in SwitchCase
|
|
9796
9744
|
// nodes. `cur` is used to keep the node that we are currently
|
|
@@ -10354,11 +10302,11 @@ function checkKeyName(node, name) {
|
|
|
10354
10302
|
|
|
10355
10303
|
// Parses module export declaration.
|
|
10356
10304
|
|
|
10357
|
-
pp$8.parseExportAllDeclaration = function(node, exports
|
|
10305
|
+
pp$8.parseExportAllDeclaration = function(node, exports) {
|
|
10358
10306
|
if (this.options.ecmaVersion >= 11) {
|
|
10359
10307
|
if (this.eatContextual("as")) {
|
|
10360
10308
|
node.exported = this.parseModuleExportName();
|
|
10361
|
-
this.checkExport(exports
|
|
10309
|
+
this.checkExport(exports, node.exported, this.lastTokStart);
|
|
10362
10310
|
} else {
|
|
10363
10311
|
node.exported = null;
|
|
10364
10312
|
}
|
|
@@ -10372,14 +10320,14 @@ pp$8.parseExportAllDeclaration = function(node, exports$1) {
|
|
|
10372
10320
|
return this.finishNode(node, "ExportAllDeclaration")
|
|
10373
10321
|
};
|
|
10374
10322
|
|
|
10375
|
-
pp$8.parseExport = function(node, exports
|
|
10323
|
+
pp$8.parseExport = function(node, exports) {
|
|
10376
10324
|
this.next();
|
|
10377
10325
|
// export * from '...'
|
|
10378
10326
|
if (this.eat(types$1.star)) {
|
|
10379
|
-
return this.parseExportAllDeclaration(node, exports
|
|
10327
|
+
return this.parseExportAllDeclaration(node, exports)
|
|
10380
10328
|
}
|
|
10381
10329
|
if (this.eat(types$1._default)) { // export default ...
|
|
10382
|
-
this.checkExport(exports
|
|
10330
|
+
this.checkExport(exports, "default", this.lastTokStart);
|
|
10383
10331
|
node.declaration = this.parseExportDefaultDeclaration();
|
|
10384
10332
|
return this.finishNode(node, "ExportDefaultDeclaration")
|
|
10385
10333
|
}
|
|
@@ -10387,16 +10335,16 @@ pp$8.parseExport = function(node, exports$1) {
|
|
|
10387
10335
|
if (this.shouldParseExportStatement()) {
|
|
10388
10336
|
node.declaration = this.parseExportDeclaration(node);
|
|
10389
10337
|
if (node.declaration.type === "VariableDeclaration")
|
|
10390
|
-
{ this.checkVariableExport(exports
|
|
10338
|
+
{ this.checkVariableExport(exports, node.declaration.declarations); }
|
|
10391
10339
|
else
|
|
10392
|
-
{ this.checkExport(exports
|
|
10340
|
+
{ this.checkExport(exports, node.declaration.id, node.declaration.id.start); }
|
|
10393
10341
|
node.specifiers = [];
|
|
10394
10342
|
node.source = null;
|
|
10395
10343
|
if (this.options.ecmaVersion >= 16)
|
|
10396
10344
|
{ node.attributes = []; }
|
|
10397
10345
|
} else { // export { x, y as z } [from '...']
|
|
10398
10346
|
node.declaration = null;
|
|
10399
|
-
node.specifiers = this.parseExportSpecifiers(exports
|
|
10347
|
+
node.specifiers = this.parseExportSpecifiers(exports);
|
|
10400
10348
|
if (this.eatContextual("from")) {
|
|
10401
10349
|
if (this.type !== types$1.string) { this.unexpected(); }
|
|
10402
10350
|
node.source = this.parseExprAtom();
|
|
@@ -10446,47 +10394,47 @@ pp$8.parseExportDefaultDeclaration = function() {
|
|
|
10446
10394
|
}
|
|
10447
10395
|
};
|
|
10448
10396
|
|
|
10449
|
-
pp$8.checkExport = function(exports
|
|
10450
|
-
if (!exports
|
|
10397
|
+
pp$8.checkExport = function(exports, name, pos) {
|
|
10398
|
+
if (!exports) { return }
|
|
10451
10399
|
if (typeof name !== "string")
|
|
10452
10400
|
{ name = name.type === "Identifier" ? name.name : name.value; }
|
|
10453
|
-
if (hasOwn(exports
|
|
10401
|
+
if (hasOwn(exports, name))
|
|
10454
10402
|
{ this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
|
|
10455
|
-
exports
|
|
10403
|
+
exports[name] = true;
|
|
10456
10404
|
};
|
|
10457
10405
|
|
|
10458
|
-
pp$8.checkPatternExport = function(exports
|
|
10406
|
+
pp$8.checkPatternExport = function(exports, pat) {
|
|
10459
10407
|
var type = pat.type;
|
|
10460
10408
|
if (type === "Identifier")
|
|
10461
|
-
{ this.checkExport(exports
|
|
10409
|
+
{ this.checkExport(exports, pat, pat.start); }
|
|
10462
10410
|
else if (type === "ObjectPattern")
|
|
10463
10411
|
{ for (var i = 0, list = pat.properties; i < list.length; i += 1)
|
|
10464
10412
|
{
|
|
10465
10413
|
var prop = list[i];
|
|
10466
10414
|
|
|
10467
|
-
this.checkPatternExport(exports
|
|
10415
|
+
this.checkPatternExport(exports, prop);
|
|
10468
10416
|
} }
|
|
10469
10417
|
else if (type === "ArrayPattern")
|
|
10470
10418
|
{ for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
|
|
10471
10419
|
var elt = list$1[i$1];
|
|
10472
10420
|
|
|
10473
|
-
if (elt) { this.checkPatternExport(exports
|
|
10421
|
+
if (elt) { this.checkPatternExport(exports, elt); }
|
|
10474
10422
|
} }
|
|
10475
10423
|
else if (type === "Property")
|
|
10476
|
-
{ this.checkPatternExport(exports
|
|
10424
|
+
{ this.checkPatternExport(exports, pat.value); }
|
|
10477
10425
|
else if (type === "AssignmentPattern")
|
|
10478
|
-
{ this.checkPatternExport(exports
|
|
10426
|
+
{ this.checkPatternExport(exports, pat.left); }
|
|
10479
10427
|
else if (type === "RestElement")
|
|
10480
|
-
{ this.checkPatternExport(exports
|
|
10428
|
+
{ this.checkPatternExport(exports, pat.argument); }
|
|
10481
10429
|
};
|
|
10482
10430
|
|
|
10483
|
-
pp$8.checkVariableExport = function(exports
|
|
10484
|
-
if (!exports
|
|
10431
|
+
pp$8.checkVariableExport = function(exports, decls) {
|
|
10432
|
+
if (!exports) { return }
|
|
10485
10433
|
for (var i = 0, list = decls; i < list.length; i += 1)
|
|
10486
10434
|
{
|
|
10487
10435
|
var decl = list[i];
|
|
10488
10436
|
|
|
10489
|
-
this.checkPatternExport(exports
|
|
10437
|
+
this.checkPatternExport(exports, decl.id);
|
|
10490
10438
|
}
|
|
10491
10439
|
};
|
|
10492
10440
|
|
|
@@ -10501,13 +10449,13 @@ pp$8.shouldParseExportStatement = function() {
|
|
|
10501
10449
|
|
|
10502
10450
|
// Parses a comma-separated list of module exports.
|
|
10503
10451
|
|
|
10504
|
-
pp$8.parseExportSpecifier = function(exports
|
|
10452
|
+
pp$8.parseExportSpecifier = function(exports) {
|
|
10505
10453
|
var node = this.startNode();
|
|
10506
10454
|
node.local = this.parseModuleExportName();
|
|
10507
10455
|
|
|
10508
10456
|
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
10509
10457
|
this.checkExport(
|
|
10510
|
-
exports
|
|
10458
|
+
exports,
|
|
10511
10459
|
node.exported,
|
|
10512
10460
|
node.exported.start
|
|
10513
10461
|
);
|
|
@@ -10515,7 +10463,7 @@ pp$8.parseExportSpecifier = function(exports$1) {
|
|
|
10515
10463
|
return this.finishNode(node, "ExportSpecifier")
|
|
10516
10464
|
};
|
|
10517
10465
|
|
|
10518
|
-
pp$8.parseExportSpecifiers = function(exports
|
|
10466
|
+
pp$8.parseExportSpecifiers = function(exports) {
|
|
10519
10467
|
var nodes = [], first = true;
|
|
10520
10468
|
// export { x, y as z } [from '...']
|
|
10521
10469
|
this.expect(types$1.braceL);
|
|
@@ -10525,7 +10473,7 @@ pp$8.parseExportSpecifiers = function(exports$1) {
|
|
|
10525
10473
|
if (this.afterTrailingComma(types$1.braceR)) { break }
|
|
10526
10474
|
} else { first = false; }
|
|
10527
10475
|
|
|
10528
|
-
nodes.push(this.parseExportSpecifier(exports
|
|
10476
|
+
nodes.push(this.parseExportSpecifier(exports));
|
|
10529
10477
|
}
|
|
10530
10478
|
return nodes
|
|
10531
10479
|
};
|
|
@@ -11256,19 +11204,15 @@ pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {
|
|
|
11256
11204
|
// delayed syntax error at correct position).
|
|
11257
11205
|
|
|
11258
11206
|
pp$5.parseExpression = function(forInit, refDestructuringErrors) {
|
|
11259
|
-
var this
|
|
11260
|
-
|
|
11261
|
-
|
|
11262
|
-
var
|
|
11263
|
-
|
|
11264
|
-
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
return this$1$1.finishNode(node, "SequenceExpression")
|
|
11269
|
-
}
|
|
11270
|
-
return expr
|
|
11271
|
-
})
|
|
11207
|
+
var startPos = this.start, startLoc = this.startLoc;
|
|
11208
|
+
var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);
|
|
11209
|
+
if (this.type === types$1.comma) {
|
|
11210
|
+
var node = this.startNodeAt(startPos, startLoc);
|
|
11211
|
+
node.expressions = [expr];
|
|
11212
|
+
while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); }
|
|
11213
|
+
return this.finishNode(node, "SequenceExpression")
|
|
11214
|
+
}
|
|
11215
|
+
return expr
|
|
11272
11216
|
};
|
|
11273
11217
|
|
|
11274
11218
|
// Parse an assignment expression. This includes applications of
|
|
@@ -11333,7 +11277,7 @@ pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {
|
|
|
11333
11277
|
var startPos = this.start, startLoc = this.startLoc;
|
|
11334
11278
|
var expr = this.parseExprOps(forInit, refDestructuringErrors);
|
|
11335
11279
|
if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
|
|
11336
|
-
if (
|
|
11280
|
+
if (this.eat(types$1.question)) {
|
|
11337
11281
|
var node = this.startNodeAt(startPos, startLoc);
|
|
11338
11282
|
node.test = expr;
|
|
11339
11283
|
node.consequent = this.parseMaybeAssign();
|
|
@@ -11433,7 +11377,7 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
|
|
|
11433
11377
|
}
|
|
11434
11378
|
}
|
|
11435
11379
|
|
|
11436
|
-
if (!incDec &&
|
|
11380
|
+
if (!incDec && this.eat(types$1.starstar)) {
|
|
11437
11381
|
if (sawUnary)
|
|
11438
11382
|
{ this.unexpected(this.lastTokStart); }
|
|
11439
11383
|
else
|
|
@@ -11885,8 +11829,6 @@ pp$5.parseNew = function() {
|
|
|
11885
11829
|
}
|
|
11886
11830
|
var startPos = this.start, startLoc = this.startLoc;
|
|
11887
11831
|
node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
|
|
11888
|
-
if (node.callee.type === "Super")
|
|
11889
|
-
{ this.raiseRecoverable(startPos, "Invalid use of 'super'"); }
|
|
11890
11832
|
if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); }
|
|
11891
11833
|
else { node.arguments = empty; }
|
|
11892
11834
|
return this.finishNode(node, "NewExpression")
|
|
@@ -12504,7 +12446,7 @@ pp$2.copyNode = function(node) {
|
|
|
12504
12446
|
};
|
|
12505
12447
|
|
|
12506
12448
|
// This file was generated by "bin/generate-unicode-script-values.js". Do not modify manually!
|
|
12507
|
-
var scriptValuesAddedInUnicode = "
|
|
12449
|
+
var scriptValuesAddedInUnicode = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz";
|
|
12508
12450
|
|
|
12509
12451
|
// This file contains Unicode properties extracted from the ECMAScript specification.
|
|
12510
12452
|
// The lists are extracted like so:
|
|
@@ -14065,17 +14007,13 @@ pp.readToken = function(code) {
|
|
|
14065
14007
|
return this.getTokenFromCode(code)
|
|
14066
14008
|
};
|
|
14067
14009
|
|
|
14068
|
-
pp.
|
|
14069
|
-
var code = this.input.charCodeAt(pos);
|
|
14010
|
+
pp.fullCharCodeAtPos = function() {
|
|
14011
|
+
var code = this.input.charCodeAt(this.pos);
|
|
14070
14012
|
if (code <= 0xd7ff || code >= 0xdc00) { return code }
|
|
14071
|
-
var next = this.input.charCodeAt(pos + 1);
|
|
14013
|
+
var next = this.input.charCodeAt(this.pos + 1);
|
|
14072
14014
|
return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00
|
|
14073
14015
|
};
|
|
14074
14016
|
|
|
14075
|
-
pp.fullCharCodeAtPos = function() {
|
|
14076
|
-
return this.fullCharCodeAt(this.pos)
|
|
14077
|
-
};
|
|
14078
|
-
|
|
14079
14017
|
pp.skipBlockComment = function() {
|
|
14080
14018
|
var startLoc = this.options.onComment && this.curPosition();
|
|
14081
14019
|
var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
|
|
@@ -14803,7 +14741,7 @@ pp.readWord = function() {
|
|
|
14803
14741
|
// [ghbt]: https://github.com/acornjs/acorn/issues
|
|
14804
14742
|
|
|
14805
14743
|
|
|
14806
|
-
var version = "8.
|
|
14744
|
+
var version = "8.15.0";
|
|
14807
14745
|
|
|
14808
14746
|
Parser.acorn = {
|
|
14809
14747
|
Parser: Parser,
|