@vue/compiler-sfc 3.6.0-alpha.1 → 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-sfc.cjs.js +226 -79
- package/dist/compiler-sfc.d.ts +1 -1
- package/dist/compiler-sfc.esm-browser.js +985 -474
- package/package.json +11 -11
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-sfc v3.6.0-alpha.
|
|
2
|
+
* @vue/compiler-sfc 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);
|
|
@@ -45,10 +44,10 @@ const isBuiltInDirective = /* @__PURE__ */ makeMap(
|
|
|
45
44
|
);
|
|
46
45
|
const cacheStringFunction = (fn) => {
|
|
47
46
|
const cache = /* @__PURE__ */ Object.create(null);
|
|
48
|
-
return (str) => {
|
|
47
|
+
return ((str) => {
|
|
49
48
|
const hit = cache[str];
|
|
50
49
|
return hit || (cache[str] = fn(str));
|
|
51
|
-
};
|
|
50
|
+
});
|
|
52
51
|
};
|
|
53
52
|
const camelizeRE = /-(\w)/g;
|
|
54
53
|
const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
|
|
@@ -271,6 +270,9 @@ function shouldSetAsAttr(tagName, key) {
|
|
|
271
270
|
if ((key === "width" || key === "height") && (tagName === "IMG" || tagName === "VIDEO" || tagName === "CANVAS" || tagName === "SOURCE")) {
|
|
272
271
|
return true;
|
|
273
272
|
}
|
|
273
|
+
if (key === "sandbox" && tagName === "IFRAME") {
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
274
276
|
return false;
|
|
275
277
|
}
|
|
276
278
|
|
|
@@ -2921,7 +2923,7 @@ function requireLib$2 () {
|
|
|
2921
2923
|
allowUndeclaredExports: false,
|
|
2922
2924
|
allowYieldOutsideFunction: false,
|
|
2923
2925
|
plugins: [],
|
|
2924
|
-
strictMode:
|
|
2926
|
+
strictMode: undefined,
|
|
2925
2927
|
ranges: false,
|
|
2926
2928
|
tokens: false,
|
|
2927
2929
|
createImportExpressions: false,
|
|
@@ -3109,7 +3111,6 @@ function requireLib$2 () {
|
|
|
3109
3111
|
}
|
|
3110
3112
|
convertPrivateNameToPrivateIdentifier(node) {
|
|
3111
3113
|
const name = super.getPrivateNameSV(node);
|
|
3112
|
-
node = node;
|
|
3113
3114
|
delete node.id;
|
|
3114
3115
|
node.name = name;
|
|
3115
3116
|
return this.castNodeTo(node, "PrivateIdentifier");
|
|
@@ -3224,8 +3225,8 @@ function requireLib$2 () {
|
|
|
3224
3225
|
node.kind = "init";
|
|
3225
3226
|
return this.finishNode(node, "Property");
|
|
3226
3227
|
}
|
|
3227
|
-
isValidLVal(type, isUnparenthesizedInAssign, binding) {
|
|
3228
|
-
return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding);
|
|
3228
|
+
isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) {
|
|
3229
|
+
return type === "Property" ? "value" : super.isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding);
|
|
3229
3230
|
}
|
|
3230
3231
|
isAssignable(node, isBinding) {
|
|
3231
3232
|
if (node != null && this.isObjectProperty(node)) {
|
|
@@ -3259,11 +3260,14 @@ function requireLib$2 () {
|
|
|
3259
3260
|
finishCallExpression(unfinished, optional) {
|
|
3260
3261
|
const node = super.finishCallExpression(unfinished, optional);
|
|
3261
3262
|
if (node.callee.type === "Import") {
|
|
3262
|
-
var _ref
|
|
3263
|
+
var _ref;
|
|
3263
3264
|
this.castNodeTo(node, "ImportExpression");
|
|
3264
3265
|
node.source = node.arguments[0];
|
|
3265
3266
|
node.options = (_ref = node.arguments[1]) != null ? _ref : null;
|
|
3266
|
-
|
|
3267
|
+
{
|
|
3268
|
+
var _ref2;
|
|
3269
|
+
node.attributes = (_ref2 = node.arguments[1]) != null ? _ref2 : null;
|
|
3270
|
+
}
|
|
3267
3271
|
delete node.arguments;
|
|
3268
3272
|
delete node.callee;
|
|
3269
3273
|
} else if (node.type === "OptionalCallExpression") {
|
|
@@ -3939,13 +3943,13 @@ function requireLib$2 () {
|
|
|
3939
3943
|
context.push(types.j_expr, types.j_oTag);
|
|
3940
3944
|
};
|
|
3941
3945
|
}
|
|
3942
|
-
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-\
|
|
3943
|
-
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-\
|
|
3946
|
+
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";
|
|
3947
|
+
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";
|
|
3944
3948
|
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
3945
3949
|
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
3946
3950
|
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
3947
|
-
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,
|
|
3948
|
-
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,
|
|
3951
|
+
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];
|
|
3952
|
+
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];
|
|
3949
3953
|
function isInAstralSet(code, set) {
|
|
3950
3954
|
let pos = 0x10000;
|
|
3951
3955
|
for (let i = 0, length = set.length; i < length; i += 2) {
|
|
@@ -4129,7 +4133,7 @@ function requireLib$2 () {
|
|
|
4129
4133
|
if (bindingType & 8) {
|
|
4130
4134
|
return scope.names.has(name);
|
|
4131
4135
|
}
|
|
4132
|
-
const type = scope.names.get(name);
|
|
4136
|
+
const type = scope.names.get(name) || 0;
|
|
4133
4137
|
if (bindingType & 16) {
|
|
4134
4138
|
return (type & 2) > 0 || !this.treatFunctionsAsVarInScope(scope) && (type & 1) > 0;
|
|
4135
4139
|
}
|
|
@@ -4444,9 +4448,8 @@ function requireLib$2 () {
|
|
|
4444
4448
|
return this.flowParseDeclareInterface(node);
|
|
4445
4449
|
} else if (this.match(82)) {
|
|
4446
4450
|
return this.flowParseDeclareExportDeclaration(node, insideModule);
|
|
4447
|
-
} else {
|
|
4448
|
-
this.unexpected();
|
|
4449
4451
|
}
|
|
4452
|
+
throw this.unexpected();
|
|
4450
4453
|
}
|
|
4451
4454
|
flowParseDeclareVariable(node) {
|
|
4452
4455
|
this.next();
|
|
@@ -4466,18 +4469,17 @@ function requireLib$2 () {
|
|
|
4466
4469
|
const body = bodyNode.body = [];
|
|
4467
4470
|
this.expect(5);
|
|
4468
4471
|
while (!this.match(8)) {
|
|
4469
|
-
|
|
4472
|
+
const bodyNode = this.startNode();
|
|
4470
4473
|
if (this.match(83)) {
|
|
4471
4474
|
this.next();
|
|
4472
4475
|
if (!this.isContextual(130) && !this.match(87)) {
|
|
4473
4476
|
this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc);
|
|
4474
4477
|
}
|
|
4475
|
-
super.parseImport(bodyNode);
|
|
4478
|
+
body.push(super.parseImport(bodyNode));
|
|
4476
4479
|
} else {
|
|
4477
4480
|
this.expectContextual(125, FlowErrors.UnsupportedStatementInDeclareModule);
|
|
4478
|
-
|
|
4481
|
+
body.push(this.flowParseDeclare(bodyNode, true));
|
|
4479
4482
|
}
|
|
4480
|
-
body.push(bodyNode);
|
|
4481
4483
|
}
|
|
4482
4484
|
this.scope.exit();
|
|
4483
4485
|
this.expect(8);
|
|
@@ -4538,7 +4540,7 @@ function requireLib$2 () {
|
|
|
4538
4540
|
}
|
|
4539
4541
|
}
|
|
4540
4542
|
}
|
|
4541
|
-
this.unexpected();
|
|
4543
|
+
throw this.unexpected();
|
|
4542
4544
|
}
|
|
4543
4545
|
flowParseDeclareModuleExports(node) {
|
|
4544
4546
|
this.next();
|
|
@@ -4746,7 +4748,7 @@ function requireLib$2 () {
|
|
|
4746
4748
|
return this.finishNode(node, "TypeParameterInstantiation");
|
|
4747
4749
|
}
|
|
4748
4750
|
flowParseTypeParameterInstantiationCallOrNew() {
|
|
4749
|
-
if (this.reScan_lt() !== 47) return;
|
|
4751
|
+
if (this.reScan_lt() !== 47) return null;
|
|
4750
4752
|
const node = this.startNode();
|
|
4751
4753
|
const oldInType = this.state.inType;
|
|
4752
4754
|
node.params = [];
|
|
@@ -5242,8 +5244,7 @@ function requireLib$2 () {
|
|
|
5242
5244
|
}
|
|
5243
5245
|
throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc);
|
|
5244
5246
|
}
|
|
5245
|
-
this.unexpected();
|
|
5246
|
-
return;
|
|
5247
|
+
throw this.unexpected();
|
|
5247
5248
|
case 135:
|
|
5248
5249
|
return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
|
|
5249
5250
|
case 136:
|
|
@@ -5274,7 +5275,7 @@ function requireLib$2 () {
|
|
|
5274
5275
|
return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier());
|
|
5275
5276
|
}
|
|
5276
5277
|
}
|
|
5277
|
-
this.unexpected();
|
|
5278
|
+
throw this.unexpected();
|
|
5278
5279
|
}
|
|
5279
5280
|
flowParsePostfixType() {
|
|
5280
5281
|
const startLoc = this.state.startLoc;
|
|
@@ -5735,15 +5736,15 @@ function requireLib$2 () {
|
|
|
5735
5736
|
}
|
|
5736
5737
|
return exprList;
|
|
5737
5738
|
}
|
|
5738
|
-
parseArrayLike(close,
|
|
5739
|
-
const node = super.parseArrayLike(close,
|
|
5740
|
-
if (
|
|
5739
|
+
parseArrayLike(close, isTuple, refExpressionErrors) {
|
|
5740
|
+
const node = super.parseArrayLike(close, isTuple, refExpressionErrors);
|
|
5741
|
+
if (refExpressionErrors != null && !this.state.maybeInArrowParameters) {
|
|
5741
5742
|
this.toReferencedList(node.elements);
|
|
5742
5743
|
}
|
|
5743
5744
|
return node;
|
|
5744
5745
|
}
|
|
5745
|
-
isValidLVal(type, isParenthesized, binding) {
|
|
5746
|
-
return type === "TypeCastExpression" || super.isValidLVal(type, isParenthesized, binding);
|
|
5746
|
+
isValidLVal(type, disallowCallExpression, isParenthesized, binding) {
|
|
5747
|
+
return type === "TypeCastExpression" || super.isValidLVal(type, disallowCallExpression, isParenthesized, binding);
|
|
5747
5748
|
}
|
|
5748
5749
|
parseClassProperty(node) {
|
|
5749
5750
|
if (this.match(14)) {
|
|
@@ -7592,10 +7593,8 @@ function requireLib$2 () {
|
|
|
7592
7593
|
setLeadingComments(commentWS.trailingNode, comments);
|
|
7593
7594
|
}
|
|
7594
7595
|
} else {
|
|
7595
|
-
const
|
|
7596
|
-
|
|
7597
|
-
start: commentStart
|
|
7598
|
-
} = commentWS;
|
|
7596
|
+
const node = commentWS.containingNode;
|
|
7597
|
+
const commentStart = commentWS.start;
|
|
7599
7598
|
if (this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) === 44) {
|
|
7600
7599
|
switch (node.type) {
|
|
7601
7600
|
case "ObjectExpression":
|
|
@@ -8416,7 +8415,7 @@ function requireLib$2 () {
|
|
|
8416
8415
|
const commentWhitespace = {
|
|
8417
8416
|
start: this.sourceToOffsetPos(spaceStart),
|
|
8418
8417
|
end: this.sourceToOffsetPos(end),
|
|
8419
|
-
comments,
|
|
8418
|
+
comments: comments,
|
|
8420
8419
|
leadingNode: null,
|
|
8421
8420
|
trailingNode: null,
|
|
8422
8421
|
containingNode: null
|
|
@@ -9427,7 +9426,7 @@ function requireLib$2 () {
|
|
|
9427
9426
|
};
|
|
9428
9427
|
}
|
|
9429
9428
|
return {
|
|
9430
|
-
node,
|
|
9429
|
+
node: node,
|
|
9431
9430
|
error: null,
|
|
9432
9431
|
thrown: false,
|
|
9433
9432
|
aborted: false,
|
|
@@ -9683,7 +9682,7 @@ function requireLib$2 () {
|
|
|
9683
9682
|
if (isLHS) {
|
|
9684
9683
|
if (parenthesized.type === "Identifier") {
|
|
9685
9684
|
this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, node);
|
|
9686
|
-
} else if (parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) {
|
|
9685
|
+
} else if (parenthesized.type !== "CallExpression" && parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) {
|
|
9687
9686
|
this.raise(Errors.InvalidParenthesizedAssignment, node);
|
|
9688
9687
|
}
|
|
9689
9688
|
} else {
|
|
@@ -9959,7 +9958,7 @@ function requireLib$2 () {
|
|
|
9959
9958
|
node.right = this.parseMaybeAssignAllowIn();
|
|
9960
9959
|
return this.finishNode(node, "AssignmentPattern");
|
|
9961
9960
|
}
|
|
9962
|
-
isValidLVal(type, isUnparenthesizedInAssign, binding) {
|
|
9961
|
+
isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) {
|
|
9963
9962
|
switch (type) {
|
|
9964
9963
|
case "AssignmentPattern":
|
|
9965
9964
|
return "left";
|
|
@@ -9975,13 +9974,17 @@ function requireLib$2 () {
|
|
|
9975
9974
|
return "properties";
|
|
9976
9975
|
case "VoidPattern":
|
|
9977
9976
|
return true;
|
|
9977
|
+
case "CallExpression":
|
|
9978
|
+
if (!disallowCallExpression && !this.state.strict && this.optionFlags & 8192) {
|
|
9979
|
+
return true;
|
|
9980
|
+
}
|
|
9978
9981
|
}
|
|
9979
9982
|
return false;
|
|
9980
9983
|
}
|
|
9981
9984
|
isOptionalMemberExpression(expression) {
|
|
9982
9985
|
return expression.type === "OptionalMemberExpression";
|
|
9983
9986
|
}
|
|
9984
|
-
checkLVal(expression, ancestor, binding = 64, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false) {
|
|
9987
|
+
checkLVal(expression, ancestor, binding = 64, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false, disallowCallExpression = false) {
|
|
9985
9988
|
var _expression$extra;
|
|
9986
9989
|
const type = expression.type;
|
|
9987
9990
|
if (this.isObjectMethod(expression)) return;
|
|
@@ -10016,7 +10019,9 @@ function requireLib$2 () {
|
|
|
10016
10019
|
} else if (type === "VoidPattern" && ancestor.type === "CatchClause") {
|
|
10017
10020
|
this.raise(Errors.VoidPatternCatchClauseParam, expression);
|
|
10018
10021
|
}
|
|
10019
|
-
const
|
|
10022
|
+
const unwrappedExpression = unwrapParenthesizedExpression(expression);
|
|
10023
|
+
disallowCallExpression || (disallowCallExpression = unwrappedExpression.type === "CallExpression" && (unwrappedExpression.callee.type === "Import" || unwrappedExpression.callee.type === "Super"));
|
|
10024
|
+
const validity = this.isValidLVal(type, disallowCallExpression, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding);
|
|
10020
10025
|
if (validity === true) return;
|
|
10021
10026
|
if (validity === false) {
|
|
10022
10027
|
const ParseErrorClass = binding === 64 ? Errors.InvalidLhs : Errors.InvalidLhsBinding;
|
|
@@ -10039,11 +10044,11 @@ function requireLib$2 () {
|
|
|
10039
10044
|
if (Array.isArray(val)) {
|
|
10040
10045
|
for (const child of val) {
|
|
10041
10046
|
if (child) {
|
|
10042
|
-
this.checkLVal(child, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression);
|
|
10047
|
+
this.checkLVal(child, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression, true);
|
|
10043
10048
|
}
|
|
10044
10049
|
}
|
|
10045
10050
|
} else if (val) {
|
|
10046
|
-
this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression);
|
|
10051
|
+
this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression, disallowCallExpression);
|
|
10047
10052
|
}
|
|
10048
10053
|
}
|
|
10049
10054
|
checkIdentifier(at, bindingType, strictModeChanged = false) {
|
|
@@ -10091,6 +10096,7 @@ function requireLib$2 () {
|
|
|
10091
10096
|
return true;
|
|
10092
10097
|
}
|
|
10093
10098
|
}
|
|
10099
|
+
const keywordAndTSRelationalOperator = /in(?:stanceof)?|as|satisfies/y;
|
|
10094
10100
|
function nonNull(x) {
|
|
10095
10101
|
if (x == null) {
|
|
10096
10102
|
throw new Error(`Unexpected ${x} value.`);
|
|
@@ -10474,6 +10480,7 @@ function requireLib$2 () {
|
|
|
10474
10480
|
this.expect(14);
|
|
10475
10481
|
withProperty.value = this.tsParseImportTypeWithPropertyValue();
|
|
10476
10482
|
node.properties = [this.finishObjectProperty(withProperty)];
|
|
10483
|
+
this.eat(12);
|
|
10477
10484
|
this.expect(8);
|
|
10478
10485
|
return this.finishNode(node, "ObjectExpression");
|
|
10479
10486
|
}
|
|
@@ -10977,7 +10984,7 @@ function requireLib$2 () {
|
|
|
10977
10984
|
}
|
|
10978
10985
|
}
|
|
10979
10986
|
}
|
|
10980
|
-
this.unexpected();
|
|
10987
|
+
throw this.unexpected();
|
|
10981
10988
|
}
|
|
10982
10989
|
tsParseArrayTypeOrHigher() {
|
|
10983
10990
|
const {
|
|
@@ -11541,52 +11548,22 @@ function requireLib$2 () {
|
|
|
11541
11548
|
}
|
|
11542
11549
|
default:
|
|
11543
11550
|
if (tokenIsIdentifier(startType)) {
|
|
11544
|
-
return this.tsParseDeclaration(node, this.state.
|
|
11551
|
+
return this.tsParseDeclaration(node, this.state.type, true, null);
|
|
11545
11552
|
}
|
|
11546
11553
|
}
|
|
11547
11554
|
});
|
|
11548
11555
|
}
|
|
11549
11556
|
tsTryParseExportDeclaration() {
|
|
11550
|
-
return this.tsParseDeclaration(this.startNode(), this.state.
|
|
11557
|
+
return this.tsParseDeclaration(this.startNode(), this.state.type, true, null);
|
|
11551
11558
|
}
|
|
11552
|
-
|
|
11553
|
-
switch (
|
|
11554
|
-
case
|
|
11555
|
-
{
|
|
11556
|
-
const declaration = this.tsTryParseDeclare(node);
|
|
11557
|
-
if (declaration) {
|
|
11558
|
-
declaration.declare = true;
|
|
11559
|
-
}
|
|
11560
|
-
return declaration;
|
|
11561
|
-
}
|
|
11562
|
-
case "global":
|
|
11563
|
-
if (this.match(5)) {
|
|
11564
|
-
this.scope.enter(1024);
|
|
11565
|
-
this.prodParam.enter(0);
|
|
11566
|
-
const mod = node;
|
|
11567
|
-
mod.kind = "global";
|
|
11568
|
-
{
|
|
11569
|
-
node.global = true;
|
|
11570
|
-
}
|
|
11571
|
-
mod.id = expr;
|
|
11572
|
-
mod.body = this.tsParseModuleBlock();
|
|
11573
|
-
this.scope.exit();
|
|
11574
|
-
this.prodParam.exit();
|
|
11575
|
-
return this.finishNode(mod, "TSModuleDeclaration");
|
|
11576
|
-
}
|
|
11577
|
-
break;
|
|
11578
|
-
default:
|
|
11579
|
-
return this.tsParseDeclaration(node, expr.name, false, decorators);
|
|
11580
|
-
}
|
|
11581
|
-
}
|
|
11582
|
-
tsParseDeclaration(node, value, next, decorators) {
|
|
11583
|
-
switch (value) {
|
|
11584
|
-
case "abstract":
|
|
11559
|
+
tsParseDeclaration(node, type, next, decorators) {
|
|
11560
|
+
switch (type) {
|
|
11561
|
+
case 124:
|
|
11585
11562
|
if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) {
|
|
11586
11563
|
return this.tsParseAbstractDeclaration(node, decorators);
|
|
11587
11564
|
}
|
|
11588
11565
|
break;
|
|
11589
|
-
case
|
|
11566
|
+
case 127:
|
|
11590
11567
|
if (this.tsCheckLineTerminator(next)) {
|
|
11591
11568
|
if (this.match(134)) {
|
|
11592
11569
|
return this.tsParseAmbientExternalModuleDeclaration(node);
|
|
@@ -11596,13 +11573,13 @@ function requireLib$2 () {
|
|
|
11596
11573
|
}
|
|
11597
11574
|
}
|
|
11598
11575
|
break;
|
|
11599
|
-
case
|
|
11576
|
+
case 128:
|
|
11600
11577
|
if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
|
|
11601
11578
|
node.kind = "namespace";
|
|
11602
11579
|
return this.tsParseModuleOrNamespaceDeclaration(node);
|
|
11603
11580
|
}
|
|
11604
11581
|
break;
|
|
11605
|
-
case
|
|
11582
|
+
case 130:
|
|
11606
11583
|
if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
|
|
11607
11584
|
return this.tsParseTypeAliasDeclaration(node);
|
|
11608
11585
|
}
|
|
@@ -11743,8 +11720,8 @@ function requireLib$2 () {
|
|
|
11743
11720
|
this.tsCheckForInvalidTypeCasts(exprList);
|
|
11744
11721
|
return exprList;
|
|
11745
11722
|
}
|
|
11746
|
-
parseArrayLike(close,
|
|
11747
|
-
const node = super.parseArrayLike(close,
|
|
11723
|
+
parseArrayLike(close, isTuple, refExpressionErrors) {
|
|
11724
|
+
const node = super.parseArrayLike(close, isTuple, refExpressionErrors);
|
|
11748
11725
|
if (node.type === "ArrayExpression") {
|
|
11749
11726
|
this.tsCheckForInvalidTypeCasts(node.elements);
|
|
11750
11727
|
}
|
|
@@ -11773,6 +11750,7 @@ function requireLib$2 () {
|
|
|
11773
11750
|
if (!noCalls && this.atPossibleAsyncArrow(base)) {
|
|
11774
11751
|
const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startLoc);
|
|
11775
11752
|
if (asyncArrowFn) {
|
|
11753
|
+
state.stop = true;
|
|
11776
11754
|
return asyncArrowFn;
|
|
11777
11755
|
}
|
|
11778
11756
|
}
|
|
@@ -11988,19 +11966,85 @@ function requireLib$2 () {
|
|
|
11988
11966
|
return declaration;
|
|
11989
11967
|
}
|
|
11990
11968
|
parseStatementContent(flags, decorators) {
|
|
11991
|
-
if (this.
|
|
11992
|
-
|
|
11993
|
-
|
|
11994
|
-
|
|
11995
|
-
|
|
11996
|
-
|
|
11997
|
-
|
|
11998
|
-
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
|
|
11969
|
+
if (!this.state.containsEsc) {
|
|
11970
|
+
switch (this.state.type) {
|
|
11971
|
+
case 75:
|
|
11972
|
+
{
|
|
11973
|
+
if (this.isLookaheadContextual("enum")) {
|
|
11974
|
+
const node = this.startNode();
|
|
11975
|
+
this.expect(75);
|
|
11976
|
+
return this.tsParseEnumDeclaration(node, {
|
|
11977
|
+
const: true
|
|
11978
|
+
});
|
|
11979
|
+
}
|
|
11980
|
+
break;
|
|
11981
|
+
}
|
|
11982
|
+
case 124:
|
|
11983
|
+
case 125:
|
|
11984
|
+
{
|
|
11985
|
+
if (this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()) {
|
|
11986
|
+
const token = this.state.type;
|
|
11987
|
+
const node = this.startNode();
|
|
11988
|
+
this.next();
|
|
11989
|
+
const declaration = token === 125 ? this.tsTryParseDeclare(node) : this.tsParseAbstractDeclaration(node, decorators);
|
|
11990
|
+
if (declaration) {
|
|
11991
|
+
if (token === 125) {
|
|
11992
|
+
declaration.declare = true;
|
|
11993
|
+
}
|
|
11994
|
+
return declaration;
|
|
11995
|
+
} else {
|
|
11996
|
+
node.expression = this.createIdentifier(this.startNodeAt(node.loc.start), token === 125 ? "declare" : "abstract");
|
|
11997
|
+
this.semicolon(false);
|
|
11998
|
+
return this.finishNode(node, "ExpressionStatement");
|
|
11999
|
+
}
|
|
12000
|
+
}
|
|
12001
|
+
break;
|
|
12002
|
+
}
|
|
12003
|
+
case 126:
|
|
12004
|
+
return this.tsParseEnumDeclaration(this.startNode());
|
|
12005
|
+
case 112:
|
|
12006
|
+
{
|
|
12007
|
+
const nextCh = this.lookaheadCharCode();
|
|
12008
|
+
if (nextCh === 123) {
|
|
12009
|
+
const node = this.startNode();
|
|
12010
|
+
return this.tsParseAmbientExternalModuleDeclaration(node);
|
|
12011
|
+
}
|
|
12012
|
+
break;
|
|
12013
|
+
}
|
|
12014
|
+
case 129:
|
|
12015
|
+
{
|
|
12016
|
+
const result = this.tsParseInterfaceDeclaration(this.startNode());
|
|
12017
|
+
if (result) return result;
|
|
12018
|
+
break;
|
|
12019
|
+
}
|
|
12020
|
+
case 127:
|
|
12021
|
+
{
|
|
12022
|
+
if (this.nextTokenIsIdentifierOrStringLiteralOnSameLine()) {
|
|
12023
|
+
const node = this.startNode();
|
|
12024
|
+
this.next();
|
|
12025
|
+
return this.tsParseDeclaration(node, 127, false, decorators);
|
|
12026
|
+
}
|
|
12027
|
+
break;
|
|
12028
|
+
}
|
|
12029
|
+
case 128:
|
|
12030
|
+
{
|
|
12031
|
+
if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
12032
|
+
const node = this.startNode();
|
|
12033
|
+
this.next();
|
|
12034
|
+
return this.tsParseDeclaration(node, 128, false, decorators);
|
|
12035
|
+
}
|
|
12036
|
+
break;
|
|
12037
|
+
}
|
|
12038
|
+
case 130:
|
|
12039
|
+
{
|
|
12040
|
+
if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
12041
|
+
const node = this.startNode();
|
|
12042
|
+
this.next();
|
|
12043
|
+
return this.tsParseTypeAliasDeclaration(node);
|
|
12044
|
+
}
|
|
12045
|
+
break;
|
|
12046
|
+
}
|
|
12047
|
+
}
|
|
12004
12048
|
}
|
|
12005
12049
|
return super.parseStatementContent(flags, decorators);
|
|
12006
12050
|
}
|
|
@@ -12084,10 +12128,6 @@ function requireLib$2 () {
|
|
|
12084
12128
|
this.raise(TSErrors.ClassMethodHasDeclare, methodOrProp);
|
|
12085
12129
|
}
|
|
12086
12130
|
}
|
|
12087
|
-
parseExpressionStatement(node, expr, decorators) {
|
|
12088
|
-
const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr, decorators) : undefined;
|
|
12089
|
-
return decl || super.parseExpressionStatement(node, expr, decorators);
|
|
12090
|
-
}
|
|
12091
12131
|
shouldParseExportDeclaration() {
|
|
12092
12132
|
if (this.tsIsDeclarationStart()) return true;
|
|
12093
12133
|
return super.shouldParseExportDeclaration();
|
|
@@ -12412,7 +12452,7 @@ function requireLib$2 () {
|
|
|
12412
12452
|
super.checkToRestConversion(node, allowPattern);
|
|
12413
12453
|
}
|
|
12414
12454
|
}
|
|
12415
|
-
isValidLVal(type, isUnparenthesizedInAssign, binding) {
|
|
12455
|
+
isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) {
|
|
12416
12456
|
switch (type) {
|
|
12417
12457
|
case "TSTypeCastExpression":
|
|
12418
12458
|
return true;
|
|
@@ -12425,7 +12465,7 @@ function requireLib$2 () {
|
|
|
12425
12465
|
case "TSTypeAssertion":
|
|
12426
12466
|
return (binding !== 64 || !isUnparenthesizedInAssign) && ["expression", true];
|
|
12427
12467
|
default:
|
|
12428
|
-
return super.isValidLVal(type, isUnparenthesizedInAssign, binding);
|
|
12468
|
+
return super.isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding);
|
|
12429
12469
|
}
|
|
12430
12470
|
}
|
|
12431
12471
|
parseBindingAtom() {
|
|
@@ -12587,10 +12627,11 @@ function requireLib$2 () {
|
|
|
12587
12627
|
node.abstract = true;
|
|
12588
12628
|
this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifier, node);
|
|
12589
12629
|
return this.tsParseInterfaceDeclaration(node);
|
|
12630
|
+
} else {
|
|
12631
|
+
return null;
|
|
12590
12632
|
}
|
|
12591
|
-
} else {
|
|
12592
|
-
this.unexpected(null, 80);
|
|
12593
12633
|
}
|
|
12634
|
+
throw this.unexpected(null, 80);
|
|
12594
12635
|
}
|
|
12595
12636
|
parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {
|
|
12596
12637
|
const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
|
|
@@ -12700,7 +12741,7 @@ function requireLib$2 () {
|
|
|
12700
12741
|
}
|
|
12701
12742
|
}
|
|
12702
12743
|
fillOptionalPropertiesForTSESLint(node) {
|
|
12703
|
-
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;
|
|
12744
|
+
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;
|
|
12704
12745
|
switch (node.type) {
|
|
12705
12746
|
case "ExpressionStatement":
|
|
12706
12747
|
(_node$directive = node.directive) != null ? _node$directive : node.directive = undefined;
|
|
@@ -12791,6 +12832,10 @@ function requireLib$2 () {
|
|
|
12791
12832
|
(_node$declare6 = node.declare) != null ? _node$declare6 : node.declare = false;
|
|
12792
12833
|
(_node$extends = node.extends) != null ? _node$extends : node.extends = [];
|
|
12793
12834
|
return;
|
|
12835
|
+
case "TSMappedType":
|
|
12836
|
+
(_node$optional5 = node.optional) != null ? _node$optional5 : node.optional = false;
|
|
12837
|
+
(_node$readonly4 = node.readonly) != null ? _node$readonly4 : node.readonly = undefined;
|
|
12838
|
+
return;
|
|
12794
12839
|
case "TSModuleDeclaration":
|
|
12795
12840
|
(_node$declare7 = node.declare) != null ? _node$declare7 : node.declare = false;
|
|
12796
12841
|
(_node$global = node.global) != null ? _node$global : node.global = node.kind === "global";
|
|
@@ -12802,6 +12847,32 @@ function requireLib$2 () {
|
|
|
12802
12847
|
return;
|
|
12803
12848
|
}
|
|
12804
12849
|
}
|
|
12850
|
+
chStartsBindingIdentifierAndNotRelationalOperator(ch, pos) {
|
|
12851
|
+
if (isIdentifierStart(ch)) {
|
|
12852
|
+
keywordAndTSRelationalOperator.lastIndex = pos;
|
|
12853
|
+
if (keywordAndTSRelationalOperator.test(this.input)) {
|
|
12854
|
+
const endCh = this.codePointAtPos(keywordAndTSRelationalOperator.lastIndex);
|
|
12855
|
+
if (!isIdentifierChar(endCh) && endCh !== 92) {
|
|
12856
|
+
return false;
|
|
12857
|
+
}
|
|
12858
|
+
}
|
|
12859
|
+
return true;
|
|
12860
|
+
} else if (ch === 92) {
|
|
12861
|
+
return true;
|
|
12862
|
+
} else {
|
|
12863
|
+
return false;
|
|
12864
|
+
}
|
|
12865
|
+
}
|
|
12866
|
+
nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine() {
|
|
12867
|
+
const next = this.nextTokenInLineStart();
|
|
12868
|
+
const nextCh = this.codePointAtPos(next);
|
|
12869
|
+
return this.chStartsBindingIdentifierAndNotRelationalOperator(nextCh, next);
|
|
12870
|
+
}
|
|
12871
|
+
nextTokenIsIdentifierOrStringLiteralOnSameLine() {
|
|
12872
|
+
const next = this.nextTokenInLineStart();
|
|
12873
|
+
const nextCh = this.codePointAtPos(next);
|
|
12874
|
+
return this.chStartsBindingIdentifier(nextCh, next) || nextCh === 34 || nextCh === 39;
|
|
12875
|
+
}
|
|
12805
12876
|
};
|
|
12806
12877
|
function isPossiblyLiteralEnum(expression) {
|
|
12807
12878
|
if (expression.type !== "MemberExpression") return false;
|
|
@@ -12930,8 +13001,8 @@ function requireLib$2 () {
|
|
|
12930
13001
|
parseBindingAtom() {
|
|
12931
13002
|
return this.parsePlaceholder("Pattern") || super.parseBindingAtom();
|
|
12932
13003
|
}
|
|
12933
|
-
isValidLVal(type, isParenthesized, binding) {
|
|
12934
|
-
return type === "Placeholder" || super.isValidLVal(type, isParenthesized, binding);
|
|
13004
|
+
isValidLVal(type, disallowCallExpression, isParenthesized, binding) {
|
|
13005
|
+
return type === "Placeholder" || super.isValidLVal(type, disallowCallExpression, isParenthesized, binding);
|
|
12935
13006
|
}
|
|
12936
13007
|
toAssignable(node, isLHS) {
|
|
12937
13008
|
if (node && node.type === "Placeholder" && node.expectedNode === "Expression") {
|
|
@@ -13331,7 +13402,7 @@ function requireLib$2 () {
|
|
|
13331
13402
|
}
|
|
13332
13403
|
this.next();
|
|
13333
13404
|
node.right = this.parseMaybeAssign();
|
|
13334
|
-
this.checkLVal(left, this.finishNode(node, "AssignmentExpression"));
|
|
13405
|
+
this.checkLVal(left, this.finishNode(node, "AssignmentExpression"), undefined, undefined, undefined, undefined, operator === "||=" || operator === "&&=" || operator === "??=");
|
|
13335
13406
|
return node;
|
|
13336
13407
|
} else if (ownExpressionErrors) {
|
|
13337
13408
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
@@ -13805,7 +13876,7 @@ function requireLib$2 () {
|
|
|
13805
13876
|
}
|
|
13806
13877
|
case 0:
|
|
13807
13878
|
{
|
|
13808
|
-
return this.parseArrayLike(3,
|
|
13879
|
+
return this.parseArrayLike(3, false, refExpressionErrors);
|
|
13809
13880
|
}
|
|
13810
13881
|
case 5:
|
|
13811
13882
|
{
|
|
@@ -13862,25 +13933,22 @@ function requireLib$2 () {
|
|
|
13862
13933
|
if (pipeProposal) {
|
|
13863
13934
|
return this.parseTopicReference(pipeProposal);
|
|
13864
13935
|
}
|
|
13865
|
-
this.unexpected();
|
|
13866
|
-
break;
|
|
13936
|
+
throw this.unexpected();
|
|
13867
13937
|
}
|
|
13868
13938
|
case 47:
|
|
13869
13939
|
{
|
|
13870
13940
|
const lookaheadCh = this.input.codePointAt(this.nextTokenStart());
|
|
13871
13941
|
if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) {
|
|
13872
|
-
this.expectOnePlugin(["jsx", "flow", "typescript"]);
|
|
13873
|
-
} else {
|
|
13874
|
-
this.unexpected();
|
|
13942
|
+
throw this.expectOnePlugin(["jsx", "flow", "typescript"]);
|
|
13875
13943
|
}
|
|
13876
|
-
|
|
13944
|
+
throw this.unexpected();
|
|
13877
13945
|
}
|
|
13878
13946
|
default:
|
|
13879
13947
|
{
|
|
13880
13948
|
if (type === 137) {
|
|
13881
13949
|
return this.parseDecimalLiteral(this.state.value);
|
|
13882
13950
|
} else if (type === 2 || type === 1) {
|
|
13883
|
-
return this.parseArrayLike(this.state.type === 2 ? 4 : 3,
|
|
13951
|
+
return this.parseArrayLike(this.state.type === 2 ? 4 : 3, true);
|
|
13884
13952
|
} else if (type === 6 || type === 7) {
|
|
13885
13953
|
return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true);
|
|
13886
13954
|
}
|
|
@@ -13917,7 +13985,7 @@ function requireLib$2 () {
|
|
|
13917
13985
|
}
|
|
13918
13986
|
return id;
|
|
13919
13987
|
} else {
|
|
13920
|
-
this.unexpected();
|
|
13988
|
+
throw this.unexpected();
|
|
13921
13989
|
}
|
|
13922
13990
|
}
|
|
13923
13991
|
}
|
|
@@ -13930,9 +13998,8 @@ function requireLib$2 () {
|
|
|
13930
13998
|
this.state.end--;
|
|
13931
13999
|
this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1);
|
|
13932
14000
|
return this.parseTopicReference(pipeProposal);
|
|
13933
|
-
} else {
|
|
13934
|
-
this.unexpected();
|
|
13935
14001
|
}
|
|
14002
|
+
throw this.unexpected();
|
|
13936
14003
|
}
|
|
13937
14004
|
parseTopicReference(pipeProposal) {
|
|
13938
14005
|
const node = this.startNode();
|
|
@@ -14008,10 +14075,18 @@ function requireLib$2 () {
|
|
|
14008
14075
|
parseSuper() {
|
|
14009
14076
|
const node = this.startNode();
|
|
14010
14077
|
this.next();
|
|
14011
|
-
if (this.match(10) && !this.scope.allowDirectSuper
|
|
14012
|
-
|
|
14013
|
-
|
|
14014
|
-
|
|
14078
|
+
if (this.match(10) && !this.scope.allowDirectSuper) {
|
|
14079
|
+
{
|
|
14080
|
+
if (!(this.optionFlags & 16)) {
|
|
14081
|
+
this.raise(Errors.SuperNotAllowed, node);
|
|
14082
|
+
}
|
|
14083
|
+
}
|
|
14084
|
+
} else if (!this.scope.allowSuper) {
|
|
14085
|
+
{
|
|
14086
|
+
if (!(this.optionFlags & 16)) {
|
|
14087
|
+
this.raise(Errors.UnexpectedSuper, node);
|
|
14088
|
+
}
|
|
14089
|
+
}
|
|
14015
14090
|
}
|
|
14016
14091
|
if (!this.match(10) && !this.match(0) && !this.match(16)) {
|
|
14017
14092
|
this.raise(Errors.UnsupportedSuper, node);
|
|
@@ -14525,7 +14600,7 @@ function requireLib$2 () {
|
|
|
14525
14600
|
this.scope.exit();
|
|
14526
14601
|
return finishedNode;
|
|
14527
14602
|
}
|
|
14528
|
-
parseArrayLike(close,
|
|
14603
|
+
parseArrayLike(close, isTuple, refExpressionErrors) {
|
|
14529
14604
|
if (isTuple) {
|
|
14530
14605
|
this.expectPlugin("recordAndTuple");
|
|
14531
14606
|
}
|
|
@@ -15151,9 +15226,7 @@ function requireLib$2 () {
|
|
|
15151
15226
|
if (!this.isContextual(107)) {
|
|
15152
15227
|
return false;
|
|
15153
15228
|
}
|
|
15154
|
-
|
|
15155
|
-
const nextCh = this.codePointAtPos(next);
|
|
15156
|
-
return this.chStartsBindingIdentifier(nextCh, next);
|
|
15229
|
+
return this.nextTokenIsIdentifierOnSameLine();
|
|
15157
15230
|
}
|
|
15158
15231
|
isForUsing() {
|
|
15159
15232
|
if (!this.isContextual(107)) {
|
|
@@ -15172,6 +15245,11 @@ function requireLib$2 () {
|
|
|
15172
15245
|
}
|
|
15173
15246
|
return false;
|
|
15174
15247
|
}
|
|
15248
|
+
nextTokenIsIdentifierOnSameLine() {
|
|
15249
|
+
const next = this.nextTokenInLineStart();
|
|
15250
|
+
const nextCh = this.codePointAtPos(next);
|
|
15251
|
+
return this.chStartsBindingIdentifier(nextCh, next);
|
|
15252
|
+
}
|
|
15175
15253
|
isAwaitUsing() {
|
|
15176
15254
|
if (!this.isContextual(96)) {
|
|
15177
15255
|
return false;
|
|
@@ -16314,7 +16392,7 @@ function requireLib$2 () {
|
|
|
16314
16392
|
this.sawUnambiguousESM = true;
|
|
16315
16393
|
return this.finishNode(node2, "ExportDefaultDeclaration");
|
|
16316
16394
|
}
|
|
16317
|
-
this.unexpected(null, 5);
|
|
16395
|
+
throw this.unexpected(null, 5);
|
|
16318
16396
|
}
|
|
16319
16397
|
eatExportStar(node) {
|
|
16320
16398
|
return this.eat(55);
|
|
@@ -16906,54 +16984,54 @@ function requireLib$2 () {
|
|
|
16906
16984
|
}
|
|
16907
16985
|
class Parser extends StatementParser {
|
|
16908
16986
|
constructor(options, input, pluginsMap) {
|
|
16909
|
-
|
|
16910
|
-
super(
|
|
16911
|
-
this.options =
|
|
16987
|
+
const normalizedOptions = getOptions(options);
|
|
16988
|
+
super(normalizedOptions, input);
|
|
16989
|
+
this.options = normalizedOptions;
|
|
16912
16990
|
this.initializeScopes();
|
|
16913
16991
|
this.plugins = pluginsMap;
|
|
16914
|
-
this.filename =
|
|
16915
|
-
this.startIndex =
|
|
16992
|
+
this.filename = normalizedOptions.sourceFilename;
|
|
16993
|
+
this.startIndex = normalizedOptions.startIndex;
|
|
16916
16994
|
let optionFlags = 0;
|
|
16917
|
-
if (
|
|
16995
|
+
if (normalizedOptions.allowAwaitOutsideFunction) {
|
|
16918
16996
|
optionFlags |= 1;
|
|
16919
16997
|
}
|
|
16920
|
-
if (
|
|
16998
|
+
if (normalizedOptions.allowReturnOutsideFunction) {
|
|
16921
16999
|
optionFlags |= 2;
|
|
16922
17000
|
}
|
|
16923
|
-
if (
|
|
17001
|
+
if (normalizedOptions.allowImportExportEverywhere) {
|
|
16924
17002
|
optionFlags |= 8;
|
|
16925
17003
|
}
|
|
16926
|
-
if (
|
|
17004
|
+
if (normalizedOptions.allowSuperOutsideMethod) {
|
|
16927
17005
|
optionFlags |= 16;
|
|
16928
17006
|
}
|
|
16929
|
-
if (
|
|
17007
|
+
if (normalizedOptions.allowUndeclaredExports) {
|
|
16930
17008
|
optionFlags |= 64;
|
|
16931
17009
|
}
|
|
16932
|
-
if (
|
|
17010
|
+
if (normalizedOptions.allowNewTargetOutsideFunction) {
|
|
16933
17011
|
optionFlags |= 4;
|
|
16934
17012
|
}
|
|
16935
|
-
if (
|
|
17013
|
+
if (normalizedOptions.allowYieldOutsideFunction) {
|
|
16936
17014
|
optionFlags |= 32;
|
|
16937
17015
|
}
|
|
16938
|
-
if (
|
|
17016
|
+
if (normalizedOptions.ranges) {
|
|
16939
17017
|
optionFlags |= 128;
|
|
16940
17018
|
}
|
|
16941
|
-
if (
|
|
17019
|
+
if (normalizedOptions.tokens) {
|
|
16942
17020
|
optionFlags |= 256;
|
|
16943
17021
|
}
|
|
16944
|
-
if (
|
|
17022
|
+
if (normalizedOptions.createImportExpressions) {
|
|
16945
17023
|
optionFlags |= 512;
|
|
16946
17024
|
}
|
|
16947
|
-
if (
|
|
17025
|
+
if (normalizedOptions.createParenthesizedExpressions) {
|
|
16948
17026
|
optionFlags |= 1024;
|
|
16949
17027
|
}
|
|
16950
|
-
if (
|
|
17028
|
+
if (normalizedOptions.errorRecovery) {
|
|
16951
17029
|
optionFlags |= 2048;
|
|
16952
17030
|
}
|
|
16953
|
-
if (
|
|
17031
|
+
if (normalizedOptions.attachComment) {
|
|
16954
17032
|
optionFlags |= 4096;
|
|
16955
17033
|
}
|
|
16956
|
-
if (
|
|
17034
|
+
if (normalizedOptions.annexB) {
|
|
16957
17035
|
optionFlags |= 8192;
|
|
16958
17036
|
}
|
|
16959
17037
|
this.optionFlags = optionFlags;
|
|
@@ -16967,10 +17045,10 @@ function requireLib$2 () {
|
|
|
16967
17045
|
const program = this.startNode();
|
|
16968
17046
|
this.nextToken();
|
|
16969
17047
|
file.errors = null;
|
|
16970
|
-
this.parseTopLevel(file, program);
|
|
16971
|
-
|
|
16972
|
-
|
|
16973
|
-
return
|
|
17048
|
+
const result = this.parseTopLevel(file, program);
|
|
17049
|
+
result.errors = this.state.errors;
|
|
17050
|
+
result.comments.length = this.state.commentsLen;
|
|
17051
|
+
return result;
|
|
16974
17052
|
}
|
|
16975
17053
|
}
|
|
16976
17054
|
function parse(input, options) {
|
|
@@ -17302,16 +17380,34 @@ function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [
|
|
|
17302
17380
|
(id) => markScopeIdentifier(node, id, knownIds)
|
|
17303
17381
|
);
|
|
17304
17382
|
}
|
|
17383
|
+
} else if (node.type === "SwitchStatement") {
|
|
17384
|
+
if (node.scopeIds) {
|
|
17385
|
+
node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
|
|
17386
|
+
} else {
|
|
17387
|
+
walkSwitchStatement(
|
|
17388
|
+
node,
|
|
17389
|
+
false,
|
|
17390
|
+
(id) => markScopeIdentifier(node, id, knownIds)
|
|
17391
|
+
);
|
|
17392
|
+
}
|
|
17305
17393
|
} else if (node.type === "CatchClause" && node.param) {
|
|
17306
|
-
|
|
17307
|
-
|
|
17394
|
+
if (node.scopeIds) {
|
|
17395
|
+
node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
|
|
17396
|
+
} else {
|
|
17397
|
+
for (const id of extractIdentifiers$1(node.param)) {
|
|
17398
|
+
markScopeIdentifier(node, id, knownIds);
|
|
17399
|
+
}
|
|
17308
17400
|
}
|
|
17309
17401
|
} else if (isForStatement(node)) {
|
|
17310
|
-
|
|
17311
|
-
node,
|
|
17312
|
-
|
|
17313
|
-
(
|
|
17314
|
-
|
|
17402
|
+
if (node.scopeIds) {
|
|
17403
|
+
node.scopeIds.forEach((id) => markKnownIds(id, knownIds));
|
|
17404
|
+
} else {
|
|
17405
|
+
walkForStatement(
|
|
17406
|
+
node,
|
|
17407
|
+
false,
|
|
17408
|
+
(id) => markScopeIdentifier(node, id, knownIds)
|
|
17409
|
+
);
|
|
17410
|
+
}
|
|
17315
17411
|
}
|
|
17316
17412
|
},
|
|
17317
17413
|
leave(node, parent) {
|
|
@@ -17334,14 +17430,15 @@ function isReferencedIdentifier(id, parent, parentStack) {
|
|
|
17334
17430
|
if (id.name === "arguments") {
|
|
17335
17431
|
return false;
|
|
17336
17432
|
}
|
|
17337
|
-
if (isReferenced$1(id, parent)) {
|
|
17433
|
+
if (isReferenced$1(id, parent, parentStack[parentStack.length - 2])) {
|
|
17338
17434
|
return true;
|
|
17339
17435
|
}
|
|
17340
17436
|
switch (parent.type) {
|
|
17341
17437
|
case "AssignmentExpression":
|
|
17342
17438
|
case "AssignmentPattern":
|
|
17343
17439
|
return true;
|
|
17344
|
-
case "
|
|
17440
|
+
case "ObjectProperty":
|
|
17441
|
+
return parent.key !== id && isInDestructureAssignment(parent, parentStack);
|
|
17345
17442
|
case "ArrayPattern":
|
|
17346
17443
|
return isInDestructureAssignment(parent, parentStack);
|
|
17347
17444
|
}
|
|
@@ -17381,7 +17478,8 @@ function walkFunctionParams(node, onIdent) {
|
|
|
17381
17478
|
}
|
|
17382
17479
|
}
|
|
17383
17480
|
function walkBlockDeclarations(block, onIdent) {
|
|
17384
|
-
|
|
17481
|
+
const body = block.type === "SwitchCase" ? block.consequent : block.body;
|
|
17482
|
+
for (const stmt of body) {
|
|
17385
17483
|
if (stmt.type === "VariableDeclaration") {
|
|
17386
17484
|
if (stmt.declare) continue;
|
|
17387
17485
|
for (const decl of stmt.declarations) {
|
|
@@ -17394,6 +17492,8 @@ function walkBlockDeclarations(block, onIdent) {
|
|
|
17394
17492
|
onIdent(stmt.id);
|
|
17395
17493
|
} else if (isForStatement(stmt)) {
|
|
17396
17494
|
walkForStatement(stmt, true, onIdent);
|
|
17495
|
+
} else if (stmt.type === "SwitchStatement") {
|
|
17496
|
+
walkSwitchStatement(stmt, true, onIdent);
|
|
17397
17497
|
}
|
|
17398
17498
|
}
|
|
17399
17499
|
}
|
|
@@ -17410,6 +17510,20 @@ function walkForStatement(stmt, isVar, onIdent) {
|
|
|
17410
17510
|
}
|
|
17411
17511
|
}
|
|
17412
17512
|
}
|
|
17513
|
+
function walkSwitchStatement(stmt, isVar, onIdent) {
|
|
17514
|
+
for (const cs of stmt.cases) {
|
|
17515
|
+
for (const stmt2 of cs.consequent) {
|
|
17516
|
+
if (stmt2.type === "VariableDeclaration" && (stmt2.kind === "var" ? isVar : !isVar)) {
|
|
17517
|
+
for (const decl of stmt2.declarations) {
|
|
17518
|
+
for (const id of extractIdentifiers$1(decl.id)) {
|
|
17519
|
+
onIdent(id);
|
|
17520
|
+
}
|
|
17521
|
+
}
|
|
17522
|
+
}
|
|
17523
|
+
}
|
|
17524
|
+
walkBlockDeclarations(cs, onIdent);
|
|
17525
|
+
}
|
|
17526
|
+
}
|
|
17413
17527
|
function extractIdentifiers$1(param, nodes = []) {
|
|
17414
17528
|
switch (param.type) {
|
|
17415
17529
|
case "Identifier":
|
|
@@ -17510,7 +17624,7 @@ function isReferenced$1(node, parent, grandparent) {
|
|
|
17510
17624
|
if (parent.key === node) {
|
|
17511
17625
|
return !!parent.computed;
|
|
17512
17626
|
}
|
|
17513
|
-
return
|
|
17627
|
+
return !grandparent || grandparent.type !== "ObjectPattern";
|
|
17514
17628
|
// no: class { NODE = value; }
|
|
17515
17629
|
// yes: class { [NODE] = value; }
|
|
17516
17630
|
// yes: class { key = NODE; }
|
|
@@ -17560,6 +17674,9 @@ function isReferenced$1(node, parent, grandparent) {
|
|
|
17560
17674
|
// yes: export { NODE as foo };
|
|
17561
17675
|
// no: export { NODE as foo } from "foo";
|
|
17562
17676
|
case "ExportSpecifier":
|
|
17677
|
+
if (grandparent == null ? void 0 : grandparent.source) {
|
|
17678
|
+
return false;
|
|
17679
|
+
}
|
|
17563
17680
|
return parent.local === node;
|
|
17564
17681
|
// no: import NODE from "foo";
|
|
17565
17682
|
// no: import * as NODE from "foo";
|
|
@@ -17693,7 +17810,7 @@ function isCoreComponent(tag) {
|
|
|
17693
17810
|
return BASE_TRANSITION;
|
|
17694
17811
|
}
|
|
17695
17812
|
}
|
|
17696
|
-
const nonIdentifierRE =
|
|
17813
|
+
const nonIdentifierRE = /^$|^\d|[^\$\w\xA0-\uFFFF]/;
|
|
17697
17814
|
const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
|
|
17698
17815
|
const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
|
|
17699
17816
|
const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
|
|
@@ -17773,7 +17890,7 @@ const isMemberExpressionNode = (exp, context) => {
|
|
|
17773
17890
|
}
|
|
17774
17891
|
};
|
|
17775
17892
|
const isMemberExpression$1 = isMemberExpressionNode;
|
|
17776
|
-
const fnExpRE = /^\s*(async\s*)?(
|
|
17893
|
+
const fnExpRE = /^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/;
|
|
17777
17894
|
const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp));
|
|
17778
17895
|
const isFnExpressionNode = (exp, context) => {
|
|
17779
17896
|
try {
|
|
@@ -17858,6 +17975,9 @@ function hasDynamicKeyVBind(node) {
|
|
|
17858
17975
|
function isText$1(node) {
|
|
17859
17976
|
return node.type === 5 || node.type === 2;
|
|
17860
17977
|
}
|
|
17978
|
+
function isVPre(p) {
|
|
17979
|
+
return p.type === 7 && p.name === "pre";
|
|
17980
|
+
}
|
|
17861
17981
|
function isVSlot(p) {
|
|
17862
17982
|
return p.type === 7 && p.name === "slot";
|
|
17863
17983
|
}
|
|
@@ -18156,7 +18276,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
18156
18276
|
ondirarg(start, end) {
|
|
18157
18277
|
if (start === end) return;
|
|
18158
18278
|
const arg = getSlice(start, end);
|
|
18159
|
-
if (inVPre) {
|
|
18279
|
+
if (inVPre && !isVPre(currentProp)) {
|
|
18160
18280
|
currentProp.name += arg;
|
|
18161
18281
|
setLocEnd(currentProp.nameLoc, end);
|
|
18162
18282
|
} else {
|
|
@@ -18171,7 +18291,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
18171
18291
|
},
|
|
18172
18292
|
ondirmodifier(start, end) {
|
|
18173
18293
|
const mod = getSlice(start, end);
|
|
18174
|
-
if (inVPre) {
|
|
18294
|
+
if (inVPre && !isVPre(currentProp)) {
|
|
18175
18295
|
currentProp.name += "." + mod;
|
|
18176
18296
|
setLocEnd(currentProp.nameLoc, end);
|
|
18177
18297
|
} else if (currentProp.name === "slot") {
|
|
@@ -18735,6 +18855,11 @@ function walk$1(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
18735
18855
|
} else if (child.type === 12) {
|
|
18736
18856
|
const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
|
|
18737
18857
|
if (constantType >= 2) {
|
|
18858
|
+
if (child.codegenNode.type === 14 && child.codegenNode.arguments.length > 0) {
|
|
18859
|
+
child.codegenNode.arguments.push(
|
|
18860
|
+
-1 + (` /* ${PatchFlagNames[-1]} */` )
|
|
18861
|
+
);
|
|
18862
|
+
}
|
|
18738
18863
|
toCache.push(child);
|
|
18739
18864
|
continue;
|
|
18740
18865
|
}
|
|
@@ -18763,7 +18888,6 @@ function walk$1(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
18763
18888
|
}
|
|
18764
18889
|
}
|
|
18765
18890
|
let cachedAsArray = false;
|
|
18766
|
-
const slotCacheKeys = [];
|
|
18767
18891
|
if (toCache.length === children.length && node.type === 1) {
|
|
18768
18892
|
if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray$3(node.codegenNode.children)) {
|
|
18769
18893
|
node.codegenNode.children = getCacheExpression(
|
|
@@ -18773,7 +18897,6 @@ function walk$1(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
18773
18897
|
} else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray$3(node.codegenNode.children) && node.codegenNode.children.type === 15) {
|
|
18774
18898
|
const slot = getSlotNode(node.codegenNode, "default");
|
|
18775
18899
|
if (slot) {
|
|
18776
|
-
slotCacheKeys.push(context.cached.length);
|
|
18777
18900
|
slot.returns = getCacheExpression(
|
|
18778
18901
|
createArrayExpression(slot.returns)
|
|
18779
18902
|
);
|
|
@@ -18783,7 +18906,6 @@ function walk$1(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
18783
18906
|
const slotName = findDir$1(node, "slot", true);
|
|
18784
18907
|
const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
|
|
18785
18908
|
if (slot) {
|
|
18786
|
-
slotCacheKeys.push(context.cached.length);
|
|
18787
18909
|
slot.returns = getCacheExpression(
|
|
18788
18910
|
createArrayExpression(slot.returns)
|
|
18789
18911
|
);
|
|
@@ -18793,23 +18915,12 @@ function walk$1(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
18793
18915
|
}
|
|
18794
18916
|
if (!cachedAsArray) {
|
|
18795
18917
|
for (const child of toCache) {
|
|
18796
|
-
slotCacheKeys.push(context.cached.length);
|
|
18797
18918
|
child.codegenNode = context.cache(child.codegenNode);
|
|
18798
18919
|
}
|
|
18799
18920
|
}
|
|
18800
|
-
if (slotCacheKeys.length && node.type === 1 && node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray$3(node.codegenNode.children) && node.codegenNode.children.type === 15) {
|
|
18801
|
-
node.codegenNode.children.properties.push(
|
|
18802
|
-
createObjectProperty(
|
|
18803
|
-
`__`,
|
|
18804
|
-
createSimpleExpression(JSON.stringify(slotCacheKeys), false)
|
|
18805
|
-
)
|
|
18806
|
-
);
|
|
18807
|
-
}
|
|
18808
18921
|
function getCacheExpression(value) {
|
|
18809
18922
|
const exp = context.cache(value);
|
|
18810
|
-
|
|
18811
|
-
exp.needArraySpread = true;
|
|
18812
|
-
}
|
|
18923
|
+
exp.needArraySpread = true;
|
|
18813
18924
|
return exp;
|
|
18814
18925
|
}
|
|
18815
18926
|
function getSlotNode(node2, name) {
|
|
@@ -23680,14 +23791,17 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
23680
23791
|
knownIds
|
|
23681
23792
|
);
|
|
23682
23793
|
const children = [];
|
|
23794
|
+
const isTSNode = TS_NODE_TYPES.includes(ast.type);
|
|
23683
23795
|
ids.sort((a, b) => a.start - b.start);
|
|
23684
23796
|
ids.forEach((id, i) => {
|
|
23685
23797
|
const start = id.start - 1;
|
|
23686
23798
|
const end = id.end - 1;
|
|
23687
23799
|
const last = ids[i - 1];
|
|
23688
|
-
|
|
23689
|
-
|
|
23690
|
-
|
|
23800
|
+
if (!(isTSNode && i === 0)) {
|
|
23801
|
+
const leadingText = rawExp.slice(last ? last.end - 1 : 0, start);
|
|
23802
|
+
if (leadingText.length || id.prefix) {
|
|
23803
|
+
children.push(leadingText + (id.prefix || ``));
|
|
23804
|
+
}
|
|
23691
23805
|
}
|
|
23692
23806
|
const source = rawExp.slice(start, end);
|
|
23693
23807
|
children.push(
|
|
@@ -23702,7 +23816,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
23702
23816
|
id.isConstant ? 3 : 0
|
|
23703
23817
|
)
|
|
23704
23818
|
);
|
|
23705
|
-
if (i === ids.length - 1 && end < rawExp.length) {
|
|
23819
|
+
if (i === ids.length - 1 && end < rawExp.length && !isTSNode) {
|
|
23706
23820
|
children.push(rawExp.slice(end));
|
|
23707
23821
|
}
|
|
23708
23822
|
});
|
|
@@ -23740,7 +23854,7 @@ function isConst(type) {
|
|
|
23740
23854
|
}
|
|
23741
23855
|
|
|
23742
23856
|
const transformIf = createStructuralDirectiveTransform$1(
|
|
23743
|
-
/^(if|else|else-if)$/,
|
|
23857
|
+
/^(?:if|else|else-if)$/,
|
|
23744
23858
|
(node, dir, context) => {
|
|
23745
23859
|
return processIf$1(node, dir, context, (ifNode, branch, isRoot) => {
|
|
23746
23860
|
const siblings = context.parent.children;
|
|
@@ -23809,7 +23923,7 @@ function processIf$1(node, dir, context, processCodegen) {
|
|
|
23809
23923
|
continue;
|
|
23810
23924
|
}
|
|
23811
23925
|
if (sibling && sibling.type === 9) {
|
|
23812
|
-
if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
|
|
23926
|
+
if ((dir.name === "else-if" || dir.name === "else") && sibling.branches[sibling.branches.length - 1].condition === void 0) {
|
|
23813
23927
|
context.onError(
|
|
23814
23928
|
createCompilerError(30, node.loc)
|
|
23815
23929
|
);
|
|
@@ -23958,90 +24072,6 @@ function getParentCondition(node) {
|
|
|
23958
24072
|
}
|
|
23959
24073
|
}
|
|
23960
24074
|
|
|
23961
|
-
const transformBind = (dir, _node, context) => {
|
|
23962
|
-
const { modifiers, loc } = dir;
|
|
23963
|
-
const arg = dir.arg;
|
|
23964
|
-
let { exp } = dir;
|
|
23965
|
-
if (exp && exp.type === 4 && !exp.content.trim()) {
|
|
23966
|
-
{
|
|
23967
|
-
context.onError(
|
|
23968
|
-
createCompilerError(34, loc)
|
|
23969
|
-
);
|
|
23970
|
-
return {
|
|
23971
|
-
props: [
|
|
23972
|
-
createObjectProperty(arg, createSimpleExpression("", true, loc))
|
|
23973
|
-
]
|
|
23974
|
-
};
|
|
23975
|
-
}
|
|
23976
|
-
}
|
|
23977
|
-
if (!exp) {
|
|
23978
|
-
if (arg.type !== 4 || !arg.isStatic) {
|
|
23979
|
-
context.onError(
|
|
23980
|
-
createCompilerError(
|
|
23981
|
-
52,
|
|
23982
|
-
arg.loc
|
|
23983
|
-
)
|
|
23984
|
-
);
|
|
23985
|
-
return {
|
|
23986
|
-
props: [
|
|
23987
|
-
createObjectProperty(arg, createSimpleExpression("", true, loc))
|
|
23988
|
-
]
|
|
23989
|
-
};
|
|
23990
|
-
}
|
|
23991
|
-
transformBindShorthand(dir, context);
|
|
23992
|
-
exp = dir.exp;
|
|
23993
|
-
}
|
|
23994
|
-
if (arg.type !== 4) {
|
|
23995
|
-
arg.children.unshift(`(`);
|
|
23996
|
-
arg.children.push(`) || ""`);
|
|
23997
|
-
} else if (!arg.isStatic) {
|
|
23998
|
-
arg.content = `${arg.content} || ""`;
|
|
23999
|
-
}
|
|
24000
|
-
if (modifiers.some((mod) => mod.content === "camel")) {
|
|
24001
|
-
if (arg.type === 4) {
|
|
24002
|
-
if (arg.isStatic) {
|
|
24003
|
-
arg.content = camelize(arg.content);
|
|
24004
|
-
} else {
|
|
24005
|
-
arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
|
|
24006
|
-
}
|
|
24007
|
-
} else {
|
|
24008
|
-
arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
|
|
24009
|
-
arg.children.push(`)`);
|
|
24010
|
-
}
|
|
24011
|
-
}
|
|
24012
|
-
if (!context.inSSR) {
|
|
24013
|
-
if (modifiers.some((mod) => mod.content === "prop")) {
|
|
24014
|
-
injectPrefix(arg, ".");
|
|
24015
|
-
}
|
|
24016
|
-
if (modifiers.some((mod) => mod.content === "attr")) {
|
|
24017
|
-
injectPrefix(arg, "^");
|
|
24018
|
-
}
|
|
24019
|
-
}
|
|
24020
|
-
return {
|
|
24021
|
-
props: [createObjectProperty(arg, exp)]
|
|
24022
|
-
};
|
|
24023
|
-
};
|
|
24024
|
-
const transformBindShorthand = (dir, context) => {
|
|
24025
|
-
const arg = dir.arg;
|
|
24026
|
-
const propName = camelize(arg.content);
|
|
24027
|
-
dir.exp = createSimpleExpression(propName, false, arg.loc);
|
|
24028
|
-
{
|
|
24029
|
-
dir.exp = processExpression(dir.exp, context);
|
|
24030
|
-
}
|
|
24031
|
-
};
|
|
24032
|
-
const injectPrefix = (arg, prefix) => {
|
|
24033
|
-
if (arg.type === 4) {
|
|
24034
|
-
if (arg.isStatic) {
|
|
24035
|
-
arg.content = prefix + arg.content;
|
|
24036
|
-
} else {
|
|
24037
|
-
arg.content = `\`${prefix}\${${arg.content}}\``;
|
|
24038
|
-
}
|
|
24039
|
-
} else {
|
|
24040
|
-
arg.children.unshift(`'${prefix}' + (`);
|
|
24041
|
-
arg.children.push(`)`);
|
|
24042
|
-
}
|
|
24043
|
-
};
|
|
24044
|
-
|
|
24045
24075
|
const transformFor = createStructuralDirectiveTransform$1(
|
|
24046
24076
|
"for",
|
|
24047
24077
|
(node, dir, context) => {
|
|
@@ -24054,9 +24084,6 @@ const transformFor = createStructuralDirectiveTransform$1(
|
|
|
24054
24084
|
const memo = findDir$1(node, "memo");
|
|
24055
24085
|
const keyProp = findProp$1(node, `key`, false, true);
|
|
24056
24086
|
const isDirKey = keyProp && keyProp.type === 7;
|
|
24057
|
-
if (isDirKey && !keyProp.exp) {
|
|
24058
|
-
transformBindShorthand(keyProp, context);
|
|
24059
|
-
}
|
|
24060
24087
|
let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
|
|
24061
24088
|
if (memo && keyExp && isDirKey) {
|
|
24062
24089
|
{
|
|
@@ -24337,7 +24364,9 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
24337
24364
|
const dynamicSlots = [];
|
|
24338
24365
|
let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0;
|
|
24339
24366
|
if (!context.ssr && context.prefixIdentifiers) {
|
|
24340
|
-
hasDynamicSlots =
|
|
24367
|
+
hasDynamicSlots = node.props.some(
|
|
24368
|
+
(prop) => isVSlot(prop) && (hasScopeRef(prop.arg, context.identifiers) || hasScopeRef(prop.exp, context.identifiers))
|
|
24369
|
+
) || children.some((child) => hasScopeRef(child, context.identifiers));
|
|
24341
24370
|
}
|
|
24342
24371
|
const onComponentSlot = findDir$1(node, "slot", true);
|
|
24343
24372
|
if (onComponentSlot) {
|
|
@@ -24400,7 +24429,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
24400
24429
|
);
|
|
24401
24430
|
} else if (vElse = findDir$1(
|
|
24402
24431
|
slotElement,
|
|
24403
|
-
/^else(
|
|
24432
|
+
/^else(?:-if)?$/,
|
|
24404
24433
|
true
|
|
24405
24434
|
/* allowEmpty */
|
|
24406
24435
|
)) {
|
|
@@ -24412,7 +24441,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
24412
24441
|
break;
|
|
24413
24442
|
}
|
|
24414
24443
|
}
|
|
24415
|
-
if (prev && isTemplateNode(prev) && findDir$1(prev, /^(else-)?if$/)) {
|
|
24444
|
+
if (prev && isTemplateNode(prev) && findDir$1(prev, /^(?:else-)?if$/)) {
|
|
24416
24445
|
let conditional = dynamicSlots[dynamicSlots.length - 1];
|
|
24417
24446
|
while (conditional.alternate.type === 19) {
|
|
24418
24447
|
conditional = conditional.alternate;
|
|
@@ -25327,6 +25356,65 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
25327
25356
|
return ret;
|
|
25328
25357
|
};
|
|
25329
25358
|
|
|
25359
|
+
const transformBind = (dir, _node, context) => {
|
|
25360
|
+
const { modifiers, loc } = dir;
|
|
25361
|
+
const arg = dir.arg;
|
|
25362
|
+
let { exp } = dir;
|
|
25363
|
+
if (exp && exp.type === 4 && !exp.content.trim()) {
|
|
25364
|
+
{
|
|
25365
|
+
context.onError(
|
|
25366
|
+
createCompilerError(34, loc)
|
|
25367
|
+
);
|
|
25368
|
+
return {
|
|
25369
|
+
props: [
|
|
25370
|
+
createObjectProperty(arg, createSimpleExpression("", true, loc))
|
|
25371
|
+
]
|
|
25372
|
+
};
|
|
25373
|
+
}
|
|
25374
|
+
}
|
|
25375
|
+
if (arg.type !== 4) {
|
|
25376
|
+
arg.children.unshift(`(`);
|
|
25377
|
+
arg.children.push(`) || ""`);
|
|
25378
|
+
} else if (!arg.isStatic) {
|
|
25379
|
+
arg.content = arg.content ? `${arg.content} || ""` : `""`;
|
|
25380
|
+
}
|
|
25381
|
+
if (modifiers.some((mod) => mod.content === "camel")) {
|
|
25382
|
+
if (arg.type === 4) {
|
|
25383
|
+
if (arg.isStatic) {
|
|
25384
|
+
arg.content = camelize(arg.content);
|
|
25385
|
+
} else {
|
|
25386
|
+
arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
|
|
25387
|
+
}
|
|
25388
|
+
} else {
|
|
25389
|
+
arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
|
|
25390
|
+
arg.children.push(`)`);
|
|
25391
|
+
}
|
|
25392
|
+
}
|
|
25393
|
+
if (!context.inSSR) {
|
|
25394
|
+
if (modifiers.some((mod) => mod.content === "prop")) {
|
|
25395
|
+
injectPrefix(arg, ".");
|
|
25396
|
+
}
|
|
25397
|
+
if (modifiers.some((mod) => mod.content === "attr")) {
|
|
25398
|
+
injectPrefix(arg, "^");
|
|
25399
|
+
}
|
|
25400
|
+
}
|
|
25401
|
+
return {
|
|
25402
|
+
props: [createObjectProperty(arg, exp)]
|
|
25403
|
+
};
|
|
25404
|
+
};
|
|
25405
|
+
const injectPrefix = (arg, prefix) => {
|
|
25406
|
+
if (arg.type === 4) {
|
|
25407
|
+
if (arg.isStatic) {
|
|
25408
|
+
arg.content = prefix + arg.content;
|
|
25409
|
+
} else {
|
|
25410
|
+
arg.content = `\`${prefix}\${${arg.content}}\``;
|
|
25411
|
+
}
|
|
25412
|
+
} else {
|
|
25413
|
+
arg.children.unshift(`'${prefix}' + (`);
|
|
25414
|
+
arg.children.push(`)`);
|
|
25415
|
+
}
|
|
25416
|
+
};
|
|
25417
|
+
|
|
25330
25418
|
const transformText$1 = (node, context) => {
|
|
25331
25419
|
if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) {
|
|
25332
25420
|
return () => {
|
|
@@ -25511,7 +25599,7 @@ const seen$1 = /* @__PURE__ */ new WeakSet();
|
|
|
25511
25599
|
const transformMemo = (node, context) => {
|
|
25512
25600
|
if (node.type === 1) {
|
|
25513
25601
|
const dir = findDir$1(node, "memo");
|
|
25514
|
-
if (!dir || seen$1.has(node)) {
|
|
25602
|
+
if (!dir || seen$1.has(node) || context.inSSR) {
|
|
25515
25603
|
return;
|
|
25516
25604
|
}
|
|
25517
25605
|
seen$1.add(node);
|
|
@@ -25533,9 +25621,36 @@ const transformMemo = (node, context) => {
|
|
|
25533
25621
|
}
|
|
25534
25622
|
};
|
|
25535
25623
|
|
|
25624
|
+
const transformVBindShorthand = (node, context) => {
|
|
25625
|
+
if (node.type === 1) {
|
|
25626
|
+
for (const prop of node.props) {
|
|
25627
|
+
if (prop.type === 7 && prop.name === "bind" && (!prop.exp || // #13930 :foo in in-DOM templates will be parsed into :foo="" by browser
|
|
25628
|
+
false) && prop.arg) {
|
|
25629
|
+
const arg = prop.arg;
|
|
25630
|
+
if (arg.type !== 4 || !arg.isStatic) {
|
|
25631
|
+
context.onError(
|
|
25632
|
+
createCompilerError(
|
|
25633
|
+
52,
|
|
25634
|
+
arg.loc
|
|
25635
|
+
)
|
|
25636
|
+
);
|
|
25637
|
+
prop.exp = createSimpleExpression("", true, arg.loc);
|
|
25638
|
+
} else {
|
|
25639
|
+
const propName = camelize(arg.content);
|
|
25640
|
+
if (validFirstIdentCharRE.test(propName[0]) || // allow hyphen first char for https://github.com/vuejs/language-tools/pull/3424
|
|
25641
|
+
propName[0] === "-") {
|
|
25642
|
+
prop.exp = createSimpleExpression(propName, false, arg.loc);
|
|
25643
|
+
}
|
|
25644
|
+
}
|
|
25645
|
+
}
|
|
25646
|
+
}
|
|
25647
|
+
}
|
|
25648
|
+
};
|
|
25649
|
+
|
|
25536
25650
|
function getBaseTransformPreset$1(prefixIdentifiers) {
|
|
25537
25651
|
return [
|
|
25538
25652
|
[
|
|
25653
|
+
transformVBindShorthand,
|
|
25539
25654
|
transformOnce,
|
|
25540
25655
|
transformIf,
|
|
25541
25656
|
transformMemo,
|
|
@@ -26004,50 +26119,50 @@ const transformShow = (dir, node, context) => {
|
|
|
26004
26119
|
};
|
|
26005
26120
|
};
|
|
26006
26121
|
|
|
26007
|
-
const transformTransition = (node, context) => {
|
|
26122
|
+
const transformTransition$1 = (node, context) => {
|
|
26008
26123
|
if (node.type === 1 && node.tagType === 1) {
|
|
26009
26124
|
const component = context.isBuiltInComponent(node.tag);
|
|
26010
26125
|
if (component === TRANSITION) {
|
|
26011
|
-
return ()
|
|
26012
|
-
if (!node.children.length) {
|
|
26013
|
-
return;
|
|
26014
|
-
}
|
|
26015
|
-
if (hasMultipleChildren(node)) {
|
|
26016
|
-
context.onError(
|
|
26017
|
-
createDOMCompilerError(
|
|
26018
|
-
62,
|
|
26019
|
-
{
|
|
26020
|
-
start: node.children[0].loc.start,
|
|
26021
|
-
end: node.children[node.children.length - 1].loc.end,
|
|
26022
|
-
source: ""
|
|
26023
|
-
}
|
|
26024
|
-
)
|
|
26025
|
-
);
|
|
26026
|
-
}
|
|
26027
|
-
const child = node.children[0];
|
|
26028
|
-
if (child.type === 1) {
|
|
26029
|
-
for (const p of child.props) {
|
|
26030
|
-
if (p.type === 7 && p.name === "show") {
|
|
26031
|
-
node.props.push({
|
|
26032
|
-
type: 6,
|
|
26033
|
-
name: "persisted",
|
|
26034
|
-
nameLoc: node.loc,
|
|
26035
|
-
value: void 0,
|
|
26036
|
-
loc: node.loc
|
|
26037
|
-
});
|
|
26038
|
-
}
|
|
26039
|
-
}
|
|
26040
|
-
}
|
|
26041
|
-
};
|
|
26126
|
+
return postTransformTransition(node, context.onError);
|
|
26042
26127
|
}
|
|
26043
26128
|
}
|
|
26044
26129
|
};
|
|
26045
|
-
function
|
|
26130
|
+
function postTransformTransition(node, onError, hasMultipleChildren = defaultHasMultipleChildren) {
|
|
26131
|
+
return () => {
|
|
26132
|
+
if (!node.children.length) {
|
|
26133
|
+
return;
|
|
26134
|
+
}
|
|
26135
|
+
if (hasMultipleChildren(node)) {
|
|
26136
|
+
onError(
|
|
26137
|
+
createDOMCompilerError(62, {
|
|
26138
|
+
start: node.children[0].loc.start,
|
|
26139
|
+
end: node.children[node.children.length - 1].loc.end,
|
|
26140
|
+
source: ""
|
|
26141
|
+
})
|
|
26142
|
+
);
|
|
26143
|
+
}
|
|
26144
|
+
const child = node.children[0];
|
|
26145
|
+
if (child.type === 1) {
|
|
26146
|
+
for (const p of child.props) {
|
|
26147
|
+
if (p.type === 7 && p.name === "show") {
|
|
26148
|
+
node.props.push({
|
|
26149
|
+
type: 6,
|
|
26150
|
+
name: "persisted",
|
|
26151
|
+
nameLoc: node.loc,
|
|
26152
|
+
value: void 0,
|
|
26153
|
+
loc: node.loc
|
|
26154
|
+
});
|
|
26155
|
+
}
|
|
26156
|
+
}
|
|
26157
|
+
}
|
|
26158
|
+
};
|
|
26159
|
+
}
|
|
26160
|
+
function defaultHasMultipleChildren(node) {
|
|
26046
26161
|
const children = node.children = node.children.filter(
|
|
26047
26162
|
(c) => c.type !== 3 && !(c.type === 2 && !c.content.trim())
|
|
26048
26163
|
);
|
|
26049
26164
|
const child = children[0];
|
|
26050
|
-
return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(
|
|
26165
|
+
return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(defaultHasMultipleChildren);
|
|
26051
26166
|
}
|
|
26052
26167
|
|
|
26053
26168
|
const expReplaceRE = /__VUE_EXP_START__(.*?)__VUE_EXP_END__/g;
|
|
@@ -26122,7 +26237,7 @@ const getCachedNode = (node) => {
|
|
|
26122
26237
|
return node.codegenNode;
|
|
26123
26238
|
}
|
|
26124
26239
|
};
|
|
26125
|
-
const dataAriaRE = /^(data|aria)-/;
|
|
26240
|
+
const dataAriaRE = /^(?:data|aria)-/;
|
|
26126
26241
|
const isStringifiableAttr = (name, ns) => {
|
|
26127
26242
|
return (ns === 0 ? isKnownHtmlAttr(name) : ns === 1 ? isKnownSvgAttr(name) : ns === 2 ? isKnownMathMLAttr(name) : false) || dataAriaRE.test(name);
|
|
26128
26243
|
};
|
|
@@ -26133,6 +26248,9 @@ function analyzeNode(node) {
|
|
|
26133
26248
|
if (node.type === 1 && isNonStringifiable(node.tag)) {
|
|
26134
26249
|
return false;
|
|
26135
26250
|
}
|
|
26251
|
+
if (node.type === 1 && findDir$1(node, "once", true)) {
|
|
26252
|
+
return false;
|
|
26253
|
+
}
|
|
26136
26254
|
if (node.type === 12) {
|
|
26137
26255
|
return [1, 0];
|
|
26138
26256
|
}
|
|
@@ -26470,7 +26588,7 @@ const validateHtmlNesting = (node, context) => {
|
|
|
26470
26588
|
|
|
26471
26589
|
const DOMNodeTransforms = [
|
|
26472
26590
|
transformStyle,
|
|
26473
|
-
...[transformTransition, validateHtmlNesting]
|
|
26591
|
+
...[transformTransition$1, validateHtmlNesting]
|
|
26474
26592
|
];
|
|
26475
26593
|
const DOMDirectiveTransforms = {
|
|
26476
26594
|
cloak: noopDirectiveTransform,
|
|
@@ -26646,12 +26764,14 @@ var CompilerDOM = /*#__PURE__*/Object.freeze({
|
|
|
26646
26764
|
isStaticPropertyKey: isStaticPropertyKey,
|
|
26647
26765
|
isTemplateNode: isTemplateNode,
|
|
26648
26766
|
isText: isText$1,
|
|
26767
|
+
isVPre: isVPre,
|
|
26649
26768
|
isVSlot: isVSlot,
|
|
26650
26769
|
isValidHTMLNesting: isValidHTMLNesting,
|
|
26651
26770
|
locStub: locStub,
|
|
26652
26771
|
noopDirectiveTransform: noopDirectiveTransform,
|
|
26653
26772
|
parse: parse$3,
|
|
26654
26773
|
parserOptions: parserOptions,
|
|
26774
|
+
postTransformTransition: postTransformTransition,
|
|
26655
26775
|
processExpression: processExpression,
|
|
26656
26776
|
processFor: processFor$1,
|
|
26657
26777
|
processIf: processIf$1,
|
|
@@ -26670,8 +26790,10 @@ var CompilerDOM = /*#__PURE__*/Object.freeze({
|
|
|
26670
26790
|
transformModel: transformModel$1,
|
|
26671
26791
|
transformOn: transformOn$1,
|
|
26672
26792
|
transformStyle: transformStyle,
|
|
26793
|
+
transformVBindShorthand: transformVBindShorthand,
|
|
26673
26794
|
traverseNode: traverseNode,
|
|
26674
26795
|
unwrapTSNode: unwrapTSNode,
|
|
26796
|
+
validFirstIdentCharRE: validFirstIdentCharRE,
|
|
26675
26797
|
walkBlockDeclarations: walkBlockDeclarations,
|
|
26676
26798
|
walkFunctionParams: walkFunctionParams,
|
|
26677
26799
|
walkIdentifiers: walkIdentifiers,
|
|
@@ -26775,7 +26897,7 @@ function genCssVarsFromList(vars, id, isProd, isSSR = false) {
|
|
|
26775
26897
|
}
|
|
26776
26898
|
function genVarName$1(id, raw, isProd, isSSR = false) {
|
|
26777
26899
|
if (isProd) {
|
|
26778
|
-
return hash(id + raw);
|
|
26900
|
+
return hash(id + raw).replace(/^\d/, (r) => `v${r}`);
|
|
26779
26901
|
} else {
|
|
26780
26902
|
return `${id}-${getEscapedCssVarName(raw, isSSR)}`;
|
|
26781
26903
|
}
|
|
@@ -27130,8 +27252,8 @@ function createCache(max = 500) {
|
|
|
27130
27252
|
}
|
|
27131
27253
|
}
|
|
27132
27254
|
|
|
27133
|
-
function
|
|
27134
|
-
return resolveTemplateUsedIdentifiers(sfc).has(
|
|
27255
|
+
function isUsedInTemplate(identifier, sfc) {
|
|
27256
|
+
return resolveTemplateUsedIdentifiers(sfc).has(identifier);
|
|
27135
27257
|
}
|
|
27136
27258
|
const templateUsageCheckCache = createCache();
|
|
27137
27259
|
function resolveTemplateUsedIdentifiers(sfc) {
|
|
@@ -27474,7 +27596,7 @@ function hmrShouldReload(prevImports, next) {
|
|
|
27474
27596
|
return false;
|
|
27475
27597
|
}
|
|
27476
27598
|
for (const key in prevImports) {
|
|
27477
|
-
if (!prevImports[key].isUsedInTemplate &&
|
|
27599
|
+
if (!prevImports[key].isUsedInTemplate && isUsedInTemplate(key, next)) {
|
|
27478
27600
|
return true;
|
|
27479
27601
|
}
|
|
27480
27602
|
}
|
|
@@ -31645,7 +31767,7 @@ function isRelativeUrl(url) {
|
|
|
31645
31767
|
const firstChar = url.charAt(0);
|
|
31646
31768
|
return firstChar === "." || firstChar === "~" || firstChar === "@";
|
|
31647
31769
|
}
|
|
31648
|
-
const externalRE = /^(https?:)?\/\//;
|
|
31770
|
+
const externalRE = /^(?:https?:)?\/\//;
|
|
31649
31771
|
function isExternalUrl(url) {
|
|
31650
31772
|
return externalRE.test(url);
|
|
31651
31773
|
}
|
|
@@ -31819,7 +31941,7 @@ const transformSrcset = (node, context, options = defaultAssetUrlOptions) => {
|
|
|
31819
31941
|
}
|
|
31820
31942
|
}
|
|
31821
31943
|
const shouldProcessUrl = (url) => {
|
|
31822
|
-
return !isExternalUrl(url) && !isDataUrl(url) && (options.includeAbsolute || isRelativeUrl(url));
|
|
31944
|
+
return url && !isExternalUrl(url) && !isDataUrl(url) && (options.includeAbsolute || isRelativeUrl(url));
|
|
31823
31945
|
};
|
|
31824
31946
|
if (!imageCandidates.some(({ url }) => shouldProcessUrl(url))) {
|
|
31825
31947
|
return;
|
|
@@ -31920,7 +32042,8 @@ const newBlock = (node) => ({
|
|
|
31920
32042
|
effect: [],
|
|
31921
32043
|
operation: [],
|
|
31922
32044
|
returns: [],
|
|
31923
|
-
tempId: 0
|
|
32045
|
+
tempId: 0,
|
|
32046
|
+
hasDeferredVShow: false
|
|
31924
32047
|
});
|
|
31925
32048
|
function wrapTemplate(node, dirs) {
|
|
31926
32049
|
if (node.tagType === 3) {
|
|
@@ -31984,6 +32107,40 @@ function getLiteralExpressionValue(exp) {
|
|
|
31984
32107
|
}
|
|
31985
32108
|
return exp.isStatic ? exp.content : null;
|
|
31986
32109
|
}
|
|
32110
|
+
function isInTransition(context) {
|
|
32111
|
+
const parentNode = context.parent && context.parent.node;
|
|
32112
|
+
return !!(parentNode && isTransitionNode(parentNode));
|
|
32113
|
+
}
|
|
32114
|
+
function isTransitionNode(node) {
|
|
32115
|
+
return node.type === 1 && isTransitionTag(node.tag);
|
|
32116
|
+
}
|
|
32117
|
+
function isTransitionTag(tag) {
|
|
32118
|
+
tag = tag.toLowerCase();
|
|
32119
|
+
return tag === "transition" || tag === "vaportransition";
|
|
32120
|
+
}
|
|
32121
|
+
function isTransitionGroupTag(tag) {
|
|
32122
|
+
tag = tag.toLowerCase().replace(/-/g, "");
|
|
32123
|
+
return tag === "transitiongroup" || tag === "vaportransitiongroup";
|
|
32124
|
+
}
|
|
32125
|
+
function isKeepAliveTag(tag) {
|
|
32126
|
+
tag = tag.toLowerCase();
|
|
32127
|
+
return tag === "keepalive" || tag === "vaporkeepalive";
|
|
32128
|
+
}
|
|
32129
|
+
function isTeleportTag(tag) {
|
|
32130
|
+
tag = tag.toLowerCase();
|
|
32131
|
+
return tag === "teleport" || tag === "vaporteleport";
|
|
32132
|
+
}
|
|
32133
|
+
function isBuiltInComponent(tag) {
|
|
32134
|
+
if (isTeleportTag(tag)) {
|
|
32135
|
+
return "VaporTeleport";
|
|
32136
|
+
} else if (isKeepAliveTag(tag)) {
|
|
32137
|
+
return "VaporKeepAlive";
|
|
32138
|
+
} else if (isTransitionTag(tag)) {
|
|
32139
|
+
return "VaporTransition";
|
|
32140
|
+
} else if (isTransitionGroupTag(tag)) {
|
|
32141
|
+
return "VaporTransitionGroup";
|
|
32142
|
+
}
|
|
32143
|
+
}
|
|
31987
32144
|
|
|
31988
32145
|
class TransformContext {
|
|
31989
32146
|
constructor(ir, node, options = {}) {
|
|
@@ -32196,13 +32353,13 @@ const DELIMITERS_ARRAY = ["[", "]", ", "];
|
|
|
32196
32353
|
const DELIMITERS_ARRAY_NEWLINE = [
|
|
32197
32354
|
["[", INDENT_START, NEWLINE],
|
|
32198
32355
|
[INDENT_END, NEWLINE, "]"],
|
|
32199
|
-
[",
|
|
32356
|
+
[",", NEWLINE]
|
|
32200
32357
|
];
|
|
32201
32358
|
const DELIMITERS_OBJECT = ["{ ", " }", ", "];
|
|
32202
32359
|
const DELIMITERS_OBJECT_NEWLINE = [
|
|
32203
32360
|
["{", INDENT_START, NEWLINE],
|
|
32204
32361
|
[INDENT_END, NEWLINE, "}"],
|
|
32205
|
-
[",
|
|
32362
|
+
[",", NEWLINE]
|
|
32206
32363
|
];
|
|
32207
32364
|
function genCall(name, ...frags) {
|
|
32208
32365
|
const hasPlaceholder = isArray$3(name);
|
|
@@ -35165,7 +35322,6 @@ function requireGenerated$3 () {
|
|
|
35165
35322
|
case "AssignmentPattern":
|
|
35166
35323
|
case "ArrayPattern":
|
|
35167
35324
|
case "ObjectPattern":
|
|
35168
|
-
case "OptionalMemberExpression":
|
|
35169
35325
|
case "TSParameterProperty":
|
|
35170
35326
|
case "TSAsExpression":
|
|
35171
35327
|
case "TSSatisfiesExpression":
|
|
@@ -36037,13 +36193,13 @@ function requireIdentifier () {
|
|
|
36037
36193
|
identifier.isIdentifierChar = isIdentifierChar;
|
|
36038
36194
|
identifier.isIdentifierName = isIdentifierName;
|
|
36039
36195
|
identifier.isIdentifierStart = isIdentifierStart;
|
|
36040
|
-
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-\
|
|
36041
|
-
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-\
|
|
36196
|
+
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";
|
|
36197
|
+
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";
|
|
36042
36198
|
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
36043
36199
|
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
36044
36200
|
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
36045
|
-
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,
|
|
36046
|
-
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,
|
|
36201
|
+
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];
|
|
36202
|
+
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];
|
|
36047
36203
|
function isInAstralSet(code, set) {
|
|
36048
36204
|
let pos = 0x10000;
|
|
36049
36205
|
for (let i = 0, length = set.length; i < length; i += 2) {
|
|
@@ -36290,7 +36446,7 @@ function requireUtils () {
|
|
|
36290
36446
|
Object.defineProperty(utils, "__esModule", {
|
|
36291
36447
|
value: true
|
|
36292
36448
|
});
|
|
36293
|
-
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;
|
|
36449
|
+
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;
|
|
36294
36450
|
utils.arrayOf = arrayOf;
|
|
36295
36451
|
utils.arrayOfType = arrayOfType;
|
|
36296
36452
|
utils.assertEach = assertEach;
|
|
@@ -36317,6 +36473,7 @@ function requireUtils () {
|
|
|
36317
36473
|
const BUILDER_KEYS = utils.BUILDER_KEYS = {};
|
|
36318
36474
|
const DEPRECATED_KEYS = utils.DEPRECATED_KEYS = {};
|
|
36319
36475
|
const NODE_PARENT_VALIDATIONS = utils.NODE_PARENT_VALIDATIONS = {};
|
|
36476
|
+
const NODE_UNION_SHAPES__PRIVATE = utils.NODE_UNION_SHAPES__PRIVATE = {};
|
|
36320
36477
|
function getType(val) {
|
|
36321
36478
|
if (Array.isArray(val)) {
|
|
36322
36479
|
return "array";
|
|
@@ -36493,7 +36650,7 @@ function requireUtils () {
|
|
|
36493
36650
|
}
|
|
36494
36651
|
return validate;
|
|
36495
36652
|
}
|
|
36496
|
-
const validTypeOpts = new Set(["aliases", "builder", "deprecatedAlias", "fields", "inherits", "visitor", "validate"]);
|
|
36653
|
+
const validTypeOpts = new Set(["aliases", "builder", "deprecatedAlias", "fields", "inherits", "visitor", "validate", "unionShape"]);
|
|
36497
36654
|
const validFieldKeys = new Set(["default", "optional", "deprecated", "validate"]);
|
|
36498
36655
|
const store = {};
|
|
36499
36656
|
function defineAliasedType(...aliases) {
|
|
@@ -36573,6 +36730,9 @@ function requireUtils () {
|
|
|
36573
36730
|
if (opts.validate) {
|
|
36574
36731
|
NODE_PARENT_VALIDATIONS[type] = opts.validate;
|
|
36575
36732
|
}
|
|
36733
|
+
if (opts.unionShape) {
|
|
36734
|
+
NODE_UNION_SHAPES__PRIVATE[type] = opts.unionShape;
|
|
36735
|
+
}
|
|
36576
36736
|
store[type] = opts;
|
|
36577
36737
|
}
|
|
36578
36738
|
|
|
@@ -36688,6 +36848,12 @@ function requireDefinitions () {
|
|
|
36688
36848
|
return _utils.NODE_PARENT_VALIDATIONS;
|
|
36689
36849
|
}
|
|
36690
36850
|
});
|
|
36851
|
+
Object.defineProperty(exports, "NODE_UNION_SHAPES__PRIVATE", {
|
|
36852
|
+
enumerable: true,
|
|
36853
|
+
get: function () {
|
|
36854
|
+
return _utils.NODE_UNION_SHAPES__PRIVATE;
|
|
36855
|
+
}
|
|
36856
|
+
});
|
|
36691
36857
|
Object.defineProperty(exports, "PLACEHOLDERS", {
|
|
36692
36858
|
enumerable: true,
|
|
36693
36859
|
get: function () {
|
|
@@ -39370,7 +39536,7 @@ function requireLowercase () {
|
|
|
39370
39536
|
validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1);
|
|
39371
39537
|
return node;
|
|
39372
39538
|
}
|
|
39373
|
-
function tsTypeOperator(typeAnnotation, operator) {
|
|
39539
|
+
function tsTypeOperator(typeAnnotation, operator = "keyof") {
|
|
39374
39540
|
const node = {
|
|
39375
39541
|
type: "TSTypeOperator",
|
|
39376
39542
|
typeAnnotation,
|
|
@@ -44147,18 +44313,26 @@ function genFor(oper, context) {
|
|
|
44147
44313
|
keyProp,
|
|
44148
44314
|
idMap
|
|
44149
44315
|
);
|
|
44150
|
-
const
|
|
44316
|
+
const selectorDeclarations = [];
|
|
44317
|
+
const selectorSetup = [];
|
|
44151
44318
|
for (let i = 0; i < selectorPatterns.length; i++) {
|
|
44152
44319
|
const { selector } = selectorPatterns[i];
|
|
44153
44320
|
const selectorName = `_selector${id}_${i}`;
|
|
44154
|
-
|
|
44321
|
+
selectorDeclarations.push(`let ${selectorName}`, NEWLINE);
|
|
44322
|
+
if (i === 0) {
|
|
44323
|
+
selectorSetup.push(`({ createSelector }) => {`, INDENT_START);
|
|
44324
|
+
}
|
|
44325
|
+
selectorSetup.push(
|
|
44155
44326
|
NEWLINE,
|
|
44156
|
-
|
|
44157
|
-
...genCall(`
|
|
44327
|
+
`${selectorName} = `,
|
|
44328
|
+
...genCall(`createSelector`, [
|
|
44158
44329
|
`() => `,
|
|
44159
44330
|
...genExpression(selector, context)
|
|
44160
44331
|
])
|
|
44161
44332
|
);
|
|
44333
|
+
if (i === selectorPatterns.length - 1) {
|
|
44334
|
+
selectorSetup.push(INDENT_END, NEWLINE, "}");
|
|
44335
|
+
}
|
|
44162
44336
|
}
|
|
44163
44337
|
const blockFn = context.withId(() => {
|
|
44164
44338
|
const frag = [];
|
|
@@ -44166,25 +44340,25 @@ function genFor(oper, context) {
|
|
|
44166
44340
|
if (selectorPatterns.length || keyOnlyBindingPatterns.length) {
|
|
44167
44341
|
frag.push(
|
|
44168
44342
|
...genBlockContent(render, context, false, () => {
|
|
44169
|
-
const
|
|
44343
|
+
const patternFrag = [];
|
|
44170
44344
|
for (let i = 0; i < selectorPatterns.length; i++) {
|
|
44171
44345
|
const { effect } = selectorPatterns[i];
|
|
44172
|
-
|
|
44346
|
+
patternFrag.push(
|
|
44173
44347
|
NEWLINE,
|
|
44174
44348
|
`_selector${id}_${i}(() => {`,
|
|
44175
44349
|
INDENT_START
|
|
44176
44350
|
);
|
|
44177
44351
|
for (const oper2 of effect.operations) {
|
|
44178
|
-
|
|
44352
|
+
patternFrag.push(...genOperation(oper2, context));
|
|
44179
44353
|
}
|
|
44180
|
-
|
|
44354
|
+
patternFrag.push(INDENT_END, NEWLINE, `})`);
|
|
44181
44355
|
}
|
|
44182
44356
|
for (const { effect } of keyOnlyBindingPatterns) {
|
|
44183
44357
|
for (const oper2 of effect.operations) {
|
|
44184
|
-
|
|
44358
|
+
patternFrag.push(...genOperation(oper2, context));
|
|
44185
44359
|
}
|
|
44186
44360
|
}
|
|
44187
|
-
return
|
|
44361
|
+
return patternFrag;
|
|
44188
44362
|
})
|
|
44189
44363
|
);
|
|
44190
44364
|
} else {
|
|
@@ -44206,16 +44380,17 @@ function genFor(oper, context) {
|
|
|
44206
44380
|
}
|
|
44207
44381
|
return [
|
|
44208
44382
|
NEWLINE,
|
|
44383
|
+
...selectorDeclarations,
|
|
44209
44384
|
`const n${id} = `,
|
|
44210
44385
|
...genCall(
|
|
44211
|
-
helper("createFor"),
|
|
44386
|
+
[helper("createFor"), "undefined"],
|
|
44212
44387
|
sourceExpr,
|
|
44213
44388
|
blockFn,
|
|
44214
44389
|
genCallback(keyProp),
|
|
44215
|
-
flags ? String(flags) : void 0
|
|
44390
|
+
flags ? String(flags) : void 0,
|
|
44391
|
+
selectorSetup.length ? selectorSetup : void 0
|
|
44216
44392
|
// todo: hydrationNode
|
|
44217
|
-
)
|
|
44218
|
-
...patternFrag
|
|
44393
|
+
)
|
|
44219
44394
|
];
|
|
44220
44395
|
function parseValueDestructure() {
|
|
44221
44396
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -44477,10 +44652,15 @@ function isKeyOnlyBinding(expr, keyAst) {
|
|
|
44477
44652
|
|
|
44478
44653
|
function genSetHtml(oper, context) {
|
|
44479
44654
|
const { helper } = context;
|
|
44480
|
-
const { value, element } = oper;
|
|
44655
|
+
const { value, element, isComponent } = oper;
|
|
44481
44656
|
return [
|
|
44482
44657
|
NEWLINE,
|
|
44483
|
-
...genCall(
|
|
44658
|
+
...genCall(
|
|
44659
|
+
// use setBlockHtml for component
|
|
44660
|
+
isComponent ? helper("setBlockHtml") : helper("setHtml"),
|
|
44661
|
+
`n${element}`,
|
|
44662
|
+
genExpression(value, context)
|
|
44663
|
+
)
|
|
44484
44664
|
];
|
|
44485
44665
|
}
|
|
44486
44666
|
|
|
@@ -44569,7 +44749,7 @@ function genLiteralObjectProps(props, context) {
|
|
|
44569
44749
|
}
|
|
44570
44750
|
function genPropKey({ key: node, modifier, runtimeCamelize, handler, handlerModifiers }, context) {
|
|
44571
44751
|
const { helper } = context;
|
|
44572
|
-
const handlerModifierPostfix = handlerModifiers ? handlerModifiers.map(capitalize).join("") : "";
|
|
44752
|
+
const handlerModifierPostfix = handlerModifiers && handlerModifiers.options ? handlerModifiers.options.map(capitalize).join("") : "";
|
|
44573
44753
|
if (node.isStatic) {
|
|
44574
44754
|
const keyName = (handler ? toHandlerKey(node.content) : node.content) + handlerModifierPostfix;
|
|
44575
44755
|
return [
|
|
@@ -44644,6 +44824,7 @@ function getSpecialHelper(keyName, tagName) {
|
|
|
44644
44824
|
|
|
44645
44825
|
const setTemplateRefIdent = `_setTemplateRef`;
|
|
44646
44826
|
function genSetTemplateRef(oper, context) {
|
|
44827
|
+
const [refValue, refKey] = genRefValue(oper.value, context);
|
|
44647
44828
|
return [
|
|
44648
44829
|
NEWLINE,
|
|
44649
44830
|
oper.effect && `r${oper.element} = `,
|
|
@@ -44651,9 +44832,10 @@ function genSetTemplateRef(oper, context) {
|
|
|
44651
44832
|
setTemplateRefIdent,
|
|
44652
44833
|
// will be generated in root scope
|
|
44653
44834
|
`n${oper.element}`,
|
|
44654
|
-
|
|
44835
|
+
refValue,
|
|
44655
44836
|
oper.effect ? `r${oper.element}` : oper.refFor ? "void 0" : void 0,
|
|
44656
|
-
oper.refFor && "true"
|
|
44837
|
+
oper.refFor && "true",
|
|
44838
|
+
refKey
|
|
44657
44839
|
)
|
|
44658
44840
|
];
|
|
44659
44841
|
}
|
|
@@ -44664,19 +44846,24 @@ function genRefValue(value, context) {
|
|
|
44664
44846
|
if (value && context.options.inline) {
|
|
44665
44847
|
const binding = context.options.bindingMetadata[value.content];
|
|
44666
44848
|
if (binding === "setup-let" || binding === "setup-ref" || binding === "setup-maybe-ref") {
|
|
44667
|
-
return [value.content];
|
|
44849
|
+
return [[value.content], JSON.stringify(value.content)];
|
|
44668
44850
|
}
|
|
44669
44851
|
}
|
|
44670
|
-
return genExpression(value, context);
|
|
44852
|
+
return [genExpression(value, context)];
|
|
44671
44853
|
}
|
|
44672
44854
|
|
|
44673
44855
|
function genSetText(oper, context) {
|
|
44674
44856
|
const { helper } = context;
|
|
44675
|
-
const { element, values, generated, jsx } = oper;
|
|
44857
|
+
const { element, values, generated, jsx, isComponent } = oper;
|
|
44676
44858
|
const texts = combineValues(values, context, jsx);
|
|
44677
44859
|
return [
|
|
44678
44860
|
NEWLINE,
|
|
44679
|
-
...genCall(
|
|
44861
|
+
...genCall(
|
|
44862
|
+
// use setBlockText for component
|
|
44863
|
+
isComponent ? helper("setBlockText") : helper("setText"),
|
|
44864
|
+
`${generated && !isComponent ? "x" : "n"}${element}`,
|
|
44865
|
+
texts
|
|
44866
|
+
)
|
|
44680
44867
|
];
|
|
44681
44868
|
}
|
|
44682
44869
|
function combineValues(values, context, jsx) {
|
|
@@ -44694,18 +44881,21 @@ function combineValues(values, context, jsx) {
|
|
|
44694
44881
|
function genGetTextChild(oper, context) {
|
|
44695
44882
|
return [
|
|
44696
44883
|
NEWLINE,
|
|
44697
|
-
`const x${oper.parent} = ${context.helper("
|
|
44884
|
+
`const x${oper.parent} = ${context.helper("txt")}(n${oper.parent})`
|
|
44698
44885
|
];
|
|
44699
44886
|
}
|
|
44700
44887
|
|
|
44701
44888
|
function genVShow(oper, context) {
|
|
44889
|
+
const { deferred, element } = oper;
|
|
44702
44890
|
return [
|
|
44703
44891
|
NEWLINE,
|
|
44704
|
-
|
|
44892
|
+
deferred ? `deferredApplyVShows.push(() => ` : void 0,
|
|
44893
|
+
...genCall(context.helper("applyVShow"), `n${element}`, [
|
|
44705
44894
|
`() => (`,
|
|
44706
44895
|
...genExpression(oper.dir.exp, context),
|
|
44707
44896
|
`)`
|
|
44708
|
-
])
|
|
44897
|
+
]),
|
|
44898
|
+
deferred ? `)` : void 0
|
|
44709
44899
|
];
|
|
44710
44900
|
}
|
|
44711
44901
|
|
|
@@ -44844,8 +45034,14 @@ function genCreateComponent(operation, context) {
|
|
|
44844
45034
|
} else if (operation.asset) {
|
|
44845
45035
|
return toValidAssetId(operation.tag, "component");
|
|
44846
45036
|
} else {
|
|
45037
|
+
const { tag: tag2 } = operation;
|
|
45038
|
+
const builtInTag = isBuiltInComponent(tag2);
|
|
45039
|
+
if (builtInTag) {
|
|
45040
|
+
helper(builtInTag);
|
|
45041
|
+
return `_${builtInTag}`;
|
|
45042
|
+
}
|
|
44847
45043
|
return genExpression(
|
|
44848
|
-
extend(createSimpleExpression(
|
|
45044
|
+
extend(createSimpleExpression(tag2, false), { ast: null }),
|
|
44849
45045
|
context
|
|
44850
45046
|
);
|
|
44851
45047
|
}
|
|
@@ -44853,6 +45049,7 @@ function genCreateComponent(operation, context) {
|
|
|
44853
45049
|
}
|
|
44854
45050
|
function getUniqueHandlerName(context, name) {
|
|
44855
45051
|
const { seenInlineHandlerNames } = context;
|
|
45052
|
+
name = genVarName(name);
|
|
44856
45053
|
const count = seenInlineHandlerNames[name] || 0;
|
|
44857
45054
|
seenInlineHandlerNames[name] = count + 1;
|
|
44858
45055
|
return count === 0 ? name : `${name}${count}`;
|
|
@@ -44868,7 +45065,10 @@ function processInlineHandlers(props, context) {
|
|
|
44868
45065
|
prop.values.forEach((value, i2) => {
|
|
44869
45066
|
const isMemberExp = isMemberExpression$1(value, context.options);
|
|
44870
45067
|
if (!isMemberExp) {
|
|
44871
|
-
const name = getUniqueHandlerName(
|
|
45068
|
+
const name = getUniqueHandlerName(
|
|
45069
|
+
context,
|
|
45070
|
+
`_on_${prop.key.content.replace(/-/g, "_")}`
|
|
45071
|
+
);
|
|
44872
45072
|
handlers.push({ name, value });
|
|
44873
45073
|
ids[name] = null;
|
|
44874
45074
|
prop.values[i2] = extend({ ast: null }, createSimpleExpression(name));
|
|
@@ -44935,7 +45135,7 @@ function genProp(prop, context, isStatic) {
|
|
|
44935
45135
|
...prop.handler ? genEventHandler(
|
|
44936
45136
|
context,
|
|
44937
45137
|
prop.values[0],
|
|
44938
|
-
|
|
45138
|
+
prop.handlerModifiers,
|
|
44939
45139
|
true
|
|
44940
45140
|
) : isStatic ? ["() => (", ...values, ")"] : values,
|
|
44941
45141
|
...prop.model ? [...genModelEvent(prop, context), ...genModelModifiers(prop, context)] : []
|
|
@@ -45067,7 +45267,7 @@ function genSlotBlockWithProps(oper, context) {
|
|
|
45067
45267
|
let propsName;
|
|
45068
45268
|
let exitScope;
|
|
45069
45269
|
let depth;
|
|
45070
|
-
const { props } = oper;
|
|
45270
|
+
const { props, key, node } = oper;
|
|
45071
45271
|
const idsOfProps = /* @__PURE__ */ new Set();
|
|
45072
45272
|
if (props) {
|
|
45073
45273
|
rawProps = props.content;
|
|
@@ -45089,17 +45289,39 @@ function genSlotBlockWithProps(oper, context) {
|
|
|
45089
45289
|
idsOfProps.forEach(
|
|
45090
45290
|
(id) => idMap[id] = isDestructureAssignment ? `${propsName}[${JSON.stringify(id)}]` : null
|
|
45091
45291
|
);
|
|
45092
|
-
|
|
45292
|
+
let blockFn = context.withId(
|
|
45093
45293
|
() => genBlock(oper, context, [propsName]),
|
|
45094
45294
|
idMap
|
|
45095
45295
|
);
|
|
45096
45296
|
exitScope && exitScope();
|
|
45297
|
+
if (key) {
|
|
45298
|
+
blockFn = [
|
|
45299
|
+
`() => {`,
|
|
45300
|
+
INDENT_START,
|
|
45301
|
+
NEWLINE,
|
|
45302
|
+
`return `,
|
|
45303
|
+
...genCall(
|
|
45304
|
+
context.helper("createKeyedFragment"),
|
|
45305
|
+
[`() => `, ...genExpression(key, context)],
|
|
45306
|
+
blockFn
|
|
45307
|
+
),
|
|
45308
|
+
INDENT_END,
|
|
45309
|
+
NEWLINE,
|
|
45310
|
+
`}`
|
|
45311
|
+
];
|
|
45312
|
+
}
|
|
45313
|
+
if (node.type === 1 && // Not a real component
|
|
45314
|
+
!isTeleportTag(node.tag) && // Needs to determine whether to activate/deactivate based on instance.parent being KeepAlive
|
|
45315
|
+
!isKeepAliveTag(node.tag) && // Slot updates need to trigger TransitionGroup's onBeforeUpdate/onUpdated hook
|
|
45316
|
+
!isTransitionGroupTag(node.tag)) {
|
|
45317
|
+
blockFn = [`${context.helper("withVaporCtx")}(`, ...blockFn, `)`];
|
|
45318
|
+
}
|
|
45097
45319
|
return blockFn;
|
|
45098
45320
|
}
|
|
45099
45321
|
|
|
45100
45322
|
function genSlotOutlet(oper, context) {
|
|
45101
45323
|
const { helper } = context;
|
|
45102
|
-
const { id, name, fallback } = oper;
|
|
45324
|
+
const { id, name, fallback, noSlotted } = oper;
|
|
45103
45325
|
const [frag, push] = buildCodeFragment();
|
|
45104
45326
|
const nameExpr = name.isStatic ? genExpression(name, context) : ["() => (", ...genExpression(name, context), ")"];
|
|
45105
45327
|
let fallbackArg;
|
|
@@ -45113,7 +45335,11 @@ function genSlotOutlet(oper, context) {
|
|
|
45113
45335
|
helper("createSlot"),
|
|
45114
45336
|
nameExpr,
|
|
45115
45337
|
genRawProps(oper.props, context) || "null",
|
|
45116
|
-
fallbackArg
|
|
45338
|
+
fallbackArg,
|
|
45339
|
+
noSlotted && "undefined",
|
|
45340
|
+
// instance
|
|
45341
|
+
noSlotted && "true"
|
|
45342
|
+
// noSlotted
|
|
45117
45343
|
)
|
|
45118
45344
|
);
|
|
45119
45345
|
return frag;
|
|
@@ -45229,12 +45455,18 @@ function genEffect({ operations }, context) {
|
|
|
45229
45455
|
return frag;
|
|
45230
45456
|
}
|
|
45231
45457
|
function genInsertionState(operation, context) {
|
|
45458
|
+
const { parent, anchor, append, last } = operation;
|
|
45232
45459
|
return [
|
|
45233
45460
|
NEWLINE,
|
|
45234
45461
|
...genCall(
|
|
45235
45462
|
context.helper("setInsertionState"),
|
|
45236
|
-
`n${
|
|
45237
|
-
|
|
45463
|
+
`n${parent}`,
|
|
45464
|
+
anchor == null ? void 0 : anchor === -1 ? `0` : append ? (
|
|
45465
|
+
// null or anchor > 0 for append
|
|
45466
|
+
// anchor > 0 is the logical index of append node - used for locate node during hydration
|
|
45467
|
+
anchor === 0 ? "null" : `${anchor}`
|
|
45468
|
+
) : `n${anchor}`,
|
|
45469
|
+
last && "true"
|
|
45238
45470
|
)
|
|
45239
45471
|
];
|
|
45240
45472
|
}
|
|
@@ -45249,7 +45481,7 @@ function genTemplates(templates, rootIndex, { helper }) {
|
|
|
45249
45481
|
}
|
|
45250
45482
|
function genSelf(dynamic, context) {
|
|
45251
45483
|
const [frag, push] = buildCodeFragment();
|
|
45252
|
-
const { id, template, operation } = dynamic;
|
|
45484
|
+
const { id, template, operation, hasDynamicChild } = dynamic;
|
|
45253
45485
|
if (id !== void 0 && template !== void 0) {
|
|
45254
45486
|
push(NEWLINE, `const n${id} = t${template}()`);
|
|
45255
45487
|
push(...genDirectivesForElement(id, context));
|
|
@@ -45257,6 +45489,9 @@ function genSelf(dynamic, context) {
|
|
|
45257
45489
|
if (operation) {
|
|
45258
45490
|
push(...genOperationWithInsertionState(operation, context));
|
|
45259
45491
|
}
|
|
45492
|
+
if (hasDynamicChild) {
|
|
45493
|
+
push(...genChildren(dynamic, context, push, `n${id}`));
|
|
45494
|
+
}
|
|
45260
45495
|
return frag;
|
|
45261
45496
|
}
|
|
45262
45497
|
function genChildren(dynamic, context, pushBlock, from = `n${dynamic.id}`) {
|
|
@@ -45265,51 +45500,65 @@ function genChildren(dynamic, context, pushBlock, from = `n${dynamic.id}`) {
|
|
|
45265
45500
|
const { children } = dynamic;
|
|
45266
45501
|
let offset = 0;
|
|
45267
45502
|
let prev;
|
|
45268
|
-
|
|
45503
|
+
let ifBranchCount = 0;
|
|
45504
|
+
let prependCount = 0;
|
|
45269
45505
|
for (const [index, child] of children.entries()) {
|
|
45506
|
+
if (child.operation && child.operation.anchor === -1) {
|
|
45507
|
+
prependCount++;
|
|
45508
|
+
}
|
|
45270
45509
|
if (child.flags & 2) {
|
|
45271
45510
|
offset--;
|
|
45511
|
+
} else if (child.ifBranch) {
|
|
45512
|
+
ifBranchCount++;
|
|
45272
45513
|
}
|
|
45273
45514
|
const id = child.flags & 1 ? child.flags & 4 ? child.anchor : child.id : void 0;
|
|
45274
45515
|
if (id === void 0 && !child.hasDynamicChild) {
|
|
45275
45516
|
push(...genSelf(child, context));
|
|
45276
45517
|
continue;
|
|
45277
45518
|
}
|
|
45278
|
-
const elementIndex =
|
|
45519
|
+
const elementIndex = index + offset;
|
|
45520
|
+
const logicalIndex = elementIndex - ifBranchCount + prependCount;
|
|
45279
45521
|
const variable = id === void 0 ? `p${context.block.tempId++}` : `n${id}`;
|
|
45280
45522
|
pushBlock(NEWLINE, `const ${variable} = `);
|
|
45281
45523
|
if (prev) {
|
|
45282
45524
|
if (elementIndex - prev[1] === 1) {
|
|
45283
|
-
pushBlock(...genCall(helper("next"), prev[0]));
|
|
45525
|
+
pushBlock(...genCall(helper("next"), prev[0], String(logicalIndex)));
|
|
45284
45526
|
} else {
|
|
45285
|
-
pushBlock(
|
|
45527
|
+
pushBlock(
|
|
45528
|
+
...genCall(
|
|
45529
|
+
helper("nthChild"),
|
|
45530
|
+
from,
|
|
45531
|
+
String(elementIndex),
|
|
45532
|
+
String(logicalIndex)
|
|
45533
|
+
)
|
|
45534
|
+
);
|
|
45286
45535
|
}
|
|
45287
45536
|
} else {
|
|
45288
45537
|
if (elementIndex === 0) {
|
|
45289
|
-
pushBlock(...genCall(helper("child"), from));
|
|
45538
|
+
pushBlock(...genCall(helper("child"), from, String(logicalIndex)));
|
|
45290
45539
|
} else {
|
|
45291
45540
|
let init = genCall(helper("child"), from);
|
|
45292
45541
|
if (elementIndex === 1) {
|
|
45293
|
-
init = genCall(helper("next"), init);
|
|
45542
|
+
init = genCall(helper("next"), init, String(logicalIndex));
|
|
45294
45543
|
} else if (elementIndex > 1) {
|
|
45295
|
-
init = genCall(
|
|
45544
|
+
init = genCall(
|
|
45545
|
+
helper("nthChild"),
|
|
45546
|
+
from,
|
|
45547
|
+
String(elementIndex),
|
|
45548
|
+
String(logicalIndex)
|
|
45549
|
+
);
|
|
45296
45550
|
}
|
|
45297
45551
|
pushBlock(...init);
|
|
45298
45552
|
}
|
|
45299
45553
|
}
|
|
45300
|
-
if (id === child.anchor) {
|
|
45554
|
+
if (id === child.anchor && !child.hasDynamicChild) {
|
|
45301
45555
|
push(...genSelf(child, context));
|
|
45302
45556
|
}
|
|
45303
45557
|
if (id !== void 0) {
|
|
45304
45558
|
push(...genDirectivesForElement(id, context));
|
|
45305
45559
|
}
|
|
45306
45560
|
prev = [variable, elementIndex];
|
|
45307
|
-
|
|
45308
|
-
}
|
|
45309
|
-
if (childrenToGen.length) {
|
|
45310
|
-
for (const [child, from2] of childrenToGen) {
|
|
45311
|
-
push(...genChildren(child, context, pushBlock, from2));
|
|
45312
|
-
}
|
|
45561
|
+
push(...genChildren(child, context, pushBlock, variable));
|
|
45313
45562
|
}
|
|
45314
45563
|
return frag;
|
|
45315
45564
|
}
|
|
@@ -45328,8 +45577,11 @@ function genBlock(oper, context, args = [], root) {
|
|
|
45328
45577
|
}
|
|
45329
45578
|
function genBlockContent(block, context, root, genEffectsExtraFrag) {
|
|
45330
45579
|
const [frag, push] = buildCodeFragment();
|
|
45331
|
-
const { dynamic, effect, operation, returns } = block;
|
|
45580
|
+
const { dynamic, effect, operation, returns, key } = block;
|
|
45332
45581
|
const resetBlock = context.enterBlock(block);
|
|
45582
|
+
if (block.hasDeferredVShow) {
|
|
45583
|
+
push(NEWLINE, `const deferredApplyVShows = []`);
|
|
45584
|
+
}
|
|
45333
45585
|
if (root) {
|
|
45334
45586
|
for (let name of context.ir.component) {
|
|
45335
45587
|
const id = toValidAssetId(name, "component");
|
|
@@ -45352,10 +45604,21 @@ function genBlockContent(block, context, root, genEffectsExtraFrag) {
|
|
|
45352
45604
|
push(...genSelf(child, context));
|
|
45353
45605
|
}
|
|
45354
45606
|
for (const child of dynamic.children) {
|
|
45355
|
-
|
|
45607
|
+
if (!child.hasDynamicChild) {
|
|
45608
|
+
push(...genChildren(child, context, push, `n${child.id}`));
|
|
45609
|
+
}
|
|
45356
45610
|
}
|
|
45357
45611
|
push(...genOperations(operation, context));
|
|
45358
45612
|
push(...genEffects(effect, context, genEffectsExtraFrag));
|
|
45613
|
+
if (block.hasDeferredVShow) {
|
|
45614
|
+
push(NEWLINE, `deferredApplyVShows.forEach(fn => fn())`);
|
|
45615
|
+
}
|
|
45616
|
+
if (dynamic.needsKey) {
|
|
45617
|
+
for (const child of dynamic.children) {
|
|
45618
|
+
const keyValue = key ? genExpression(key, context) : JSON.stringify(child.id);
|
|
45619
|
+
push(NEWLINE, `n${child.id}.$key = `, ...keyValue);
|
|
45620
|
+
}
|
|
45621
|
+
}
|
|
45359
45622
|
push(NEWLINE, `return `);
|
|
45360
45623
|
const returnNodes = returns.map((n) => `n${n}`);
|
|
45361
45624
|
const returnsCode = returnNodes.length > 1 ? genMulti(DELIMITERS_ARRAY, ...returnNodes) : [returnNodes[0] || "null"];
|
|
@@ -45514,15 +45777,17 @@ const transformChildren = (node, context) => {
|
|
|
45514
45777
|
};
|
|
45515
45778
|
function processDynamicChildren(context) {
|
|
45516
45779
|
let prevDynamics = [];
|
|
45517
|
-
let
|
|
45780
|
+
let staticCount = 0;
|
|
45781
|
+
let dynamicCount = 0;
|
|
45782
|
+
let lastInsertionChild;
|
|
45518
45783
|
const children = context.dynamic.children;
|
|
45519
45784
|
for (const [index, child] of children.entries()) {
|
|
45520
45785
|
if (child.flags & 4) {
|
|
45521
|
-
prevDynamics.push(child);
|
|
45786
|
+
prevDynamics.push(lastInsertionChild = child);
|
|
45522
45787
|
}
|
|
45523
45788
|
if (!(child.flags & 2)) {
|
|
45524
45789
|
if (prevDynamics.length) {
|
|
45525
|
-
if (
|
|
45790
|
+
if (staticCount) {
|
|
45526
45791
|
context.childrenTemplate[index - prevDynamics.length] = `<!>`;
|
|
45527
45792
|
prevDynamics[0].flags -= 2;
|
|
45528
45793
|
const anchor = prevDynamics[0].anchor = context.increaseId();
|
|
@@ -45535,27 +45800,38 @@ function processDynamicChildren(context) {
|
|
|
45535
45800
|
/* prepend */
|
|
45536
45801
|
);
|
|
45537
45802
|
}
|
|
45803
|
+
dynamicCount += prevDynamics.length;
|
|
45538
45804
|
prevDynamics = [];
|
|
45539
45805
|
}
|
|
45540
|
-
|
|
45806
|
+
staticCount++;
|
|
45541
45807
|
}
|
|
45542
45808
|
}
|
|
45543
45809
|
if (prevDynamics.length) {
|
|
45544
|
-
registerInsertion(
|
|
45810
|
+
registerInsertion(
|
|
45811
|
+
prevDynamics,
|
|
45812
|
+
context,
|
|
45813
|
+
// the logical index of append child
|
|
45814
|
+
dynamicCount + staticCount,
|
|
45815
|
+
true
|
|
45816
|
+
);
|
|
45817
|
+
}
|
|
45818
|
+
if (lastInsertionChild && lastInsertionChild.operation) {
|
|
45819
|
+
lastInsertionChild.operation.last = true;
|
|
45545
45820
|
}
|
|
45546
45821
|
}
|
|
45547
|
-
function registerInsertion(dynamics, context, anchor) {
|
|
45822
|
+
function registerInsertion(dynamics, context, anchor, append) {
|
|
45548
45823
|
for (const child of dynamics) {
|
|
45549
45824
|
if (child.template != null) {
|
|
45550
45825
|
context.registerOperation({
|
|
45551
45826
|
type: 9,
|
|
45552
45827
|
elements: dynamics.map((child2) => child2.id),
|
|
45553
45828
|
parent: context.reference(),
|
|
45554
|
-
anchor
|
|
45829
|
+
anchor: append ? void 0 : anchor
|
|
45555
45830
|
});
|
|
45556
45831
|
} else if (child.operation && isBlockOperation(child.operation)) {
|
|
45557
45832
|
child.operation.parent = context.reference();
|
|
45558
45833
|
child.operation.anchor = anchor;
|
|
45834
|
+
child.operation.append = append;
|
|
45559
45835
|
}
|
|
45560
45836
|
}
|
|
45561
45837
|
}
|
|
@@ -45623,6 +45899,11 @@ function transformComponentElement(node, propsResult, singleRoot, context, isDyn
|
|
|
45623
45899
|
tag = fromSetup;
|
|
45624
45900
|
asset = false;
|
|
45625
45901
|
}
|
|
45902
|
+
const builtInTag = isBuiltInComponent(tag);
|
|
45903
|
+
if (builtInTag) {
|
|
45904
|
+
tag = builtInTag;
|
|
45905
|
+
asset = false;
|
|
45906
|
+
}
|
|
45626
45907
|
const dotIndex = tag.indexOf(".");
|
|
45627
45908
|
if (dotIndex > 0) {
|
|
45628
45909
|
const ns = resolveSetupReference(tag.slice(0, dotIndex), context);
|
|
@@ -45679,6 +45960,7 @@ function resolveSetupReference(name, context) {
|
|
|
45679
45960
|
const PascalName = capitalize(camelName);
|
|
45680
45961
|
return bindings[name] ? name : bindings[camelName] ? camelName : bindings[PascalName] ? PascalName : void 0;
|
|
45681
45962
|
}
|
|
45963
|
+
const dynamicKeys = ["indeterminate"];
|
|
45682
45964
|
function transformNativeElement(node, propsResult, singleRoot, context, getEffectIndex) {
|
|
45683
45965
|
const { tag } = node;
|
|
45684
45966
|
const { scopeId } = context.options;
|
|
@@ -45701,7 +45983,7 @@ function transformNativeElement(node, propsResult, singleRoot, context, getEffec
|
|
|
45701
45983
|
} else {
|
|
45702
45984
|
for (const prop of propsResult[1]) {
|
|
45703
45985
|
const { key, values } = prop;
|
|
45704
|
-
if (key.isStatic && values.length === 1 && values[0].isStatic) {
|
|
45986
|
+
if (key.isStatic && values.length === 1 && values[0].isStatic && !dynamicKeys.includes(key.content)) {
|
|
45705
45987
|
template += ` ${key.content}`;
|
|
45706
45988
|
if (values[0].content) template += `="${values[0].content}"`;
|
|
45707
45989
|
} else {
|
|
@@ -45857,7 +46139,7 @@ function dedupeProperties(results) {
|
|
|
45857
46139
|
}
|
|
45858
46140
|
const name = prop.key.content;
|
|
45859
46141
|
const existing = knownProps.get(name);
|
|
45860
|
-
if (existing) {
|
|
46142
|
+
if (existing && existing.handler === prop.handler) {
|
|
45861
46143
|
if (name === "style" || name === "class") {
|
|
45862
46144
|
mergePropValues(existing, prop);
|
|
45863
46145
|
}
|
|
@@ -45899,7 +46181,8 @@ const transformVHtml = (dir, node, context) => {
|
|
|
45899
46181
|
context.registerEffect([exp], {
|
|
45900
46182
|
type: 7,
|
|
45901
46183
|
element: context.reference(),
|
|
45902
|
-
value: exp
|
|
46184
|
+
value: exp,
|
|
46185
|
+
isComponent: node.tagType === 1
|
|
45903
46186
|
});
|
|
45904
46187
|
};
|
|
45905
46188
|
|
|
@@ -45925,15 +46208,19 @@ const transformVText = (dir, node, context) => {
|
|
|
45925
46208
|
context.childrenTemplate = [String(literal)];
|
|
45926
46209
|
} else {
|
|
45927
46210
|
context.childrenTemplate = [" "];
|
|
45928
|
-
|
|
45929
|
-
|
|
45930
|
-
|
|
45931
|
-
|
|
46211
|
+
const isComponent = node.tagType === 1;
|
|
46212
|
+
if (!isComponent) {
|
|
46213
|
+
context.registerOperation({
|
|
46214
|
+
type: 17,
|
|
46215
|
+
parent: context.reference()
|
|
46216
|
+
});
|
|
46217
|
+
}
|
|
45932
46218
|
context.registerEffect([exp], {
|
|
45933
46219
|
type: 4,
|
|
45934
46220
|
element: context.reference(),
|
|
45935
46221
|
values: [exp],
|
|
45936
|
-
generated: true
|
|
46222
|
+
generated: true,
|
|
46223
|
+
isComponent
|
|
45937
46224
|
});
|
|
45938
46225
|
}
|
|
45939
46226
|
};
|
|
@@ -46023,7 +46310,11 @@ const transformVOn = (dir, node, context) => {
|
|
|
46023
46310
|
key: arg,
|
|
46024
46311
|
value: handler,
|
|
46025
46312
|
handler: true,
|
|
46026
|
-
handlerModifiers:
|
|
46313
|
+
handlerModifiers: {
|
|
46314
|
+
keys: keyModifiers,
|
|
46315
|
+
nonKeys: nonKeyModifiers,
|
|
46316
|
+
options: eventOptionModifiers
|
|
46317
|
+
}
|
|
46027
46318
|
};
|
|
46028
46319
|
}
|
|
46029
46320
|
const delegate = arg.isStatic && !eventOptionModifiers.length && delegatedEvents(arg.content);
|
|
@@ -46061,12 +46352,21 @@ const transformVShow = (dir, node, context) => {
|
|
|
46061
46352
|
);
|
|
46062
46353
|
return;
|
|
46063
46354
|
}
|
|
46355
|
+
let shouldDeferred = false;
|
|
46356
|
+
const parentNode = context.parent && context.parent.node;
|
|
46357
|
+
if (parentNode && parentNode.type === 1) {
|
|
46358
|
+
shouldDeferred = !!(isTransitionTag(parentNode.tag) && findProp(parentNode, "appear", false, true));
|
|
46359
|
+
if (shouldDeferred) {
|
|
46360
|
+
context.parent.parent.block.hasDeferredVShow = true;
|
|
46361
|
+
}
|
|
46362
|
+
}
|
|
46064
46363
|
context.registerOperation({
|
|
46065
46364
|
type: 13,
|
|
46066
46365
|
element: context.reference(),
|
|
46067
46366
|
dir,
|
|
46068
46367
|
name: "show",
|
|
46069
|
-
builtin: true
|
|
46368
|
+
builtin: true,
|
|
46369
|
+
deferred: shouldDeferred
|
|
46070
46370
|
});
|
|
46071
46371
|
};
|
|
46072
46372
|
|
|
@@ -46136,11 +46436,12 @@ const transformText = (node, context) => {
|
|
|
46136
46436
|
} else if (node.type === 5) {
|
|
46137
46437
|
processInterpolation(context);
|
|
46138
46438
|
} else if (node.type === 2) {
|
|
46139
|
-
context.template += node.content;
|
|
46439
|
+
context.template += escapeHtml(node.content);
|
|
46140
46440
|
}
|
|
46141
46441
|
};
|
|
46142
46442
|
function processInterpolation(context) {
|
|
46143
|
-
const
|
|
46443
|
+
const parentNode = context.parent.node;
|
|
46444
|
+
const children = parentNode.children;
|
|
46144
46445
|
const nexts = children.slice(context.index);
|
|
46145
46446
|
const idx = nexts.findIndex((n) => !isTextLike(n));
|
|
46146
46447
|
const nodes = idx > -1 ? nexts.slice(0, idx) : nexts;
|
|
@@ -46148,9 +46449,15 @@ function processInterpolation(context) {
|
|
|
46148
46449
|
if (prev && prev.type === 2) {
|
|
46149
46450
|
nodes.unshift(prev);
|
|
46150
46451
|
}
|
|
46452
|
+
const values = processTextLikeChildren(nodes, context);
|
|
46453
|
+
if (values.length === 0 && parentNode.type !== 0) {
|
|
46454
|
+
return;
|
|
46455
|
+
}
|
|
46151
46456
|
context.template += " ";
|
|
46152
46457
|
const id = context.reference();
|
|
46153
|
-
|
|
46458
|
+
if (values.length === 0) {
|
|
46459
|
+
return;
|
|
46460
|
+
}
|
|
46154
46461
|
const nonConstantExps = values.filter((v) => !isConstantExpression(v));
|
|
46155
46462
|
const isStatic = !nonConstantExps.length || nonConstantExps.every(
|
|
46156
46463
|
(e) => isStaticExpression(e, context.options.bindingMetadata)
|
|
@@ -46170,10 +46477,10 @@ function processInterpolation(context) {
|
|
|
46170
46477
|
}
|
|
46171
46478
|
}
|
|
46172
46479
|
function processTextContainer(children, context) {
|
|
46173
|
-
const values = children
|
|
46480
|
+
const values = processTextLikeChildren(children, context);
|
|
46174
46481
|
const literals = values.map(getLiteralExpressionValue);
|
|
46175
46482
|
if (literals.every((l) => l != null)) {
|
|
46176
|
-
context.childrenTemplate = literals.map((l) => String(l));
|
|
46483
|
+
context.childrenTemplate = literals.map((l) => escapeHtml(String(l)));
|
|
46177
46484
|
} else {
|
|
46178
46485
|
context.childrenTemplate = [" "];
|
|
46179
46486
|
context.registerOperation({
|
|
@@ -46189,13 +46496,19 @@ function processTextContainer(children, context) {
|
|
|
46189
46496
|
});
|
|
46190
46497
|
}
|
|
46191
46498
|
}
|
|
46192
|
-
function
|
|
46193
|
-
|
|
46194
|
-
|
|
46195
|
-
|
|
46196
|
-
|
|
46197
|
-
|
|
46499
|
+
function processTextLikeChildren(nodes, context) {
|
|
46500
|
+
const exps = [];
|
|
46501
|
+
for (const node of nodes) {
|
|
46502
|
+
let exp;
|
|
46503
|
+
markNonTemplate(node, context);
|
|
46504
|
+
if (node.type === 2) {
|
|
46505
|
+
exp = createSimpleExpression(node.content, true, node.loc);
|
|
46506
|
+
} else {
|
|
46507
|
+
exp = node.content;
|
|
46508
|
+
}
|
|
46509
|
+
if (exp.content) exps.push(exp);
|
|
46198
46510
|
}
|
|
46511
|
+
return exps;
|
|
46199
46512
|
}
|
|
46200
46513
|
function isTextLike(node) {
|
|
46201
46514
|
return node.type === 5 || node.type === 2;
|
|
@@ -46318,7 +46631,7 @@ const transformComment = (node, context) => {
|
|
|
46318
46631
|
context.comment.push(node);
|
|
46319
46632
|
context.dynamic.flags |= 2;
|
|
46320
46633
|
} else {
|
|
46321
|
-
context.template += `<!--${node.content}-->`;
|
|
46634
|
+
context.template += `<!--${escapeHtml(node.content)}-->`;
|
|
46322
46635
|
}
|
|
46323
46636
|
};
|
|
46324
46637
|
function getSiblingIf(context, reverse) {
|
|
@@ -46372,6 +46685,7 @@ function processIf(node, dir, context) {
|
|
|
46372
46685
|
};
|
|
46373
46686
|
} else {
|
|
46374
46687
|
const siblingIf = getSiblingIf(context, true);
|
|
46688
|
+
context.dynamic.ifBranch = true;
|
|
46375
46689
|
const siblings = context.parent && context.parent.dynamic.children;
|
|
46376
46690
|
let lastIfNode;
|
|
46377
46691
|
if (siblings) {
|
|
@@ -46428,6 +46742,7 @@ function createIfBranch(node, context) {
|
|
|
46428
46742
|
const branch = newBlock(node);
|
|
46429
46743
|
const exitBlock = context.enterBlock(branch);
|
|
46430
46744
|
context.reference();
|
|
46745
|
+
branch.dynamic.needsKey = isInTransition(context);
|
|
46431
46746
|
return [branch, exitBlock];
|
|
46432
46747
|
}
|
|
46433
46748
|
|
|
@@ -46452,7 +46767,8 @@ function processFor(node, dir, context) {
|
|
|
46452
46767
|
const { source, value, key, index } = parseResult;
|
|
46453
46768
|
const keyProp = findProp(node, "key");
|
|
46454
46769
|
const keyProperty = keyProp && propToExpression(keyProp);
|
|
46455
|
-
const isComponent = node.tagType === 1
|
|
46770
|
+
const isComponent = node.tagType === 1 || // template v-for with a single component child
|
|
46771
|
+
isTemplateWithSingleComponent(node);
|
|
46456
46772
|
context.node = node = wrapTemplate(node, ["for"]);
|
|
46457
46773
|
context.dynamic.flags |= 2 | 4;
|
|
46458
46774
|
const id = context.reference();
|
|
@@ -46481,6 +46797,13 @@ function processFor(node, dir, context) {
|
|
|
46481
46797
|
};
|
|
46482
46798
|
};
|
|
46483
46799
|
}
|
|
46800
|
+
function isTemplateWithSingleComponent(node) {
|
|
46801
|
+
if (node.tag !== "template") return false;
|
|
46802
|
+
const nonCommentChildren = node.children.filter(
|
|
46803
|
+
(c) => c.type !== 3
|
|
46804
|
+
);
|
|
46805
|
+
return nonCommentChildren.length === 1 && nonCommentChildren[0].type === 1 && nonCommentChildren[0].tagType === 1;
|
|
46806
|
+
}
|
|
46484
46807
|
|
|
46485
46808
|
const transformSlotOutlet = (node, context) => {
|
|
46486
46809
|
if (node.type !== 1 || node.tag !== "slot") {
|
|
@@ -46554,7 +46877,8 @@ const transformSlotOutlet = (node, context) => {
|
|
|
46554
46877
|
id,
|
|
46555
46878
|
name: slotName,
|
|
46556
46879
|
props: irProps,
|
|
46557
|
-
fallback
|
|
46880
|
+
fallback,
|
|
46881
|
+
noSlotted: !!(context.options.scopeId && !context.options.slotted)
|
|
46558
46882
|
};
|
|
46559
46883
|
};
|
|
46560
46884
|
};
|
|
@@ -46616,7 +46940,22 @@ function transformComponentSlot(node, dir, context) {
|
|
|
46616
46940
|
markNonTemplate(n, context);
|
|
46617
46941
|
});
|
|
46618
46942
|
}
|
|
46619
|
-
|
|
46943
|
+
let slotKey;
|
|
46944
|
+
if (isTransitionNode(node) && nonSlotTemplateChildren.length) {
|
|
46945
|
+
const nonCommentChild = nonSlotTemplateChildren.find(
|
|
46946
|
+
(n) => n.type !== 3
|
|
46947
|
+
);
|
|
46948
|
+
if (nonCommentChild) {
|
|
46949
|
+
const keyProp = findProp(
|
|
46950
|
+
nonCommentChild,
|
|
46951
|
+
"key"
|
|
46952
|
+
);
|
|
46953
|
+
if (keyProp) {
|
|
46954
|
+
slotKey = keyProp.exp;
|
|
46955
|
+
}
|
|
46956
|
+
}
|
|
46957
|
+
}
|
|
46958
|
+
const [block, onExit] = createSlotBlock(node, dir, context, slotKey);
|
|
46620
46959
|
const { slots } = context;
|
|
46621
46960
|
return () => {
|
|
46622
46961
|
onExit();
|
|
@@ -46750,9 +47089,13 @@ function hasStaticSlot(slots, name) {
|
|
|
46750
47089
|
if (slot.slotType === 0) return !!slot.slots[name];
|
|
46751
47090
|
});
|
|
46752
47091
|
}
|
|
46753
|
-
function createSlotBlock(slotNode, dir, context) {
|
|
47092
|
+
function createSlotBlock(slotNode, dir, context, key = void 0) {
|
|
46754
47093
|
const block = newBlock(slotNode);
|
|
46755
47094
|
block.props = dir && dir.exp;
|
|
47095
|
+
if (key) {
|
|
47096
|
+
block.key = key;
|
|
47097
|
+
block.dynamic.needsKey = true;
|
|
47098
|
+
}
|
|
46756
47099
|
const exitBlock = context.enterBlock(block);
|
|
46757
47100
|
return [block, exitBlock];
|
|
46758
47101
|
}
|
|
@@ -46761,6 +47104,37 @@ function isNonWhitespaceContent(node) {
|
|
|
46761
47104
|
return !!node.content.trim();
|
|
46762
47105
|
}
|
|
46763
47106
|
|
|
47107
|
+
const transformTransition = (node, context) => {
|
|
47108
|
+
if (node.type === 1 && node.tagType === 1) {
|
|
47109
|
+
if (isTransitionTag(node.tag)) {
|
|
47110
|
+
return postTransformTransition(
|
|
47111
|
+
node,
|
|
47112
|
+
context.options.onError,
|
|
47113
|
+
hasMultipleChildren
|
|
47114
|
+
);
|
|
47115
|
+
}
|
|
47116
|
+
}
|
|
47117
|
+
};
|
|
47118
|
+
function hasMultipleChildren(node) {
|
|
47119
|
+
const children = node.children = node.children.filter(
|
|
47120
|
+
(c) => c.type !== 3 && !(c.type === 2 && !c.content.trim())
|
|
47121
|
+
);
|
|
47122
|
+
const first = children[0];
|
|
47123
|
+
if (children.length === 1 && first.type === 1 && (findDir(first, "for") || isTemplateNode(first))) {
|
|
47124
|
+
return true;
|
|
47125
|
+
}
|
|
47126
|
+
const hasElse = (node2) => findDir(node2, "else-if") || findDir(node2, "else", true);
|
|
47127
|
+
if (children.every(
|
|
47128
|
+
(c, index) => c.type === 1 && // not template
|
|
47129
|
+
!isTemplateNode(c) && // not has v-for
|
|
47130
|
+
!findDir(c, "for") && // if the first child has v-if, the rest should also have v-else-if/v-else
|
|
47131
|
+
(index === 0 ? findDir(c, "if") : hasElse(c)) && !hasMultipleChildren(c)
|
|
47132
|
+
)) {
|
|
47133
|
+
return false;
|
|
47134
|
+
}
|
|
47135
|
+
return children.length > 1;
|
|
47136
|
+
}
|
|
47137
|
+
|
|
46764
47138
|
function compile$1(source, options = {}) {
|
|
46765
47139
|
const resolvedOptions = extend({}, options);
|
|
46766
47140
|
const ast = isString$1(source) ? parse$3(source, resolvedOptions) : source;
|
|
@@ -46779,6 +47153,7 @@ function compile$1(source, options = {}) {
|
|
|
46779
47153
|
extend({}, resolvedOptions, {
|
|
46780
47154
|
nodeTransforms: [
|
|
46781
47155
|
...nodeTransforms,
|
|
47156
|
+
...[transformTransition] ,
|
|
46782
47157
|
...options.nodeTransforms || []
|
|
46783
47158
|
// user transforms
|
|
46784
47159
|
],
|
|
@@ -46924,7 +47299,7 @@ const ssrHelpers = {
|
|
|
46924
47299
|
registerRuntimeHelpers(ssrHelpers);
|
|
46925
47300
|
|
|
46926
47301
|
const ssrTransformIf = createStructuralDirectiveTransform$1(
|
|
46927
|
-
/^(if|else|else-if)$/,
|
|
47302
|
+
/^(?:if|else|else-if)$/,
|
|
46928
47303
|
processIf$1
|
|
46929
47304
|
);
|
|
46930
47305
|
function ssrProcessIf(node, context, disableNestedFragments = false, disableComment = false) {
|
|
@@ -47163,6 +47538,14 @@ const ssrTransformElement = (node, context) => {
|
|
|
47163
47538
|
const hasCustomDir = node.props.some(
|
|
47164
47539
|
(p) => p.type === 7 && !isBuiltInDirective(p.name)
|
|
47165
47540
|
);
|
|
47541
|
+
const vShowPropIndex = node.props.findIndex(
|
|
47542
|
+
(i) => i.type === 7 && i.name === "show"
|
|
47543
|
+
);
|
|
47544
|
+
if (vShowPropIndex !== -1) {
|
|
47545
|
+
const vShowProp = node.props[vShowPropIndex];
|
|
47546
|
+
node.props.splice(vShowPropIndex, 1);
|
|
47547
|
+
node.props.push(vShowProp);
|
|
47548
|
+
}
|
|
47166
47549
|
const needMergeProps = hasDynamicVBind || hasCustomDir;
|
|
47167
47550
|
if (needMergeProps) {
|
|
47168
47551
|
const { props, directives } = buildProps$1(
|
|
@@ -47181,7 +47564,7 @@ const ssrTransformElement = (node, context) => {
|
|
|
47181
47564
|
);
|
|
47182
47565
|
if (node.tag === "textarea") {
|
|
47183
47566
|
const existingText = node.children[0];
|
|
47184
|
-
if (!existingText || existingText.type !== 5) {
|
|
47567
|
+
if (!hasContentOverrideDirective(node) && (!existingText || existingText.type !== 5)) {
|
|
47185
47568
|
const tempId = `_temp${context.temps++}`;
|
|
47186
47569
|
propsExp.arguments = [
|
|
47187
47570
|
createAssignmentExpression(
|
|
@@ -47228,8 +47611,7 @@ const ssrTransformElement = (node, context) => {
|
|
|
47228
47611
|
];
|
|
47229
47612
|
}
|
|
47230
47613
|
} else if (directives.length && !node.children.length) {
|
|
47231
|
-
|
|
47232
|
-
if (!vText) {
|
|
47614
|
+
if (!hasContentOverrideDirective(node)) {
|
|
47233
47615
|
const tempId = `_temp${context.temps++}`;
|
|
47234
47616
|
propsExp.arguments = [
|
|
47235
47617
|
createAssignmentExpression(
|
|
@@ -47443,6 +47825,9 @@ function findVModel(node) {
|
|
|
47443
47825
|
(p) => p.type === 7 && p.name === "model" && p.exp
|
|
47444
47826
|
);
|
|
47445
47827
|
}
|
|
47828
|
+
function hasContentOverrideDirective(node) {
|
|
47829
|
+
return !!findDir$1(node, "text") || !!findDir$1(node, "html");
|
|
47830
|
+
}
|
|
47446
47831
|
function ssrProcessElement(node, context) {
|
|
47447
47832
|
const isVoidTag = context.options.isVoidTag || NO;
|
|
47448
47833
|
const elementsToAdd = node.ssrCodegenNode.elements;
|
|
@@ -48258,6 +48643,7 @@ function compile(source, options = {}) {
|
|
|
48258
48643
|
transform$1(ast, __spreadProps$6(__spreadValues$7({}, options), {
|
|
48259
48644
|
hoistStatic: false,
|
|
48260
48645
|
nodeTransforms: [
|
|
48646
|
+
transformVBindShorthand,
|
|
48261
48647
|
ssrTransformIf,
|
|
48262
48648
|
ssrTransformFor,
|
|
48263
48649
|
trackVForSlotScopes,
|
|
@@ -56994,8 +57380,9 @@ function requireDist () {
|
|
|
56994
57380
|
var distExports = /*@__PURE__*/ requireDist();
|
|
56995
57381
|
var selectorParser = /*@__PURE__*/getDefaultExportFromCjs(distExports);
|
|
56996
57382
|
|
|
56997
|
-
const animationNameRE = /^(
|
|
56998
|
-
const animationRE = /^(
|
|
57383
|
+
const animationNameRE = /^(?:-\w+-)?animation-name$/;
|
|
57384
|
+
const animationRE = /^(?:-\w+-)?animation$/;
|
|
57385
|
+
const keyframesRE = /^(?:-\w+-)?keyframes$/;
|
|
56999
57386
|
const scopedPlugin = (id = "") => {
|
|
57000
57387
|
const keyframes = /* @__PURE__ */ Object.create(null);
|
|
57001
57388
|
const shortId = id.replace(/^data-v-/, "");
|
|
@@ -57005,7 +57392,7 @@ const scopedPlugin = (id = "") => {
|
|
|
57005
57392
|
processRule(id, rule);
|
|
57006
57393
|
},
|
|
57007
57394
|
AtRule(node) {
|
|
57008
|
-
if (
|
|
57395
|
+
if (keyframesRE.test(node.name) && !node.params.endsWith(`-${shortId}`)) {
|
|
57009
57396
|
keyframes[node.params] = node.params = node.params + "-" + shortId;
|
|
57010
57397
|
}
|
|
57011
57398
|
},
|
|
@@ -57034,7 +57421,7 @@ const scopedPlugin = (id = "") => {
|
|
|
57034
57421
|
};
|
|
57035
57422
|
const processedRules = /* @__PURE__ */ new WeakSet();
|
|
57036
57423
|
function processRule(id, rule) {
|
|
57037
|
-
if (processedRules.has(rule) || rule.parent && rule.parent.type === "atrule" &&
|
|
57424
|
+
if (processedRules.has(rule) || rule.parent && rule.parent.type === "atrule" && keyframesRE.test(rule.parent.name)) {
|
|
57038
57425
|
return;
|
|
57039
57426
|
}
|
|
57040
57427
|
processedRules.add(rule);
|
|
@@ -60824,6 +61211,9 @@ function getImportedName(specifier) {
|
|
|
60824
61211
|
function getId(node) {
|
|
60825
61212
|
return node.type === "Identifier" ? node.name : node.type === "StringLiteral" ? node.value : null;
|
|
60826
61213
|
}
|
|
61214
|
+
function getStringLiteralKey(node) {
|
|
61215
|
+
return node.computed ? node.key.type === "TemplateLiteral" && !node.key.expressions.length ? node.key.quasis.map((q) => q.value.cooked).join("") : null : node.key.type === "Identifier" ? node.key.name : node.key.type === "StringLiteral" ? node.key.value : node.key.type === "NumericLiteral" ? String(node.key.value) : null;
|
|
61216
|
+
}
|
|
60827
61217
|
const normalize = (path.posix || path).normalize;
|
|
60828
61218
|
const windowsSlashRE = /\\/g;
|
|
60829
61219
|
function normalizePath(p) {
|
|
@@ -60834,6 +61224,8 @@ const propNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~\-]/;
|
|
|
60834
61224
|
function getEscapedPropName(key) {
|
|
60835
61225
|
return propNameEscapeSymbolsRE.test(key) ? JSON.stringify(key) : key;
|
|
60836
61226
|
}
|
|
61227
|
+
const isJS = (...langs) => langs.some((lang) => lang === "js" || lang === "jsx");
|
|
61228
|
+
const isTS = (...langs) => langs.some((lang) => lang === "ts" || lang === "tsx");
|
|
60837
61229
|
|
|
60838
61230
|
function analyzeScriptBindings(ast) {
|
|
60839
61231
|
for (const node of ast) {
|
|
@@ -61559,6 +61951,10 @@ class MagicString {
|
|
|
61559
61951
|
if (chunk.outro.length) mappings.advance(chunk.outro);
|
|
61560
61952
|
});
|
|
61561
61953
|
|
|
61954
|
+
if (this.outro) {
|
|
61955
|
+
mappings.advance(this.outro);
|
|
61956
|
+
}
|
|
61957
|
+
|
|
61562
61958
|
return {
|
|
61563
61959
|
file: options.file ? options.file.split(/[/\\]/).pop() : undefined,
|
|
61564
61960
|
sources: [
|
|
@@ -62025,12 +62421,18 @@ class MagicString {
|
|
|
62025
62421
|
if (this.byStart[index] || this.byEnd[index]) return;
|
|
62026
62422
|
|
|
62027
62423
|
let chunk = this.lastSearchedChunk;
|
|
62424
|
+
let previousChunk = chunk;
|
|
62028
62425
|
const searchForward = index > chunk.end;
|
|
62029
62426
|
|
|
62030
62427
|
while (chunk) {
|
|
62031
62428
|
if (chunk.contains(index)) return this._splitChunk(chunk, index);
|
|
62032
62429
|
|
|
62033
62430
|
chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
|
|
62431
|
+
|
|
62432
|
+
// Prevent infinite loop (e.g. via empty chunks, where start === end)
|
|
62433
|
+
if (chunk === previousChunk) return;
|
|
62434
|
+
|
|
62435
|
+
previousChunk = chunk;
|
|
62034
62436
|
}
|
|
62035
62437
|
}
|
|
62036
62438
|
|
|
@@ -62218,7 +62620,12 @@ class MagicString {
|
|
|
62218
62620
|
const index = original.indexOf(string);
|
|
62219
62621
|
|
|
62220
62622
|
if (index !== -1) {
|
|
62221
|
-
|
|
62623
|
+
if (typeof replacement === 'function') {
|
|
62624
|
+
replacement = replacement(string, index, original);
|
|
62625
|
+
}
|
|
62626
|
+
if (string !== replacement) {
|
|
62627
|
+
this.overwrite(index, index + string.length, replacement);
|
|
62628
|
+
}
|
|
62222
62629
|
}
|
|
62223
62630
|
|
|
62224
62631
|
return this;
|
|
@@ -62241,7 +62648,11 @@ class MagicString {
|
|
|
62241
62648
|
index = original.indexOf(string, index + stringLength)
|
|
62242
62649
|
) {
|
|
62243
62650
|
const previous = original.slice(index, index + stringLength);
|
|
62244
|
-
|
|
62651
|
+
let _replacement = replacement;
|
|
62652
|
+
if (typeof replacement === 'function') {
|
|
62653
|
+
_replacement = replacement(previous, index, original);
|
|
62654
|
+
}
|
|
62655
|
+
if (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement);
|
|
62245
62656
|
}
|
|
62246
62657
|
|
|
62247
62658
|
return this;
|
|
@@ -62292,8 +62703,8 @@ class ScriptCompileContext {
|
|
|
62292
62703
|
const { script, scriptSetup } = descriptor;
|
|
62293
62704
|
const scriptLang = script && script.lang;
|
|
62294
62705
|
const scriptSetupLang = scriptSetup && scriptSetup.lang;
|
|
62295
|
-
this.isJS = scriptLang
|
|
62296
|
-
this.isTS = scriptLang
|
|
62706
|
+
this.isJS = isJS(scriptLang, scriptSetupLang);
|
|
62707
|
+
this.isTS = isTS(scriptLang, scriptSetupLang);
|
|
62297
62708
|
const customElement = options.customElement;
|
|
62298
62709
|
const filename = this.descriptor.filename;
|
|
62299
62710
|
if (customElement) {
|
|
@@ -62491,9 +62902,6 @@ const normalScriptDefaultVar = `__default__`;
|
|
|
62491
62902
|
function processNormalScript(ctx, scopeId) {
|
|
62492
62903
|
var _a;
|
|
62493
62904
|
const script = ctx.descriptor.script;
|
|
62494
|
-
if (script.lang && !ctx.isJS && !ctx.isTS) {
|
|
62495
|
-
return script;
|
|
62496
|
-
}
|
|
62497
62905
|
try {
|
|
62498
62906
|
let content = script.content;
|
|
62499
62907
|
let map = script.map;
|
|
@@ -62725,13 +63133,9 @@ function typeElementsToMap(ctx, elements, scope = ctxToScope(ctx), typeParameter
|
|
|
62725
63133
|
Object.assign(scope.types, typeParameters);
|
|
62726
63134
|
}
|
|
62727
63135
|
e._ownerScope = scope;
|
|
62728
|
-
const name =
|
|
62729
|
-
if (name
|
|
63136
|
+
const name = getStringLiteralKey(e);
|
|
63137
|
+
if (name !== null) {
|
|
62730
63138
|
res.props[name] = e;
|
|
62731
|
-
} else if (e.key.type === "TemplateLiteral") {
|
|
62732
|
-
for (const key of resolveTemplateKeys(ctx, e.key, scope)) {
|
|
62733
|
-
res.props[key] = e;
|
|
62734
|
-
}
|
|
62735
63139
|
} else {
|
|
62736
63140
|
ctx.error(
|
|
62737
63141
|
`Unsupported computed key in type referenced by a macro`,
|
|
@@ -63129,7 +63533,7 @@ function registerTS(_loadTS) {
|
|
|
63129
63533
|
} catch (err) {
|
|
63130
63534
|
if (typeof err.message === "string" && err.message.includes("Cannot find module")) {
|
|
63131
63535
|
throw new Error(
|
|
63132
|
-
'Failed to load TypeScript, which is required for resolving imported types. Please make sure "
|
|
63536
|
+
'Failed to load TypeScript, which is required for resolving imported types. Please make sure "TypeScript" is installed as a project dependency.'
|
|
63133
63537
|
);
|
|
63134
63538
|
} else {
|
|
63135
63539
|
throw new Error(
|
|
@@ -63343,7 +63747,11 @@ function recordTypes(ctx, body, scope, asGlobal = false) {
|
|
|
63343
63747
|
}
|
|
63344
63748
|
} else if (stmt.type === "TSModuleDeclaration" && stmt.global) {
|
|
63345
63749
|
for (const s of stmt.body.body) {
|
|
63346
|
-
|
|
63750
|
+
if (s.type === "ExportNamedDeclaration" && s.declaration) {
|
|
63751
|
+
recordType(s.declaration, types, declares);
|
|
63752
|
+
} else {
|
|
63753
|
+
recordType(s, types, declares);
|
|
63754
|
+
}
|
|
63347
63755
|
}
|
|
63348
63756
|
}
|
|
63349
63757
|
} else {
|
|
@@ -63517,7 +63925,10 @@ function recordImport(node, imports) {
|
|
|
63517
63925
|
};
|
|
63518
63926
|
}
|
|
63519
63927
|
}
|
|
63520
|
-
function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx), isKeyOf = false) {
|
|
63928
|
+
function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx), isKeyOf = false, typeParameters) {
|
|
63929
|
+
if (node.leadingComments && node.leadingComments.some((c) => c.value.includes("@vue-ignore"))) {
|
|
63930
|
+
return [UNKNOWN_TYPE];
|
|
63931
|
+
}
|
|
63521
63932
|
try {
|
|
63522
63933
|
switch (node.type) {
|
|
63523
63934
|
case "TSStringKeyword":
|
|
@@ -63590,12 +64001,38 @@ function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx)
|
|
|
63590
64001
|
case "TSTypeReference": {
|
|
63591
64002
|
const resolved = resolveTypeReference(ctx, node, scope);
|
|
63592
64003
|
if (resolved) {
|
|
63593
|
-
if (resolved.type === "TSTypeAliasDeclaration"
|
|
63594
|
-
|
|
64004
|
+
if (resolved.type === "TSTypeAliasDeclaration") {
|
|
64005
|
+
if (resolved.typeAnnotation.type === "TSFunctionType") {
|
|
64006
|
+
return ["Function"];
|
|
64007
|
+
}
|
|
64008
|
+
if (node.typeParameters) {
|
|
64009
|
+
const typeParams = /* @__PURE__ */ Object.create(null);
|
|
64010
|
+
if (resolved.typeParameters) {
|
|
64011
|
+
resolved.typeParameters.params.forEach((p, i) => {
|
|
64012
|
+
typeParams[p.name] = node.typeParameters.params[i];
|
|
64013
|
+
});
|
|
64014
|
+
}
|
|
64015
|
+
return inferRuntimeType(
|
|
64016
|
+
ctx,
|
|
64017
|
+
resolved.typeAnnotation,
|
|
64018
|
+
resolved._ownerScope,
|
|
64019
|
+
isKeyOf,
|
|
64020
|
+
typeParams
|
|
64021
|
+
);
|
|
64022
|
+
}
|
|
63595
64023
|
}
|
|
63596
64024
|
return inferRuntimeType(ctx, resolved, resolved._ownerScope, isKeyOf);
|
|
63597
64025
|
}
|
|
63598
64026
|
if (node.typeName.type === "Identifier") {
|
|
64027
|
+
if (typeParameters && typeParameters[node.typeName.name]) {
|
|
64028
|
+
return inferRuntimeType(
|
|
64029
|
+
ctx,
|
|
64030
|
+
typeParameters[node.typeName.name],
|
|
64031
|
+
scope,
|
|
64032
|
+
isKeyOf,
|
|
64033
|
+
typeParameters
|
|
64034
|
+
);
|
|
64035
|
+
}
|
|
63599
64036
|
if (isKeyOf) {
|
|
63600
64037
|
switch (node.typeName.name) {
|
|
63601
64038
|
case "String":
|
|
@@ -63718,11 +64155,33 @@ function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx)
|
|
|
63718
64155
|
case "TSParenthesizedType":
|
|
63719
64156
|
return inferRuntimeType(ctx, node.typeAnnotation, scope);
|
|
63720
64157
|
case "TSUnionType":
|
|
63721
|
-
return flattenTypes(ctx, node.types, scope, isKeyOf);
|
|
64158
|
+
return flattenTypes(ctx, node.types, scope, isKeyOf, typeParameters);
|
|
63722
64159
|
case "TSIntersectionType": {
|
|
63723
|
-
return flattenTypes(
|
|
63724
|
-
|
|
63725
|
-
|
|
64160
|
+
return flattenTypes(
|
|
64161
|
+
ctx,
|
|
64162
|
+
node.types,
|
|
64163
|
+
scope,
|
|
64164
|
+
isKeyOf,
|
|
64165
|
+
typeParameters
|
|
64166
|
+
).filter((t) => t !== UNKNOWN_TYPE);
|
|
64167
|
+
}
|
|
64168
|
+
case "TSMappedType": {
|
|
64169
|
+
const { typeAnnotation, typeParameter } = node;
|
|
64170
|
+
if (typeAnnotation && typeAnnotation.type === "TSIndexedAccessType" && typeParameter && typeParameter.constraint && typeParameters) {
|
|
64171
|
+
const constraint = typeParameter.constraint;
|
|
64172
|
+
if (constraint.type === "TSTypeOperator" && constraint.operator === "keyof" && constraint.typeAnnotation && constraint.typeAnnotation.type === "TSTypeReference" && constraint.typeAnnotation.typeName.type === "Identifier") {
|
|
64173
|
+
const typeName = constraint.typeAnnotation.typeName.name;
|
|
64174
|
+
const index = typeAnnotation.indexType;
|
|
64175
|
+
const obj = typeAnnotation.objectType;
|
|
64176
|
+
if (obj && obj.type === "TSTypeReference" && obj.typeName.type === "Identifier" && obj.typeName.name === typeName && index && index.type === "TSTypeReference" && index.typeName.type === "Identifier" && index.typeName.name === typeParameter.name) {
|
|
64177
|
+
const targetType = typeParameters[typeName];
|
|
64178
|
+
if (targetType) {
|
|
64179
|
+
return inferRuntimeType(ctx, targetType, scope);
|
|
64180
|
+
}
|
|
64181
|
+
}
|
|
64182
|
+
}
|
|
64183
|
+
}
|
|
64184
|
+
return [UNKNOWN_TYPE];
|
|
63726
64185
|
}
|
|
63727
64186
|
case "TSEnumDeclaration":
|
|
63728
64187
|
return inferEnumType(node);
|
|
@@ -63777,14 +64236,16 @@ function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx)
|
|
|
63777
64236
|
}
|
|
63778
64237
|
return [UNKNOWN_TYPE];
|
|
63779
64238
|
}
|
|
63780
|
-
function flattenTypes(ctx, types, scope, isKeyOf = false) {
|
|
64239
|
+
function flattenTypes(ctx, types, scope, isKeyOf = false, typeParameters = void 0) {
|
|
63781
64240
|
if (types.length === 1) {
|
|
63782
|
-
return inferRuntimeType(ctx, types[0], scope, isKeyOf);
|
|
64241
|
+
return inferRuntimeType(ctx, types[0], scope, isKeyOf, typeParameters);
|
|
63783
64242
|
}
|
|
63784
64243
|
return [
|
|
63785
64244
|
...new Set(
|
|
63786
64245
|
[].concat(
|
|
63787
|
-
...types.map(
|
|
64246
|
+
...types.map(
|
|
64247
|
+
(t) => inferRuntimeType(ctx, t, scope, isKeyOf, typeParameters)
|
|
64248
|
+
)
|
|
63788
64249
|
)
|
|
63789
64250
|
)
|
|
63790
64251
|
];
|
|
@@ -63870,7 +64331,7 @@ function ctorToType(ctorType) {
|
|
|
63870
64331
|
}
|
|
63871
64332
|
function findStaticPropertyType(node, key) {
|
|
63872
64333
|
const prop = node.members.find(
|
|
63873
|
-
(m) => m.type === "TSPropertySignature" &&
|
|
64334
|
+
(m) => m.type === "TSPropertySignature" && getStringLiteralKey(m) === key && m.typeAnnotation
|
|
63874
64335
|
);
|
|
63875
64336
|
return prop && prop.typeAnnotation.typeAnnotation;
|
|
63876
64337
|
}
|
|
@@ -64693,7 +65154,6 @@ function compileScript(sfc, options) {
|
|
|
64693
65154
|
Upgrade your vite or vue-loader version for compatibility with the latest experimental proposals.`
|
|
64694
65155
|
);
|
|
64695
65156
|
}
|
|
64696
|
-
const ctx = new ScriptCompileContext(sfc, options);
|
|
64697
65157
|
const { script, scriptSetup, source, filename } = sfc;
|
|
64698
65158
|
const hoistStatic = options.hoistStatic !== false && !script;
|
|
64699
65159
|
const scopeId = options.id ? options.id.replace(/^data-v-/, "") : "";
|
|
@@ -64701,20 +65161,27 @@ Upgrade your vite or vue-loader version for compatibility with the latest experi
|
|
|
64701
65161
|
const scriptSetupLang = scriptSetup && scriptSetup.lang;
|
|
64702
65162
|
const vapor = sfc.vapor || options.vapor;
|
|
64703
65163
|
const ssr = (_a = options.templateOptions) == null ? void 0 : _a.ssr;
|
|
65164
|
+
const setupPreambleLines = [];
|
|
65165
|
+
const isJSOrTS = isJS(scriptLang, scriptSetupLang) || isTS(scriptLang, scriptSetupLang);
|
|
65166
|
+
if (script && scriptSetup && scriptLang !== scriptSetupLang) {
|
|
65167
|
+
throw new Error(
|
|
65168
|
+
`[@vue/compiler-sfc] <script> and <script setup> must have the same language type.`
|
|
65169
|
+
);
|
|
65170
|
+
}
|
|
64704
65171
|
if (!scriptSetup) {
|
|
64705
65172
|
if (!script) {
|
|
64706
65173
|
throw new Error(`[@vue/compiler-sfc] SFC contains no <script> tags.`);
|
|
64707
65174
|
}
|
|
64708
|
-
|
|
64709
|
-
|
|
64710
|
-
|
|
64711
|
-
|
|
64712
|
-
|
|
64713
|
-
);
|
|
65175
|
+
if (script.lang && !isJSOrTS) {
|
|
65176
|
+
return script;
|
|
65177
|
+
}
|
|
65178
|
+
const ctx2 = new ScriptCompileContext(sfc, options);
|
|
65179
|
+
return processNormalScript(ctx2, scopeId);
|
|
64714
65180
|
}
|
|
64715
|
-
if (scriptSetupLang && !
|
|
65181
|
+
if (scriptSetupLang && !isJSOrTS) {
|
|
64716
65182
|
return scriptSetup;
|
|
64717
65183
|
}
|
|
65184
|
+
const ctx = new ScriptCompileContext(sfc, options);
|
|
64718
65185
|
const scriptBindings = /* @__PURE__ */ Object.create(null);
|
|
64719
65186
|
const setupBindings = /* @__PURE__ */ Object.create(null);
|
|
64720
65187
|
let defaultExport;
|
|
@@ -64740,9 +65207,9 @@ Upgrade your vite or vue-loader version for compatibility with the latest experi
|
|
|
64740
65207
|
ctx.s.move(start, end, 0);
|
|
64741
65208
|
}
|
|
64742
65209
|
function registerUserImport(source2, local, imported, isType, isFromSetup, needTemplateUsageCheck) {
|
|
64743
|
-
let
|
|
65210
|
+
let isImportUsed = needTemplateUsageCheck;
|
|
64744
65211
|
if (needTemplateUsageCheck && ctx.isTS && sfc.template && !sfc.template.src && !sfc.template.lang) {
|
|
64745
|
-
|
|
65212
|
+
isImportUsed = isUsedInTemplate(local, sfc);
|
|
64746
65213
|
}
|
|
64747
65214
|
ctx.userImports[local] = {
|
|
64748
65215
|
isType,
|
|
@@ -64750,7 +65217,7 @@ Upgrade your vite or vue-loader version for compatibility with the latest experi
|
|
|
64750
65217
|
local,
|
|
64751
65218
|
source: source2,
|
|
64752
65219
|
isFromSetup,
|
|
64753
|
-
isUsedInTemplate
|
|
65220
|
+
isUsedInTemplate: isImportUsed
|
|
64754
65221
|
};
|
|
64755
65222
|
}
|
|
64756
65223
|
function checkInvalidScopeReference(node, method) {
|
|
@@ -64765,8 +65232,36 @@ Upgrade your vite or vue-loader version for compatibility with the latest experi
|
|
|
64765
65232
|
}
|
|
64766
65233
|
});
|
|
64767
65234
|
}
|
|
65235
|
+
function buildDestructureElements() {
|
|
65236
|
+
if (!sfc.template || !sfc.template.ast) return;
|
|
65237
|
+
const builtins = {
|
|
65238
|
+
$props: {
|
|
65239
|
+
bindingType: "setup-reactive-const",
|
|
65240
|
+
setup: () => setupPreambleLines.push(`const $props = __props`)
|
|
65241
|
+
},
|
|
65242
|
+
$emit: {
|
|
65243
|
+
bindingType: "setup-const",
|
|
65244
|
+
setup: () => ctx.emitDecl ? setupPreambleLines.push(`const $emit = __emit`) : destructureElements.push("emit: $emit")
|
|
65245
|
+
},
|
|
65246
|
+
$attrs: {
|
|
65247
|
+
bindingType: "setup-reactive-const",
|
|
65248
|
+
setup: () => destructureElements.push("attrs: $attrs")
|
|
65249
|
+
},
|
|
65250
|
+
$slots: {
|
|
65251
|
+
bindingType: "setup-reactive-const",
|
|
65252
|
+
setup: () => destructureElements.push("slots: $slots")
|
|
65253
|
+
}
|
|
65254
|
+
};
|
|
65255
|
+
for (const [name, config] of Object.entries(builtins)) {
|
|
65256
|
+
if (isUsedInTemplate(name, sfc) && !ctx.bindingMetadata[name]) {
|
|
65257
|
+
config.setup();
|
|
65258
|
+
ctx.bindingMetadata[name] = config.bindingType;
|
|
65259
|
+
}
|
|
65260
|
+
}
|
|
65261
|
+
}
|
|
64768
65262
|
const scriptAst = ctx.scriptAst;
|
|
64769
65263
|
const scriptSetupAst = ctx.scriptSetupAst;
|
|
65264
|
+
const inlineMode = options.inlineTemplate;
|
|
64770
65265
|
if (scriptAst) {
|
|
64771
65266
|
for (const node of scriptAst.body) {
|
|
64772
65267
|
if (node.type === "ImportDeclaration") {
|
|
@@ -64778,7 +65273,7 @@ Upgrade your vite or vue-loader version for compatibility with the latest experi
|
|
|
64778
65273
|
imported,
|
|
64779
65274
|
node.importKind === "type" || specifier.type === "ImportSpecifier" && specifier.importKind === "type",
|
|
64780
65275
|
false,
|
|
64781
|
-
!
|
|
65276
|
+
!inlineMode
|
|
64782
65277
|
);
|
|
64783
65278
|
}
|
|
64784
65279
|
}
|
|
@@ -64803,6 +65298,13 @@ Upgrade your vite or vue-loader version for compatibility with the latest experi
|
|
|
64803
65298
|
const local = specifier.local.name;
|
|
64804
65299
|
const imported = getImportedName(specifier);
|
|
64805
65300
|
const source2 = node.source.value;
|
|
65301
|
+
if (vapor && ssr && specifier.type === "ImportSpecifier" && source2 === "vue" && imported === "defineVaporAsyncComponent") {
|
|
65302
|
+
ctx.s.overwrite(
|
|
65303
|
+
specifier.start + startOffset,
|
|
65304
|
+
specifier.end + startOffset,
|
|
65305
|
+
`defineAsyncComponent as ${local}`
|
|
65306
|
+
);
|
|
65307
|
+
}
|
|
64806
65308
|
const existing = ctx.userImports[local];
|
|
64807
65309
|
if (source2 === "vue" && MACROS.includes(imported)) {
|
|
64808
65310
|
if (local === imported) {
|
|
@@ -64832,7 +65334,7 @@ Upgrade your vite or vue-loader version for compatibility with the latest experi
|
|
|
64832
65334
|
imported,
|
|
64833
65335
|
node.importKind === "type" || specifier.type === "ImportSpecifier" && specifier.importKind === "type",
|
|
64834
65336
|
true,
|
|
64835
|
-
!
|
|
65337
|
+
!inlineMode
|
|
64836
65338
|
);
|
|
64837
65339
|
}
|
|
64838
65340
|
}
|
|
@@ -65136,16 +65638,20 @@ ${genCssVarsCode(
|
|
|
65136
65638
|
let __temp${any}, __restore${any}
|
|
65137
65639
|
`);
|
|
65138
65640
|
}
|
|
65139
|
-
const destructureElements = ctx.hasDefineExposeCall || !
|
|
65641
|
+
const destructureElements = ctx.hasDefineExposeCall || !inlineMode ? [`expose: __expose`] : [];
|
|
65140
65642
|
if (ctx.emitDecl) {
|
|
65141
65643
|
destructureElements.push(`emit: __emit`);
|
|
65142
65644
|
}
|
|
65645
|
+
if (inlineMode) {
|
|
65646
|
+
buildDestructureElements();
|
|
65647
|
+
}
|
|
65143
65648
|
if (destructureElements.length) {
|
|
65144
65649
|
args += `, { ${destructureElements.join(", ")} }`;
|
|
65145
65650
|
}
|
|
65146
65651
|
let templateMap;
|
|
65147
65652
|
let returned;
|
|
65148
|
-
|
|
65653
|
+
const propsDecl = genRuntimeProps(ctx);
|
|
65654
|
+
if (!inlineMode || !sfc.template && ctx.hasDefaultExportRender) {
|
|
65149
65655
|
const allBindings = __spreadValues$1(__spreadValues$1({}, scriptBindings), setupBindings);
|
|
65150
65656
|
for (const key in ctx.userImports) {
|
|
65151
65657
|
if (!ctx.userImports[key].isType && ctx.userImports[key].isUsedInTemplate) {
|
|
@@ -65217,7 +65723,7 @@ let __temp${any}, __restore${any}
|
|
|
65217
65723
|
returned = `() => {}`;
|
|
65218
65724
|
}
|
|
65219
65725
|
}
|
|
65220
|
-
if (!
|
|
65726
|
+
if (!inlineMode && true) {
|
|
65221
65727
|
ctx.s.appendRight(
|
|
65222
65728
|
endOffset,
|
|
65223
65729
|
`
|
|
@@ -65252,7 +65758,6 @@ ${vapor && !ssr ? `` : `return `}${returned}
|
|
|
65252
65758
|
runtimeOptions += `
|
|
65253
65759
|
__ssrInlineRender: true,`;
|
|
65254
65760
|
}
|
|
65255
|
-
const propsDecl = genRuntimeProps(ctx);
|
|
65256
65761
|
if (propsDecl) runtimeOptions += `
|
|
65257
65762
|
props: ${propsDecl},`;
|
|
65258
65763
|
const emitsDecl = genRuntimeEmits(ctx);
|
|
@@ -65262,9 +65767,15 @@ ${vapor && !ssr ? `` : `return `}${returned}
|
|
|
65262
65767
|
if (ctx.optionsRuntimeDecl) {
|
|
65263
65768
|
definedOptions = scriptSetup.content.slice(ctx.optionsRuntimeDecl.start, ctx.optionsRuntimeDecl.end).trim();
|
|
65264
65769
|
}
|
|
65265
|
-
|
|
65266
|
-
|
|
65770
|
+
if (!ctx.hasDefineExposeCall && !inlineMode)
|
|
65771
|
+
setupPreambleLines.push(`__expose();`);
|
|
65772
|
+
const setupPreamble = setupPreambleLines.length ? ` ${setupPreambleLines.join("\n ")}
|
|
65773
|
+
` : "";
|
|
65267
65774
|
if (ctx.isTS) {
|
|
65775
|
+
if (ssr && vapor) {
|
|
65776
|
+
runtimeOptions += `
|
|
65777
|
+
__vapor: true,`;
|
|
65778
|
+
}
|
|
65268
65779
|
const def = (defaultExport ? `
|
|
65269
65780
|
...${normalScriptDefaultVar},` : ``) + (definedOptions ? `
|
|
65270
65781
|
...${definedOptions},` : "");
|
|
@@ -65275,7 +65786,7 @@ ${genDefaultAs} /*@__PURE__*/${ctx.helper(
|
|
|
65275
65786
|
vapor && !ssr ? `defineVaporComponent` : `defineComponent`
|
|
65276
65787
|
)}({${def}${runtimeOptions}
|
|
65277
65788
|
${hasAwait ? `async ` : ``}setup(${args}) {
|
|
65278
|
-
${
|
|
65789
|
+
${setupPreamble}`
|
|
65279
65790
|
);
|
|
65280
65791
|
ctx.s.appendRight(endOffset, `})`);
|
|
65281
65792
|
} else {
|
|
@@ -65289,7 +65800,7 @@ ${exposeCall}`
|
|
|
65289
65800
|
`
|
|
65290
65801
|
${genDefaultAs} /*@__PURE__*/Object.assign(${defaultExport ? `${normalScriptDefaultVar}, ` : ""}${definedOptions ? `${definedOptions}, ` : ""}{${runtimeOptions}
|
|
65291
65802
|
${hasAwait ? `async ` : ``}setup(${args}) {
|
|
65292
|
-
${
|
|
65803
|
+
${setupPreamble}`
|
|
65293
65804
|
);
|
|
65294
65805
|
ctx.s.appendRight(endOffset, `})`);
|
|
65295
65806
|
} else {
|
|
@@ -65298,7 +65809,7 @@ ${exposeCall}`
|
|
|
65298
65809
|
`
|
|
65299
65810
|
${genDefaultAs} {${runtimeOptions}
|
|
65300
65811
|
${hasAwait ? `async ` : ``}setup(${args}) {
|
|
65301
|
-
${
|
|
65812
|
+
${setupPreamble}`
|
|
65302
65813
|
);
|
|
65303
65814
|
ctx.s.appendRight(endOffset, `}`);
|
|
65304
65815
|
}
|
|
@@ -65512,7 +66023,7 @@ var __spreadValues = (a, b) => {
|
|
|
65512
66023
|
}
|
|
65513
66024
|
return a;
|
|
65514
66025
|
};
|
|
65515
|
-
const version = "3.6.0-alpha.
|
|
66026
|
+
const version = "3.6.0-alpha.3";
|
|
65516
66027
|
const parseCache = parseCache$1;
|
|
65517
66028
|
const errorMessages = __spreadValues(__spreadValues({}, errorMessages$1), DOMErrorMessages);
|
|
65518
66029
|
const walk = walk$2;
|