@vue/compiler-vapor 3.6.0-alpha.2 → 3.6.0-alpha.3
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/compiler-vapor.cjs.js +287 -67
- package/dist/compiler-vapor.d.ts +17 -1
- package/dist/compiler-vapor.esm-browser.js +667 -239
- package/package.json +4 -4
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-vapor v3.6.0-alpha.
|
|
2
|
+
* @vue/compiler-vapor v3.6.0-alpha.3
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
7
6
|
// @__NO_SIDE_EFFECTS__
|
|
8
7
|
function makeMap(str) {
|
|
9
8
|
const map = /* @__PURE__ */ Object.create(null);
|
|
@@ -29,10 +28,10 @@ const isBuiltInDirective = /* @__PURE__ */ makeMap(
|
|
|
29
28
|
);
|
|
30
29
|
const cacheStringFunction = (fn) => {
|
|
31
30
|
const cache = /* @__PURE__ */ Object.create(null);
|
|
32
|
-
return (str) => {
|
|
31
|
+
return ((str) => {
|
|
33
32
|
const hit = cache[str];
|
|
34
33
|
return hit || (cache[str] = fn(str));
|
|
35
|
-
};
|
|
34
|
+
});
|
|
36
35
|
};
|
|
37
36
|
const camelizeRE = /-(\w)/g;
|
|
38
37
|
const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
|
|
@@ -85,9 +84,52 @@ function shouldSetAsAttr(tagName, key) {
|
|
|
85
84
|
if ((key === "width" || key === "height") && (tagName === "IMG" || tagName === "VIDEO" || tagName === "CANVAS" || tagName === "SOURCE")) {
|
|
86
85
|
return true;
|
|
87
86
|
}
|
|
87
|
+
if (key === "sandbox" && tagName === "IFRAME") {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
88
90
|
return false;
|
|
89
91
|
}
|
|
90
92
|
|
|
93
|
+
const escapeRE = /["'&<>]/;
|
|
94
|
+
function escapeHtml(string) {
|
|
95
|
+
const str = "" + string;
|
|
96
|
+
const match = escapeRE.exec(str);
|
|
97
|
+
if (!match) {
|
|
98
|
+
return str;
|
|
99
|
+
}
|
|
100
|
+
let html = "";
|
|
101
|
+
let escaped;
|
|
102
|
+
let index;
|
|
103
|
+
let lastIndex = 0;
|
|
104
|
+
for (index = match.index; index < str.length; index++) {
|
|
105
|
+
switch (str.charCodeAt(index)) {
|
|
106
|
+
case 34:
|
|
107
|
+
escaped = """;
|
|
108
|
+
break;
|
|
109
|
+
case 38:
|
|
110
|
+
escaped = "&";
|
|
111
|
+
break;
|
|
112
|
+
case 39:
|
|
113
|
+
escaped = "'";
|
|
114
|
+
break;
|
|
115
|
+
case 60:
|
|
116
|
+
escaped = "<";
|
|
117
|
+
break;
|
|
118
|
+
case 62:
|
|
119
|
+
escaped = ">";
|
|
120
|
+
break;
|
|
121
|
+
default:
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (lastIndex !== index) {
|
|
125
|
+
html += str.slice(lastIndex, index);
|
|
126
|
+
}
|
|
127
|
+
lastIndex = index + 1;
|
|
128
|
+
html += escaped;
|
|
129
|
+
}
|
|
130
|
+
return lastIndex !== index ? html + str.slice(lastIndex, index) : html;
|
|
131
|
+
}
|
|
132
|
+
|
|
91
133
|
const TELEPORT = Symbol(`Teleport` );
|
|
92
134
|
const SUSPENSE = Symbol(`Suspense` );
|
|
93
135
|
const KEEP_ALIVE = Symbol(`KeepAlive` );
|
|
@@ -2061,7 +2103,7 @@ function requireLib$2 () {
|
|
|
2061
2103
|
allowUndeclaredExports: false,
|
|
2062
2104
|
allowYieldOutsideFunction: false,
|
|
2063
2105
|
plugins: [],
|
|
2064
|
-
strictMode:
|
|
2106
|
+
strictMode: undefined,
|
|
2065
2107
|
ranges: false,
|
|
2066
2108
|
tokens: false,
|
|
2067
2109
|
createImportExpressions: false,
|
|
@@ -2249,7 +2291,6 @@ function requireLib$2 () {
|
|
|
2249
2291
|
}
|
|
2250
2292
|
convertPrivateNameToPrivateIdentifier(node) {
|
|
2251
2293
|
const name = super.getPrivateNameSV(node);
|
|
2252
|
-
node = node;
|
|
2253
2294
|
delete node.id;
|
|
2254
2295
|
node.name = name;
|
|
2255
2296
|
return this.castNodeTo(node, "PrivateIdentifier");
|
|
@@ -2364,8 +2405,8 @@ function requireLib$2 () {
|
|
|
2364
2405
|
node.kind = "init";
|
|
2365
2406
|
return this.finishNode(node, "Property");
|
|
2366
2407
|
}
|
|
2367
|
-
isValidLVal(type, isUnparenthesizedInAssign, binding) {
|
|
2368
|
-
return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding);
|
|
2408
|
+
isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) {
|
|
2409
|
+
return type === "Property" ? "value" : super.isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding);
|
|
2369
2410
|
}
|
|
2370
2411
|
isAssignable(node, isBinding) {
|
|
2371
2412
|
if (node != null && this.isObjectProperty(node)) {
|
|
@@ -2399,11 +2440,14 @@ function requireLib$2 () {
|
|
|
2399
2440
|
finishCallExpression(unfinished, optional) {
|
|
2400
2441
|
const node = super.finishCallExpression(unfinished, optional);
|
|
2401
2442
|
if (node.callee.type === "Import") {
|
|
2402
|
-
var _ref
|
|
2443
|
+
var _ref;
|
|
2403
2444
|
this.castNodeTo(node, "ImportExpression");
|
|
2404
2445
|
node.source = node.arguments[0];
|
|
2405
2446
|
node.options = (_ref = node.arguments[1]) != null ? _ref : null;
|
|
2406
|
-
|
|
2447
|
+
{
|
|
2448
|
+
var _ref2;
|
|
2449
|
+
node.attributes = (_ref2 = node.arguments[1]) != null ? _ref2 : null;
|
|
2450
|
+
}
|
|
2407
2451
|
delete node.arguments;
|
|
2408
2452
|
delete node.callee;
|
|
2409
2453
|
} else if (node.type === "OptionalCallExpression") {
|
|
@@ -3079,13 +3123,13 @@ function requireLib$2 () {
|
|
|
3079
3123
|
context.push(types.j_expr, types.j_oTag);
|
|
3080
3124
|
};
|
|
3081
3125
|
}
|
|
3082
|
-
let 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-\
|
|
3083
|
-
let nonASCIIidentifierChars = "\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-\
|
|
3126
|
+
let 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-\u088f\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\u0c5c\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdc-\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-\ua7dc\ua7f1-\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";
|
|
3127
|
+
let nonASCIIidentifierChars = "\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-\u1add\u1ae0-\u1aeb\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";
|
|
3084
3128
|
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
3085
3129
|
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
3086
3130
|
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
3087
|
-
const 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,
|
|
3088
|
-
const 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,
|
|
3131
|
+
const 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, 7, 25, 39, 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, 5, 57, 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, 24, 43, 261, 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, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 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, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 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, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489];
|
|
3132
|
+
const 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, 78, 5, 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, 199, 7, 137, 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, 55, 9, 266, 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, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
3089
3133
|
function isInAstralSet(code, set) {
|
|
3090
3134
|
let pos = 0x10000;
|
|
3091
3135
|
for (let i = 0, length = set.length; i < length; i += 2) {
|
|
@@ -3269,7 +3313,7 @@ function requireLib$2 () {
|
|
|
3269
3313
|
if (bindingType & 8) {
|
|
3270
3314
|
return scope.names.has(name);
|
|
3271
3315
|
}
|
|
3272
|
-
const type = scope.names.get(name);
|
|
3316
|
+
const type = scope.names.get(name) || 0;
|
|
3273
3317
|
if (bindingType & 16) {
|
|
3274
3318
|
return (type & 2) > 0 || !this.treatFunctionsAsVarInScope(scope) && (type & 1) > 0;
|
|
3275
3319
|
}
|
|
@@ -3584,9 +3628,8 @@ function requireLib$2 () {
|
|
|
3584
3628
|
return this.flowParseDeclareInterface(node);
|
|
3585
3629
|
} else if (this.match(82)) {
|
|
3586
3630
|
return this.flowParseDeclareExportDeclaration(node, insideModule);
|
|
3587
|
-
} else {
|
|
3588
|
-
this.unexpected();
|
|
3589
3631
|
}
|
|
3632
|
+
throw this.unexpected();
|
|
3590
3633
|
}
|
|
3591
3634
|
flowParseDeclareVariable(node) {
|
|
3592
3635
|
this.next();
|
|
@@ -3606,18 +3649,17 @@ function requireLib$2 () {
|
|
|
3606
3649
|
const body = bodyNode.body = [];
|
|
3607
3650
|
this.expect(5);
|
|
3608
3651
|
while (!this.match(8)) {
|
|
3609
|
-
|
|
3652
|
+
const bodyNode = this.startNode();
|
|
3610
3653
|
if (this.match(83)) {
|
|
3611
3654
|
this.next();
|
|
3612
3655
|
if (!this.isContextual(130) && !this.match(87)) {
|
|
3613
3656
|
this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc);
|
|
3614
3657
|
}
|
|
3615
|
-
super.parseImport(bodyNode);
|
|
3658
|
+
body.push(super.parseImport(bodyNode));
|
|
3616
3659
|
} else {
|
|
3617
3660
|
this.expectContextual(125, FlowErrors.UnsupportedStatementInDeclareModule);
|
|
3618
|
-
|
|
3661
|
+
body.push(this.flowParseDeclare(bodyNode, true));
|
|
3619
3662
|
}
|
|
3620
|
-
body.push(bodyNode);
|
|
3621
3663
|
}
|
|
3622
3664
|
this.scope.exit();
|
|
3623
3665
|
this.expect(8);
|
|
@@ -3678,7 +3720,7 @@ function requireLib$2 () {
|
|
|
3678
3720
|
}
|
|
3679
3721
|
}
|
|
3680
3722
|
}
|
|
3681
|
-
this.unexpected();
|
|
3723
|
+
throw this.unexpected();
|
|
3682
3724
|
}
|
|
3683
3725
|
flowParseDeclareModuleExports(node) {
|
|
3684
3726
|
this.next();
|
|
@@ -3886,7 +3928,7 @@ function requireLib$2 () {
|
|
|
3886
3928
|
return this.finishNode(node, "TypeParameterInstantiation");
|
|
3887
3929
|
}
|
|
3888
3930
|
flowParseTypeParameterInstantiationCallOrNew() {
|
|
3889
|
-
if (this.reScan_lt() !== 47) return;
|
|
3931
|
+
if (this.reScan_lt() !== 47) return null;
|
|
3890
3932
|
const node = this.startNode();
|
|
3891
3933
|
const oldInType = this.state.inType;
|
|
3892
3934
|
node.params = [];
|
|
@@ -4382,8 +4424,7 @@ function requireLib$2 () {
|
|
|
4382
4424
|
}
|
|
4383
4425
|
throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc);
|
|
4384
4426
|
}
|
|
4385
|
-
this.unexpected();
|
|
4386
|
-
return;
|
|
4427
|
+
throw this.unexpected();
|
|
4387
4428
|
case 135:
|
|
4388
4429
|
return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
|
|
4389
4430
|
case 136:
|
|
@@ -4414,7 +4455,7 @@ function requireLib$2 () {
|
|
|
4414
4455
|
return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier());
|
|
4415
4456
|
}
|
|
4416
4457
|
}
|
|
4417
|
-
this.unexpected();
|
|
4458
|
+
throw this.unexpected();
|
|
4418
4459
|
}
|
|
4419
4460
|
flowParsePostfixType() {
|
|
4420
4461
|
const startLoc = this.state.startLoc;
|
|
@@ -4875,15 +4916,15 @@ function requireLib$2 () {
|
|
|
4875
4916
|
}
|
|
4876
4917
|
return exprList;
|
|
4877
4918
|
}
|
|
4878
|
-
parseArrayLike(close,
|
|
4879
|
-
const node = super.parseArrayLike(close,
|
|
4880
|
-
if (
|
|
4919
|
+
parseArrayLike(close, isTuple, refExpressionErrors) {
|
|
4920
|
+
const node = super.parseArrayLike(close, isTuple, refExpressionErrors);
|
|
4921
|
+
if (refExpressionErrors != null && !this.state.maybeInArrowParameters) {
|
|
4881
4922
|
this.toReferencedList(node.elements);
|
|
4882
4923
|
}
|
|
4883
4924
|
return node;
|
|
4884
4925
|
}
|
|
4885
|
-
isValidLVal(type, isParenthesized, binding) {
|
|
4886
|
-
return type === "TypeCastExpression" || super.isValidLVal(type, isParenthesized, binding);
|
|
4926
|
+
isValidLVal(type, disallowCallExpression, isParenthesized, binding) {
|
|
4927
|
+
return type === "TypeCastExpression" || super.isValidLVal(type, disallowCallExpression, isParenthesized, binding);
|
|
4887
4928
|
}
|
|
4888
4929
|
parseClassProperty(node) {
|
|
4889
4930
|
if (this.match(14)) {
|
|
@@ -6732,10 +6773,8 @@ function requireLib$2 () {
|
|
|
6732
6773
|
setLeadingComments(commentWS.trailingNode, comments);
|
|
6733
6774
|
}
|
|
6734
6775
|
} else {
|
|
6735
|
-
const
|
|
6736
|
-
|
|
6737
|
-
start: commentStart
|
|
6738
|
-
} = commentWS;
|
|
6776
|
+
const node = commentWS.containingNode;
|
|
6777
|
+
const commentStart = commentWS.start;
|
|
6739
6778
|
if (this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) === 44) {
|
|
6740
6779
|
switch (node.type) {
|
|
6741
6780
|
case "ObjectExpression":
|
|
@@ -7556,7 +7595,7 @@ function requireLib$2 () {
|
|
|
7556
7595
|
const commentWhitespace = {
|
|
7557
7596
|
start: this.sourceToOffsetPos(spaceStart),
|
|
7558
7597
|
end: this.sourceToOffsetPos(end),
|
|
7559
|
-
comments,
|
|
7598
|
+
comments: comments,
|
|
7560
7599
|
leadingNode: null,
|
|
7561
7600
|
trailingNode: null,
|
|
7562
7601
|
containingNode: null
|
|
@@ -8567,7 +8606,7 @@ function requireLib$2 () {
|
|
|
8567
8606
|
};
|
|
8568
8607
|
}
|
|
8569
8608
|
return {
|
|
8570
|
-
node,
|
|
8609
|
+
node: node,
|
|
8571
8610
|
error: null,
|
|
8572
8611
|
thrown: false,
|
|
8573
8612
|
aborted: false,
|
|
@@ -8823,7 +8862,7 @@ function requireLib$2 () {
|
|
|
8823
8862
|
if (isLHS) {
|
|
8824
8863
|
if (parenthesized.type === "Identifier") {
|
|
8825
8864
|
this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, node);
|
|
8826
|
-
} else if (parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) {
|
|
8865
|
+
} else if (parenthesized.type !== "CallExpression" && parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) {
|
|
8827
8866
|
this.raise(Errors.InvalidParenthesizedAssignment, node);
|
|
8828
8867
|
}
|
|
8829
8868
|
} else {
|
|
@@ -9099,7 +9138,7 @@ function requireLib$2 () {
|
|
|
9099
9138
|
node.right = this.parseMaybeAssignAllowIn();
|
|
9100
9139
|
return this.finishNode(node, "AssignmentPattern");
|
|
9101
9140
|
}
|
|
9102
|
-
isValidLVal(type, isUnparenthesizedInAssign, binding) {
|
|
9141
|
+
isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) {
|
|
9103
9142
|
switch (type) {
|
|
9104
9143
|
case "AssignmentPattern":
|
|
9105
9144
|
return "left";
|
|
@@ -9115,13 +9154,17 @@ function requireLib$2 () {
|
|
|
9115
9154
|
return "properties";
|
|
9116
9155
|
case "VoidPattern":
|
|
9117
9156
|
return true;
|
|
9157
|
+
case "CallExpression":
|
|
9158
|
+
if (!disallowCallExpression && !this.state.strict && this.optionFlags & 8192) {
|
|
9159
|
+
return true;
|
|
9160
|
+
}
|
|
9118
9161
|
}
|
|
9119
9162
|
return false;
|
|
9120
9163
|
}
|
|
9121
9164
|
isOptionalMemberExpression(expression) {
|
|
9122
9165
|
return expression.type === "OptionalMemberExpression";
|
|
9123
9166
|
}
|
|
9124
|
-
checkLVal(expression, ancestor, binding = 64, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false) {
|
|
9167
|
+
checkLVal(expression, ancestor, binding = 64, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false, disallowCallExpression = false) {
|
|
9125
9168
|
var _expression$extra;
|
|
9126
9169
|
const type = expression.type;
|
|
9127
9170
|
if (this.isObjectMethod(expression)) return;
|
|
@@ -9156,7 +9199,9 @@ function requireLib$2 () {
|
|
|
9156
9199
|
} else if (type === "VoidPattern" && ancestor.type === "CatchClause") {
|
|
9157
9200
|
this.raise(Errors.VoidPatternCatchClauseParam, expression);
|
|
9158
9201
|
}
|
|
9159
|
-
const
|
|
9202
|
+
const unwrappedExpression = unwrapParenthesizedExpression(expression);
|
|
9203
|
+
disallowCallExpression || (disallowCallExpression = unwrappedExpression.type === "CallExpression" && (unwrappedExpression.callee.type === "Import" || unwrappedExpression.callee.type === "Super"));
|
|
9204
|
+
const validity = this.isValidLVal(type, disallowCallExpression, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding);
|
|
9160
9205
|
if (validity === true) return;
|
|
9161
9206
|
if (validity === false) {
|
|
9162
9207
|
const ParseErrorClass = binding === 64 ? Errors.InvalidLhs : Errors.InvalidLhsBinding;
|
|
@@ -9179,11 +9224,11 @@ function requireLib$2 () {
|
|
|
9179
9224
|
if (Array.isArray(val)) {
|
|
9180
9225
|
for (const child of val) {
|
|
9181
9226
|
if (child) {
|
|
9182
|
-
this.checkLVal(child, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression);
|
|
9227
|
+
this.checkLVal(child, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression, true);
|
|
9183
9228
|
}
|
|
9184
9229
|
}
|
|
9185
9230
|
} else if (val) {
|
|
9186
|
-
this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression);
|
|
9231
|
+
this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression, disallowCallExpression);
|
|
9187
9232
|
}
|
|
9188
9233
|
}
|
|
9189
9234
|
checkIdentifier(at, bindingType, strictModeChanged = false) {
|
|
@@ -9231,6 +9276,7 @@ function requireLib$2 () {
|
|
|
9231
9276
|
return true;
|
|
9232
9277
|
}
|
|
9233
9278
|
}
|
|
9279
|
+
const keywordAndTSRelationalOperator = /in(?:stanceof)?|as|satisfies/y;
|
|
9234
9280
|
function nonNull(x) {
|
|
9235
9281
|
if (x == null) {
|
|
9236
9282
|
throw new Error(`Unexpected ${x} value.`);
|
|
@@ -9614,6 +9660,7 @@ function requireLib$2 () {
|
|
|
9614
9660
|
this.expect(14);
|
|
9615
9661
|
withProperty.value = this.tsParseImportTypeWithPropertyValue();
|
|
9616
9662
|
node.properties = [this.finishObjectProperty(withProperty)];
|
|
9663
|
+
this.eat(12);
|
|
9617
9664
|
this.expect(8);
|
|
9618
9665
|
return this.finishNode(node, "ObjectExpression");
|
|
9619
9666
|
}
|
|
@@ -10117,7 +10164,7 @@ function requireLib$2 () {
|
|
|
10117
10164
|
}
|
|
10118
10165
|
}
|
|
10119
10166
|
}
|
|
10120
|
-
this.unexpected();
|
|
10167
|
+
throw this.unexpected();
|
|
10121
10168
|
}
|
|
10122
10169
|
tsParseArrayTypeOrHigher() {
|
|
10123
10170
|
const {
|
|
@@ -10681,52 +10728,22 @@ function requireLib$2 () {
|
|
|
10681
10728
|
}
|
|
10682
10729
|
default:
|
|
10683
10730
|
if (tokenIsIdentifier(startType)) {
|
|
10684
|
-
return this.tsParseDeclaration(node, this.state.
|
|
10731
|
+
return this.tsParseDeclaration(node, this.state.type, true, null);
|
|
10685
10732
|
}
|
|
10686
10733
|
}
|
|
10687
10734
|
});
|
|
10688
10735
|
}
|
|
10689
10736
|
tsTryParseExportDeclaration() {
|
|
10690
|
-
return this.tsParseDeclaration(this.startNode(), this.state.
|
|
10691
|
-
}
|
|
10692
|
-
tsParseExpressionStatement(node, expr, decorators) {
|
|
10693
|
-
switch (expr.name) {
|
|
10694
|
-
case "declare":
|
|
10695
|
-
{
|
|
10696
|
-
const declaration = this.tsTryParseDeclare(node);
|
|
10697
|
-
if (declaration) {
|
|
10698
|
-
declaration.declare = true;
|
|
10699
|
-
}
|
|
10700
|
-
return declaration;
|
|
10701
|
-
}
|
|
10702
|
-
case "global":
|
|
10703
|
-
if (this.match(5)) {
|
|
10704
|
-
this.scope.enter(1024);
|
|
10705
|
-
this.prodParam.enter(0);
|
|
10706
|
-
const mod = node;
|
|
10707
|
-
mod.kind = "global";
|
|
10708
|
-
{
|
|
10709
|
-
node.global = true;
|
|
10710
|
-
}
|
|
10711
|
-
mod.id = expr;
|
|
10712
|
-
mod.body = this.tsParseModuleBlock();
|
|
10713
|
-
this.scope.exit();
|
|
10714
|
-
this.prodParam.exit();
|
|
10715
|
-
return this.finishNode(mod, "TSModuleDeclaration");
|
|
10716
|
-
}
|
|
10717
|
-
break;
|
|
10718
|
-
default:
|
|
10719
|
-
return this.tsParseDeclaration(node, expr.name, false, decorators);
|
|
10720
|
-
}
|
|
10737
|
+
return this.tsParseDeclaration(this.startNode(), this.state.type, true, null);
|
|
10721
10738
|
}
|
|
10722
|
-
tsParseDeclaration(node,
|
|
10723
|
-
switch (
|
|
10724
|
-
case
|
|
10739
|
+
tsParseDeclaration(node, type, next, decorators) {
|
|
10740
|
+
switch (type) {
|
|
10741
|
+
case 124:
|
|
10725
10742
|
if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) {
|
|
10726
10743
|
return this.tsParseAbstractDeclaration(node, decorators);
|
|
10727
10744
|
}
|
|
10728
10745
|
break;
|
|
10729
|
-
case
|
|
10746
|
+
case 127:
|
|
10730
10747
|
if (this.tsCheckLineTerminator(next)) {
|
|
10731
10748
|
if (this.match(134)) {
|
|
10732
10749
|
return this.tsParseAmbientExternalModuleDeclaration(node);
|
|
@@ -10736,13 +10753,13 @@ function requireLib$2 () {
|
|
|
10736
10753
|
}
|
|
10737
10754
|
}
|
|
10738
10755
|
break;
|
|
10739
|
-
case
|
|
10756
|
+
case 128:
|
|
10740
10757
|
if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
|
|
10741
10758
|
node.kind = "namespace";
|
|
10742
10759
|
return this.tsParseModuleOrNamespaceDeclaration(node);
|
|
10743
10760
|
}
|
|
10744
10761
|
break;
|
|
10745
|
-
case
|
|
10762
|
+
case 130:
|
|
10746
10763
|
if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
|
|
10747
10764
|
return this.tsParseTypeAliasDeclaration(node);
|
|
10748
10765
|
}
|
|
@@ -10883,8 +10900,8 @@ function requireLib$2 () {
|
|
|
10883
10900
|
this.tsCheckForInvalidTypeCasts(exprList);
|
|
10884
10901
|
return exprList;
|
|
10885
10902
|
}
|
|
10886
|
-
parseArrayLike(close,
|
|
10887
|
-
const node = super.parseArrayLike(close,
|
|
10903
|
+
parseArrayLike(close, isTuple, refExpressionErrors) {
|
|
10904
|
+
const node = super.parseArrayLike(close, isTuple, refExpressionErrors);
|
|
10888
10905
|
if (node.type === "ArrayExpression") {
|
|
10889
10906
|
this.tsCheckForInvalidTypeCasts(node.elements);
|
|
10890
10907
|
}
|
|
@@ -10913,6 +10930,7 @@ function requireLib$2 () {
|
|
|
10913
10930
|
if (!noCalls && this.atPossibleAsyncArrow(base)) {
|
|
10914
10931
|
const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startLoc);
|
|
10915
10932
|
if (asyncArrowFn) {
|
|
10933
|
+
state.stop = true;
|
|
10916
10934
|
return asyncArrowFn;
|
|
10917
10935
|
}
|
|
10918
10936
|
}
|
|
@@ -11128,19 +11146,85 @@ function requireLib$2 () {
|
|
|
11128
11146
|
return declaration;
|
|
11129
11147
|
}
|
|
11130
11148
|
parseStatementContent(flags, decorators) {
|
|
11131
|
-
if (this.
|
|
11132
|
-
|
|
11133
|
-
|
|
11134
|
-
|
|
11135
|
-
|
|
11136
|
-
|
|
11137
|
-
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
|
|
11141
|
-
|
|
11142
|
-
|
|
11143
|
-
|
|
11149
|
+
if (!this.state.containsEsc) {
|
|
11150
|
+
switch (this.state.type) {
|
|
11151
|
+
case 75:
|
|
11152
|
+
{
|
|
11153
|
+
if (this.isLookaheadContextual("enum")) {
|
|
11154
|
+
const node = this.startNode();
|
|
11155
|
+
this.expect(75);
|
|
11156
|
+
return this.tsParseEnumDeclaration(node, {
|
|
11157
|
+
const: true
|
|
11158
|
+
});
|
|
11159
|
+
}
|
|
11160
|
+
break;
|
|
11161
|
+
}
|
|
11162
|
+
case 124:
|
|
11163
|
+
case 125:
|
|
11164
|
+
{
|
|
11165
|
+
if (this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()) {
|
|
11166
|
+
const token = this.state.type;
|
|
11167
|
+
const node = this.startNode();
|
|
11168
|
+
this.next();
|
|
11169
|
+
const declaration = token === 125 ? this.tsTryParseDeclare(node) : this.tsParseAbstractDeclaration(node, decorators);
|
|
11170
|
+
if (declaration) {
|
|
11171
|
+
if (token === 125) {
|
|
11172
|
+
declaration.declare = true;
|
|
11173
|
+
}
|
|
11174
|
+
return declaration;
|
|
11175
|
+
} else {
|
|
11176
|
+
node.expression = this.createIdentifier(this.startNodeAt(node.loc.start), token === 125 ? "declare" : "abstract");
|
|
11177
|
+
this.semicolon(false);
|
|
11178
|
+
return this.finishNode(node, "ExpressionStatement");
|
|
11179
|
+
}
|
|
11180
|
+
}
|
|
11181
|
+
break;
|
|
11182
|
+
}
|
|
11183
|
+
case 126:
|
|
11184
|
+
return this.tsParseEnumDeclaration(this.startNode());
|
|
11185
|
+
case 112:
|
|
11186
|
+
{
|
|
11187
|
+
const nextCh = this.lookaheadCharCode();
|
|
11188
|
+
if (nextCh === 123) {
|
|
11189
|
+
const node = this.startNode();
|
|
11190
|
+
return this.tsParseAmbientExternalModuleDeclaration(node);
|
|
11191
|
+
}
|
|
11192
|
+
break;
|
|
11193
|
+
}
|
|
11194
|
+
case 129:
|
|
11195
|
+
{
|
|
11196
|
+
const result = this.tsParseInterfaceDeclaration(this.startNode());
|
|
11197
|
+
if (result) return result;
|
|
11198
|
+
break;
|
|
11199
|
+
}
|
|
11200
|
+
case 127:
|
|
11201
|
+
{
|
|
11202
|
+
if (this.nextTokenIsIdentifierOrStringLiteralOnSameLine()) {
|
|
11203
|
+
const node = this.startNode();
|
|
11204
|
+
this.next();
|
|
11205
|
+
return this.tsParseDeclaration(node, 127, false, decorators);
|
|
11206
|
+
}
|
|
11207
|
+
break;
|
|
11208
|
+
}
|
|
11209
|
+
case 128:
|
|
11210
|
+
{
|
|
11211
|
+
if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
11212
|
+
const node = this.startNode();
|
|
11213
|
+
this.next();
|
|
11214
|
+
return this.tsParseDeclaration(node, 128, false, decorators);
|
|
11215
|
+
}
|
|
11216
|
+
break;
|
|
11217
|
+
}
|
|
11218
|
+
case 130:
|
|
11219
|
+
{
|
|
11220
|
+
if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
11221
|
+
const node = this.startNode();
|
|
11222
|
+
this.next();
|
|
11223
|
+
return this.tsParseTypeAliasDeclaration(node);
|
|
11224
|
+
}
|
|
11225
|
+
break;
|
|
11226
|
+
}
|
|
11227
|
+
}
|
|
11144
11228
|
}
|
|
11145
11229
|
return super.parseStatementContent(flags, decorators);
|
|
11146
11230
|
}
|
|
@@ -11224,10 +11308,6 @@ function requireLib$2 () {
|
|
|
11224
11308
|
this.raise(TSErrors.ClassMethodHasDeclare, methodOrProp);
|
|
11225
11309
|
}
|
|
11226
11310
|
}
|
|
11227
|
-
parseExpressionStatement(node, expr, decorators) {
|
|
11228
|
-
const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr, decorators) : undefined;
|
|
11229
|
-
return decl || super.parseExpressionStatement(node, expr, decorators);
|
|
11230
|
-
}
|
|
11231
11311
|
shouldParseExportDeclaration() {
|
|
11232
11312
|
if (this.tsIsDeclarationStart()) return true;
|
|
11233
11313
|
return super.shouldParseExportDeclaration();
|
|
@@ -11552,7 +11632,7 @@ function requireLib$2 () {
|
|
|
11552
11632
|
super.checkToRestConversion(node, allowPattern);
|
|
11553
11633
|
}
|
|
11554
11634
|
}
|
|
11555
|
-
isValidLVal(type, isUnparenthesizedInAssign, binding) {
|
|
11635
|
+
isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) {
|
|
11556
11636
|
switch (type) {
|
|
11557
11637
|
case "TSTypeCastExpression":
|
|
11558
11638
|
return true;
|
|
@@ -11565,7 +11645,7 @@ function requireLib$2 () {
|
|
|
11565
11645
|
case "TSTypeAssertion":
|
|
11566
11646
|
return (binding !== 64 || !isUnparenthesizedInAssign) && ["expression", true];
|
|
11567
11647
|
default:
|
|
11568
|
-
return super.isValidLVal(type, isUnparenthesizedInAssign, binding);
|
|
11648
|
+
return super.isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding);
|
|
11569
11649
|
}
|
|
11570
11650
|
}
|
|
11571
11651
|
parseBindingAtom() {
|
|
@@ -11727,10 +11807,11 @@ function requireLib$2 () {
|
|
|
11727
11807
|
node.abstract = true;
|
|
11728
11808
|
this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifier, node);
|
|
11729
11809
|
return this.tsParseInterfaceDeclaration(node);
|
|
11810
|
+
} else {
|
|
11811
|
+
return null;
|
|
11730
11812
|
}
|
|
11731
|
-
} else {
|
|
11732
|
-
this.unexpected(null, 80);
|
|
11733
11813
|
}
|
|
11814
|
+
throw this.unexpected(null, 80);
|
|
11734
11815
|
}
|
|
11735
11816
|
parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {
|
|
11736
11817
|
const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
|
|
@@ -11840,7 +11921,7 @@ function requireLib$2 () {
|
|
|
11840
11921
|
}
|
|
11841
11922
|
}
|
|
11842
11923
|
fillOptionalPropertiesForTSESLint(node) {
|
|
11843
|
-
var _node$directive, _node$decorators, _node$optional, _node$typeAnnotation, _node$accessibility, _node$decorators2, _node$override, _node$readonly, _node$static, _node$declare, _node$returnType, _node$typeParameters, _node$optional2, _node$optional3, _node$accessibility2, _node$readonly2, _node$static2, _node$declare2, _node$definite, _node$readonly3, _node$typeAnnotation2, _node$accessibility3, _node$decorators3, _node$override2, _node$optional4, _node$id, _node$abstract, _node$declare3, _node$decorators4, _node$implements, _node$superTypeArgume, _node$typeParameters2, _node$declare4, _node$definite2, _node$const, _node$declare5, _node$computed, _node$qualifier, _node$options, _node$declare6, _node$extends, _node$declare7, _node$global, _node$const2, _node$in, _node$out;
|
|
11924
|
+
var _node$directive, _node$decorators, _node$optional, _node$typeAnnotation, _node$accessibility, _node$decorators2, _node$override, _node$readonly, _node$static, _node$declare, _node$returnType, _node$typeParameters, _node$optional2, _node$optional3, _node$accessibility2, _node$readonly2, _node$static2, _node$declare2, _node$definite, _node$readonly3, _node$typeAnnotation2, _node$accessibility3, _node$decorators3, _node$override2, _node$optional4, _node$id, _node$abstract, _node$declare3, _node$decorators4, _node$implements, _node$superTypeArgume, _node$typeParameters2, _node$declare4, _node$definite2, _node$const, _node$declare5, _node$computed, _node$qualifier, _node$options, _node$declare6, _node$extends, _node$optional5, _node$readonly4, _node$declare7, _node$global, _node$const2, _node$in, _node$out;
|
|
11844
11925
|
switch (node.type) {
|
|
11845
11926
|
case "ExpressionStatement":
|
|
11846
11927
|
(_node$directive = node.directive) != null ? _node$directive : node.directive = undefined;
|
|
@@ -11931,6 +12012,10 @@ function requireLib$2 () {
|
|
|
11931
12012
|
(_node$declare6 = node.declare) != null ? _node$declare6 : node.declare = false;
|
|
11932
12013
|
(_node$extends = node.extends) != null ? _node$extends : node.extends = [];
|
|
11933
12014
|
return;
|
|
12015
|
+
case "TSMappedType":
|
|
12016
|
+
(_node$optional5 = node.optional) != null ? _node$optional5 : node.optional = false;
|
|
12017
|
+
(_node$readonly4 = node.readonly) != null ? _node$readonly4 : node.readonly = undefined;
|
|
12018
|
+
return;
|
|
11934
12019
|
case "TSModuleDeclaration":
|
|
11935
12020
|
(_node$declare7 = node.declare) != null ? _node$declare7 : node.declare = false;
|
|
11936
12021
|
(_node$global = node.global) != null ? _node$global : node.global = node.kind === "global";
|
|
@@ -11942,6 +12027,32 @@ function requireLib$2 () {
|
|
|
11942
12027
|
return;
|
|
11943
12028
|
}
|
|
11944
12029
|
}
|
|
12030
|
+
chStartsBindingIdentifierAndNotRelationalOperator(ch, pos) {
|
|
12031
|
+
if (isIdentifierStart(ch)) {
|
|
12032
|
+
keywordAndTSRelationalOperator.lastIndex = pos;
|
|
12033
|
+
if (keywordAndTSRelationalOperator.test(this.input)) {
|
|
12034
|
+
const endCh = this.codePointAtPos(keywordAndTSRelationalOperator.lastIndex);
|
|
12035
|
+
if (!isIdentifierChar(endCh) && endCh !== 92) {
|
|
12036
|
+
return false;
|
|
12037
|
+
}
|
|
12038
|
+
}
|
|
12039
|
+
return true;
|
|
12040
|
+
} else if (ch === 92) {
|
|
12041
|
+
return true;
|
|
12042
|
+
} else {
|
|
12043
|
+
return false;
|
|
12044
|
+
}
|
|
12045
|
+
}
|
|
12046
|
+
nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine() {
|
|
12047
|
+
const next = this.nextTokenInLineStart();
|
|
12048
|
+
const nextCh = this.codePointAtPos(next);
|
|
12049
|
+
return this.chStartsBindingIdentifierAndNotRelationalOperator(nextCh, next);
|
|
12050
|
+
}
|
|
12051
|
+
nextTokenIsIdentifierOrStringLiteralOnSameLine() {
|
|
12052
|
+
const next = this.nextTokenInLineStart();
|
|
12053
|
+
const nextCh = this.codePointAtPos(next);
|
|
12054
|
+
return this.chStartsBindingIdentifier(nextCh, next) || nextCh === 34 || nextCh === 39;
|
|
12055
|
+
}
|
|
11945
12056
|
};
|
|
11946
12057
|
function isPossiblyLiteralEnum(expression) {
|
|
11947
12058
|
if (expression.type !== "MemberExpression") return false;
|
|
@@ -12070,8 +12181,8 @@ function requireLib$2 () {
|
|
|
12070
12181
|
parseBindingAtom() {
|
|
12071
12182
|
return this.parsePlaceholder("Pattern") || super.parseBindingAtom();
|
|
12072
12183
|
}
|
|
12073
|
-
isValidLVal(type, isParenthesized, binding) {
|
|
12074
|
-
return type === "Placeholder" || super.isValidLVal(type, isParenthesized, binding);
|
|
12184
|
+
isValidLVal(type, disallowCallExpression, isParenthesized, binding) {
|
|
12185
|
+
return type === "Placeholder" || super.isValidLVal(type, disallowCallExpression, isParenthesized, binding);
|
|
12075
12186
|
}
|
|
12076
12187
|
toAssignable(node, isLHS) {
|
|
12077
12188
|
if (node && node.type === "Placeholder" && node.expectedNode === "Expression") {
|
|
@@ -12471,7 +12582,7 @@ function requireLib$2 () {
|
|
|
12471
12582
|
}
|
|
12472
12583
|
this.next();
|
|
12473
12584
|
node.right = this.parseMaybeAssign();
|
|
12474
|
-
this.checkLVal(left, this.finishNode(node, "AssignmentExpression"));
|
|
12585
|
+
this.checkLVal(left, this.finishNode(node, "AssignmentExpression"), undefined, undefined, undefined, undefined, operator === "||=" || operator === "&&=" || operator === "??=");
|
|
12475
12586
|
return node;
|
|
12476
12587
|
} else if (ownExpressionErrors) {
|
|
12477
12588
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
@@ -12945,7 +13056,7 @@ function requireLib$2 () {
|
|
|
12945
13056
|
}
|
|
12946
13057
|
case 0:
|
|
12947
13058
|
{
|
|
12948
|
-
return this.parseArrayLike(3,
|
|
13059
|
+
return this.parseArrayLike(3, false, refExpressionErrors);
|
|
12949
13060
|
}
|
|
12950
13061
|
case 5:
|
|
12951
13062
|
{
|
|
@@ -13002,25 +13113,22 @@ function requireLib$2 () {
|
|
|
13002
13113
|
if (pipeProposal) {
|
|
13003
13114
|
return this.parseTopicReference(pipeProposal);
|
|
13004
13115
|
}
|
|
13005
|
-
this.unexpected();
|
|
13006
|
-
break;
|
|
13116
|
+
throw this.unexpected();
|
|
13007
13117
|
}
|
|
13008
13118
|
case 47:
|
|
13009
13119
|
{
|
|
13010
13120
|
const lookaheadCh = this.input.codePointAt(this.nextTokenStart());
|
|
13011
13121
|
if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) {
|
|
13012
|
-
this.expectOnePlugin(["jsx", "flow", "typescript"]);
|
|
13013
|
-
} else {
|
|
13014
|
-
this.unexpected();
|
|
13122
|
+
throw this.expectOnePlugin(["jsx", "flow", "typescript"]);
|
|
13015
13123
|
}
|
|
13016
|
-
|
|
13124
|
+
throw this.unexpected();
|
|
13017
13125
|
}
|
|
13018
13126
|
default:
|
|
13019
13127
|
{
|
|
13020
13128
|
if (type === 137) {
|
|
13021
13129
|
return this.parseDecimalLiteral(this.state.value);
|
|
13022
13130
|
} else if (type === 2 || type === 1) {
|
|
13023
|
-
return this.parseArrayLike(this.state.type === 2 ? 4 : 3,
|
|
13131
|
+
return this.parseArrayLike(this.state.type === 2 ? 4 : 3, true);
|
|
13024
13132
|
} else if (type === 6 || type === 7) {
|
|
13025
13133
|
return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true);
|
|
13026
13134
|
}
|
|
@@ -13057,7 +13165,7 @@ function requireLib$2 () {
|
|
|
13057
13165
|
}
|
|
13058
13166
|
return id;
|
|
13059
13167
|
} else {
|
|
13060
|
-
this.unexpected();
|
|
13168
|
+
throw this.unexpected();
|
|
13061
13169
|
}
|
|
13062
13170
|
}
|
|
13063
13171
|
}
|
|
@@ -13070,9 +13178,8 @@ function requireLib$2 () {
|
|
|
13070
13178
|
this.state.end--;
|
|
13071
13179
|
this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1);
|
|
13072
13180
|
return this.parseTopicReference(pipeProposal);
|
|
13073
|
-
} else {
|
|
13074
|
-
this.unexpected();
|
|
13075
13181
|
}
|
|
13182
|
+
throw this.unexpected();
|
|
13076
13183
|
}
|
|
13077
13184
|
parseTopicReference(pipeProposal) {
|
|
13078
13185
|
const node = this.startNode();
|
|
@@ -13148,10 +13255,18 @@ function requireLib$2 () {
|
|
|
13148
13255
|
parseSuper() {
|
|
13149
13256
|
const node = this.startNode();
|
|
13150
13257
|
this.next();
|
|
13151
|
-
if (this.match(10) && !this.scope.allowDirectSuper
|
|
13152
|
-
|
|
13153
|
-
|
|
13154
|
-
|
|
13258
|
+
if (this.match(10) && !this.scope.allowDirectSuper) {
|
|
13259
|
+
{
|
|
13260
|
+
if (!(this.optionFlags & 16)) {
|
|
13261
|
+
this.raise(Errors.SuperNotAllowed, node);
|
|
13262
|
+
}
|
|
13263
|
+
}
|
|
13264
|
+
} else if (!this.scope.allowSuper) {
|
|
13265
|
+
{
|
|
13266
|
+
if (!(this.optionFlags & 16)) {
|
|
13267
|
+
this.raise(Errors.UnexpectedSuper, node);
|
|
13268
|
+
}
|
|
13269
|
+
}
|
|
13155
13270
|
}
|
|
13156
13271
|
if (!this.match(10) && !this.match(0) && !this.match(16)) {
|
|
13157
13272
|
this.raise(Errors.UnsupportedSuper, node);
|
|
@@ -13665,7 +13780,7 @@ function requireLib$2 () {
|
|
|
13665
13780
|
this.scope.exit();
|
|
13666
13781
|
return finishedNode;
|
|
13667
13782
|
}
|
|
13668
|
-
parseArrayLike(close,
|
|
13783
|
+
parseArrayLike(close, isTuple, refExpressionErrors) {
|
|
13669
13784
|
if (isTuple) {
|
|
13670
13785
|
this.expectPlugin("recordAndTuple");
|
|
13671
13786
|
}
|
|
@@ -14291,9 +14406,7 @@ function requireLib$2 () {
|
|
|
14291
14406
|
if (!this.isContextual(107)) {
|
|
14292
14407
|
return false;
|
|
14293
14408
|
}
|
|
14294
|
-
|
|
14295
|
-
const nextCh = this.codePointAtPos(next);
|
|
14296
|
-
return this.chStartsBindingIdentifier(nextCh, next);
|
|
14409
|
+
return this.nextTokenIsIdentifierOnSameLine();
|
|
14297
14410
|
}
|
|
14298
14411
|
isForUsing() {
|
|
14299
14412
|
if (!this.isContextual(107)) {
|
|
@@ -14312,6 +14425,11 @@ function requireLib$2 () {
|
|
|
14312
14425
|
}
|
|
14313
14426
|
return false;
|
|
14314
14427
|
}
|
|
14428
|
+
nextTokenIsIdentifierOnSameLine() {
|
|
14429
|
+
const next = this.nextTokenInLineStart();
|
|
14430
|
+
const nextCh = this.codePointAtPos(next);
|
|
14431
|
+
return this.chStartsBindingIdentifier(nextCh, next);
|
|
14432
|
+
}
|
|
14315
14433
|
isAwaitUsing() {
|
|
14316
14434
|
if (!this.isContextual(96)) {
|
|
14317
14435
|
return false;
|
|
@@ -15454,7 +15572,7 @@ function requireLib$2 () {
|
|
|
15454
15572
|
this.sawUnambiguousESM = true;
|
|
15455
15573
|
return this.finishNode(node2, "ExportDefaultDeclaration");
|
|
15456
15574
|
}
|
|
15457
|
-
this.unexpected(null, 5);
|
|
15575
|
+
throw this.unexpected(null, 5);
|
|
15458
15576
|
}
|
|
15459
15577
|
eatExportStar(node) {
|
|
15460
15578
|
return this.eat(55);
|
|
@@ -16046,54 +16164,54 @@ function requireLib$2 () {
|
|
|
16046
16164
|
}
|
|
16047
16165
|
class Parser extends StatementParser {
|
|
16048
16166
|
constructor(options, input, pluginsMap) {
|
|
16049
|
-
|
|
16050
|
-
super(
|
|
16051
|
-
this.options =
|
|
16167
|
+
const normalizedOptions = getOptions(options);
|
|
16168
|
+
super(normalizedOptions, input);
|
|
16169
|
+
this.options = normalizedOptions;
|
|
16052
16170
|
this.initializeScopes();
|
|
16053
16171
|
this.plugins = pluginsMap;
|
|
16054
|
-
this.filename =
|
|
16055
|
-
this.startIndex =
|
|
16172
|
+
this.filename = normalizedOptions.sourceFilename;
|
|
16173
|
+
this.startIndex = normalizedOptions.startIndex;
|
|
16056
16174
|
let optionFlags = 0;
|
|
16057
|
-
if (
|
|
16175
|
+
if (normalizedOptions.allowAwaitOutsideFunction) {
|
|
16058
16176
|
optionFlags |= 1;
|
|
16059
16177
|
}
|
|
16060
|
-
if (
|
|
16178
|
+
if (normalizedOptions.allowReturnOutsideFunction) {
|
|
16061
16179
|
optionFlags |= 2;
|
|
16062
16180
|
}
|
|
16063
|
-
if (
|
|
16181
|
+
if (normalizedOptions.allowImportExportEverywhere) {
|
|
16064
16182
|
optionFlags |= 8;
|
|
16065
16183
|
}
|
|
16066
|
-
if (
|
|
16184
|
+
if (normalizedOptions.allowSuperOutsideMethod) {
|
|
16067
16185
|
optionFlags |= 16;
|
|
16068
16186
|
}
|
|
16069
|
-
if (
|
|
16187
|
+
if (normalizedOptions.allowUndeclaredExports) {
|
|
16070
16188
|
optionFlags |= 64;
|
|
16071
16189
|
}
|
|
16072
|
-
if (
|
|
16190
|
+
if (normalizedOptions.allowNewTargetOutsideFunction) {
|
|
16073
16191
|
optionFlags |= 4;
|
|
16074
16192
|
}
|
|
16075
|
-
if (
|
|
16193
|
+
if (normalizedOptions.allowYieldOutsideFunction) {
|
|
16076
16194
|
optionFlags |= 32;
|
|
16077
16195
|
}
|
|
16078
|
-
if (
|
|
16196
|
+
if (normalizedOptions.ranges) {
|
|
16079
16197
|
optionFlags |= 128;
|
|
16080
16198
|
}
|
|
16081
|
-
if (
|
|
16199
|
+
if (normalizedOptions.tokens) {
|
|
16082
16200
|
optionFlags |= 256;
|
|
16083
16201
|
}
|
|
16084
|
-
if (
|
|
16202
|
+
if (normalizedOptions.createImportExpressions) {
|
|
16085
16203
|
optionFlags |= 512;
|
|
16086
16204
|
}
|
|
16087
|
-
if (
|
|
16205
|
+
if (normalizedOptions.createParenthesizedExpressions) {
|
|
16088
16206
|
optionFlags |= 1024;
|
|
16089
16207
|
}
|
|
16090
|
-
if (
|
|
16208
|
+
if (normalizedOptions.errorRecovery) {
|
|
16091
16209
|
optionFlags |= 2048;
|
|
16092
16210
|
}
|
|
16093
|
-
if (
|
|
16211
|
+
if (normalizedOptions.attachComment) {
|
|
16094
16212
|
optionFlags |= 4096;
|
|
16095
16213
|
}
|
|
16096
|
-
if (
|
|
16214
|
+
if (normalizedOptions.annexB) {
|
|
16097
16215
|
optionFlags |= 8192;
|
|
16098
16216
|
}
|
|
16099
16217
|
this.optionFlags = optionFlags;
|
|
@@ -16107,10 +16225,10 @@ function requireLib$2 () {
|
|
|
16107
16225
|
const program = this.startNode();
|
|
16108
16226
|
this.nextToken();
|
|
16109
16227
|
file.errors = null;
|
|
16110
|
-
this.parseTopLevel(file, program);
|
|
16111
|
-
|
|
16112
|
-
|
|
16113
|
-
return
|
|
16228
|
+
const result = this.parseTopLevel(file, program);
|
|
16229
|
+
result.errors = this.state.errors;
|
|
16230
|
+
result.comments.length = this.state.commentsLen;
|
|
16231
|
+
return result;
|
|
16114
16232
|
}
|
|
16115
16233
|
}
|
|
16116
16234
|
function parse(input, options) {
|
|
@@ -16442,16 +16560,34 @@ function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [
|
|
|
16442
16560
|
(id) => markScopeIdentifier(node, id, knownIds)
|
|
16443
16561
|
);
|
|
16444
16562
|
}
|
|
16563
|
+
} else if (node.type === "SwitchStatement") {
|
|
16564
|
+
if (node.scopeIds) {
|
|
16565
|
+
node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
|
|
16566
|
+
} else {
|
|
16567
|
+
walkSwitchStatement(
|
|
16568
|
+
node,
|
|
16569
|
+
false,
|
|
16570
|
+
(id) => markScopeIdentifier(node, id, knownIds)
|
|
16571
|
+
);
|
|
16572
|
+
}
|
|
16445
16573
|
} else if (node.type === "CatchClause" && node.param) {
|
|
16446
|
-
|
|
16447
|
-
|
|
16574
|
+
if (node.scopeIds) {
|
|
16575
|
+
node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
|
|
16576
|
+
} else {
|
|
16577
|
+
for (const id of extractIdentifiers(node.param)) {
|
|
16578
|
+
markScopeIdentifier(node, id, knownIds);
|
|
16579
|
+
}
|
|
16448
16580
|
}
|
|
16449
16581
|
} else if (isForStatement(node)) {
|
|
16450
|
-
|
|
16451
|
-
node,
|
|
16452
|
-
|
|
16453
|
-
(
|
|
16454
|
-
|
|
16582
|
+
if (node.scopeIds) {
|
|
16583
|
+
node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
|
|
16584
|
+
} else {
|
|
16585
|
+
walkForStatement(
|
|
16586
|
+
node,
|
|
16587
|
+
false,
|
|
16588
|
+
(id) => markScopeIdentifier(node, id, knownIds)
|
|
16589
|
+
);
|
|
16590
|
+
}
|
|
16455
16591
|
}
|
|
16456
16592
|
},
|
|
16457
16593
|
leave(node, parent) {
|
|
@@ -16474,14 +16610,15 @@ function isReferencedIdentifier(id, parent, parentStack) {
|
|
|
16474
16610
|
if (id.name === "arguments") {
|
|
16475
16611
|
return false;
|
|
16476
16612
|
}
|
|
16477
|
-
if (isReferenced$1(id, parent)) {
|
|
16613
|
+
if (isReferenced$1(id, parent, parentStack[parentStack.length - 2])) {
|
|
16478
16614
|
return true;
|
|
16479
16615
|
}
|
|
16480
16616
|
switch (parent.type) {
|
|
16481
16617
|
case "AssignmentExpression":
|
|
16482
16618
|
case "AssignmentPattern":
|
|
16483
16619
|
return true;
|
|
16484
|
-
case "
|
|
16620
|
+
case "ObjectProperty":
|
|
16621
|
+
return parent.key !== id && isInDestructureAssignment(parent, parentStack);
|
|
16485
16622
|
case "ArrayPattern":
|
|
16486
16623
|
return isInDestructureAssignment(parent, parentStack);
|
|
16487
16624
|
}
|
|
@@ -16509,7 +16646,8 @@ function walkFunctionParams(node, onIdent) {
|
|
|
16509
16646
|
}
|
|
16510
16647
|
}
|
|
16511
16648
|
function walkBlockDeclarations(block, onIdent) {
|
|
16512
|
-
|
|
16649
|
+
const body = block.type === "SwitchCase" ? block.consequent : block.body;
|
|
16650
|
+
for (const stmt of body) {
|
|
16513
16651
|
if (stmt.type === "VariableDeclaration") {
|
|
16514
16652
|
if (stmt.declare) continue;
|
|
16515
16653
|
for (const decl of stmt.declarations) {
|
|
@@ -16522,6 +16660,8 @@ function walkBlockDeclarations(block, onIdent) {
|
|
|
16522
16660
|
onIdent(stmt.id);
|
|
16523
16661
|
} else if (isForStatement(stmt)) {
|
|
16524
16662
|
walkForStatement(stmt, true, onIdent);
|
|
16663
|
+
} else if (stmt.type === "SwitchStatement") {
|
|
16664
|
+
walkSwitchStatement(stmt, true, onIdent);
|
|
16525
16665
|
}
|
|
16526
16666
|
}
|
|
16527
16667
|
}
|
|
@@ -16538,6 +16678,20 @@ function walkForStatement(stmt, isVar, onIdent) {
|
|
|
16538
16678
|
}
|
|
16539
16679
|
}
|
|
16540
16680
|
}
|
|
16681
|
+
function walkSwitchStatement(stmt, isVar, onIdent) {
|
|
16682
|
+
for (const cs of stmt.cases) {
|
|
16683
|
+
for (const stmt2 of cs.consequent) {
|
|
16684
|
+
if (stmt2.type === "VariableDeclaration" && (stmt2.kind === "var" ? isVar : !isVar)) {
|
|
16685
|
+
for (const decl of stmt2.declarations) {
|
|
16686
|
+
for (const id of extractIdentifiers(decl.id)) {
|
|
16687
|
+
onIdent(id);
|
|
16688
|
+
}
|
|
16689
|
+
}
|
|
16690
|
+
}
|
|
16691
|
+
}
|
|
16692
|
+
walkBlockDeclarations(cs, onIdent);
|
|
16693
|
+
}
|
|
16694
|
+
}
|
|
16541
16695
|
function extractIdentifiers(param, nodes = []) {
|
|
16542
16696
|
switch (param.type) {
|
|
16543
16697
|
case "Identifier":
|
|
@@ -16637,7 +16791,7 @@ function isReferenced$1(node, parent, grandparent) {
|
|
|
16637
16791
|
if (parent.key === node) {
|
|
16638
16792
|
return !!parent.computed;
|
|
16639
16793
|
}
|
|
16640
|
-
return
|
|
16794
|
+
return !grandparent || grandparent.type !== "ObjectPattern";
|
|
16641
16795
|
// no: class { NODE = value; }
|
|
16642
16796
|
// yes: class { [NODE] = value; }
|
|
16643
16797
|
// yes: class { key = NODE; }
|
|
@@ -16687,6 +16841,9 @@ function isReferenced$1(node, parent, grandparent) {
|
|
|
16687
16841
|
// yes: export { NODE as foo };
|
|
16688
16842
|
// no: export { NODE as foo } from "foo";
|
|
16689
16843
|
case "ExportSpecifier":
|
|
16844
|
+
if (grandparent == null ? void 0 : grandparent.source) {
|
|
16845
|
+
return false;
|
|
16846
|
+
}
|
|
16690
16847
|
return parent.local === node;
|
|
16691
16848
|
// no: import NODE from "foo";
|
|
16692
16849
|
// no: import * as NODE from "foo";
|
|
@@ -16820,7 +16977,7 @@ function isCoreComponent(tag) {
|
|
|
16820
16977
|
return BASE_TRANSITION;
|
|
16821
16978
|
}
|
|
16822
16979
|
}
|
|
16823
|
-
const nonIdentifierRE =
|
|
16980
|
+
const nonIdentifierRE = /^$|^\d|[^\$\w\xA0-\uFFFF]/;
|
|
16824
16981
|
const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
|
|
16825
16982
|
const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
|
|
16826
16983
|
const isMemberExpressionNode = (exp, context) => {
|
|
@@ -16910,6 +17067,9 @@ function hasDynamicKeyVBind(node) {
|
|
|
16910
17067
|
// v-bind:[foo]
|
|
16911
17068
|
);
|
|
16912
17069
|
}
|
|
17070
|
+
function isVPre(p) {
|
|
17071
|
+
return p.type === 7 && p.name === "pre";
|
|
17072
|
+
}
|
|
16913
17073
|
function isVSlot(p) {
|
|
16914
17074
|
return p.type === 7 && p.name === "slot";
|
|
16915
17075
|
}
|
|
@@ -17077,7 +17237,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
17077
17237
|
ondirarg(start, end) {
|
|
17078
17238
|
if (start === end) return;
|
|
17079
17239
|
const arg = getSlice(start, end);
|
|
17080
|
-
if (inVPre) {
|
|
17240
|
+
if (inVPre && !isVPre(currentProp)) {
|
|
17081
17241
|
currentProp.name += arg;
|
|
17082
17242
|
setLocEnd(currentProp.nameLoc, end);
|
|
17083
17243
|
} else {
|
|
@@ -17092,7 +17252,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
17092
17252
|
},
|
|
17093
17253
|
ondirmodifier(start, end) {
|
|
17094
17254
|
const mod = getSlice(start, end);
|
|
17095
|
-
if (inVPre) {
|
|
17255
|
+
if (inVPre && !isVPre(currentProp)) {
|
|
17096
17256
|
currentProp.name += "." + mod;
|
|
17097
17257
|
setLocEnd(currentProp.nameLoc, end);
|
|
17098
17258
|
} else if (currentProp.name === "slot") {
|
|
@@ -21187,6 +21347,44 @@ const resolveModifiers = (key, modifiers, context, loc) => {
|
|
|
21187
21347
|
};
|
|
21188
21348
|
};
|
|
21189
21349
|
|
|
21350
|
+
function postTransformTransition(node, onError, hasMultipleChildren = defaultHasMultipleChildren) {
|
|
21351
|
+
return () => {
|
|
21352
|
+
if (!node.children.length) {
|
|
21353
|
+
return;
|
|
21354
|
+
}
|
|
21355
|
+
if (hasMultipleChildren(node)) {
|
|
21356
|
+
onError(
|
|
21357
|
+
createDOMCompilerError(62, {
|
|
21358
|
+
start: node.children[0].loc.start,
|
|
21359
|
+
end: node.children[node.children.length - 1].loc.end,
|
|
21360
|
+
source: ""
|
|
21361
|
+
})
|
|
21362
|
+
);
|
|
21363
|
+
}
|
|
21364
|
+
const child = node.children[0];
|
|
21365
|
+
if (child.type === 1) {
|
|
21366
|
+
for (const p of child.props) {
|
|
21367
|
+
if (p.type === 7 && p.name === "show") {
|
|
21368
|
+
node.props.push({
|
|
21369
|
+
type: 6,
|
|
21370
|
+
name: "persisted",
|
|
21371
|
+
nameLoc: node.loc,
|
|
21372
|
+
value: void 0,
|
|
21373
|
+
loc: node.loc
|
|
21374
|
+
});
|
|
21375
|
+
}
|
|
21376
|
+
}
|
|
21377
|
+
}
|
|
21378
|
+
};
|
|
21379
|
+
}
|
|
21380
|
+
function defaultHasMultipleChildren(node) {
|
|
21381
|
+
const children = node.children = node.children.filter(
|
|
21382
|
+
(c) => c.type !== 3 && !(c.type === 2 && !c.content.trim())
|
|
21383
|
+
);
|
|
21384
|
+
const child = children[0];
|
|
21385
|
+
return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(defaultHasMultipleChildren);
|
|
21386
|
+
}
|
|
21387
|
+
|
|
21190
21388
|
function isValidHTMLNesting(parent, child) {
|
|
21191
21389
|
if (parent === "template") {
|
|
21192
21390
|
return true;
|
|
@@ -21367,7 +21565,8 @@ const newBlock = (node) => ({
|
|
|
21367
21565
|
effect: [],
|
|
21368
21566
|
operation: [],
|
|
21369
21567
|
returns: [],
|
|
21370
|
-
tempId: 0
|
|
21568
|
+
tempId: 0,
|
|
21569
|
+
hasDeferredVShow: false
|
|
21371
21570
|
});
|
|
21372
21571
|
function wrapTemplate(node, dirs) {
|
|
21373
21572
|
if (node.tagType === 3) {
|
|
@@ -21431,6 +21630,40 @@ function getLiteralExpressionValue(exp) {
|
|
|
21431
21630
|
}
|
|
21432
21631
|
return exp.isStatic ? exp.content : null;
|
|
21433
21632
|
}
|
|
21633
|
+
function isInTransition(context) {
|
|
21634
|
+
const parentNode = context.parent && context.parent.node;
|
|
21635
|
+
return !!(parentNode && isTransitionNode(parentNode));
|
|
21636
|
+
}
|
|
21637
|
+
function isTransitionNode(node) {
|
|
21638
|
+
return node.type === 1 && isTransitionTag(node.tag);
|
|
21639
|
+
}
|
|
21640
|
+
function isTransitionTag(tag) {
|
|
21641
|
+
tag = tag.toLowerCase();
|
|
21642
|
+
return tag === "transition" || tag === "vaportransition";
|
|
21643
|
+
}
|
|
21644
|
+
function isTransitionGroupTag(tag) {
|
|
21645
|
+
tag = tag.toLowerCase().replace(/-/g, "");
|
|
21646
|
+
return tag === "transitiongroup" || tag === "vaportransitiongroup";
|
|
21647
|
+
}
|
|
21648
|
+
function isKeepAliveTag(tag) {
|
|
21649
|
+
tag = tag.toLowerCase();
|
|
21650
|
+
return tag === "keepalive" || tag === "vaporkeepalive";
|
|
21651
|
+
}
|
|
21652
|
+
function isTeleportTag(tag) {
|
|
21653
|
+
tag = tag.toLowerCase();
|
|
21654
|
+
return tag === "teleport" || tag === "vaporteleport";
|
|
21655
|
+
}
|
|
21656
|
+
function isBuiltInComponent(tag) {
|
|
21657
|
+
if (isTeleportTag(tag)) {
|
|
21658
|
+
return "VaporTeleport";
|
|
21659
|
+
} else if (isKeepAliveTag(tag)) {
|
|
21660
|
+
return "VaporKeepAlive";
|
|
21661
|
+
} else if (isTransitionTag(tag)) {
|
|
21662
|
+
return "VaporTransition";
|
|
21663
|
+
} else if (isTransitionGroupTag(tag)) {
|
|
21664
|
+
return "VaporTransitionGroup";
|
|
21665
|
+
}
|
|
21666
|
+
}
|
|
21434
21667
|
|
|
21435
21668
|
class TransformContext {
|
|
21436
21669
|
constructor(ir, node, options = {}) {
|
|
@@ -21643,13 +21876,13 @@ const DELIMITERS_ARRAY = ["[", "]", ", "];
|
|
|
21643
21876
|
const DELIMITERS_ARRAY_NEWLINE = [
|
|
21644
21877
|
["[", INDENT_START, NEWLINE],
|
|
21645
21878
|
[INDENT_END, NEWLINE, "]"],
|
|
21646
|
-
[",
|
|
21879
|
+
[",", NEWLINE]
|
|
21647
21880
|
];
|
|
21648
21881
|
const DELIMITERS_OBJECT = ["{ ", " }", ", "];
|
|
21649
21882
|
const DELIMITERS_OBJECT_NEWLINE = [
|
|
21650
21883
|
["{", INDENT_START, NEWLINE],
|
|
21651
21884
|
[INDENT_END, NEWLINE, "}"],
|
|
21652
|
-
[",
|
|
21885
|
+
[",", NEWLINE]
|
|
21653
21886
|
];
|
|
21654
21887
|
function genCall(name, ...frags) {
|
|
21655
21888
|
const hasPlaceholder = isArray(name);
|
|
@@ -24630,7 +24863,6 @@ function requireGenerated$3 () {
|
|
|
24630
24863
|
case "AssignmentPattern":
|
|
24631
24864
|
case "ArrayPattern":
|
|
24632
24865
|
case "ObjectPattern":
|
|
24633
|
-
case "OptionalMemberExpression":
|
|
24634
24866
|
case "TSParameterProperty":
|
|
24635
24867
|
case "TSAsExpression":
|
|
24636
24868
|
case "TSSatisfiesExpression":
|
|
@@ -25502,13 +25734,13 @@ function requireIdentifier () {
|
|
|
25502
25734
|
identifier.isIdentifierChar = isIdentifierChar;
|
|
25503
25735
|
identifier.isIdentifierName = isIdentifierName;
|
|
25504
25736
|
identifier.isIdentifierStart = isIdentifierStart;
|
|
25505
|
-
let 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-\
|
|
25506
|
-
let nonASCIIidentifierChars = "\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-\
|
|
25737
|
+
let 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-\u088f\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\u0c5c\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdc-\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-\ua7dc\ua7f1-\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";
|
|
25738
|
+
let nonASCIIidentifierChars = "\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-\u1add\u1ae0-\u1aeb\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";
|
|
25507
25739
|
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
25508
25740
|
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
25509
25741
|
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
25510
|
-
const 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,
|
|
25511
|
-
const 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,
|
|
25742
|
+
const 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, 7, 25, 39, 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, 5, 57, 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, 24, 43, 261, 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, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 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, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 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, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489];
|
|
25743
|
+
const 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, 78, 5, 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, 199, 7, 137, 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, 55, 9, 266, 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, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
25512
25744
|
function isInAstralSet(code, set) {
|
|
25513
25745
|
let pos = 0x10000;
|
|
25514
25746
|
for (let i = 0, length = set.length; i < length; i += 2) {
|
|
@@ -25755,7 +25987,7 @@ function requireUtils () {
|
|
|
25755
25987
|
Object.defineProperty(utils, "__esModule", {
|
|
25756
25988
|
value: true
|
|
25757
25989
|
});
|
|
25758
|
-
utils.allExpandedTypes = utils.VISITOR_KEYS = utils.NODE_PARENT_VALIDATIONS = utils.NODE_FIELDS = utils.FLIPPED_ALIAS_KEYS = utils.DEPRECATED_KEYS = utils.BUILDER_KEYS = utils.ALIAS_KEYS = void 0;
|
|
25990
|
+
utils.allExpandedTypes = utils.VISITOR_KEYS = utils.NODE_UNION_SHAPES__PRIVATE = utils.NODE_PARENT_VALIDATIONS = utils.NODE_FIELDS = utils.FLIPPED_ALIAS_KEYS = utils.DEPRECATED_KEYS = utils.BUILDER_KEYS = utils.ALIAS_KEYS = void 0;
|
|
25759
25991
|
utils.arrayOf = arrayOf;
|
|
25760
25992
|
utils.arrayOfType = arrayOfType;
|
|
25761
25993
|
utils.assertEach = assertEach;
|
|
@@ -25782,6 +26014,7 @@ function requireUtils () {
|
|
|
25782
26014
|
const BUILDER_KEYS = utils.BUILDER_KEYS = {};
|
|
25783
26015
|
const DEPRECATED_KEYS = utils.DEPRECATED_KEYS = {};
|
|
25784
26016
|
const NODE_PARENT_VALIDATIONS = utils.NODE_PARENT_VALIDATIONS = {};
|
|
26017
|
+
const NODE_UNION_SHAPES__PRIVATE = utils.NODE_UNION_SHAPES__PRIVATE = {};
|
|
25785
26018
|
function getType(val) {
|
|
25786
26019
|
if (Array.isArray(val)) {
|
|
25787
26020
|
return "array";
|
|
@@ -25958,7 +26191,7 @@ function requireUtils () {
|
|
|
25958
26191
|
}
|
|
25959
26192
|
return validate;
|
|
25960
26193
|
}
|
|
25961
|
-
const validTypeOpts = new Set(["aliases", "builder", "deprecatedAlias", "fields", "inherits", "visitor", "validate"]);
|
|
26194
|
+
const validTypeOpts = new Set(["aliases", "builder", "deprecatedAlias", "fields", "inherits", "visitor", "validate", "unionShape"]);
|
|
25962
26195
|
const validFieldKeys = new Set(["default", "optional", "deprecated", "validate"]);
|
|
25963
26196
|
const store = {};
|
|
25964
26197
|
function defineAliasedType(...aliases) {
|
|
@@ -26038,6 +26271,9 @@ function requireUtils () {
|
|
|
26038
26271
|
if (opts.validate) {
|
|
26039
26272
|
NODE_PARENT_VALIDATIONS[type] = opts.validate;
|
|
26040
26273
|
}
|
|
26274
|
+
if (opts.unionShape) {
|
|
26275
|
+
NODE_UNION_SHAPES__PRIVATE[type] = opts.unionShape;
|
|
26276
|
+
}
|
|
26041
26277
|
store[type] = opts;
|
|
26042
26278
|
}
|
|
26043
26279
|
|
|
@@ -26153,6 +26389,12 @@ function requireDefinitions () {
|
|
|
26153
26389
|
return _utils.NODE_PARENT_VALIDATIONS;
|
|
26154
26390
|
}
|
|
26155
26391
|
});
|
|
26392
|
+
Object.defineProperty(exports, "NODE_UNION_SHAPES__PRIVATE", {
|
|
26393
|
+
enumerable: true,
|
|
26394
|
+
get: function () {
|
|
26395
|
+
return _utils.NODE_UNION_SHAPES__PRIVATE;
|
|
26396
|
+
}
|
|
26397
|
+
});
|
|
26156
26398
|
Object.defineProperty(exports, "PLACEHOLDERS", {
|
|
26157
26399
|
enumerable: true,
|
|
26158
26400
|
get: function () {
|
|
@@ -28835,7 +29077,7 @@ function requireLowercase () {
|
|
|
28835
29077
|
validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1);
|
|
28836
29078
|
return node;
|
|
28837
29079
|
}
|
|
28838
|
-
function tsTypeOperator(typeAnnotation, operator) {
|
|
29080
|
+
function tsTypeOperator(typeAnnotation, operator = "keyof") {
|
|
28839
29081
|
const node = {
|
|
28840
29082
|
type: "TSTypeOperator",
|
|
28841
29083
|
typeAnnotation,
|
|
@@ -33951,10 +34193,15 @@ function isKeyOnlyBinding(expr, keyAst) {
|
|
|
33951
34193
|
|
|
33952
34194
|
function genSetHtml(oper, context) {
|
|
33953
34195
|
const { helper } = context;
|
|
33954
|
-
const { value, element } = oper;
|
|
34196
|
+
const { value, element, isComponent } = oper;
|
|
33955
34197
|
return [
|
|
33956
34198
|
NEWLINE,
|
|
33957
|
-
...genCall(
|
|
34199
|
+
...genCall(
|
|
34200
|
+
// use setBlockHtml for component
|
|
34201
|
+
isComponent ? helper("setBlockHtml") : helper("setHtml"),
|
|
34202
|
+
`n${element}`,
|
|
34203
|
+
genExpression(value, context)
|
|
34204
|
+
)
|
|
33958
34205
|
];
|
|
33959
34206
|
}
|
|
33960
34207
|
|
|
@@ -34043,7 +34290,7 @@ function genLiteralObjectProps(props, context) {
|
|
|
34043
34290
|
}
|
|
34044
34291
|
function genPropKey({ key: node, modifier, runtimeCamelize, handler, handlerModifiers }, context) {
|
|
34045
34292
|
const { helper } = context;
|
|
34046
|
-
const handlerModifierPostfix = handlerModifiers ? handlerModifiers.map(capitalize).join("") : "";
|
|
34293
|
+
const handlerModifierPostfix = handlerModifiers && handlerModifiers.options ? handlerModifiers.options.map(capitalize).join("") : "";
|
|
34047
34294
|
if (node.isStatic) {
|
|
34048
34295
|
const keyName = (handler ? toHandlerKey(node.content) : node.content) + handlerModifierPostfix;
|
|
34049
34296
|
return [
|
|
@@ -34118,6 +34365,7 @@ function getSpecialHelper(keyName, tagName) {
|
|
|
34118
34365
|
|
|
34119
34366
|
const setTemplateRefIdent = `_setTemplateRef`;
|
|
34120
34367
|
function genSetTemplateRef(oper, context) {
|
|
34368
|
+
const [refValue, refKey] = genRefValue(oper.value, context);
|
|
34121
34369
|
return [
|
|
34122
34370
|
NEWLINE,
|
|
34123
34371
|
oper.effect && `r${oper.element} = `,
|
|
@@ -34125,9 +34373,10 @@ function genSetTemplateRef(oper, context) {
|
|
|
34125
34373
|
setTemplateRefIdent,
|
|
34126
34374
|
// will be generated in root scope
|
|
34127
34375
|
`n${oper.element}`,
|
|
34128
|
-
|
|
34376
|
+
refValue,
|
|
34129
34377
|
oper.effect ? `r${oper.element}` : oper.refFor ? "void 0" : void 0,
|
|
34130
|
-
oper.refFor && "true"
|
|
34378
|
+
oper.refFor && "true",
|
|
34379
|
+
refKey
|
|
34131
34380
|
)
|
|
34132
34381
|
];
|
|
34133
34382
|
}
|
|
@@ -34138,19 +34387,24 @@ function genRefValue(value, context) {
|
|
|
34138
34387
|
if (value && context.options.inline) {
|
|
34139
34388
|
const binding = context.options.bindingMetadata[value.content];
|
|
34140
34389
|
if (binding === "setup-let" || binding === "setup-ref" || binding === "setup-maybe-ref") {
|
|
34141
|
-
return [value.content];
|
|
34390
|
+
return [[value.content], JSON.stringify(value.content)];
|
|
34142
34391
|
}
|
|
34143
34392
|
}
|
|
34144
|
-
return genExpression(value, context);
|
|
34393
|
+
return [genExpression(value, context)];
|
|
34145
34394
|
}
|
|
34146
34395
|
|
|
34147
34396
|
function genSetText(oper, context) {
|
|
34148
34397
|
const { helper } = context;
|
|
34149
|
-
const { element, values, generated, jsx } = oper;
|
|
34398
|
+
const { element, values, generated, jsx, isComponent } = oper;
|
|
34150
34399
|
const texts = combineValues(values, context, jsx);
|
|
34151
34400
|
return [
|
|
34152
34401
|
NEWLINE,
|
|
34153
|
-
...genCall(
|
|
34402
|
+
...genCall(
|
|
34403
|
+
// use setBlockText for component
|
|
34404
|
+
isComponent ? helper("setBlockText") : helper("setText"),
|
|
34405
|
+
`${generated && !isComponent ? "x" : "n"}${element}`,
|
|
34406
|
+
texts
|
|
34407
|
+
)
|
|
34154
34408
|
];
|
|
34155
34409
|
}
|
|
34156
34410
|
function combineValues(values, context, jsx) {
|
|
@@ -34168,18 +34422,21 @@ function combineValues(values, context, jsx) {
|
|
|
34168
34422
|
function genGetTextChild(oper, context) {
|
|
34169
34423
|
return [
|
|
34170
34424
|
NEWLINE,
|
|
34171
|
-
`const x${oper.parent} = ${context.helper("
|
|
34425
|
+
`const x${oper.parent} = ${context.helper("txt")}(n${oper.parent})`
|
|
34172
34426
|
];
|
|
34173
34427
|
}
|
|
34174
34428
|
|
|
34175
34429
|
function genVShow(oper, context) {
|
|
34430
|
+
const { deferred, element } = oper;
|
|
34176
34431
|
return [
|
|
34177
34432
|
NEWLINE,
|
|
34178
|
-
|
|
34433
|
+
deferred ? `deferredApplyVShows.push(() => ` : void 0,
|
|
34434
|
+
...genCall(context.helper("applyVShow"), `n${element}`, [
|
|
34179
34435
|
`() => (`,
|
|
34180
34436
|
...genExpression(oper.dir.exp, context),
|
|
34181
34437
|
`)`
|
|
34182
|
-
])
|
|
34438
|
+
]),
|
|
34439
|
+
deferred ? `)` : void 0
|
|
34183
34440
|
];
|
|
34184
34441
|
}
|
|
34185
34442
|
|
|
@@ -34318,8 +34575,14 @@ function genCreateComponent(operation, context) {
|
|
|
34318
34575
|
} else if (operation.asset) {
|
|
34319
34576
|
return toValidAssetId(operation.tag, "component");
|
|
34320
34577
|
} else {
|
|
34578
|
+
const { tag: tag2 } = operation;
|
|
34579
|
+
const builtInTag = isBuiltInComponent(tag2);
|
|
34580
|
+
if (builtInTag) {
|
|
34581
|
+
helper(builtInTag);
|
|
34582
|
+
return `_${builtInTag}`;
|
|
34583
|
+
}
|
|
34321
34584
|
return genExpression(
|
|
34322
|
-
extend(createSimpleExpression(
|
|
34585
|
+
extend(createSimpleExpression(tag2, false), { ast: null }),
|
|
34323
34586
|
context
|
|
34324
34587
|
);
|
|
34325
34588
|
}
|
|
@@ -34343,7 +34606,10 @@ function processInlineHandlers(props, context) {
|
|
|
34343
34606
|
prop.values.forEach((value, i2) => {
|
|
34344
34607
|
const isMemberExp = isMemberExpression$1(value, context.options);
|
|
34345
34608
|
if (!isMemberExp) {
|
|
34346
|
-
const name = getUniqueHandlerName(
|
|
34609
|
+
const name = getUniqueHandlerName(
|
|
34610
|
+
context,
|
|
34611
|
+
`_on_${prop.key.content.replace(/-/g, "_")}`
|
|
34612
|
+
);
|
|
34347
34613
|
handlers.push({ name, value });
|
|
34348
34614
|
ids[name] = null;
|
|
34349
34615
|
prop.values[i2] = extend({ ast: null }, createSimpleExpression(name));
|
|
@@ -34410,7 +34676,7 @@ function genProp(prop, context, isStatic) {
|
|
|
34410
34676
|
...prop.handler ? genEventHandler(
|
|
34411
34677
|
context,
|
|
34412
34678
|
prop.values[0],
|
|
34413
|
-
|
|
34679
|
+
prop.handlerModifiers,
|
|
34414
34680
|
true
|
|
34415
34681
|
) : isStatic ? ["() => (", ...values, ")"] : values,
|
|
34416
34682
|
...prop.model ? [...genModelEvent(prop, context), ...genModelModifiers(prop, context)] : []
|
|
@@ -34542,7 +34808,7 @@ function genSlotBlockWithProps(oper, context) {
|
|
|
34542
34808
|
let propsName;
|
|
34543
34809
|
let exitScope;
|
|
34544
34810
|
let depth;
|
|
34545
|
-
const { props } = oper;
|
|
34811
|
+
const { props, key, node } = oper;
|
|
34546
34812
|
const idsOfProps = /* @__PURE__ */ new Set();
|
|
34547
34813
|
if (props) {
|
|
34548
34814
|
rawProps = props.content;
|
|
@@ -34564,17 +34830,39 @@ function genSlotBlockWithProps(oper, context) {
|
|
|
34564
34830
|
idsOfProps.forEach(
|
|
34565
34831
|
(id) => idMap[id] = isDestructureAssignment ? `${propsName}[${JSON.stringify(id)}]` : null
|
|
34566
34832
|
);
|
|
34567
|
-
|
|
34833
|
+
let blockFn = context.withId(
|
|
34568
34834
|
() => genBlock(oper, context, [propsName]),
|
|
34569
34835
|
idMap
|
|
34570
34836
|
);
|
|
34571
34837
|
exitScope && exitScope();
|
|
34838
|
+
if (key) {
|
|
34839
|
+
blockFn = [
|
|
34840
|
+
`() => {`,
|
|
34841
|
+
INDENT_START,
|
|
34842
|
+
NEWLINE,
|
|
34843
|
+
`return `,
|
|
34844
|
+
...genCall(
|
|
34845
|
+
context.helper("createKeyedFragment"),
|
|
34846
|
+
[`() => `, ...genExpression(key, context)],
|
|
34847
|
+
blockFn
|
|
34848
|
+
),
|
|
34849
|
+
INDENT_END,
|
|
34850
|
+
NEWLINE,
|
|
34851
|
+
`}`
|
|
34852
|
+
];
|
|
34853
|
+
}
|
|
34854
|
+
if (node.type === 1 && // Not a real component
|
|
34855
|
+
!isTeleportTag(node.tag) && // Needs to determine whether to activate/deactivate based on instance.parent being KeepAlive
|
|
34856
|
+
!isKeepAliveTag(node.tag) && // Slot updates need to trigger TransitionGroup's onBeforeUpdate/onUpdated hook
|
|
34857
|
+
!isTransitionGroupTag(node.tag)) {
|
|
34858
|
+
blockFn = [`${context.helper("withVaporCtx")}(`, ...blockFn, `)`];
|
|
34859
|
+
}
|
|
34572
34860
|
return blockFn;
|
|
34573
34861
|
}
|
|
34574
34862
|
|
|
34575
34863
|
function genSlotOutlet(oper, context) {
|
|
34576
34864
|
const { helper } = context;
|
|
34577
|
-
const { id, name, fallback } = oper;
|
|
34865
|
+
const { id, name, fallback, noSlotted } = oper;
|
|
34578
34866
|
const [frag, push] = buildCodeFragment();
|
|
34579
34867
|
const nameExpr = name.isStatic ? genExpression(name, context) : ["() => (", ...genExpression(name, context), ")"];
|
|
34580
34868
|
let fallbackArg;
|
|
@@ -34588,7 +34876,11 @@ function genSlotOutlet(oper, context) {
|
|
|
34588
34876
|
helper("createSlot"),
|
|
34589
34877
|
nameExpr,
|
|
34590
34878
|
genRawProps(oper.props, context) || "null",
|
|
34591
|
-
fallbackArg
|
|
34879
|
+
fallbackArg,
|
|
34880
|
+
noSlotted && "undefined",
|
|
34881
|
+
// instance
|
|
34882
|
+
noSlotted && "true"
|
|
34883
|
+
// noSlotted
|
|
34592
34884
|
)
|
|
34593
34885
|
);
|
|
34594
34886
|
return frag;
|
|
@@ -34704,12 +34996,18 @@ function genEffect({ operations }, context) {
|
|
|
34704
34996
|
return frag;
|
|
34705
34997
|
}
|
|
34706
34998
|
function genInsertionState(operation, context) {
|
|
34999
|
+
const { parent, anchor, append, last } = operation;
|
|
34707
35000
|
return [
|
|
34708
35001
|
NEWLINE,
|
|
34709
35002
|
...genCall(
|
|
34710
35003
|
context.helper("setInsertionState"),
|
|
34711
|
-
`n${
|
|
34712
|
-
|
|
35004
|
+
`n${parent}`,
|
|
35005
|
+
anchor == null ? void 0 : anchor === -1 ? `0` : append ? (
|
|
35006
|
+
// null or anchor > 0 for append
|
|
35007
|
+
// anchor > 0 is the logical index of append node - used for locate node during hydration
|
|
35008
|
+
anchor === 0 ? "null" : `${anchor}`
|
|
35009
|
+
) : `n${anchor}`,
|
|
35010
|
+
last && "true"
|
|
34713
35011
|
)
|
|
34714
35012
|
];
|
|
34715
35013
|
}
|
|
@@ -34724,7 +35022,7 @@ function genTemplates(templates, rootIndex, { helper }) {
|
|
|
34724
35022
|
}
|
|
34725
35023
|
function genSelf(dynamic, context) {
|
|
34726
35024
|
const [frag, push] = buildCodeFragment();
|
|
34727
|
-
const { id, template, operation } = dynamic;
|
|
35025
|
+
const { id, template, operation, hasDynamicChild } = dynamic;
|
|
34728
35026
|
if (id !== void 0 && template !== void 0) {
|
|
34729
35027
|
push(NEWLINE, `const n${id} = t${template}()`);
|
|
34730
35028
|
push(...genDirectivesForElement(id, context));
|
|
@@ -34732,6 +35030,9 @@ function genSelf(dynamic, context) {
|
|
|
34732
35030
|
if (operation) {
|
|
34733
35031
|
push(...genOperationWithInsertionState(operation, context));
|
|
34734
35032
|
}
|
|
35033
|
+
if (hasDynamicChild) {
|
|
35034
|
+
push(...genChildren(dynamic, context, push, `n${id}`));
|
|
35035
|
+
}
|
|
34735
35036
|
return frag;
|
|
34736
35037
|
}
|
|
34737
35038
|
function genChildren(dynamic, context, pushBlock, from = `n${dynamic.id}`) {
|
|
@@ -34740,51 +35041,65 @@ function genChildren(dynamic, context, pushBlock, from = `n${dynamic.id}`) {
|
|
|
34740
35041
|
const { children } = dynamic;
|
|
34741
35042
|
let offset = 0;
|
|
34742
35043
|
let prev;
|
|
34743
|
-
|
|
35044
|
+
let ifBranchCount = 0;
|
|
35045
|
+
let prependCount = 0;
|
|
34744
35046
|
for (const [index, child] of children.entries()) {
|
|
35047
|
+
if (child.operation && child.operation.anchor === -1) {
|
|
35048
|
+
prependCount++;
|
|
35049
|
+
}
|
|
34745
35050
|
if (child.flags & 2) {
|
|
34746
35051
|
offset--;
|
|
35052
|
+
} else if (child.ifBranch) {
|
|
35053
|
+
ifBranchCount++;
|
|
34747
35054
|
}
|
|
34748
35055
|
const id = child.flags & 1 ? child.flags & 4 ? child.anchor : child.id : void 0;
|
|
34749
35056
|
if (id === void 0 && !child.hasDynamicChild) {
|
|
34750
35057
|
push(...genSelf(child, context));
|
|
34751
35058
|
continue;
|
|
34752
35059
|
}
|
|
34753
|
-
const elementIndex =
|
|
35060
|
+
const elementIndex = index + offset;
|
|
35061
|
+
const logicalIndex = elementIndex - ifBranchCount + prependCount;
|
|
34754
35062
|
const variable = id === void 0 ? `p${context.block.tempId++}` : `n${id}`;
|
|
34755
35063
|
pushBlock(NEWLINE, `const ${variable} = `);
|
|
34756
35064
|
if (prev) {
|
|
34757
35065
|
if (elementIndex - prev[1] === 1) {
|
|
34758
|
-
pushBlock(...genCall(helper("next"), prev[0]));
|
|
35066
|
+
pushBlock(...genCall(helper("next"), prev[0], String(logicalIndex)));
|
|
34759
35067
|
} else {
|
|
34760
|
-
pushBlock(
|
|
35068
|
+
pushBlock(
|
|
35069
|
+
...genCall(
|
|
35070
|
+
helper("nthChild"),
|
|
35071
|
+
from,
|
|
35072
|
+
String(elementIndex),
|
|
35073
|
+
String(logicalIndex)
|
|
35074
|
+
)
|
|
35075
|
+
);
|
|
34761
35076
|
}
|
|
34762
35077
|
} else {
|
|
34763
35078
|
if (elementIndex === 0) {
|
|
34764
|
-
pushBlock(...genCall(helper("child"), from));
|
|
35079
|
+
pushBlock(...genCall(helper("child"), from, String(logicalIndex)));
|
|
34765
35080
|
} else {
|
|
34766
35081
|
let init = genCall(helper("child"), from);
|
|
34767
35082
|
if (elementIndex === 1) {
|
|
34768
|
-
init = genCall(helper("next"), init);
|
|
35083
|
+
init = genCall(helper("next"), init, String(logicalIndex));
|
|
34769
35084
|
} else if (elementIndex > 1) {
|
|
34770
|
-
init = genCall(
|
|
35085
|
+
init = genCall(
|
|
35086
|
+
helper("nthChild"),
|
|
35087
|
+
from,
|
|
35088
|
+
String(elementIndex),
|
|
35089
|
+
String(logicalIndex)
|
|
35090
|
+
);
|
|
34771
35091
|
}
|
|
34772
35092
|
pushBlock(...init);
|
|
34773
35093
|
}
|
|
34774
35094
|
}
|
|
34775
|
-
if (id === child.anchor) {
|
|
35095
|
+
if (id === child.anchor && !child.hasDynamicChild) {
|
|
34776
35096
|
push(...genSelf(child, context));
|
|
34777
35097
|
}
|
|
34778
35098
|
if (id !== void 0) {
|
|
34779
35099
|
push(...genDirectivesForElement(id, context));
|
|
34780
35100
|
}
|
|
34781
35101
|
prev = [variable, elementIndex];
|
|
34782
|
-
|
|
34783
|
-
}
|
|
34784
|
-
if (childrenToGen.length) {
|
|
34785
|
-
for (const [child, from2] of childrenToGen) {
|
|
34786
|
-
push(...genChildren(child, context, pushBlock, from2));
|
|
34787
|
-
}
|
|
35102
|
+
push(...genChildren(child, context, pushBlock, variable));
|
|
34788
35103
|
}
|
|
34789
35104
|
return frag;
|
|
34790
35105
|
}
|
|
@@ -34803,8 +35118,11 @@ function genBlock(oper, context, args = [], root) {
|
|
|
34803
35118
|
}
|
|
34804
35119
|
function genBlockContent(block, context, root, genEffectsExtraFrag) {
|
|
34805
35120
|
const [frag, push] = buildCodeFragment();
|
|
34806
|
-
const { dynamic, effect, operation, returns } = block;
|
|
35121
|
+
const { dynamic, effect, operation, returns, key } = block;
|
|
34807
35122
|
const resetBlock = context.enterBlock(block);
|
|
35123
|
+
if (block.hasDeferredVShow) {
|
|
35124
|
+
push(NEWLINE, `const deferredApplyVShows = []`);
|
|
35125
|
+
}
|
|
34808
35126
|
if (root) {
|
|
34809
35127
|
for (let name of context.ir.component) {
|
|
34810
35128
|
const id = toValidAssetId(name, "component");
|
|
@@ -34827,10 +35145,21 @@ function genBlockContent(block, context, root, genEffectsExtraFrag) {
|
|
|
34827
35145
|
push(...genSelf(child, context));
|
|
34828
35146
|
}
|
|
34829
35147
|
for (const child of dynamic.children) {
|
|
34830
|
-
|
|
35148
|
+
if (!child.hasDynamicChild) {
|
|
35149
|
+
push(...genChildren(child, context, push, `n${child.id}`));
|
|
35150
|
+
}
|
|
34831
35151
|
}
|
|
34832
35152
|
push(...genOperations(operation, context));
|
|
34833
35153
|
push(...genEffects(effect, context, genEffectsExtraFrag));
|
|
35154
|
+
if (block.hasDeferredVShow) {
|
|
35155
|
+
push(NEWLINE, `deferredApplyVShows.forEach(fn => fn())`);
|
|
35156
|
+
}
|
|
35157
|
+
if (dynamic.needsKey) {
|
|
35158
|
+
for (const child of dynamic.children) {
|
|
35159
|
+
const keyValue = key ? genExpression(key, context) : JSON.stringify(child.id);
|
|
35160
|
+
push(NEWLINE, `n${child.id}.$key = `, ...keyValue);
|
|
35161
|
+
}
|
|
35162
|
+
}
|
|
34834
35163
|
push(NEWLINE, `return `);
|
|
34835
35164
|
const returnNodes = returns.map((n) => `n${n}`);
|
|
34836
35165
|
const returnsCode = returnNodes.length > 1 ? genMulti(DELIMITERS_ARRAY, ...returnNodes) : [returnNodes[0] || "null"];
|
|
@@ -34989,15 +35318,17 @@ const transformChildren = (node, context) => {
|
|
|
34989
35318
|
};
|
|
34990
35319
|
function processDynamicChildren(context) {
|
|
34991
35320
|
let prevDynamics = [];
|
|
34992
|
-
let
|
|
35321
|
+
let staticCount = 0;
|
|
35322
|
+
let dynamicCount = 0;
|
|
35323
|
+
let lastInsertionChild;
|
|
34993
35324
|
const children = context.dynamic.children;
|
|
34994
35325
|
for (const [index, child] of children.entries()) {
|
|
34995
35326
|
if (child.flags & 4) {
|
|
34996
|
-
prevDynamics.push(child);
|
|
35327
|
+
prevDynamics.push(lastInsertionChild = child);
|
|
34997
35328
|
}
|
|
34998
35329
|
if (!(child.flags & 2)) {
|
|
34999
35330
|
if (prevDynamics.length) {
|
|
35000
|
-
if (
|
|
35331
|
+
if (staticCount) {
|
|
35001
35332
|
context.childrenTemplate[index - prevDynamics.length] = `<!>`;
|
|
35002
35333
|
prevDynamics[0].flags -= 2;
|
|
35003
35334
|
const anchor = prevDynamics[0].anchor = context.increaseId();
|
|
@@ -35010,27 +35341,38 @@ function processDynamicChildren(context) {
|
|
|
35010
35341
|
/* prepend */
|
|
35011
35342
|
);
|
|
35012
35343
|
}
|
|
35344
|
+
dynamicCount += prevDynamics.length;
|
|
35013
35345
|
prevDynamics = [];
|
|
35014
35346
|
}
|
|
35015
|
-
|
|
35347
|
+
staticCount++;
|
|
35016
35348
|
}
|
|
35017
35349
|
}
|
|
35018
35350
|
if (prevDynamics.length) {
|
|
35019
|
-
registerInsertion(
|
|
35351
|
+
registerInsertion(
|
|
35352
|
+
prevDynamics,
|
|
35353
|
+
context,
|
|
35354
|
+
// the logical index of append child
|
|
35355
|
+
dynamicCount + staticCount,
|
|
35356
|
+
true
|
|
35357
|
+
);
|
|
35358
|
+
}
|
|
35359
|
+
if (lastInsertionChild && lastInsertionChild.operation) {
|
|
35360
|
+
lastInsertionChild.operation.last = true;
|
|
35020
35361
|
}
|
|
35021
35362
|
}
|
|
35022
|
-
function registerInsertion(dynamics, context, anchor) {
|
|
35363
|
+
function registerInsertion(dynamics, context, anchor, append) {
|
|
35023
35364
|
for (const child of dynamics) {
|
|
35024
35365
|
if (child.template != null) {
|
|
35025
35366
|
context.registerOperation({
|
|
35026
35367
|
type: 9,
|
|
35027
35368
|
elements: dynamics.map((child2) => child2.id),
|
|
35028
35369
|
parent: context.reference(),
|
|
35029
|
-
anchor
|
|
35370
|
+
anchor: append ? void 0 : anchor
|
|
35030
35371
|
});
|
|
35031
35372
|
} else if (child.operation && isBlockOperation(child.operation)) {
|
|
35032
35373
|
child.operation.parent = context.reference();
|
|
35033
35374
|
child.operation.anchor = anchor;
|
|
35375
|
+
child.operation.append = append;
|
|
35034
35376
|
}
|
|
35035
35377
|
}
|
|
35036
35378
|
}
|
|
@@ -35098,6 +35440,11 @@ function transformComponentElement(node, propsResult, singleRoot, context, isDyn
|
|
|
35098
35440
|
tag = fromSetup;
|
|
35099
35441
|
asset = false;
|
|
35100
35442
|
}
|
|
35443
|
+
const builtInTag = isBuiltInComponent(tag);
|
|
35444
|
+
if (builtInTag) {
|
|
35445
|
+
tag = builtInTag;
|
|
35446
|
+
asset = false;
|
|
35447
|
+
}
|
|
35101
35448
|
const dotIndex = tag.indexOf(".");
|
|
35102
35449
|
if (dotIndex > 0) {
|
|
35103
35450
|
const ns = resolveSetupReference(tag.slice(0, dotIndex), context);
|
|
@@ -35154,6 +35501,7 @@ function resolveSetupReference(name, context) {
|
|
|
35154
35501
|
const PascalName = capitalize(camelName);
|
|
35155
35502
|
return bindings[name] ? name : bindings[camelName] ? camelName : bindings[PascalName] ? PascalName : void 0;
|
|
35156
35503
|
}
|
|
35504
|
+
const dynamicKeys = ["indeterminate"];
|
|
35157
35505
|
function transformNativeElement(node, propsResult, singleRoot, context, getEffectIndex) {
|
|
35158
35506
|
const { tag } = node;
|
|
35159
35507
|
const { scopeId } = context.options;
|
|
@@ -35176,7 +35524,7 @@ function transformNativeElement(node, propsResult, singleRoot, context, getEffec
|
|
|
35176
35524
|
} else {
|
|
35177
35525
|
for (const prop of propsResult[1]) {
|
|
35178
35526
|
const { key, values } = prop;
|
|
35179
|
-
if (key.isStatic && values.length === 1 && values[0].isStatic) {
|
|
35527
|
+
if (key.isStatic && values.length === 1 && values[0].isStatic && !dynamicKeys.includes(key.content)) {
|
|
35180
35528
|
template += ` ${key.content}`;
|
|
35181
35529
|
if (values[0].content) template += `="${values[0].content}"`;
|
|
35182
35530
|
} else {
|
|
@@ -35332,7 +35680,7 @@ function dedupeProperties(results) {
|
|
|
35332
35680
|
}
|
|
35333
35681
|
const name = prop.key.content;
|
|
35334
35682
|
const existing = knownProps.get(name);
|
|
35335
|
-
if (existing) {
|
|
35683
|
+
if (existing && existing.handler === prop.handler) {
|
|
35336
35684
|
if (name === "style" || name === "class") {
|
|
35337
35685
|
mergePropValues(existing, prop);
|
|
35338
35686
|
}
|
|
@@ -35374,7 +35722,8 @@ const transformVHtml = (dir, node, context) => {
|
|
|
35374
35722
|
context.registerEffect([exp], {
|
|
35375
35723
|
type: 7,
|
|
35376
35724
|
element: context.reference(),
|
|
35377
|
-
value: exp
|
|
35725
|
+
value: exp,
|
|
35726
|
+
isComponent: node.tagType === 1
|
|
35378
35727
|
});
|
|
35379
35728
|
};
|
|
35380
35729
|
|
|
@@ -35400,15 +35749,19 @@ const transformVText = (dir, node, context) => {
|
|
|
35400
35749
|
context.childrenTemplate = [String(literal)];
|
|
35401
35750
|
} else {
|
|
35402
35751
|
context.childrenTemplate = [" "];
|
|
35403
|
-
|
|
35404
|
-
|
|
35405
|
-
|
|
35406
|
-
|
|
35752
|
+
const isComponent = node.tagType === 1;
|
|
35753
|
+
if (!isComponent) {
|
|
35754
|
+
context.registerOperation({
|
|
35755
|
+
type: 17,
|
|
35756
|
+
parent: context.reference()
|
|
35757
|
+
});
|
|
35758
|
+
}
|
|
35407
35759
|
context.registerEffect([exp], {
|
|
35408
35760
|
type: 4,
|
|
35409
35761
|
element: context.reference(),
|
|
35410
35762
|
values: [exp],
|
|
35411
|
-
generated: true
|
|
35763
|
+
generated: true,
|
|
35764
|
+
isComponent
|
|
35412
35765
|
});
|
|
35413
35766
|
}
|
|
35414
35767
|
};
|
|
@@ -35498,7 +35851,11 @@ const transformVOn = (dir, node, context) => {
|
|
|
35498
35851
|
key: arg,
|
|
35499
35852
|
value: handler,
|
|
35500
35853
|
handler: true,
|
|
35501
|
-
handlerModifiers:
|
|
35854
|
+
handlerModifiers: {
|
|
35855
|
+
keys: keyModifiers,
|
|
35856
|
+
nonKeys: nonKeyModifiers,
|
|
35857
|
+
options: eventOptionModifiers
|
|
35858
|
+
}
|
|
35502
35859
|
};
|
|
35503
35860
|
}
|
|
35504
35861
|
const delegate = arg.isStatic && !eventOptionModifiers.length && delegatedEvents(arg.content);
|
|
@@ -35536,12 +35893,21 @@ const transformVShow = (dir, node, context) => {
|
|
|
35536
35893
|
);
|
|
35537
35894
|
return;
|
|
35538
35895
|
}
|
|
35896
|
+
let shouldDeferred = false;
|
|
35897
|
+
const parentNode = context.parent && context.parent.node;
|
|
35898
|
+
if (parentNode && parentNode.type === 1) {
|
|
35899
|
+
shouldDeferred = !!(isTransitionTag(parentNode.tag) && findProp(parentNode, "appear", false, true));
|
|
35900
|
+
if (shouldDeferred) {
|
|
35901
|
+
context.parent.parent.block.hasDeferredVShow = true;
|
|
35902
|
+
}
|
|
35903
|
+
}
|
|
35539
35904
|
context.registerOperation({
|
|
35540
35905
|
type: 13,
|
|
35541
35906
|
element: context.reference(),
|
|
35542
35907
|
dir,
|
|
35543
35908
|
name: "show",
|
|
35544
|
-
builtin: true
|
|
35909
|
+
builtin: true,
|
|
35910
|
+
deferred: shouldDeferred
|
|
35545
35911
|
});
|
|
35546
35912
|
};
|
|
35547
35913
|
|
|
@@ -35611,7 +35977,7 @@ const transformText = (node, context) => {
|
|
|
35611
35977
|
} else if (node.type === 5) {
|
|
35612
35978
|
processInterpolation(context);
|
|
35613
35979
|
} else if (node.type === 2) {
|
|
35614
|
-
context.template += node.content;
|
|
35980
|
+
context.template += escapeHtml(node.content);
|
|
35615
35981
|
}
|
|
35616
35982
|
};
|
|
35617
35983
|
function processInterpolation(context) {
|
|
@@ -35655,7 +36021,7 @@ function processTextContainer(children, context) {
|
|
|
35655
36021
|
const values = processTextLikeChildren(children, context);
|
|
35656
36022
|
const literals = values.map(getLiteralExpressionValue);
|
|
35657
36023
|
if (literals.every((l) => l != null)) {
|
|
35658
|
-
context.childrenTemplate = literals.map((l) => String(l));
|
|
36024
|
+
context.childrenTemplate = literals.map((l) => escapeHtml(String(l)));
|
|
35659
36025
|
} else {
|
|
35660
36026
|
context.childrenTemplate = [" "];
|
|
35661
36027
|
context.registerOperation({
|
|
@@ -35806,7 +36172,7 @@ const transformComment = (node, context) => {
|
|
|
35806
36172
|
context.comment.push(node);
|
|
35807
36173
|
context.dynamic.flags |= 2;
|
|
35808
36174
|
} else {
|
|
35809
|
-
context.template += `<!--${node.content}-->`;
|
|
36175
|
+
context.template += `<!--${escapeHtml(node.content)}-->`;
|
|
35810
36176
|
}
|
|
35811
36177
|
};
|
|
35812
36178
|
function getSiblingIf(context, reverse) {
|
|
@@ -35860,6 +36226,7 @@ function processIf(node, dir, context) {
|
|
|
35860
36226
|
};
|
|
35861
36227
|
} else {
|
|
35862
36228
|
const siblingIf = getSiblingIf(context, true);
|
|
36229
|
+
context.dynamic.ifBranch = true;
|
|
35863
36230
|
const siblings = context.parent && context.parent.dynamic.children;
|
|
35864
36231
|
let lastIfNode;
|
|
35865
36232
|
if (siblings) {
|
|
@@ -35916,6 +36283,7 @@ function createIfBranch(node, context) {
|
|
|
35916
36283
|
const branch = newBlock(node);
|
|
35917
36284
|
const exitBlock = context.enterBlock(branch);
|
|
35918
36285
|
context.reference();
|
|
36286
|
+
branch.dynamic.needsKey = isInTransition(context);
|
|
35919
36287
|
return [branch, exitBlock];
|
|
35920
36288
|
}
|
|
35921
36289
|
|
|
@@ -35940,7 +36308,8 @@ function processFor(node, dir, context) {
|
|
|
35940
36308
|
const { source, value, key, index } = parseResult;
|
|
35941
36309
|
const keyProp = findProp(node, "key");
|
|
35942
36310
|
const keyProperty = keyProp && propToExpression(keyProp);
|
|
35943
|
-
const isComponent = node.tagType === 1
|
|
36311
|
+
const isComponent = node.tagType === 1 || // template v-for with a single component child
|
|
36312
|
+
isTemplateWithSingleComponent(node);
|
|
35944
36313
|
context.node = node = wrapTemplate(node, ["for"]);
|
|
35945
36314
|
context.dynamic.flags |= 2 | 4;
|
|
35946
36315
|
const id = context.reference();
|
|
@@ -35969,6 +36338,13 @@ function processFor(node, dir, context) {
|
|
|
35969
36338
|
};
|
|
35970
36339
|
};
|
|
35971
36340
|
}
|
|
36341
|
+
function isTemplateWithSingleComponent(node) {
|
|
36342
|
+
if (node.tag !== "template") return false;
|
|
36343
|
+
const nonCommentChildren = node.children.filter(
|
|
36344
|
+
(c) => c.type !== 3
|
|
36345
|
+
);
|
|
36346
|
+
return nonCommentChildren.length === 1 && nonCommentChildren[0].type === 1 && nonCommentChildren[0].tagType === 1;
|
|
36347
|
+
}
|
|
35972
36348
|
|
|
35973
36349
|
const transformSlotOutlet = (node, context) => {
|
|
35974
36350
|
if (node.type !== 1 || node.tag !== "slot") {
|
|
@@ -36042,7 +36418,8 @@ const transformSlotOutlet = (node, context) => {
|
|
|
36042
36418
|
id,
|
|
36043
36419
|
name: slotName,
|
|
36044
36420
|
props: irProps,
|
|
36045
|
-
fallback
|
|
36421
|
+
fallback,
|
|
36422
|
+
noSlotted: !!(context.options.scopeId && !context.options.slotted)
|
|
36046
36423
|
};
|
|
36047
36424
|
};
|
|
36048
36425
|
};
|
|
@@ -36104,7 +36481,22 @@ function transformComponentSlot(node, dir, context) {
|
|
|
36104
36481
|
markNonTemplate(n, context);
|
|
36105
36482
|
});
|
|
36106
36483
|
}
|
|
36107
|
-
|
|
36484
|
+
let slotKey;
|
|
36485
|
+
if (isTransitionNode(node) && nonSlotTemplateChildren.length) {
|
|
36486
|
+
const nonCommentChild = nonSlotTemplateChildren.find(
|
|
36487
|
+
(n) => n.type !== 3
|
|
36488
|
+
);
|
|
36489
|
+
if (nonCommentChild) {
|
|
36490
|
+
const keyProp = findProp(
|
|
36491
|
+
nonCommentChild,
|
|
36492
|
+
"key"
|
|
36493
|
+
);
|
|
36494
|
+
if (keyProp) {
|
|
36495
|
+
slotKey = keyProp.exp;
|
|
36496
|
+
}
|
|
36497
|
+
}
|
|
36498
|
+
}
|
|
36499
|
+
const [block, onExit] = createSlotBlock(node, dir, context, slotKey);
|
|
36108
36500
|
const { slots } = context;
|
|
36109
36501
|
return () => {
|
|
36110
36502
|
onExit();
|
|
@@ -36238,9 +36630,13 @@ function hasStaticSlot(slots, name) {
|
|
|
36238
36630
|
if (slot.slotType === 0) return !!slot.slots[name];
|
|
36239
36631
|
});
|
|
36240
36632
|
}
|
|
36241
|
-
function createSlotBlock(slotNode, dir, context) {
|
|
36633
|
+
function createSlotBlock(slotNode, dir, context, key = void 0) {
|
|
36242
36634
|
const block = newBlock(slotNode);
|
|
36243
36635
|
block.props = dir && dir.exp;
|
|
36636
|
+
if (key) {
|
|
36637
|
+
block.key = key;
|
|
36638
|
+
block.dynamic.needsKey = true;
|
|
36639
|
+
}
|
|
36244
36640
|
const exitBlock = context.enterBlock(block);
|
|
36245
36641
|
return [block, exitBlock];
|
|
36246
36642
|
}
|
|
@@ -36249,6 +36645,37 @@ function isNonWhitespaceContent(node) {
|
|
|
36249
36645
|
return !!node.content.trim();
|
|
36250
36646
|
}
|
|
36251
36647
|
|
|
36648
|
+
const transformTransition = (node, context) => {
|
|
36649
|
+
if (node.type === 1 && node.tagType === 1) {
|
|
36650
|
+
if (isTransitionTag(node.tag)) {
|
|
36651
|
+
return postTransformTransition(
|
|
36652
|
+
node,
|
|
36653
|
+
context.options.onError,
|
|
36654
|
+
hasMultipleChildren
|
|
36655
|
+
);
|
|
36656
|
+
}
|
|
36657
|
+
}
|
|
36658
|
+
};
|
|
36659
|
+
function hasMultipleChildren(node) {
|
|
36660
|
+
const children = node.children = node.children.filter(
|
|
36661
|
+
(c) => c.type !== 3 && !(c.type === 2 && !c.content.trim())
|
|
36662
|
+
);
|
|
36663
|
+
const first = children[0];
|
|
36664
|
+
if (children.length === 1 && first.type === 1 && (findDir(first, "for") || isTemplateNode(first))) {
|
|
36665
|
+
return true;
|
|
36666
|
+
}
|
|
36667
|
+
const hasElse = (node2) => findDir(node2, "else-if") || findDir(node2, "else", true);
|
|
36668
|
+
if (children.every(
|
|
36669
|
+
(c, index) => c.type === 1 && // not template
|
|
36670
|
+
!isTemplateNode(c) && // not has v-for
|
|
36671
|
+
!findDir(c, "for") && // if the first child has v-if, the rest should also have v-else-if/v-else
|
|
36672
|
+
(index === 0 ? findDir(c, "if") : hasElse(c)) && !hasMultipleChildren(c)
|
|
36673
|
+
)) {
|
|
36674
|
+
return false;
|
|
36675
|
+
}
|
|
36676
|
+
return children.length > 1;
|
|
36677
|
+
}
|
|
36678
|
+
|
|
36252
36679
|
function compile(source, options = {}) {
|
|
36253
36680
|
const resolvedOptions = extend({}, options);
|
|
36254
36681
|
const ast = isString(source) ? parse(source, resolvedOptions) : source;
|
|
@@ -36267,6 +36694,7 @@ function compile(source, options = {}) {
|
|
|
36267
36694
|
extend({}, resolvedOptions, {
|
|
36268
36695
|
nodeTransforms: [
|
|
36269
36696
|
...nodeTransforms,
|
|
36697
|
+
...[transformTransition] ,
|
|
36270
36698
|
...options.nodeTransforms || []
|
|
36271
36699
|
// user transforms
|
|
36272
36700
|
],
|