@vue/compat 3.3.0-alpha.3 → 3.3.0-alpha.5
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/vue.cjs.js +626 -610
- package/dist/vue.cjs.prod.js +592 -594
- package/dist/vue.esm-browser.js +566 -560
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +577 -561
- package/dist/vue.global.js +566 -560
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +157 -151
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +168 -152
- package/dist/vue.runtime.global.js +157 -151
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
package/dist/vue.esm-bundler.js
CHANGED
|
@@ -7,6 +7,96 @@ function makeMap(str, expectsLowerCase) {
|
|
|
7
7
|
return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
const EMPTY_OBJ = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {};
|
|
11
|
+
const EMPTY_ARR = process.env.NODE_ENV !== "production" ? Object.freeze([]) : [];
|
|
12
|
+
const NOOP = () => {
|
|
13
|
+
};
|
|
14
|
+
const NO = () => false;
|
|
15
|
+
const onRE = /^on[^a-z]/;
|
|
16
|
+
const isOn = (key) => onRE.test(key);
|
|
17
|
+
const isModelListener = (key) => key.startsWith("onUpdate:");
|
|
18
|
+
const extend = Object.assign;
|
|
19
|
+
const remove = (arr, el) => {
|
|
20
|
+
const i = arr.indexOf(el);
|
|
21
|
+
if (i > -1) {
|
|
22
|
+
arr.splice(i, 1);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
26
|
+
const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
|
|
27
|
+
const isArray = Array.isArray;
|
|
28
|
+
const isMap = (val) => toTypeString(val) === "[object Map]";
|
|
29
|
+
const isSet = (val) => toTypeString(val) === "[object Set]";
|
|
30
|
+
const isDate = (val) => toTypeString(val) === "[object Date]";
|
|
31
|
+
const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
|
|
32
|
+
const isFunction = (val) => typeof val === "function";
|
|
33
|
+
const isString = (val) => typeof val === "string";
|
|
34
|
+
const isSymbol = (val) => typeof val === "symbol";
|
|
35
|
+
const isObject = (val) => val !== null && typeof val === "object";
|
|
36
|
+
const isPromise = (val) => {
|
|
37
|
+
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
|
38
|
+
};
|
|
39
|
+
const objectToString = Object.prototype.toString;
|
|
40
|
+
const toTypeString = (value) => objectToString.call(value);
|
|
41
|
+
const toRawType = (value) => {
|
|
42
|
+
return toTypeString(value).slice(8, -1);
|
|
43
|
+
};
|
|
44
|
+
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
45
|
+
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
46
|
+
const isReservedProp = /* @__PURE__ */ makeMap(
|
|
47
|
+
// the leading comma is intentional so empty string "" is also included
|
|
48
|
+
",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
|
|
49
|
+
);
|
|
50
|
+
const isBuiltInDirective = /* @__PURE__ */ makeMap(
|
|
51
|
+
"bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
|
|
52
|
+
);
|
|
53
|
+
const cacheStringFunction = (fn) => {
|
|
54
|
+
const cache = /* @__PURE__ */ Object.create(null);
|
|
55
|
+
return (str) => {
|
|
56
|
+
const hit = cache[str];
|
|
57
|
+
return hit || (cache[str] = fn(str));
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
const camelizeRE = /-(\w)/g;
|
|
61
|
+
const camelize = cacheStringFunction((str) => {
|
|
62
|
+
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
|
|
63
|
+
});
|
|
64
|
+
const hyphenateRE = /\B([A-Z])/g;
|
|
65
|
+
const hyphenate = cacheStringFunction(
|
|
66
|
+
(str) => str.replace(hyphenateRE, "-$1").toLowerCase()
|
|
67
|
+
);
|
|
68
|
+
const capitalize = cacheStringFunction(
|
|
69
|
+
(str) => str.charAt(0).toUpperCase() + str.slice(1)
|
|
70
|
+
);
|
|
71
|
+
const toHandlerKey = cacheStringFunction(
|
|
72
|
+
(str) => str ? `on${capitalize(str)}` : ``
|
|
73
|
+
);
|
|
74
|
+
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
75
|
+
const invokeArrayFns = (fns, arg) => {
|
|
76
|
+
for (let i = 0; i < fns.length; i++) {
|
|
77
|
+
fns[i](arg);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const def = (obj, key, value) => {
|
|
81
|
+
Object.defineProperty(obj, key, {
|
|
82
|
+
configurable: true,
|
|
83
|
+
enumerable: false,
|
|
84
|
+
value
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
const looseToNumber = (val) => {
|
|
88
|
+
const n = parseFloat(val);
|
|
89
|
+
return isNaN(n) ? val : n;
|
|
90
|
+
};
|
|
91
|
+
const toNumber = (val) => {
|
|
92
|
+
const n = isString(val) ? Number(val) : NaN;
|
|
93
|
+
return isNaN(n) ? val : n;
|
|
94
|
+
};
|
|
95
|
+
let _globalThis;
|
|
96
|
+
const getGlobalThis = () => {
|
|
97
|
+
return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
|
|
98
|
+
};
|
|
99
|
+
|
|
10
100
|
const PatchFlagNames = {
|
|
11
101
|
[1]: `TEXT`,
|
|
12
102
|
[2]: `CLASS`,
|
|
@@ -226,96 +316,6 @@ const replacer = (_key, val) => {
|
|
|
226
316
|
return val;
|
|
227
317
|
};
|
|
228
318
|
|
|
229
|
-
const EMPTY_OBJ = process.env.NODE_ENV !== "production" ? Object.freeze({}) : {};
|
|
230
|
-
const EMPTY_ARR = process.env.NODE_ENV !== "production" ? Object.freeze([]) : [];
|
|
231
|
-
const NOOP = () => {
|
|
232
|
-
};
|
|
233
|
-
const NO = () => false;
|
|
234
|
-
const onRE = /^on[^a-z]/;
|
|
235
|
-
const isOn = (key) => onRE.test(key);
|
|
236
|
-
const isModelListener = (key) => key.startsWith("onUpdate:");
|
|
237
|
-
const extend = Object.assign;
|
|
238
|
-
const remove = (arr, el) => {
|
|
239
|
-
const i = arr.indexOf(el);
|
|
240
|
-
if (i > -1) {
|
|
241
|
-
arr.splice(i, 1);
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
245
|
-
const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
|
|
246
|
-
const isArray = Array.isArray;
|
|
247
|
-
const isMap = (val) => toTypeString(val) === "[object Map]";
|
|
248
|
-
const isSet = (val) => toTypeString(val) === "[object Set]";
|
|
249
|
-
const isDate = (val) => toTypeString(val) === "[object Date]";
|
|
250
|
-
const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
|
|
251
|
-
const isFunction = (val) => typeof val === "function";
|
|
252
|
-
const isString = (val) => typeof val === "string";
|
|
253
|
-
const isSymbol = (val) => typeof val === "symbol";
|
|
254
|
-
const isObject = (val) => val !== null && typeof val === "object";
|
|
255
|
-
const isPromise = (val) => {
|
|
256
|
-
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
|
257
|
-
};
|
|
258
|
-
const objectToString = Object.prototype.toString;
|
|
259
|
-
const toTypeString = (value) => objectToString.call(value);
|
|
260
|
-
const toRawType = (value) => {
|
|
261
|
-
return toTypeString(value).slice(8, -1);
|
|
262
|
-
};
|
|
263
|
-
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
264
|
-
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
|
|
265
|
-
const isReservedProp = /* @__PURE__ */ makeMap(
|
|
266
|
-
// the leading comma is intentional so empty string "" is also included
|
|
267
|
-
",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
|
|
268
|
-
);
|
|
269
|
-
const isBuiltInDirective = /* @__PURE__ */ makeMap(
|
|
270
|
-
"bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
|
|
271
|
-
);
|
|
272
|
-
const cacheStringFunction = (fn) => {
|
|
273
|
-
const cache = /* @__PURE__ */ Object.create(null);
|
|
274
|
-
return (str) => {
|
|
275
|
-
const hit = cache[str];
|
|
276
|
-
return hit || (cache[str] = fn(str));
|
|
277
|
-
};
|
|
278
|
-
};
|
|
279
|
-
const camelizeRE = /-(\w)/g;
|
|
280
|
-
const camelize = cacheStringFunction((str) => {
|
|
281
|
-
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
|
|
282
|
-
});
|
|
283
|
-
const hyphenateRE = /\B([A-Z])/g;
|
|
284
|
-
const hyphenate = cacheStringFunction(
|
|
285
|
-
(str) => str.replace(hyphenateRE, "-$1").toLowerCase()
|
|
286
|
-
);
|
|
287
|
-
const capitalize = cacheStringFunction(
|
|
288
|
-
(str) => str.charAt(0).toUpperCase() + str.slice(1)
|
|
289
|
-
);
|
|
290
|
-
const toHandlerKey = cacheStringFunction(
|
|
291
|
-
(str) => str ? `on${capitalize(str)}` : ``
|
|
292
|
-
);
|
|
293
|
-
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
294
|
-
const invokeArrayFns = (fns, arg) => {
|
|
295
|
-
for (let i = 0; i < fns.length; i++) {
|
|
296
|
-
fns[i](arg);
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
const def = (obj, key, value) => {
|
|
300
|
-
Object.defineProperty(obj, key, {
|
|
301
|
-
configurable: true,
|
|
302
|
-
enumerable: false,
|
|
303
|
-
value
|
|
304
|
-
});
|
|
305
|
-
};
|
|
306
|
-
const looseToNumber = (val) => {
|
|
307
|
-
const n = parseFloat(val);
|
|
308
|
-
return isNaN(n) ? val : n;
|
|
309
|
-
};
|
|
310
|
-
const toNumber = (val) => {
|
|
311
|
-
const n = isString(val) ? Number(val) : NaN;
|
|
312
|
-
return isNaN(n) ? val : n;
|
|
313
|
-
};
|
|
314
|
-
let _globalThis;
|
|
315
|
-
const getGlobalThis = () => {
|
|
316
|
-
return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
|
|
317
|
-
};
|
|
318
|
-
|
|
319
319
|
function warn$1(msg, ...args) {
|
|
320
320
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
321
321
|
}
|
|
@@ -1475,7 +1475,7 @@ function warn(msg, ...args) {
|
|
|
1475
1475
|
callWithErrorHandling(
|
|
1476
1476
|
appWarnHandler,
|
|
1477
1477
|
instance,
|
|
1478
|
-
|
|
1478
|
+
11,
|
|
1479
1479
|
[
|
|
1480
1480
|
msg + args.join(""),
|
|
1481
1481
|
instance && instance.proxy,
|
|
@@ -1590,21 +1590,21 @@ const ErrorTypeStrings = {
|
|
|
1590
1590
|
["ec"]: "errorCaptured hook",
|
|
1591
1591
|
["rtc"]: "renderTracked hook",
|
|
1592
1592
|
["rtg"]: "renderTriggered hook",
|
|
1593
|
-
[
|
|
1594
|
-
[
|
|
1595
|
-
[
|
|
1596
|
-
[
|
|
1597
|
-
[
|
|
1598
|
-
[
|
|
1599
|
-
[
|
|
1600
|
-
[
|
|
1601
|
-
[
|
|
1602
|
-
[
|
|
1603
|
-
[
|
|
1604
|
-
[
|
|
1605
|
-
[
|
|
1606
|
-
[
|
|
1607
|
-
[
|
|
1593
|
+
[0]: "setup function",
|
|
1594
|
+
[1]: "render function",
|
|
1595
|
+
[2]: "watcher getter",
|
|
1596
|
+
[3]: "watcher callback",
|
|
1597
|
+
[4]: "watcher cleanup function",
|
|
1598
|
+
[5]: "native event handler",
|
|
1599
|
+
[6]: "component event handler",
|
|
1600
|
+
[7]: "vnode hook",
|
|
1601
|
+
[8]: "directive hook",
|
|
1602
|
+
[9]: "transition hook",
|
|
1603
|
+
[10]: "app errorHandler",
|
|
1604
|
+
[11]: "app warnHandler",
|
|
1605
|
+
[12]: "ref function",
|
|
1606
|
+
[13]: "async component loader",
|
|
1607
|
+
[14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
|
|
1608
1608
|
};
|
|
1609
1609
|
function callWithErrorHandling(fn, instance, type, args) {
|
|
1610
1610
|
let res;
|
|
@@ -1653,7 +1653,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
1653
1653
|
callWithErrorHandling(
|
|
1654
1654
|
appErrorHandler,
|
|
1655
1655
|
null,
|
|
1656
|
-
|
|
1656
|
+
10,
|
|
1657
1657
|
[err, exposedInstance, errorInfo]
|
|
1658
1658
|
);
|
|
1659
1659
|
return;
|
|
@@ -1808,7 +1808,7 @@ function flushJobs(seen) {
|
|
|
1808
1808
|
if (process.env.NODE_ENV !== "production" && check(job)) {
|
|
1809
1809
|
continue;
|
|
1810
1810
|
}
|
|
1811
|
-
callWithErrorHandling(job, null,
|
|
1811
|
+
callWithErrorHandling(job, null, 14);
|
|
1812
1812
|
}
|
|
1813
1813
|
}
|
|
1814
1814
|
} finally {
|
|
@@ -2429,7 +2429,7 @@ function emit$1(instance, event, args) {
|
|
|
2429
2429
|
callWithAsyncErrorHandling(
|
|
2430
2430
|
cbs.map((cb) => cb.bind(instance.proxy)),
|
|
2431
2431
|
instance,
|
|
2432
|
-
|
|
2432
|
+
6,
|
|
2433
2433
|
args
|
|
2434
2434
|
);
|
|
2435
2435
|
}
|
|
@@ -2491,7 +2491,7 @@ function compatModelEmit(instance, event, args) {
|
|
|
2491
2491
|
callWithErrorHandling(
|
|
2492
2492
|
modelHandler,
|
|
2493
2493
|
instance,
|
|
2494
|
-
|
|
2494
|
+
6,
|
|
2495
2495
|
args
|
|
2496
2496
|
);
|
|
2497
2497
|
}
|
|
@@ -2563,7 +2563,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
2563
2563
|
callWithAsyncErrorHandling(
|
|
2564
2564
|
handler,
|
|
2565
2565
|
instance,
|
|
2566
|
-
|
|
2566
|
+
6,
|
|
2567
2567
|
args
|
|
2568
2568
|
);
|
|
2569
2569
|
}
|
|
@@ -2578,7 +2578,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
2578
2578
|
callWithAsyncErrorHandling(
|
|
2579
2579
|
onceHandler,
|
|
2580
2580
|
instance,
|
|
2581
|
-
|
|
2581
|
+
6,
|
|
2582
2582
|
args
|
|
2583
2583
|
);
|
|
2584
2584
|
}
|
|
@@ -2762,7 +2762,7 @@ function renderComponentRoot(instance) {
|
|
|
2762
2762
|
}
|
|
2763
2763
|
} catch (err) {
|
|
2764
2764
|
blockStack.length = 0;
|
|
2765
|
-
handleError(err, instance,
|
|
2765
|
+
handleError(err, instance, 1);
|
|
2766
2766
|
result = createVNode(Comment);
|
|
2767
2767
|
}
|
|
2768
2768
|
let root = result;
|
|
@@ -3289,7 +3289,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3289
3289
|
if (delayEnter) {
|
|
3290
3290
|
activeBranch.transition.afterLeave = () => {
|
|
3291
3291
|
if (pendingId === suspense.pendingId) {
|
|
3292
|
-
move(pendingBranch, container2, anchor2,
|
|
3292
|
+
move(pendingBranch, container2, anchor2, 0);
|
|
3293
3293
|
}
|
|
3294
3294
|
};
|
|
3295
3295
|
}
|
|
@@ -3299,7 +3299,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3299
3299
|
unmount(activeBranch, parentComponent2, suspense, true);
|
|
3300
3300
|
}
|
|
3301
3301
|
if (!delayEnter) {
|
|
3302
|
-
move(pendingBranch, container2, anchor2,
|
|
3302
|
+
move(pendingBranch, container2, anchor2, 0);
|
|
3303
3303
|
}
|
|
3304
3304
|
}
|
|
3305
3305
|
setActiveBranch(suspense, pendingBranch);
|
|
@@ -3377,7 +3377,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3377
3377
|
}
|
|
3378
3378
|
const hydratedEl = instance.vnode.el;
|
|
3379
3379
|
instance.asyncDep.catch((err) => {
|
|
3380
|
-
handleError(err, instance,
|
|
3380
|
+
handleError(err, instance, 0);
|
|
3381
3381
|
}).then((asyncSetupResult) => {
|
|
3382
3382
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
|
|
3383
3383
|
return;
|
|
@@ -3621,14 +3621,14 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3621
3621
|
} else if (isReactive(s)) {
|
|
3622
3622
|
return traverse(s);
|
|
3623
3623
|
} else if (isFunction(s)) {
|
|
3624
|
-
return callWithErrorHandling(s, instance,
|
|
3624
|
+
return callWithErrorHandling(s, instance, 2);
|
|
3625
3625
|
} else {
|
|
3626
3626
|
process.env.NODE_ENV !== "production" && warnInvalidSource(s);
|
|
3627
3627
|
}
|
|
3628
3628
|
});
|
|
3629
3629
|
} else if (isFunction(source)) {
|
|
3630
3630
|
if (cb) {
|
|
3631
|
-
getter = () => callWithErrorHandling(source, instance,
|
|
3631
|
+
getter = () => callWithErrorHandling(source, instance, 2);
|
|
3632
3632
|
} else {
|
|
3633
3633
|
getter = () => {
|
|
3634
3634
|
if (instance && instance.isUnmounted) {
|
|
@@ -3640,7 +3640,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3640
3640
|
return callWithAsyncErrorHandling(
|
|
3641
3641
|
source,
|
|
3642
3642
|
instance,
|
|
3643
|
-
|
|
3643
|
+
3,
|
|
3644
3644
|
[onCleanup]
|
|
3645
3645
|
);
|
|
3646
3646
|
};
|
|
@@ -3666,7 +3666,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3666
3666
|
let cleanup;
|
|
3667
3667
|
let onCleanup = (fn) => {
|
|
3668
3668
|
cleanup = effect.onStop = () => {
|
|
3669
|
-
callWithErrorHandling(fn, instance,
|
|
3669
|
+
callWithErrorHandling(fn, instance, 4);
|
|
3670
3670
|
};
|
|
3671
3671
|
};
|
|
3672
3672
|
let ssrCleanup;
|
|
@@ -3675,7 +3675,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3675
3675
|
if (!cb) {
|
|
3676
3676
|
getter();
|
|
3677
3677
|
} else if (immediate) {
|
|
3678
|
-
callWithAsyncErrorHandling(cb, instance,
|
|
3678
|
+
callWithAsyncErrorHandling(cb, instance, 3, [
|
|
3679
3679
|
getter(),
|
|
3680
3680
|
isMultiSource ? [] : void 0,
|
|
3681
3681
|
onCleanup
|
|
@@ -3701,7 +3701,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3701
3701
|
if (cleanup) {
|
|
3702
3702
|
cleanup();
|
|
3703
3703
|
}
|
|
3704
|
-
callWithAsyncErrorHandling(cb, instance,
|
|
3704
|
+
callWithAsyncErrorHandling(cb, instance, 3, [
|
|
3705
3705
|
newValue,
|
|
3706
3706
|
// pass undefined as the old value when it's changed for the first time
|
|
3707
3707
|
oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
|
|
@@ -3983,7 +3983,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
|
|
|
3983
3983
|
hook && callWithAsyncErrorHandling(
|
|
3984
3984
|
hook,
|
|
3985
3985
|
instance,
|
|
3986
|
-
|
|
3986
|
+
9,
|
|
3987
3987
|
args
|
|
3988
3988
|
);
|
|
3989
3989
|
};
|
|
@@ -4215,7 +4215,7 @@ function defineAsyncComponent(source) {
|
|
|
4215
4215
|
handleError(
|
|
4216
4216
|
err,
|
|
4217
4217
|
instance,
|
|
4218
|
-
|
|
4218
|
+
13,
|
|
4219
4219
|
!errorComponent
|
|
4220
4220
|
/* do not throw in dev if user provided error component */
|
|
4221
4221
|
);
|
|
@@ -4320,7 +4320,7 @@ const KeepAliveImpl = {
|
|
|
4320
4320
|
const storageContainer = createElement("div");
|
|
4321
4321
|
sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
|
|
4322
4322
|
const instance2 = vnode.component;
|
|
4323
|
-
move(vnode, container, anchor,
|
|
4323
|
+
move(vnode, container, anchor, 0, parentSuspense);
|
|
4324
4324
|
patch(
|
|
4325
4325
|
instance2.vnode,
|
|
4326
4326
|
vnode,
|
|
@@ -4348,7 +4348,7 @@ const KeepAliveImpl = {
|
|
|
4348
4348
|
};
|
|
4349
4349
|
sharedContext.deactivate = (vnode) => {
|
|
4350
4350
|
const instance2 = vnode.component;
|
|
4351
|
-
move(vnode, storageContainer, null,
|
|
4351
|
+
move(vnode, storageContainer, null, 1, parentSuspense);
|
|
4352
4352
|
queuePostRenderEffect(() => {
|
|
4353
4353
|
if (instance2.da) {
|
|
4354
4354
|
invokeArrayFns(instance2.da);
|
|
@@ -4706,7 +4706,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
4706
4706
|
}
|
|
4707
4707
|
if (hook) {
|
|
4708
4708
|
pauseTracking();
|
|
4709
|
-
callWithAsyncErrorHandling(hook, instance,
|
|
4709
|
+
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
4710
4710
|
vnode.el,
|
|
4711
4711
|
binding,
|
|
4712
4712
|
vnode,
|
|
@@ -4723,7 +4723,7 @@ const FILTERS = "filters";
|
|
|
4723
4723
|
function resolveComponent(name, maybeSelfReference) {
|
|
4724
4724
|
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
4725
4725
|
}
|
|
4726
|
-
const NULL_DYNAMIC_COMPONENT = Symbol();
|
|
4726
|
+
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
4727
4727
|
function resolveDynamicComponent(component) {
|
|
4728
4728
|
if (isString(component)) {
|
|
4729
4729
|
return resolveAsset(COMPONENTS, component, false) || component;
|
|
@@ -6691,7 +6691,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6691
6691
|
return vm;
|
|
6692
6692
|
}
|
|
6693
6693
|
}
|
|
6694
|
-
Vue.version = `2.6.14-compat:${"3.3.0-alpha.
|
|
6694
|
+
Vue.version = `2.6.14-compat:${"3.3.0-alpha.5"}`;
|
|
6695
6695
|
Vue.config = singletonApp.config;
|
|
6696
6696
|
Vue.use = (p, ...options) => {
|
|
6697
6697
|
if (p && isFunction(p.install)) {
|
|
@@ -7275,7 +7275,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7275
7275
|
}
|
|
7276
7276
|
}
|
|
7277
7277
|
if (isFunction(ref)) {
|
|
7278
|
-
callWithErrorHandling(ref, owner,
|
|
7278
|
+
callWithErrorHandling(ref, owner, 12, [value, refs]);
|
|
7279
7279
|
} else {
|
|
7280
7280
|
const _isString = isString(ref);
|
|
7281
7281
|
const _isRef = isRef(ref);
|
|
@@ -8969,7 +8969,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8969
8969
|
);
|
|
8970
8970
|
} else if (moved) {
|
|
8971
8971
|
if (j < 0 || i !== increasingNewIndexSequence[j]) {
|
|
8972
|
-
move(nextChild, container, anchor,
|
|
8972
|
+
move(nextChild, container, anchor, 2);
|
|
8973
8973
|
} else {
|
|
8974
8974
|
j--;
|
|
8975
8975
|
}
|
|
@@ -9003,9 +9003,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9003
9003
|
moveStaticNode(vnode, container, anchor);
|
|
9004
9004
|
return;
|
|
9005
9005
|
}
|
|
9006
|
-
const needTransition = moveType !==
|
|
9006
|
+
const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
|
|
9007
9007
|
if (needTransition) {
|
|
9008
|
-
if (moveType ===
|
|
9008
|
+
if (moveType === 0) {
|
|
9009
9009
|
transition.beforeEnter(el);
|
|
9010
9010
|
hostInsert(el, container, anchor);
|
|
9011
9011
|
queuePostRenderEffect(() => transition.enter(el), parentSuspense);
|
|
@@ -9412,7 +9412,7 @@ const TeleportImpl = {
|
|
|
9412
9412
|
container,
|
|
9413
9413
|
mainAnchor,
|
|
9414
9414
|
internals,
|
|
9415
|
-
|
|
9415
|
+
1
|
|
9416
9416
|
);
|
|
9417
9417
|
}
|
|
9418
9418
|
} else {
|
|
@@ -9427,7 +9427,7 @@ const TeleportImpl = {
|
|
|
9427
9427
|
nextTarget,
|
|
9428
9428
|
null,
|
|
9429
9429
|
internals,
|
|
9430
|
-
|
|
9430
|
+
0
|
|
9431
9431
|
);
|
|
9432
9432
|
} else if (process.env.NODE_ENV !== "production") {
|
|
9433
9433
|
warn(
|
|
@@ -9442,7 +9442,7 @@ const TeleportImpl = {
|
|
|
9442
9442
|
target,
|
|
9443
9443
|
targetAnchor,
|
|
9444
9444
|
internals,
|
|
9445
|
-
|
|
9445
|
+
1
|
|
9446
9446
|
);
|
|
9447
9447
|
}
|
|
9448
9448
|
}
|
|
@@ -9473,12 +9473,12 @@ const TeleportImpl = {
|
|
|
9473
9473
|
move: moveTeleport,
|
|
9474
9474
|
hydrate: hydrateTeleport
|
|
9475
9475
|
};
|
|
9476
|
-
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType =
|
|
9477
|
-
if (moveType ===
|
|
9476
|
+
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
|
|
9477
|
+
if (moveType === 0) {
|
|
9478
9478
|
insert(vnode.targetAnchor, container, parentAnchor);
|
|
9479
9479
|
}
|
|
9480
9480
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
9481
|
-
const isReorder = moveType ===
|
|
9481
|
+
const isReorder = moveType === 2;
|
|
9482
9482
|
if (isReorder) {
|
|
9483
9483
|
insert(el, container, parentAnchor);
|
|
9484
9484
|
}
|
|
@@ -9489,7 +9489,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
9489
9489
|
children[i],
|
|
9490
9490
|
container,
|
|
9491
9491
|
parentAnchor,
|
|
9492
|
-
|
|
9492
|
+
2
|
|
9493
9493
|
);
|
|
9494
9494
|
}
|
|
9495
9495
|
}
|
|
@@ -9610,10 +9610,10 @@ function convertLegacyComponent(comp, instance) {
|
|
|
9610
9610
|
return comp;
|
|
9611
9611
|
}
|
|
9612
9612
|
|
|
9613
|
-
const Fragment = Symbol(
|
|
9614
|
-
const Text = Symbol(
|
|
9615
|
-
const Comment = Symbol(
|
|
9616
|
-
const Static = Symbol(
|
|
9613
|
+
const Fragment = Symbol.for("v-fgt");
|
|
9614
|
+
const Text = Symbol.for("v-txt");
|
|
9615
|
+
const Comment = Symbol.for("v-cmt");
|
|
9616
|
+
const Static = Symbol.for("v-stc");
|
|
9617
9617
|
const blockStack = [];
|
|
9618
9618
|
let currentBlock = null;
|
|
9619
9619
|
function openBlock(disableTracking = false) {
|
|
@@ -9978,7 +9978,7 @@ function mergeProps(...args) {
|
|
|
9978
9978
|
return ret;
|
|
9979
9979
|
}
|
|
9980
9980
|
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
9981
|
-
callWithAsyncErrorHandling(hook, instance,
|
|
9981
|
+
callWithAsyncErrorHandling(hook, instance, 7, [
|
|
9982
9982
|
vnode,
|
|
9983
9983
|
prevVNode
|
|
9984
9984
|
]);
|
|
@@ -10077,13 +10077,29 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
10077
10077
|
}
|
|
10078
10078
|
let currentInstance = null;
|
|
10079
10079
|
const getCurrentInstance = () => currentInstance || currentRenderingInstance;
|
|
10080
|
+
let internalSetCurrentInstance;
|
|
10081
|
+
let globalCurrentInstanceSetters;
|
|
10082
|
+
let settersKey = "__VUE_INSTANCE_SETTERS__";
|
|
10083
|
+
{
|
|
10084
|
+
if (!(globalCurrentInstanceSetters = getGlobalThis()[settersKey])) {
|
|
10085
|
+
globalCurrentInstanceSetters = getGlobalThis()[settersKey] = [];
|
|
10086
|
+
}
|
|
10087
|
+
globalCurrentInstanceSetters.push((i) => currentInstance = i);
|
|
10088
|
+
internalSetCurrentInstance = (instance) => {
|
|
10089
|
+
if (globalCurrentInstanceSetters.length > 1) {
|
|
10090
|
+
globalCurrentInstanceSetters.forEach((s) => s(instance));
|
|
10091
|
+
} else {
|
|
10092
|
+
globalCurrentInstanceSetters[0](instance);
|
|
10093
|
+
}
|
|
10094
|
+
};
|
|
10095
|
+
}
|
|
10080
10096
|
const setCurrentInstance = (instance) => {
|
|
10081
|
-
|
|
10097
|
+
internalSetCurrentInstance(instance);
|
|
10082
10098
|
instance.scope.on();
|
|
10083
10099
|
};
|
|
10084
10100
|
const unsetCurrentInstance = () => {
|
|
10085
10101
|
currentInstance && currentInstance.scope.off();
|
|
10086
|
-
|
|
10102
|
+
internalSetCurrentInstance(null);
|
|
10087
10103
|
};
|
|
10088
10104
|
const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
|
|
10089
10105
|
function validateComponentName(name, config) {
|
|
@@ -10146,7 +10162,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10146
10162
|
const setupResult = callWithErrorHandling(
|
|
10147
10163
|
setup,
|
|
10148
10164
|
instance,
|
|
10149
|
-
|
|
10165
|
+
0,
|
|
10150
10166
|
[process.env.NODE_ENV !== "production" ? shallowReadonly(instance.props) : instance.props, setupContext]
|
|
10151
10167
|
);
|
|
10152
10168
|
resetTracking();
|
|
@@ -10157,7 +10173,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10157
10173
|
return setupResult.then((resolvedResult) => {
|
|
10158
10174
|
handleSetupResult(instance, resolvedResult, isSSR);
|
|
10159
10175
|
}).catch((e) => {
|
|
10160
|
-
handleError(e, instance,
|
|
10176
|
+
handleError(e, instance, 0);
|
|
10161
10177
|
});
|
|
10162
10178
|
} else {
|
|
10163
10179
|
instance.asyncDep = setupResult;
|
|
@@ -10511,7 +10527,7 @@ function h(type, propsOrChildren, children) {
|
|
|
10511
10527
|
}
|
|
10512
10528
|
}
|
|
10513
10529
|
|
|
10514
|
-
const ssrContextKey = Symbol(
|
|
10530
|
+
const ssrContextKey = Symbol.for("v-scx");
|
|
10515
10531
|
const useSSRContext = () => {
|
|
10516
10532
|
{
|
|
10517
10533
|
const ctx = inject(ssrContextKey);
|
|
@@ -10725,7 +10741,7 @@ function isMemoSame(cached, memo) {
|
|
|
10725
10741
|
return true;
|
|
10726
10742
|
}
|
|
10727
10743
|
|
|
10728
|
-
const version = "3.3.0-alpha.
|
|
10744
|
+
const version = "3.3.0-alpha.5";
|
|
10729
10745
|
const _ssrUtils = {
|
|
10730
10746
|
createComponentInstance,
|
|
10731
10747
|
setupComponent,
|
|
@@ -11065,7 +11081,7 @@ function createInvoker(initialValue, instance) {
|
|
|
11065
11081
|
callWithAsyncErrorHandling(
|
|
11066
11082
|
patchStopImmediatePropagation(e, invoker.value),
|
|
11067
11083
|
instance,
|
|
11068
|
-
|
|
11084
|
+
5,
|
|
11069
11085
|
[e]
|
|
11070
11086
|
);
|
|
11071
11087
|
};
|
|
@@ -12585,63 +12601,63 @@ function createCompilerError(code, loc, messages, additionalMessage) {
|
|
|
12585
12601
|
}
|
|
12586
12602
|
const errorMessages = {
|
|
12587
12603
|
// parse errors
|
|
12588
|
-
[
|
|
12589
|
-
[
|
|
12590
|
-
[
|
|
12591
|
-
[
|
|
12592
|
-
[
|
|
12593
|
-
[
|
|
12594
|
-
[
|
|
12595
|
-
[
|
|
12596
|
-
[
|
|
12597
|
-
[
|
|
12598
|
-
[
|
|
12599
|
-
[
|
|
12600
|
-
[
|
|
12601
|
-
[
|
|
12602
|
-
[
|
|
12603
|
-
[
|
|
12604
|
-
[
|
|
12605
|
-
[
|
|
12606
|
-
[
|
|
12607
|
-
[
|
|
12608
|
-
[
|
|
12609
|
-
[
|
|
12610
|
-
[
|
|
12604
|
+
[0]: "Illegal comment.",
|
|
12605
|
+
[1]: "CDATA section is allowed only in XML context.",
|
|
12606
|
+
[2]: "Duplicate attribute.",
|
|
12607
|
+
[3]: "End tag cannot have attributes.",
|
|
12608
|
+
[4]: "Illegal '/' in tags.",
|
|
12609
|
+
[5]: "Unexpected EOF in tag.",
|
|
12610
|
+
[6]: "Unexpected EOF in CDATA section.",
|
|
12611
|
+
[7]: "Unexpected EOF in comment.",
|
|
12612
|
+
[8]: "Unexpected EOF in script.",
|
|
12613
|
+
[9]: "Unexpected EOF in tag.",
|
|
12614
|
+
[10]: "Incorrectly closed comment.",
|
|
12615
|
+
[11]: "Incorrectly opened comment.",
|
|
12616
|
+
[12]: "Illegal tag name. Use '<' to print '<'.",
|
|
12617
|
+
[13]: "Attribute value was expected.",
|
|
12618
|
+
[14]: "End tag name was expected.",
|
|
12619
|
+
[15]: "Whitespace was expected.",
|
|
12620
|
+
[16]: "Unexpected '<!--' in comment.",
|
|
12621
|
+
[17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
|
|
12622
|
+
[18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
|
|
12623
|
+
[19]: "Attribute name cannot start with '='.",
|
|
12624
|
+
[21]: "'<?' is allowed only in XML context.",
|
|
12625
|
+
[20]: `Unexpected null character.`,
|
|
12626
|
+
[22]: "Illegal '/' in tags.",
|
|
12611
12627
|
// Vue-specific parse errors
|
|
12612
|
-
[
|
|
12613
|
-
[
|
|
12614
|
-
[
|
|
12615
|
-
[
|
|
12616
|
-
[
|
|
12628
|
+
[23]: "Invalid end tag.",
|
|
12629
|
+
[24]: "Element is missing end tag.",
|
|
12630
|
+
[25]: "Interpolation end sign was not found.",
|
|
12631
|
+
[27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
|
|
12632
|
+
[26]: "Legal directive name was expected.",
|
|
12617
12633
|
// transform errors
|
|
12618
|
-
[
|
|
12619
|
-
[
|
|
12620
|
-
[
|
|
12621
|
-
[
|
|
12622
|
-
[
|
|
12623
|
-
[
|
|
12624
|
-
[
|
|
12625
|
-
[
|
|
12626
|
-
[
|
|
12627
|
-
[
|
|
12628
|
-
[
|
|
12629
|
-
[
|
|
12630
|
-
[
|
|
12631
|
-
[
|
|
12632
|
-
[
|
|
12633
|
-
[
|
|
12634
|
-
[
|
|
12634
|
+
[28]: `v-if/v-else-if is missing expression.`,
|
|
12635
|
+
[29]: `v-if/else branches must use unique keys.`,
|
|
12636
|
+
[30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
|
|
12637
|
+
[31]: `v-for is missing expression.`,
|
|
12638
|
+
[32]: `v-for has invalid expression.`,
|
|
12639
|
+
[33]: `<template v-for> key should be placed on the <template> tag.`,
|
|
12640
|
+
[34]: `v-bind is missing expression.`,
|
|
12641
|
+
[35]: `v-on is missing expression.`,
|
|
12642
|
+
[36]: `Unexpected custom directive on <slot> outlet.`,
|
|
12643
|
+
[37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,
|
|
12644
|
+
[38]: `Duplicate slot names found. `,
|
|
12645
|
+
[39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
|
|
12646
|
+
[40]: `v-slot can only be used on components or <template> tags.`,
|
|
12647
|
+
[41]: `v-model is missing expression.`,
|
|
12648
|
+
[42]: `v-model value must be a valid JavaScript member expression.`,
|
|
12649
|
+
[43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
|
|
12650
|
+
[44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
|
|
12635
12651
|
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
12636
|
-
[
|
|
12637
|
-
[
|
|
12652
|
+
[45]: `Error parsing JavaScript expression: `,
|
|
12653
|
+
[46]: `<KeepAlive> expects exactly one child component.`,
|
|
12638
12654
|
// generic errors
|
|
12639
|
-
[
|
|
12640
|
-
[
|
|
12641
|
-
[
|
|
12642
|
-
[
|
|
12655
|
+
[47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
12656
|
+
[48]: `ES module mode is not supported in this build of compiler.`,
|
|
12657
|
+
[49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
12658
|
+
[50]: `"scopeId" option is only supported in module mode.`,
|
|
12643
12659
|
// just to fulfill types
|
|
12644
|
-
[
|
|
12660
|
+
[51]: ``
|
|
12645
12661
|
};
|
|
12646
12662
|
|
|
12647
12663
|
const FRAGMENT = Symbol(process.env.NODE_ENV !== "production" ? `Fragment` : ``);
|
|
@@ -12739,7 +12755,7 @@ const locStub = {
|
|
|
12739
12755
|
};
|
|
12740
12756
|
function createRoot(children, loc = locStub) {
|
|
12741
12757
|
return {
|
|
12742
|
-
type:
|
|
12758
|
+
type: 0,
|
|
12743
12759
|
children,
|
|
12744
12760
|
helpers: /* @__PURE__ */ new Set(),
|
|
12745
12761
|
components: [],
|
|
@@ -12765,7 +12781,7 @@ function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps,
|
|
|
12765
12781
|
}
|
|
12766
12782
|
}
|
|
12767
12783
|
return {
|
|
12768
|
-
type:
|
|
12784
|
+
type: 13,
|
|
12769
12785
|
tag,
|
|
12770
12786
|
props,
|
|
12771
12787
|
children,
|
|
@@ -12780,21 +12796,21 @@ function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps,
|
|
|
12780
12796
|
}
|
|
12781
12797
|
function createArrayExpression(elements, loc = locStub) {
|
|
12782
12798
|
return {
|
|
12783
|
-
type:
|
|
12799
|
+
type: 17,
|
|
12784
12800
|
loc,
|
|
12785
12801
|
elements
|
|
12786
12802
|
};
|
|
12787
12803
|
}
|
|
12788
12804
|
function createObjectExpression(properties, loc = locStub) {
|
|
12789
12805
|
return {
|
|
12790
|
-
type:
|
|
12806
|
+
type: 15,
|
|
12791
12807
|
loc,
|
|
12792
12808
|
properties
|
|
12793
12809
|
};
|
|
12794
12810
|
}
|
|
12795
12811
|
function createObjectProperty(key, value) {
|
|
12796
12812
|
return {
|
|
12797
|
-
type:
|
|
12813
|
+
type: 16,
|
|
12798
12814
|
loc: locStub,
|
|
12799
12815
|
key: isString(key) ? createSimpleExpression(key, true) : key,
|
|
12800
12816
|
value
|
|
@@ -12802,23 +12818,23 @@ function createObjectProperty(key, value) {
|
|
|
12802
12818
|
}
|
|
12803
12819
|
function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) {
|
|
12804
12820
|
return {
|
|
12805
|
-
type:
|
|
12821
|
+
type: 4,
|
|
12806
12822
|
loc,
|
|
12807
12823
|
content,
|
|
12808
12824
|
isStatic,
|
|
12809
|
-
constType: isStatic ?
|
|
12825
|
+
constType: isStatic ? 3 : constType
|
|
12810
12826
|
};
|
|
12811
12827
|
}
|
|
12812
12828
|
function createCompoundExpression(children, loc = locStub) {
|
|
12813
12829
|
return {
|
|
12814
|
-
type:
|
|
12830
|
+
type: 8,
|
|
12815
12831
|
loc,
|
|
12816
12832
|
children
|
|
12817
12833
|
};
|
|
12818
12834
|
}
|
|
12819
12835
|
function createCallExpression(callee, args = [], loc = locStub) {
|
|
12820
12836
|
return {
|
|
12821
|
-
type:
|
|
12837
|
+
type: 14,
|
|
12822
12838
|
loc,
|
|
12823
12839
|
callee,
|
|
12824
12840
|
arguments: args
|
|
@@ -12826,7 +12842,7 @@ function createCallExpression(callee, args = [], loc = locStub) {
|
|
|
12826
12842
|
}
|
|
12827
12843
|
function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) {
|
|
12828
12844
|
return {
|
|
12829
|
-
type:
|
|
12845
|
+
type: 18,
|
|
12830
12846
|
params,
|
|
12831
12847
|
returns,
|
|
12832
12848
|
newline,
|
|
@@ -12836,7 +12852,7 @@ function createFunctionExpression(params, returns = void 0, newline = false, isS
|
|
|
12836
12852
|
}
|
|
12837
12853
|
function createConditionalExpression(test, consequent, alternate, newline = true) {
|
|
12838
12854
|
return {
|
|
12839
|
-
type:
|
|
12855
|
+
type: 19,
|
|
12840
12856
|
test,
|
|
12841
12857
|
consequent,
|
|
12842
12858
|
alternate,
|
|
@@ -12846,7 +12862,7 @@ function createConditionalExpression(test, consequent, alternate, newline = true
|
|
|
12846
12862
|
}
|
|
12847
12863
|
function createCacheExpression(index, value, isVNode = false) {
|
|
12848
12864
|
return {
|
|
12849
|
-
type:
|
|
12865
|
+
type: 20,
|
|
12850
12866
|
index,
|
|
12851
12867
|
value,
|
|
12852
12868
|
isVNode,
|
|
@@ -12855,13 +12871,27 @@ function createCacheExpression(index, value, isVNode = false) {
|
|
|
12855
12871
|
}
|
|
12856
12872
|
function createBlockStatement(body) {
|
|
12857
12873
|
return {
|
|
12858
|
-
type:
|
|
12874
|
+
type: 21,
|
|
12859
12875
|
body,
|
|
12860
12876
|
loc: locStub
|
|
12861
12877
|
};
|
|
12862
12878
|
}
|
|
12879
|
+
function getVNodeHelper(ssr, isComponent) {
|
|
12880
|
+
return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
|
|
12881
|
+
}
|
|
12882
|
+
function getVNodeBlockHelper(ssr, isComponent) {
|
|
12883
|
+
return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
|
|
12884
|
+
}
|
|
12885
|
+
function convertToBlock(node, { helper, removeHelper, inSSR }) {
|
|
12886
|
+
if (!node.isBlock) {
|
|
12887
|
+
node.isBlock = true;
|
|
12888
|
+
removeHelper(getVNodeHelper(inSSR, node.isComponent));
|
|
12889
|
+
helper(OPEN_BLOCK);
|
|
12890
|
+
helper(getVNodeBlockHelper(inSSR, node.isComponent));
|
|
12891
|
+
}
|
|
12892
|
+
}
|
|
12863
12893
|
|
|
12864
|
-
const isStaticExp = (p) => p.type ===
|
|
12894
|
+
const isStaticExp = (p) => p.type === 4 && p.isStatic;
|
|
12865
12895
|
const isBuiltInType = (tag, expected) => tag === expected || tag === hyphenate(expected);
|
|
12866
12896
|
function isCoreComponent(tag) {
|
|
12867
12897
|
if (isBuiltInType(tag, "Teleport")) {
|
|
@@ -12987,7 +13017,7 @@ function assert(condition, msg) {
|
|
|
12987
13017
|
function findDir(node, name, allowEmpty = false) {
|
|
12988
13018
|
for (let i = 0; i < node.props.length; i++) {
|
|
12989
13019
|
const p = node.props[i];
|
|
12990
|
-
if (p.type ===
|
|
13020
|
+
if (p.type === 7 && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) {
|
|
12991
13021
|
return p;
|
|
12992
13022
|
}
|
|
12993
13023
|
}
|
|
@@ -12995,7 +13025,7 @@ function findDir(node, name, allowEmpty = false) {
|
|
|
12995
13025
|
function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
|
|
12996
13026
|
for (let i = 0; i < node.props.length; i++) {
|
|
12997
13027
|
const p = node.props[i];
|
|
12998
|
-
if (p.type ===
|
|
13028
|
+
if (p.type === 6) {
|
|
12999
13029
|
if (dynamicOnly)
|
|
13000
13030
|
continue;
|
|
13001
13031
|
if (p.name === name && (p.value || allowEmpty)) {
|
|
@@ -13011,33 +13041,27 @@ function isStaticArgOf(arg, name) {
|
|
|
13011
13041
|
}
|
|
13012
13042
|
function hasDynamicKeyVBind(node) {
|
|
13013
13043
|
return node.props.some(
|
|
13014
|
-
(p) => p.type ===
|
|
13015
|
-
p.arg.type !==
|
|
13044
|
+
(p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj"
|
|
13045
|
+
p.arg.type !== 4 || // v-bind:[_ctx.foo]
|
|
13016
13046
|
!p.arg.isStatic)
|
|
13017
13047
|
// v-bind:[foo]
|
|
13018
13048
|
);
|
|
13019
13049
|
}
|
|
13020
13050
|
function isText$1(node) {
|
|
13021
|
-
return node.type ===
|
|
13051
|
+
return node.type === 5 || node.type === 2;
|
|
13022
13052
|
}
|
|
13023
13053
|
function isVSlot(p) {
|
|
13024
|
-
return p.type ===
|
|
13054
|
+
return p.type === 7 && p.name === "slot";
|
|
13025
13055
|
}
|
|
13026
13056
|
function isTemplateNode(node) {
|
|
13027
|
-
return node.type ===
|
|
13057
|
+
return node.type === 1 && node.tagType === 3;
|
|
13028
13058
|
}
|
|
13029
13059
|
function isSlotOutlet(node) {
|
|
13030
|
-
return node.type ===
|
|
13031
|
-
}
|
|
13032
|
-
function getVNodeHelper(ssr, isComponent) {
|
|
13033
|
-
return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
|
|
13034
|
-
}
|
|
13035
|
-
function getVNodeBlockHelper(ssr, isComponent) {
|
|
13036
|
-
return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
|
|
13060
|
+
return node.type === 1 && node.tagType === 2;
|
|
13037
13061
|
}
|
|
13038
13062
|
const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
|
|
13039
13063
|
function getUnnormalizedProps(props, callPath = []) {
|
|
13040
|
-
if (props && !isString(props) && props.type ===
|
|
13064
|
+
if (props && !isString(props) && props.type === 14) {
|
|
13041
13065
|
const callee = props.callee;
|
|
13042
13066
|
if (!isString(callee) && propsHelperSet.has(callee)) {
|
|
13043
13067
|
return getUnnormalizedProps(
|
|
@@ -13050,10 +13074,10 @@ function getUnnormalizedProps(props, callPath = []) {
|
|
|
13050
13074
|
}
|
|
13051
13075
|
function injectProp(node, prop, context) {
|
|
13052
13076
|
let propsWithInjection;
|
|
13053
|
-
let props = node.type ===
|
|
13077
|
+
let props = node.type === 13 ? node.props : node.arguments[2];
|
|
13054
13078
|
let callPath = [];
|
|
13055
13079
|
let parentCall;
|
|
13056
|
-
if (props && !isString(props) && props.type ===
|
|
13080
|
+
if (props && !isString(props) && props.type === 14) {
|
|
13057
13081
|
const ret = getUnnormalizedProps(props);
|
|
13058
13082
|
props = ret[0];
|
|
13059
13083
|
callPath = ret[1];
|
|
@@ -13061,9 +13085,9 @@ function injectProp(node, prop, context) {
|
|
|
13061
13085
|
}
|
|
13062
13086
|
if (props == null || isString(props)) {
|
|
13063
13087
|
propsWithInjection = createObjectExpression([prop]);
|
|
13064
|
-
} else if (props.type ===
|
|
13088
|
+
} else if (props.type === 14) {
|
|
13065
13089
|
const first = props.arguments[0];
|
|
13066
|
-
if (!isString(first) && first.type ===
|
|
13090
|
+
if (!isString(first) && first.type === 15) {
|
|
13067
13091
|
if (!hasProp(prop, first)) {
|
|
13068
13092
|
first.properties.unshift(prop);
|
|
13069
13093
|
}
|
|
@@ -13078,7 +13102,7 @@ function injectProp(node, prop, context) {
|
|
|
13078
13102
|
}
|
|
13079
13103
|
}
|
|
13080
13104
|
!propsWithInjection && (propsWithInjection = props);
|
|
13081
|
-
} else if (props.type ===
|
|
13105
|
+
} else if (props.type === 15) {
|
|
13082
13106
|
if (!hasProp(prop, props)) {
|
|
13083
13107
|
props.properties.unshift(prop);
|
|
13084
13108
|
}
|
|
@@ -13092,7 +13116,7 @@ function injectProp(node, prop, context) {
|
|
|
13092
13116
|
parentCall = callPath[callPath.length - 2];
|
|
13093
13117
|
}
|
|
13094
13118
|
}
|
|
13095
|
-
if (node.type ===
|
|
13119
|
+
if (node.type === 13) {
|
|
13096
13120
|
if (parentCall) {
|
|
13097
13121
|
parentCall.arguments[0] = propsWithInjection;
|
|
13098
13122
|
} else {
|
|
@@ -13108,10 +13132,10 @@ function injectProp(node, prop, context) {
|
|
|
13108
13132
|
}
|
|
13109
13133
|
function hasProp(prop, props) {
|
|
13110
13134
|
let result = false;
|
|
13111
|
-
if (prop.key.type ===
|
|
13135
|
+
if (prop.key.type === 4) {
|
|
13112
13136
|
const propKeyName = prop.key.content;
|
|
13113
13137
|
result = props.properties.some(
|
|
13114
|
-
(p) => p.key.type ===
|
|
13138
|
+
(p) => p.key.type === 4 && p.key.content === propKeyName
|
|
13115
13139
|
);
|
|
13116
13140
|
}
|
|
13117
13141
|
return result;
|
|
@@ -13122,20 +13146,12 @@ function toValidAssetId(name, type) {
|
|
|
13122
13146
|
})}`;
|
|
13123
13147
|
}
|
|
13124
13148
|
function getMemoedVNodeCall(node) {
|
|
13125
|
-
if (node.type ===
|
|
13149
|
+
if (node.type === 14 && node.callee === WITH_MEMO) {
|
|
13126
13150
|
return node.arguments[1].returns;
|
|
13127
13151
|
} else {
|
|
13128
13152
|
return node;
|
|
13129
13153
|
}
|
|
13130
13154
|
}
|
|
13131
|
-
function makeBlock(node, { helper, removeHelper, inSSR }) {
|
|
13132
|
-
if (!node.isBlock) {
|
|
13133
|
-
node.isBlock = true;
|
|
13134
|
-
removeHelper(getVNodeHelper(inSSR, node.isComponent));
|
|
13135
|
-
helper(OPEN_BLOCK);
|
|
13136
|
-
helper(getVNodeBlockHelper(inSSR, node.isComponent));
|
|
13137
|
-
}
|
|
13138
|
-
}
|
|
13139
13155
|
|
|
13140
13156
|
const deprecationData = {
|
|
13141
13157
|
["COMPILER_IS_ON_ELEMENT"]: {
|
|
@@ -13219,8 +13235,8 @@ const decodeMap = {
|
|
|
13219
13235
|
};
|
|
13220
13236
|
const defaultParserOptions = {
|
|
13221
13237
|
delimiters: [`{{`, `}}`],
|
|
13222
|
-
getNamespace: () =>
|
|
13223
|
-
getTextMode: () =>
|
|
13238
|
+
getNamespace: () => 0,
|
|
13239
|
+
getTextMode: () => 0,
|
|
13224
13240
|
isVoidTag: NO,
|
|
13225
13241
|
isPreTag: NO,
|
|
13226
13242
|
isCustomElement: NO,
|
|
@@ -13233,7 +13249,7 @@ function baseParse(content, options = {}) {
|
|
|
13233
13249
|
const context = createParserContext(content, options);
|
|
13234
13250
|
const start = getCursor(context);
|
|
13235
13251
|
return createRoot(
|
|
13236
|
-
parseChildren(context,
|
|
13252
|
+
parseChildren(context, 0, []),
|
|
13237
13253
|
getSelection(context, start)
|
|
13238
13254
|
);
|
|
13239
13255
|
}
|
|
@@ -13257,48 +13273,48 @@ function createParserContext(content, rawOptions) {
|
|
|
13257
13273
|
}
|
|
13258
13274
|
function parseChildren(context, mode, ancestors) {
|
|
13259
13275
|
const parent = last(ancestors);
|
|
13260
|
-
const ns = parent ? parent.ns :
|
|
13276
|
+
const ns = parent ? parent.ns : 0;
|
|
13261
13277
|
const nodes = [];
|
|
13262
13278
|
while (!isEnd(context, mode, ancestors)) {
|
|
13263
13279
|
const s = context.source;
|
|
13264
13280
|
let node = void 0;
|
|
13265
|
-
if (mode ===
|
|
13281
|
+
if (mode === 0 || mode === 1) {
|
|
13266
13282
|
if (!context.inVPre && startsWith(s, context.options.delimiters[0])) {
|
|
13267
13283
|
node = parseInterpolation(context, mode);
|
|
13268
|
-
} else if (mode ===
|
|
13284
|
+
} else if (mode === 0 && s[0] === "<") {
|
|
13269
13285
|
if (s.length === 1) {
|
|
13270
|
-
emitError(context,
|
|
13286
|
+
emitError(context, 5, 1);
|
|
13271
13287
|
} else if (s[1] === "!") {
|
|
13272
13288
|
if (startsWith(s, "<!--")) {
|
|
13273
13289
|
node = parseComment(context);
|
|
13274
13290
|
} else if (startsWith(s, "<!DOCTYPE")) {
|
|
13275
13291
|
node = parseBogusComment(context);
|
|
13276
13292
|
} else if (startsWith(s, "<![CDATA[")) {
|
|
13277
|
-
if (ns !==
|
|
13293
|
+
if (ns !== 0) {
|
|
13278
13294
|
node = parseCDATA(context, ancestors);
|
|
13279
13295
|
} else {
|
|
13280
|
-
emitError(context,
|
|
13296
|
+
emitError(context, 1);
|
|
13281
13297
|
node = parseBogusComment(context);
|
|
13282
13298
|
}
|
|
13283
13299
|
} else {
|
|
13284
|
-
emitError(context,
|
|
13300
|
+
emitError(context, 11);
|
|
13285
13301
|
node = parseBogusComment(context);
|
|
13286
13302
|
}
|
|
13287
13303
|
} else if (s[1] === "/") {
|
|
13288
13304
|
if (s.length === 2) {
|
|
13289
|
-
emitError(context,
|
|
13305
|
+
emitError(context, 5, 2);
|
|
13290
13306
|
} else if (s[2] === ">") {
|
|
13291
|
-
emitError(context,
|
|
13307
|
+
emitError(context, 14, 2);
|
|
13292
13308
|
advanceBy(context, 3);
|
|
13293
13309
|
continue;
|
|
13294
13310
|
} else if (/[a-z]/i.test(s[2])) {
|
|
13295
|
-
emitError(context,
|
|
13311
|
+
emitError(context, 23);
|
|
13296
13312
|
parseTag(context, TagType.End, parent);
|
|
13297
13313
|
continue;
|
|
13298
13314
|
} else {
|
|
13299
13315
|
emitError(
|
|
13300
13316
|
context,
|
|
13301
|
-
|
|
13317
|
+
12,
|
|
13302
13318
|
2
|
|
13303
13319
|
);
|
|
13304
13320
|
node = parseBogusComment(context);
|
|
@@ -13309,7 +13325,7 @@ function parseChildren(context, mode, ancestors) {
|
|
|
13309
13325
|
"COMPILER_NATIVE_TEMPLATE",
|
|
13310
13326
|
context
|
|
13311
13327
|
) && node && node.tag === "template" && !node.props.some(
|
|
13312
|
-
(p) => p.type ===
|
|
13328
|
+
(p) => p.type === 7 && isSpecialTemplateDirective(p.name)
|
|
13313
13329
|
)) {
|
|
13314
13330
|
process.env.NODE_ENV !== "production" && warnDeprecation(
|
|
13315
13331
|
"COMPILER_NATIVE_TEMPLATE",
|
|
@@ -13321,12 +13337,12 @@ function parseChildren(context, mode, ancestors) {
|
|
|
13321
13337
|
} else if (s[1] === "?") {
|
|
13322
13338
|
emitError(
|
|
13323
13339
|
context,
|
|
13324
|
-
|
|
13340
|
+
21,
|
|
13325
13341
|
1
|
|
13326
13342
|
);
|
|
13327
13343
|
node = parseBogusComment(context);
|
|
13328
13344
|
} else {
|
|
13329
|
-
emitError(context,
|
|
13345
|
+
emitError(context, 12, 1);
|
|
13330
13346
|
}
|
|
13331
13347
|
}
|
|
13332
13348
|
}
|
|
@@ -13342,16 +13358,16 @@ function parseChildren(context, mode, ancestors) {
|
|
|
13342
13358
|
}
|
|
13343
13359
|
}
|
|
13344
13360
|
let removedWhitespace = false;
|
|
13345
|
-
if (mode !==
|
|
13361
|
+
if (mode !== 2 && mode !== 1) {
|
|
13346
13362
|
const shouldCondense = context.options.whitespace !== "preserve";
|
|
13347
13363
|
for (let i = 0; i < nodes.length; i++) {
|
|
13348
13364
|
const node = nodes[i];
|
|
13349
|
-
if (node.type ===
|
|
13365
|
+
if (node.type === 2) {
|
|
13350
13366
|
if (!context.inPre) {
|
|
13351
13367
|
if (!/[^\t\r\n\f ]/.test(node.content)) {
|
|
13352
13368
|
const prev = nodes[i - 1];
|
|
13353
13369
|
const next = nodes[i + 1];
|
|
13354
|
-
if (!prev || !next || shouldCondense && (prev.type ===
|
|
13370
|
+
if (!prev || !next || shouldCondense && (prev.type === 3 && next.type === 3 || prev.type === 3 && next.type === 1 || prev.type === 1 && next.type === 3 || prev.type === 1 && next.type === 1 && /[\r\n]/.test(node.content))) {
|
|
13355
13371
|
removedWhitespace = true;
|
|
13356
13372
|
nodes[i] = null;
|
|
13357
13373
|
} else {
|
|
@@ -13363,14 +13379,14 @@ function parseChildren(context, mode, ancestors) {
|
|
|
13363
13379
|
} else {
|
|
13364
13380
|
node.content = node.content.replace(/\r\n/g, "\n");
|
|
13365
13381
|
}
|
|
13366
|
-
} else if (node.type ===
|
|
13382
|
+
} else if (node.type === 3 && !context.options.comments) {
|
|
13367
13383
|
removedWhitespace = true;
|
|
13368
13384
|
nodes[i] = null;
|
|
13369
13385
|
}
|
|
13370
13386
|
}
|
|
13371
13387
|
if (context.inPre && parent && context.options.isPreTag(parent.tag)) {
|
|
13372
13388
|
const first = nodes[0];
|
|
13373
|
-
if (first && first.type ===
|
|
13389
|
+
if (first && first.type === 2) {
|
|
13374
13390
|
first.content = first.content.replace(/^\r?\n/, "");
|
|
13375
13391
|
}
|
|
13376
13392
|
}
|
|
@@ -13378,9 +13394,9 @@ function parseChildren(context, mode, ancestors) {
|
|
|
13378
13394
|
return removedWhitespace ? nodes.filter(Boolean) : nodes;
|
|
13379
13395
|
}
|
|
13380
13396
|
function pushNode(nodes, node) {
|
|
13381
|
-
if (node.type ===
|
|
13397
|
+
if (node.type === 2) {
|
|
13382
13398
|
const prev = last(nodes);
|
|
13383
|
-
if (prev && prev.type ===
|
|
13399
|
+
if (prev && prev.type === 2 && prev.loc.end.offset === node.loc.start.offset) {
|
|
13384
13400
|
prev.content += node.content;
|
|
13385
13401
|
prev.loc.end = node.loc.end;
|
|
13386
13402
|
prev.loc.source += node.loc.source;
|
|
@@ -13391,9 +13407,9 @@ function pushNode(nodes, node) {
|
|
|
13391
13407
|
}
|
|
13392
13408
|
function parseCDATA(context, ancestors) {
|
|
13393
13409
|
advanceBy(context, 9);
|
|
13394
|
-
const nodes = parseChildren(context,
|
|
13410
|
+
const nodes = parseChildren(context, 3, ancestors);
|
|
13395
13411
|
if (context.source.length === 0) {
|
|
13396
|
-
emitError(context,
|
|
13412
|
+
emitError(context, 6);
|
|
13397
13413
|
} else {
|
|
13398
13414
|
advanceBy(context, 3);
|
|
13399
13415
|
}
|
|
@@ -13406,13 +13422,13 @@ function parseComment(context) {
|
|
|
13406
13422
|
if (!match) {
|
|
13407
13423
|
content = context.source.slice(4);
|
|
13408
13424
|
advanceBy(context, context.source.length);
|
|
13409
|
-
emitError(context,
|
|
13425
|
+
emitError(context, 7);
|
|
13410
13426
|
} else {
|
|
13411
13427
|
if (match.index <= 3) {
|
|
13412
|
-
emitError(context,
|
|
13428
|
+
emitError(context, 0);
|
|
13413
13429
|
}
|
|
13414
13430
|
if (match[1]) {
|
|
13415
|
-
emitError(context,
|
|
13431
|
+
emitError(context, 10);
|
|
13416
13432
|
}
|
|
13417
13433
|
content = context.source.slice(4, match.index);
|
|
13418
13434
|
const s = context.source.slice(0, match.index);
|
|
@@ -13420,14 +13436,14 @@ function parseComment(context) {
|
|
|
13420
13436
|
while ((nestedIndex = s.indexOf("<!--", prevIndex)) !== -1) {
|
|
13421
13437
|
advanceBy(context, nestedIndex - prevIndex + 1);
|
|
13422
13438
|
if (nestedIndex + 4 < s.length) {
|
|
13423
|
-
emitError(context,
|
|
13439
|
+
emitError(context, 16);
|
|
13424
13440
|
}
|
|
13425
13441
|
prevIndex = nestedIndex + 1;
|
|
13426
13442
|
}
|
|
13427
13443
|
advanceBy(context, match.index + match[0].length - prevIndex + 1);
|
|
13428
13444
|
}
|
|
13429
13445
|
return {
|
|
13430
|
-
type:
|
|
13446
|
+
type: 3,
|
|
13431
13447
|
content,
|
|
13432
13448
|
loc: getSelection(context, start)
|
|
13433
13449
|
};
|
|
@@ -13445,7 +13461,7 @@ function parseBogusComment(context) {
|
|
|
13445
13461
|
advanceBy(context, closeIndex + 1);
|
|
13446
13462
|
}
|
|
13447
13463
|
return {
|
|
13448
|
-
type:
|
|
13464
|
+
type: 3,
|
|
13449
13465
|
content,
|
|
13450
13466
|
loc: getSelection(context, start)
|
|
13451
13467
|
};
|
|
@@ -13472,7 +13488,7 @@ function parseElement(context, ancestors) {
|
|
|
13472
13488
|
ancestors.pop();
|
|
13473
13489
|
{
|
|
13474
13490
|
const inlineTemplateProp = element.props.find(
|
|
13475
|
-
(p) => p.type ===
|
|
13491
|
+
(p) => p.type === 6 && p.name === "inline-template"
|
|
13476
13492
|
);
|
|
13477
13493
|
if (inlineTemplateProp && checkCompatEnabled(
|
|
13478
13494
|
"COMPILER_INLINE_TEMPLATE",
|
|
@@ -13481,7 +13497,7 @@ function parseElement(context, ancestors) {
|
|
|
13481
13497
|
)) {
|
|
13482
13498
|
const loc = getSelection(context, element.loc.end);
|
|
13483
13499
|
inlineTemplateProp.value = {
|
|
13484
|
-
type:
|
|
13500
|
+
type: 2,
|
|
13485
13501
|
content: loc.source,
|
|
13486
13502
|
loc
|
|
13487
13503
|
};
|
|
@@ -13491,11 +13507,11 @@ function parseElement(context, ancestors) {
|
|
|
13491
13507
|
if (startsWithEndTagOpen(context.source, element.tag)) {
|
|
13492
13508
|
parseTag(context, TagType.End, parent);
|
|
13493
13509
|
} else {
|
|
13494
|
-
emitError(context,
|
|
13510
|
+
emitError(context, 24, 0, element.loc.start);
|
|
13495
13511
|
if (context.source.length === 0 && element.tag.toLowerCase() === "script") {
|
|
13496
13512
|
const first = children[0];
|
|
13497
13513
|
if (first && startsWith(first.loc.source, "<!--")) {
|
|
13498
|
-
emitError(context,
|
|
13514
|
+
emitError(context, 8);
|
|
13499
13515
|
}
|
|
13500
13516
|
}
|
|
13501
13517
|
}
|
|
@@ -13529,7 +13545,7 @@ function parseTag(context, type, parent) {
|
|
|
13529
13545
|
context.inPre = true;
|
|
13530
13546
|
}
|
|
13531
13547
|
let props = parseAttributes(context, type);
|
|
13532
|
-
if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type ===
|
|
13548
|
+
if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type === 7 && p.name === "pre")) {
|
|
13533
13549
|
context.inVPre = true;
|
|
13534
13550
|
extend(context, cursor);
|
|
13535
13551
|
context.source = currentSource;
|
|
@@ -13537,11 +13553,11 @@ function parseTag(context, type, parent) {
|
|
|
13537
13553
|
}
|
|
13538
13554
|
let isSelfClosing = false;
|
|
13539
13555
|
if (context.source.length === 0) {
|
|
13540
|
-
emitError(context,
|
|
13556
|
+
emitError(context, 9);
|
|
13541
13557
|
} else {
|
|
13542
13558
|
isSelfClosing = startsWith(context.source, "/>");
|
|
13543
13559
|
if (type === 1 /* End */ && isSelfClosing) {
|
|
13544
|
-
emitError(context,
|
|
13560
|
+
emitError(context, 4);
|
|
13545
13561
|
}
|
|
13546
13562
|
advanceBy(context, isSelfClosing ? 2 : 1);
|
|
13547
13563
|
}
|
|
@@ -13556,7 +13572,7 @@ function parseTag(context, type, parent) {
|
|
|
13556
13572
|
let hasFor = false;
|
|
13557
13573
|
for (let i = 0; i < props.length; i++) {
|
|
13558
13574
|
const p = props[i];
|
|
13559
|
-
if (p.type ===
|
|
13575
|
+
if (p.type === 7) {
|
|
13560
13576
|
if (p.name === "if") {
|
|
13561
13577
|
hasIf = true;
|
|
13562
13578
|
} else if (p.name === "for") {
|
|
@@ -13573,22 +13589,22 @@ function parseTag(context, type, parent) {
|
|
|
13573
13589
|
}
|
|
13574
13590
|
}
|
|
13575
13591
|
}
|
|
13576
|
-
let tagType =
|
|
13592
|
+
let tagType = 0;
|
|
13577
13593
|
if (!context.inVPre) {
|
|
13578
13594
|
if (tag === "slot") {
|
|
13579
|
-
tagType =
|
|
13595
|
+
tagType = 2;
|
|
13580
13596
|
} else if (tag === "template") {
|
|
13581
13597
|
if (props.some(
|
|
13582
|
-
(p) => p.type ===
|
|
13598
|
+
(p) => p.type === 7 && isSpecialTemplateDirective(p.name)
|
|
13583
13599
|
)) {
|
|
13584
|
-
tagType =
|
|
13600
|
+
tagType = 3;
|
|
13585
13601
|
}
|
|
13586
13602
|
} else if (isComponent(tag, props, context)) {
|
|
13587
|
-
tagType =
|
|
13603
|
+
tagType = 1;
|
|
13588
13604
|
}
|
|
13589
13605
|
}
|
|
13590
13606
|
return {
|
|
13591
|
-
type:
|
|
13607
|
+
type: 1,
|
|
13592
13608
|
ns,
|
|
13593
13609
|
tag,
|
|
13594
13610
|
tagType,
|
|
@@ -13610,7 +13626,7 @@ function isComponent(tag, props, context) {
|
|
|
13610
13626
|
}
|
|
13611
13627
|
for (let i = 0; i < props.length; i++) {
|
|
13612
13628
|
const p = props[i];
|
|
13613
|
-
if (p.type ===
|
|
13629
|
+
if (p.type === 6) {
|
|
13614
13630
|
if (p.name === "is" && p.value) {
|
|
13615
13631
|
if (p.value.content.startsWith("vue:")) {
|
|
13616
13632
|
return true;
|
|
@@ -13643,23 +13659,23 @@ function parseAttributes(context, type) {
|
|
|
13643
13659
|
const attributeNames = /* @__PURE__ */ new Set();
|
|
13644
13660
|
while (context.source.length > 0 && !startsWith(context.source, ">") && !startsWith(context.source, "/>")) {
|
|
13645
13661
|
if (startsWith(context.source, "/")) {
|
|
13646
|
-
emitError(context,
|
|
13662
|
+
emitError(context, 22);
|
|
13647
13663
|
advanceBy(context, 1);
|
|
13648
13664
|
advanceSpaces(context);
|
|
13649
13665
|
continue;
|
|
13650
13666
|
}
|
|
13651
13667
|
if (type === 1 /* End */) {
|
|
13652
|
-
emitError(context,
|
|
13668
|
+
emitError(context, 3);
|
|
13653
13669
|
}
|
|
13654
13670
|
const attr = parseAttribute(context, attributeNames);
|
|
13655
|
-
if (attr.type ===
|
|
13671
|
+
if (attr.type === 6 && attr.value && attr.name === "class") {
|
|
13656
13672
|
attr.value.content = attr.value.content.replace(/\s+/g, " ").trim();
|
|
13657
13673
|
}
|
|
13658
13674
|
if (type === 0 /* Start */) {
|
|
13659
13675
|
props.push(attr);
|
|
13660
13676
|
}
|
|
13661
13677
|
if (/^[^\t\r\n\f />]/.test(context.source)) {
|
|
13662
|
-
emitError(context,
|
|
13678
|
+
emitError(context, 15);
|
|
13663
13679
|
}
|
|
13664
13680
|
advanceSpaces(context);
|
|
13665
13681
|
}
|
|
@@ -13670,11 +13686,11 @@ function parseAttribute(context, nameSet) {
|
|
|
13670
13686
|
const match = /^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(context.source);
|
|
13671
13687
|
const name = match[0];
|
|
13672
13688
|
if (nameSet.has(name)) {
|
|
13673
|
-
emitError(context,
|
|
13689
|
+
emitError(context, 2);
|
|
13674
13690
|
}
|
|
13675
13691
|
nameSet.add(name);
|
|
13676
13692
|
if (name[0] === "=") {
|
|
13677
|
-
emitError(context,
|
|
13693
|
+
emitError(context, 19);
|
|
13678
13694
|
}
|
|
13679
13695
|
{
|
|
13680
13696
|
const pattern = /["'<]/g;
|
|
@@ -13682,7 +13698,7 @@ function parseAttribute(context, nameSet) {
|
|
|
13682
13698
|
while (m = pattern.exec(name)) {
|
|
13683
13699
|
emitError(
|
|
13684
13700
|
context,
|
|
13685
|
-
|
|
13701
|
+
17,
|
|
13686
13702
|
m.index
|
|
13687
13703
|
);
|
|
13688
13704
|
}
|
|
@@ -13695,7 +13711,7 @@ function parseAttribute(context, nameSet) {
|
|
|
13695
13711
|
advanceSpaces(context);
|
|
13696
13712
|
value = parseAttributeValue(context);
|
|
13697
13713
|
if (!value) {
|
|
13698
|
-
emitError(context,
|
|
13714
|
+
emitError(context, 13);
|
|
13699
13715
|
}
|
|
13700
13716
|
}
|
|
13701
13717
|
const loc = getSelection(context, start);
|
|
@@ -13725,7 +13741,7 @@ function parseAttribute(context, nameSet) {
|
|
|
13725
13741
|
if (!content.endsWith("]")) {
|
|
13726
13742
|
emitError(
|
|
13727
13743
|
context,
|
|
13728
|
-
|
|
13744
|
+
27
|
|
13729
13745
|
);
|
|
13730
13746
|
content = content.slice(1);
|
|
13731
13747
|
} else {
|
|
@@ -13735,10 +13751,10 @@ function parseAttribute(context, nameSet) {
|
|
|
13735
13751
|
content += match2[3] || "";
|
|
13736
13752
|
}
|
|
13737
13753
|
arg = {
|
|
13738
|
-
type:
|
|
13754
|
+
type: 4,
|
|
13739
13755
|
content,
|
|
13740
13756
|
isStatic,
|
|
13741
|
-
constType: isStatic ?
|
|
13757
|
+
constType: isStatic ? 3 : 0,
|
|
13742
13758
|
loc: loc2
|
|
13743
13759
|
};
|
|
13744
13760
|
}
|
|
@@ -13771,10 +13787,10 @@ function parseAttribute(context, nameSet) {
|
|
|
13771
13787
|
}
|
|
13772
13788
|
}
|
|
13773
13789
|
return {
|
|
13774
|
-
type:
|
|
13790
|
+
type: 7,
|
|
13775
13791
|
name: dirName,
|
|
13776
13792
|
exp: value && {
|
|
13777
|
-
type:
|
|
13793
|
+
type: 4,
|
|
13778
13794
|
content: value.content,
|
|
13779
13795
|
isStatic: false,
|
|
13780
13796
|
// Treat as non-constant by default. This can be potentially set to
|
|
@@ -13788,13 +13804,13 @@ function parseAttribute(context, nameSet) {
|
|
|
13788
13804
|
};
|
|
13789
13805
|
}
|
|
13790
13806
|
if (!context.inVPre && startsWith(name, "v-")) {
|
|
13791
|
-
emitError(context,
|
|
13807
|
+
emitError(context, 26);
|
|
13792
13808
|
}
|
|
13793
13809
|
return {
|
|
13794
|
-
type:
|
|
13810
|
+
type: 6,
|
|
13795
13811
|
name,
|
|
13796
13812
|
value: value && {
|
|
13797
|
-
type:
|
|
13813
|
+
type: 2,
|
|
13798
13814
|
content: value.content,
|
|
13799
13815
|
loc: value.loc
|
|
13800
13816
|
},
|
|
@@ -13813,10 +13829,10 @@ function parseAttributeValue(context) {
|
|
|
13813
13829
|
content = parseTextData(
|
|
13814
13830
|
context,
|
|
13815
13831
|
context.source.length,
|
|
13816
|
-
|
|
13832
|
+
4
|
|
13817
13833
|
);
|
|
13818
13834
|
} else {
|
|
13819
|
-
content = parseTextData(context, endIndex,
|
|
13835
|
+
content = parseTextData(context, endIndex, 4);
|
|
13820
13836
|
advanceBy(context, 1);
|
|
13821
13837
|
}
|
|
13822
13838
|
} else {
|
|
@@ -13829,11 +13845,11 @@ function parseAttributeValue(context) {
|
|
|
13829
13845
|
while (m = unexpectedChars.exec(match[0])) {
|
|
13830
13846
|
emitError(
|
|
13831
13847
|
context,
|
|
13832
|
-
|
|
13848
|
+
18,
|
|
13833
13849
|
m.index
|
|
13834
13850
|
);
|
|
13835
13851
|
}
|
|
13836
|
-
content = parseTextData(context, match[0].length,
|
|
13852
|
+
content = parseTextData(context, match[0].length, 4);
|
|
13837
13853
|
}
|
|
13838
13854
|
return { content, isQuoted, loc: getSelection(context, start) };
|
|
13839
13855
|
}
|
|
@@ -13841,7 +13857,7 @@ function parseInterpolation(context, mode) {
|
|
|
13841
13857
|
const [open, close] = context.options.delimiters;
|
|
13842
13858
|
const closeIndex = context.source.indexOf(close, open.length);
|
|
13843
13859
|
if (closeIndex === -1) {
|
|
13844
|
-
emitError(context,
|
|
13860
|
+
emitError(context, 25);
|
|
13845
13861
|
return void 0;
|
|
13846
13862
|
}
|
|
13847
13863
|
const start = getCursor(context);
|
|
@@ -13860,9 +13876,9 @@ function parseInterpolation(context, mode) {
|
|
|
13860
13876
|
advancePositionWithMutation(innerEnd, rawContent, endOffset);
|
|
13861
13877
|
advanceBy(context, close.length);
|
|
13862
13878
|
return {
|
|
13863
|
-
type:
|
|
13879
|
+
type: 5,
|
|
13864
13880
|
content: {
|
|
13865
|
-
type:
|
|
13881
|
+
type: 4,
|
|
13866
13882
|
isStatic: false,
|
|
13867
13883
|
// Set `isConstant` to false by default and will decide in transformExpression
|
|
13868
13884
|
constType: 0,
|
|
@@ -13873,7 +13889,7 @@ function parseInterpolation(context, mode) {
|
|
|
13873
13889
|
};
|
|
13874
13890
|
}
|
|
13875
13891
|
function parseText(context, mode) {
|
|
13876
|
-
const endTokens = mode ===
|
|
13892
|
+
const endTokens = mode === 3 ? ["]]>"] : ["<", context.options.delimiters[0]];
|
|
13877
13893
|
let endIndex = context.source.length;
|
|
13878
13894
|
for (let i = 0; i < endTokens.length; i++) {
|
|
13879
13895
|
const index = context.source.indexOf(endTokens[i], 1);
|
|
@@ -13884,7 +13900,7 @@ function parseText(context, mode) {
|
|
|
13884
13900
|
const start = getCursor(context);
|
|
13885
13901
|
const content = parseTextData(context, endIndex, mode);
|
|
13886
13902
|
return {
|
|
13887
|
-
type:
|
|
13903
|
+
type: 2,
|
|
13888
13904
|
content,
|
|
13889
13905
|
loc: getSelection(context, start)
|
|
13890
13906
|
};
|
|
@@ -13892,12 +13908,12 @@ function parseText(context, mode) {
|
|
|
13892
13908
|
function parseTextData(context, length, mode) {
|
|
13893
13909
|
const rawText = context.source.slice(0, length);
|
|
13894
13910
|
advanceBy(context, length);
|
|
13895
|
-
if (mode ===
|
|
13911
|
+
if (mode === 2 || mode === 3 || !rawText.includes("&")) {
|
|
13896
13912
|
return rawText;
|
|
13897
13913
|
} else {
|
|
13898
13914
|
return context.options.decodeEntities(
|
|
13899
13915
|
rawText,
|
|
13900
|
-
mode ===
|
|
13916
|
+
mode === 4
|
|
13901
13917
|
);
|
|
13902
13918
|
}
|
|
13903
13919
|
}
|
|
@@ -13953,7 +13969,7 @@ function emitError(context, code, offset, loc = getCursor(context)) {
|
|
|
13953
13969
|
function isEnd(context, mode, ancestors) {
|
|
13954
13970
|
const s = context.source;
|
|
13955
13971
|
switch (mode) {
|
|
13956
|
-
case
|
|
13972
|
+
case 0:
|
|
13957
13973
|
if (startsWith(s, "</")) {
|
|
13958
13974
|
for (let i = ancestors.length - 1; i >= 0; --i) {
|
|
13959
13975
|
if (startsWithEndTagOpen(s, ancestors[i].tag)) {
|
|
@@ -13962,15 +13978,15 @@ function isEnd(context, mode, ancestors) {
|
|
|
13962
13978
|
}
|
|
13963
13979
|
}
|
|
13964
13980
|
break;
|
|
13965
|
-
case
|
|
13966
|
-
case
|
|
13981
|
+
case 1:
|
|
13982
|
+
case 2: {
|
|
13967
13983
|
const parent = last(ancestors);
|
|
13968
13984
|
if (parent && startsWithEndTagOpen(s, parent.tag)) {
|
|
13969
13985
|
return true;
|
|
13970
13986
|
}
|
|
13971
13987
|
break;
|
|
13972
13988
|
}
|
|
13973
|
-
case
|
|
13989
|
+
case 3:
|
|
13974
13990
|
if (startsWith(s, "]]>")) {
|
|
13975
13991
|
return true;
|
|
13976
13992
|
}
|
|
@@ -13993,7 +14009,7 @@ function hoistStatic(root, context) {
|
|
|
13993
14009
|
}
|
|
13994
14010
|
function isSingleElementRoot(root, child) {
|
|
13995
14011
|
const { children } = root;
|
|
13996
|
-
return children.length === 1 && child.type ===
|
|
14012
|
+
return children.length === 1 && child.type === 1 && !isSlotOutlet(child);
|
|
13997
14013
|
}
|
|
13998
14014
|
function walk(node, context, doNotHoistNode = false) {
|
|
13999
14015
|
const { children } = node;
|
|
@@ -14001,10 +14017,10 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
14001
14017
|
let hoistedCount = 0;
|
|
14002
14018
|
for (let i = 0; i < children.length; i++) {
|
|
14003
14019
|
const child = children[i];
|
|
14004
|
-
if (child.type ===
|
|
14020
|
+
if (child.type === 1 && child.tagType === 0) {
|
|
14005
14021
|
const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
|
|
14006
14022
|
if (constantType > 0) {
|
|
14007
|
-
if (constantType >=
|
|
14023
|
+
if (constantType >= 2) {
|
|
14008
14024
|
child.codegenNode.patchFlag = -1 + (process.env.NODE_ENV !== "production" ? ` /* HOISTED */` : ``);
|
|
14009
14025
|
child.codegenNode = context.hoist(child.codegenNode);
|
|
14010
14026
|
hoistedCount++;
|
|
@@ -14012,9 +14028,9 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
14012
14028
|
}
|
|
14013
14029
|
} else {
|
|
14014
14030
|
const codegenNode = child.codegenNode;
|
|
14015
|
-
if (codegenNode.type ===
|
|
14031
|
+
if (codegenNode.type === 13) {
|
|
14016
14032
|
const flag = getPatchFlag(codegenNode);
|
|
14017
|
-
if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >=
|
|
14033
|
+
if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {
|
|
14018
14034
|
const props = getNodeProps(child);
|
|
14019
14035
|
if (props) {
|
|
14020
14036
|
codegenNode.props = context.hoist(props);
|
|
@@ -14026,8 +14042,8 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
14026
14042
|
}
|
|
14027
14043
|
}
|
|
14028
14044
|
}
|
|
14029
|
-
if (child.type ===
|
|
14030
|
-
const isComponent = child.tagType ===
|
|
14045
|
+
if (child.type === 1) {
|
|
14046
|
+
const isComponent = child.tagType === 1;
|
|
14031
14047
|
if (isComponent) {
|
|
14032
14048
|
context.scopes.vSlot++;
|
|
14033
14049
|
}
|
|
@@ -14035,9 +14051,9 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
14035
14051
|
if (isComponent) {
|
|
14036
14052
|
context.scopes.vSlot--;
|
|
14037
14053
|
}
|
|
14038
|
-
} else if (child.type ===
|
|
14054
|
+
} else if (child.type === 11) {
|
|
14039
14055
|
walk(child, context, child.children.length === 1);
|
|
14040
|
-
} else if (child.type ===
|
|
14056
|
+
} else if (child.type === 9) {
|
|
14041
14057
|
for (let i2 = 0; i2 < child.branches.length; i2++) {
|
|
14042
14058
|
walk(
|
|
14043
14059
|
child.branches[i2],
|
|
@@ -14050,7 +14066,7 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
14050
14066
|
if (hoistedCount && context.transformHoist) {
|
|
14051
14067
|
context.transformHoist(children, context, node);
|
|
14052
14068
|
}
|
|
14053
|
-
if (hoistedCount && hoistedCount === originalCount && node.type ===
|
|
14069
|
+
if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
|
|
14054
14070
|
node.codegenNode.children = context.hoist(
|
|
14055
14071
|
createArrayExpression(node.codegenNode.children)
|
|
14056
14072
|
);
|
|
@@ -14059,8 +14075,8 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
14059
14075
|
function getConstantType(node, context) {
|
|
14060
14076
|
const { constantCache } = context;
|
|
14061
14077
|
switch (node.type) {
|
|
14062
|
-
case
|
|
14063
|
-
if (node.tagType !==
|
|
14078
|
+
case 1:
|
|
14079
|
+
if (node.tagType !== 0) {
|
|
14064
14080
|
return 0;
|
|
14065
14081
|
}
|
|
14066
14082
|
const cached = constantCache.get(node);
|
|
@@ -14068,7 +14084,7 @@ function getConstantType(node, context) {
|
|
|
14068
14084
|
return cached;
|
|
14069
14085
|
}
|
|
14070
14086
|
const codegenNode = node.codegenNode;
|
|
14071
|
-
if (codegenNode.type !==
|
|
14087
|
+
if (codegenNode.type !== 13) {
|
|
14072
14088
|
return 0;
|
|
14073
14089
|
}
|
|
14074
14090
|
if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject") {
|
|
@@ -14076,7 +14092,7 @@ function getConstantType(node, context) {
|
|
|
14076
14092
|
}
|
|
14077
14093
|
const flag = getPatchFlag(codegenNode);
|
|
14078
14094
|
if (!flag) {
|
|
14079
|
-
let returnType2 =
|
|
14095
|
+
let returnType2 = 3;
|
|
14080
14096
|
const generatedPropsType = getGeneratedPropsConstantType(node, context);
|
|
14081
14097
|
if (generatedPropsType === 0) {
|
|
14082
14098
|
constantCache.set(node, 0);
|
|
@@ -14095,10 +14111,10 @@ function getConstantType(node, context) {
|
|
|
14095
14111
|
returnType2 = childType;
|
|
14096
14112
|
}
|
|
14097
14113
|
}
|
|
14098
|
-
if (returnType2 >
|
|
14114
|
+
if (returnType2 > 1) {
|
|
14099
14115
|
for (let i = 0; i < node.props.length; i++) {
|
|
14100
14116
|
const p = node.props[i];
|
|
14101
|
-
if (p.type ===
|
|
14117
|
+
if (p.type === 7 && p.name === "bind" && p.exp) {
|
|
14102
14118
|
const expType = getConstantType(p.exp, context);
|
|
14103
14119
|
if (expType === 0) {
|
|
14104
14120
|
constantCache.set(node, 0);
|
|
@@ -14113,7 +14129,7 @@ function getConstantType(node, context) {
|
|
|
14113
14129
|
if (codegenNode.isBlock) {
|
|
14114
14130
|
for (let i = 0; i < node.props.length; i++) {
|
|
14115
14131
|
const p = node.props[i];
|
|
14116
|
-
if (p.type ===
|
|
14132
|
+
if (p.type === 7) {
|
|
14117
14133
|
constantCache.set(node, 0);
|
|
14118
14134
|
return 0;
|
|
14119
14135
|
}
|
|
@@ -14131,20 +14147,20 @@ function getConstantType(node, context) {
|
|
|
14131
14147
|
constantCache.set(node, 0);
|
|
14132
14148
|
return 0;
|
|
14133
14149
|
}
|
|
14134
|
-
case
|
|
14135
|
-
case
|
|
14136
|
-
return
|
|
14137
|
-
case
|
|
14138
|
-
case
|
|
14139
|
-
case
|
|
14150
|
+
case 2:
|
|
14151
|
+
case 3:
|
|
14152
|
+
return 3;
|
|
14153
|
+
case 9:
|
|
14154
|
+
case 11:
|
|
14155
|
+
case 10:
|
|
14140
14156
|
return 0;
|
|
14141
|
-
case
|
|
14142
|
-
case
|
|
14157
|
+
case 5:
|
|
14158
|
+
case 12:
|
|
14143
14159
|
return getConstantType(node.content, context);
|
|
14144
|
-
case
|
|
14160
|
+
case 4:
|
|
14145
14161
|
return node.constType;
|
|
14146
|
-
case
|
|
14147
|
-
let returnType =
|
|
14162
|
+
case 8:
|
|
14163
|
+
let returnType = 3;
|
|
14148
14164
|
for (let i = 0; i < node.children.length; i++) {
|
|
14149
14165
|
const child = node.children[i];
|
|
14150
14166
|
if (isString(child) || isSymbol(child)) {
|
|
@@ -14170,20 +14186,20 @@ const allowHoistedHelperSet = /* @__PURE__ */ new Set([
|
|
|
14170
14186
|
GUARD_REACTIVE_PROPS
|
|
14171
14187
|
]);
|
|
14172
14188
|
function getConstantTypeOfHelperCall(value, context) {
|
|
14173
|
-
if (value.type ===
|
|
14189
|
+
if (value.type === 14 && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {
|
|
14174
14190
|
const arg = value.arguments[0];
|
|
14175
|
-
if (arg.type ===
|
|
14191
|
+
if (arg.type === 4) {
|
|
14176
14192
|
return getConstantType(arg, context);
|
|
14177
|
-
} else if (arg.type ===
|
|
14193
|
+
} else if (arg.type === 14) {
|
|
14178
14194
|
return getConstantTypeOfHelperCall(arg, context);
|
|
14179
14195
|
}
|
|
14180
14196
|
}
|
|
14181
14197
|
return 0;
|
|
14182
14198
|
}
|
|
14183
14199
|
function getGeneratedPropsConstantType(node, context) {
|
|
14184
|
-
let returnType =
|
|
14200
|
+
let returnType = 3;
|
|
14185
14201
|
const props = getNodeProps(node);
|
|
14186
|
-
if (props && props.type ===
|
|
14202
|
+
if (props && props.type === 15) {
|
|
14187
14203
|
const { properties } = props;
|
|
14188
14204
|
for (let i = 0; i < properties.length; i++) {
|
|
14189
14205
|
const { key, value } = properties[i];
|
|
@@ -14195,9 +14211,9 @@ function getGeneratedPropsConstantType(node, context) {
|
|
|
14195
14211
|
returnType = keyType;
|
|
14196
14212
|
}
|
|
14197
14213
|
let valueType;
|
|
14198
|
-
if (value.type ===
|
|
14214
|
+
if (value.type === 4) {
|
|
14199
14215
|
valueType = getConstantType(value, context);
|
|
14200
|
-
} else if (value.type ===
|
|
14216
|
+
} else if (value.type === 14) {
|
|
14201
14217
|
valueType = getConstantTypeOfHelperCall(value, context);
|
|
14202
14218
|
} else {
|
|
14203
14219
|
valueType = 0;
|
|
@@ -14214,7 +14230,7 @@ function getGeneratedPropsConstantType(node, context) {
|
|
|
14214
14230
|
}
|
|
14215
14231
|
function getNodeProps(node) {
|
|
14216
14232
|
const codegenNode = node.codegenNode;
|
|
14217
|
-
if (codegenNode.type ===
|
|
14233
|
+
if (codegenNode.type === 13) {
|
|
14218
14234
|
return codegenNode.props;
|
|
14219
14235
|
}
|
|
14220
14236
|
}
|
|
@@ -14356,7 +14372,7 @@ function createTransformContext(root, {
|
|
|
14356
14372
|
`_hoisted_${context.hoists.length}`,
|
|
14357
14373
|
false,
|
|
14358
14374
|
exp.loc,
|
|
14359
|
-
|
|
14375
|
+
2
|
|
14360
14376
|
);
|
|
14361
14377
|
identifier.hoisted = exp;
|
|
14362
14378
|
return identifier;
|
|
@@ -14397,8 +14413,8 @@ function createRootCodegen(root, context) {
|
|
|
14397
14413
|
const child = children[0];
|
|
14398
14414
|
if (isSingleElementRoot(root, child) && child.codegenNode) {
|
|
14399
14415
|
const codegenNode = child.codegenNode;
|
|
14400
|
-
if (codegenNode.type ===
|
|
14401
|
-
|
|
14416
|
+
if (codegenNode.type === 13) {
|
|
14417
|
+
convertToBlock(codegenNode, context);
|
|
14402
14418
|
}
|
|
14403
14419
|
root.codegenNode = codegenNode;
|
|
14404
14420
|
} else {
|
|
@@ -14407,7 +14423,7 @@ function createRootCodegen(root, context) {
|
|
|
14407
14423
|
} else if (children.length > 1) {
|
|
14408
14424
|
let patchFlag = 64;
|
|
14409
14425
|
let patchFlagText = PatchFlagNames[64];
|
|
14410
|
-
if (process.env.NODE_ENV !== "production" && children.filter((c) => c.type !==
|
|
14426
|
+
if (process.env.NODE_ENV !== "production" && children.filter((c) => c.type !== 3).length === 1) {
|
|
14411
14427
|
patchFlag |= 2048;
|
|
14412
14428
|
patchFlagText += `, ${PatchFlagNames[2048]}`;
|
|
14413
14429
|
}
|
|
@@ -14461,25 +14477,25 @@ function traverseNode(node, context) {
|
|
|
14461
14477
|
}
|
|
14462
14478
|
}
|
|
14463
14479
|
switch (node.type) {
|
|
14464
|
-
case
|
|
14480
|
+
case 3:
|
|
14465
14481
|
if (!context.ssr) {
|
|
14466
14482
|
context.helper(CREATE_COMMENT);
|
|
14467
14483
|
}
|
|
14468
14484
|
break;
|
|
14469
|
-
case
|
|
14485
|
+
case 5:
|
|
14470
14486
|
if (!context.ssr) {
|
|
14471
14487
|
context.helper(TO_DISPLAY_STRING);
|
|
14472
14488
|
}
|
|
14473
14489
|
break;
|
|
14474
|
-
case
|
|
14490
|
+
case 9:
|
|
14475
14491
|
for (let i2 = 0; i2 < node.branches.length; i2++) {
|
|
14476
14492
|
traverseNode(node.branches[i2], context);
|
|
14477
14493
|
}
|
|
14478
14494
|
break;
|
|
14479
|
-
case
|
|
14480
|
-
case
|
|
14481
|
-
case
|
|
14482
|
-
case
|
|
14495
|
+
case 10:
|
|
14496
|
+
case 11:
|
|
14497
|
+
case 1:
|
|
14498
|
+
case 0:
|
|
14483
14499
|
traverseChildren(node, context);
|
|
14484
14500
|
break;
|
|
14485
14501
|
}
|
|
@@ -14492,15 +14508,15 @@ function traverseNode(node, context) {
|
|
|
14492
14508
|
function createStructuralDirectiveTransform(name, fn) {
|
|
14493
14509
|
const matches = isString(name) ? (n) => n === name : (n) => name.test(n);
|
|
14494
14510
|
return (node, context) => {
|
|
14495
|
-
if (node.type ===
|
|
14511
|
+
if (node.type === 1) {
|
|
14496
14512
|
const { props } = node;
|
|
14497
|
-
if (node.tagType ===
|
|
14513
|
+
if (node.tagType === 3 && props.some(isVSlot)) {
|
|
14498
14514
|
return;
|
|
14499
14515
|
}
|
|
14500
14516
|
const exitFns = [];
|
|
14501
14517
|
for (let i = 0; i < props.length; i++) {
|
|
14502
14518
|
const prop = props[i];
|
|
14503
|
-
if (prop.type ===
|
|
14519
|
+
if (prop.type === 7 && matches(prop.name)) {
|
|
14504
14520
|
props.splice(i, 1);
|
|
14505
14521
|
i--;
|
|
14506
14522
|
const onExit = fn(node, prop, context);
|
|
@@ -14735,7 +14751,7 @@ function genHoists(hoists, context) {
|
|
|
14735
14751
|
context.pure = false;
|
|
14736
14752
|
}
|
|
14737
14753
|
function isText(n) {
|
|
14738
|
-
return isString(n) || n.type ===
|
|
14754
|
+
return isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8;
|
|
14739
14755
|
}
|
|
14740
14756
|
function genNodeListAsArray(nodes, context) {
|
|
14741
14757
|
const multilines = nodes.length > 3 || process.env.NODE_ENV !== "production" && nodes.some((n) => isArray(n) || !isText(n));
|
|
@@ -14776,68 +14792,68 @@ function genNode(node, context) {
|
|
|
14776
14792
|
return;
|
|
14777
14793
|
}
|
|
14778
14794
|
switch (node.type) {
|
|
14779
|
-
case
|
|
14780
|
-
case
|
|
14781
|
-
case
|
|
14795
|
+
case 1:
|
|
14796
|
+
case 9:
|
|
14797
|
+
case 11:
|
|
14782
14798
|
process.env.NODE_ENV !== "production" && assert(
|
|
14783
14799
|
node.codegenNode != null,
|
|
14784
14800
|
`Codegen node is missing for element/if/for node. Apply appropriate transforms first.`
|
|
14785
14801
|
);
|
|
14786
14802
|
genNode(node.codegenNode, context);
|
|
14787
14803
|
break;
|
|
14788
|
-
case
|
|
14804
|
+
case 2:
|
|
14789
14805
|
genText(node, context);
|
|
14790
14806
|
break;
|
|
14791
|
-
case
|
|
14807
|
+
case 4:
|
|
14792
14808
|
genExpression(node, context);
|
|
14793
14809
|
break;
|
|
14794
|
-
case
|
|
14810
|
+
case 5:
|
|
14795
14811
|
genInterpolation(node, context);
|
|
14796
14812
|
break;
|
|
14797
|
-
case
|
|
14813
|
+
case 12:
|
|
14798
14814
|
genNode(node.codegenNode, context);
|
|
14799
14815
|
break;
|
|
14800
|
-
case
|
|
14816
|
+
case 8:
|
|
14801
14817
|
genCompoundExpression(node, context);
|
|
14802
14818
|
break;
|
|
14803
|
-
case
|
|
14819
|
+
case 3:
|
|
14804
14820
|
genComment(node, context);
|
|
14805
14821
|
break;
|
|
14806
|
-
case
|
|
14822
|
+
case 13:
|
|
14807
14823
|
genVNodeCall(node, context);
|
|
14808
14824
|
break;
|
|
14809
|
-
case
|
|
14825
|
+
case 14:
|
|
14810
14826
|
genCallExpression(node, context);
|
|
14811
14827
|
break;
|
|
14812
|
-
case
|
|
14828
|
+
case 15:
|
|
14813
14829
|
genObjectExpression(node, context);
|
|
14814
14830
|
break;
|
|
14815
|
-
case
|
|
14831
|
+
case 17:
|
|
14816
14832
|
genArrayExpression(node, context);
|
|
14817
14833
|
break;
|
|
14818
|
-
case
|
|
14834
|
+
case 18:
|
|
14819
14835
|
genFunctionExpression(node, context);
|
|
14820
14836
|
break;
|
|
14821
|
-
case
|
|
14837
|
+
case 19:
|
|
14822
14838
|
genConditionalExpression(node, context);
|
|
14823
14839
|
break;
|
|
14824
|
-
case
|
|
14840
|
+
case 20:
|
|
14825
14841
|
genCacheExpression(node, context);
|
|
14826
14842
|
break;
|
|
14827
|
-
case
|
|
14843
|
+
case 21:
|
|
14828
14844
|
genNodeList(node.body, context, true, false);
|
|
14829
14845
|
break;
|
|
14830
|
-
case
|
|
14846
|
+
case 22:
|
|
14831
14847
|
break;
|
|
14832
|
-
case
|
|
14848
|
+
case 23:
|
|
14833
14849
|
break;
|
|
14834
|
-
case
|
|
14850
|
+
case 24:
|
|
14835
14851
|
break;
|
|
14836
|
-
case
|
|
14852
|
+
case 25:
|
|
14837
14853
|
break;
|
|
14838
|
-
case
|
|
14854
|
+
case 26:
|
|
14839
14855
|
break;
|
|
14840
|
-
case
|
|
14856
|
+
case 10:
|
|
14841
14857
|
break;
|
|
14842
14858
|
default:
|
|
14843
14859
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -14874,7 +14890,7 @@ function genCompoundExpression(node, context) {
|
|
|
14874
14890
|
}
|
|
14875
14891
|
function genExpressionAsPropertyKey(node, context) {
|
|
14876
14892
|
const { push } = context;
|
|
14877
|
-
if (node.type ===
|
|
14893
|
+
if (node.type === 8) {
|
|
14878
14894
|
push(`[`);
|
|
14879
14895
|
genCompoundExpression(node, context);
|
|
14880
14896
|
push(`]`);
|
|
@@ -14955,7 +14971,7 @@ function genObjectExpression(node, context) {
|
|
|
14955
14971
|
push(`{}`, node);
|
|
14956
14972
|
return;
|
|
14957
14973
|
}
|
|
14958
|
-
const multilines = properties.length > 1 || process.env.NODE_ENV !== "production" && properties.some((p) => p.value.type !==
|
|
14974
|
+
const multilines = properties.length > 1 || process.env.NODE_ENV !== "production" && properties.some((p) => p.value.type !== 4);
|
|
14959
14975
|
push(multilines ? `{` : `{ `);
|
|
14960
14976
|
multilines && indent();
|
|
14961
14977
|
for (let i = 0; i < properties.length; i++) {
|
|
@@ -15017,7 +15033,7 @@ function genFunctionExpression(node, context) {
|
|
|
15017
15033
|
function genConditionalExpression(node, context) {
|
|
15018
15034
|
const { test, consequent, alternate, newline: needNewline } = node;
|
|
15019
15035
|
const { push, indent, deindent, newline } = context;
|
|
15020
|
-
if (test.type ===
|
|
15036
|
+
if (test.type === 4) {
|
|
15021
15037
|
const needsParens = !isSimpleIdentifier(test.content);
|
|
15022
15038
|
needsParens && push(`(`);
|
|
15023
15039
|
genExpression(test, context);
|
|
@@ -15036,7 +15052,7 @@ function genConditionalExpression(node, context) {
|
|
|
15036
15052
|
needNewline && newline();
|
|
15037
15053
|
needNewline || push(` `);
|
|
15038
15054
|
push(`: `);
|
|
15039
|
-
const isNested = alternate.type ===
|
|
15055
|
+
const isNested = alternate.type === 19;
|
|
15040
15056
|
if (!isNested) {
|
|
15041
15057
|
context.indentLevel++;
|
|
15042
15058
|
}
|
|
@@ -15091,7 +15107,7 @@ function validateBrowserExpression(node, context, asParams = false, asRawStateme
|
|
|
15091
15107
|
}
|
|
15092
15108
|
context.onError(
|
|
15093
15109
|
createCompilerError(
|
|
15094
|
-
|
|
15110
|
+
45,
|
|
15095
15111
|
node.loc,
|
|
15096
15112
|
void 0,
|
|
15097
15113
|
message
|
|
@@ -15101,18 +15117,18 @@ function validateBrowserExpression(node, context, asParams = false, asRawStateme
|
|
|
15101
15117
|
}
|
|
15102
15118
|
|
|
15103
15119
|
const transformExpression = (node, context) => {
|
|
15104
|
-
if (node.type ===
|
|
15120
|
+
if (node.type === 5) {
|
|
15105
15121
|
node.content = processExpression(
|
|
15106
15122
|
node.content,
|
|
15107
15123
|
context
|
|
15108
15124
|
);
|
|
15109
|
-
} else if (node.type ===
|
|
15125
|
+
} else if (node.type === 1) {
|
|
15110
15126
|
for (let i = 0; i < node.props.length; i++) {
|
|
15111
15127
|
const dir = node.props[i];
|
|
15112
|
-
if (dir.type ===
|
|
15128
|
+
if (dir.type === 7 && dir.name !== "for") {
|
|
15113
15129
|
const exp = dir.exp;
|
|
15114
15130
|
const arg = dir.arg;
|
|
15115
|
-
if (exp && exp.type ===
|
|
15131
|
+
if (exp && exp.type === 4 && !(dir.name === "on" && arg)) {
|
|
15116
15132
|
dir.exp = processExpression(
|
|
15117
15133
|
exp,
|
|
15118
15134
|
context,
|
|
@@ -15120,7 +15136,7 @@ const transformExpression = (node, context) => {
|
|
|
15120
15136
|
dir.name === "slot"
|
|
15121
15137
|
);
|
|
15122
15138
|
}
|
|
15123
|
-
if (arg && arg.type ===
|
|
15139
|
+
if (arg && arg.type === 4 && !arg.isStatic) {
|
|
15124
15140
|
dir.arg = processExpression(arg, context);
|
|
15125
15141
|
}
|
|
15126
15142
|
}
|
|
@@ -15145,7 +15161,7 @@ const transformIf = createStructuralDirectiveTransform(
|
|
|
15145
15161
|
let key = 0;
|
|
15146
15162
|
while (i-- >= 0) {
|
|
15147
15163
|
const sibling = siblings[i];
|
|
15148
|
-
if (sibling && sibling.type ===
|
|
15164
|
+
if (sibling && sibling.type === 9) {
|
|
15149
15165
|
key += sibling.branches.length;
|
|
15150
15166
|
}
|
|
15151
15167
|
}
|
|
@@ -15172,7 +15188,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15172
15188
|
if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) {
|
|
15173
15189
|
const loc = dir.exp ? dir.exp.loc : node.loc;
|
|
15174
15190
|
context.onError(
|
|
15175
|
-
createCompilerError(
|
|
15191
|
+
createCompilerError(28, dir.loc)
|
|
15176
15192
|
);
|
|
15177
15193
|
dir.exp = createSimpleExpression(`true`, false, loc);
|
|
15178
15194
|
}
|
|
@@ -15182,7 +15198,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15182
15198
|
if (dir.name === "if") {
|
|
15183
15199
|
const branch = createIfBranch(node, dir);
|
|
15184
15200
|
const ifNode = {
|
|
15185
|
-
type:
|
|
15201
|
+
type: 9,
|
|
15186
15202
|
loc: node.loc,
|
|
15187
15203
|
branches: [branch]
|
|
15188
15204
|
};
|
|
@@ -15196,25 +15212,25 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15196
15212
|
let i = siblings.indexOf(node);
|
|
15197
15213
|
while (i-- >= -1) {
|
|
15198
15214
|
const sibling = siblings[i];
|
|
15199
|
-
if (sibling && sibling.type ===
|
|
15215
|
+
if (sibling && sibling.type === 3) {
|
|
15200
15216
|
context.removeNode(sibling);
|
|
15201
15217
|
process.env.NODE_ENV !== "production" && comments.unshift(sibling);
|
|
15202
15218
|
continue;
|
|
15203
15219
|
}
|
|
15204
|
-
if (sibling && sibling.type ===
|
|
15220
|
+
if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
|
|
15205
15221
|
context.removeNode(sibling);
|
|
15206
15222
|
continue;
|
|
15207
15223
|
}
|
|
15208
|
-
if (sibling && sibling.type ===
|
|
15224
|
+
if (sibling && sibling.type === 9) {
|
|
15209
15225
|
if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
|
|
15210
15226
|
context.onError(
|
|
15211
|
-
createCompilerError(
|
|
15227
|
+
createCompilerError(30, node.loc)
|
|
15212
15228
|
);
|
|
15213
15229
|
}
|
|
15214
15230
|
context.removeNode();
|
|
15215
15231
|
const branch = createIfBranch(node, dir);
|
|
15216
15232
|
if (process.env.NODE_ENV !== "production" && comments.length && // #3619 ignore comments if the v-if is direct child of <transition>
|
|
15217
|
-
!(context.parent && context.parent.type ===
|
|
15233
|
+
!(context.parent && context.parent.type === 1 && isBuiltInType(context.parent.tag, "transition"))) {
|
|
15218
15234
|
branch.children = [...comments, ...branch.children];
|
|
15219
15235
|
}
|
|
15220
15236
|
if (process.env.NODE_ENV !== "production" || false) {
|
|
@@ -15224,7 +15240,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15224
15240
|
if (isSameKey(userKey, key)) {
|
|
15225
15241
|
context.onError(
|
|
15226
15242
|
createCompilerError(
|
|
15227
|
-
|
|
15243
|
+
29,
|
|
15228
15244
|
branch.userKey.loc
|
|
15229
15245
|
)
|
|
15230
15246
|
);
|
|
@@ -15240,7 +15256,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15240
15256
|
context.currentNode = null;
|
|
15241
15257
|
} else {
|
|
15242
15258
|
context.onError(
|
|
15243
|
-
createCompilerError(
|
|
15259
|
+
createCompilerError(30, node.loc)
|
|
15244
15260
|
);
|
|
15245
15261
|
}
|
|
15246
15262
|
break;
|
|
@@ -15248,9 +15264,9 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15248
15264
|
}
|
|
15249
15265
|
}
|
|
15250
15266
|
function createIfBranch(node, dir) {
|
|
15251
|
-
const isTemplateIf = node.tagType ===
|
|
15267
|
+
const isTemplateIf = node.tagType === 3;
|
|
15252
15268
|
return {
|
|
15253
|
-
type:
|
|
15269
|
+
type: 10,
|
|
15254
15270
|
loc: node.loc,
|
|
15255
15271
|
condition: dir.name === "else" ? void 0 : dir.exp,
|
|
15256
15272
|
children: isTemplateIf && !findDir(node, "for") ? node.children : [node],
|
|
@@ -15282,21 +15298,21 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
|
|
|
15282
15298
|
`${keyIndex}`,
|
|
15283
15299
|
false,
|
|
15284
15300
|
locStub,
|
|
15285
|
-
|
|
15301
|
+
2
|
|
15286
15302
|
)
|
|
15287
15303
|
);
|
|
15288
15304
|
const { children } = branch;
|
|
15289
15305
|
const firstChild = children[0];
|
|
15290
|
-
const needFragmentWrapper = children.length !== 1 || firstChild.type !==
|
|
15306
|
+
const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1;
|
|
15291
15307
|
if (needFragmentWrapper) {
|
|
15292
|
-
if (children.length === 1 && firstChild.type ===
|
|
15308
|
+
if (children.length === 1 && firstChild.type === 11) {
|
|
15293
15309
|
const vnodeCall = firstChild.codegenNode;
|
|
15294
15310
|
injectProp(vnodeCall, keyProperty, context);
|
|
15295
15311
|
return vnodeCall;
|
|
15296
15312
|
} else {
|
|
15297
15313
|
let patchFlag = 64;
|
|
15298
15314
|
let patchFlagText = PatchFlagNames[64];
|
|
15299
|
-
if (process.env.NODE_ENV !== "production" && !branch.isTemplateIf && children.filter((c) => c.type !==
|
|
15315
|
+
if (process.env.NODE_ENV !== "production" && !branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) {
|
|
15300
15316
|
patchFlag |= 2048;
|
|
15301
15317
|
patchFlagText += `, ${PatchFlagNames[2048]}`;
|
|
15302
15318
|
}
|
|
@@ -15317,8 +15333,8 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
|
|
|
15317
15333
|
} else {
|
|
15318
15334
|
const ret = firstChild.codegenNode;
|
|
15319
15335
|
const vnodeCall = getMemoedVNodeCall(ret);
|
|
15320
|
-
if (vnodeCall.type ===
|
|
15321
|
-
|
|
15336
|
+
if (vnodeCall.type === 13) {
|
|
15337
|
+
convertToBlock(vnodeCall, context);
|
|
15322
15338
|
}
|
|
15323
15339
|
injectProp(vnodeCall, keyProperty, context);
|
|
15324
15340
|
return ret;
|
|
@@ -15328,7 +15344,7 @@ function isSameKey(a, b) {
|
|
|
15328
15344
|
if (!a || a.type !== b.type) {
|
|
15329
15345
|
return false;
|
|
15330
15346
|
}
|
|
15331
|
-
if (a.type ===
|
|
15347
|
+
if (a.type === 6) {
|
|
15332
15348
|
if (a.value.content !== b.value.content) {
|
|
15333
15349
|
return false;
|
|
15334
15350
|
}
|
|
@@ -15338,7 +15354,7 @@ function isSameKey(a, b) {
|
|
|
15338
15354
|
if (exp.type !== branchExp.type) {
|
|
15339
15355
|
return false;
|
|
15340
15356
|
}
|
|
15341
|
-
if (exp.type !==
|
|
15357
|
+
if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) {
|
|
15342
15358
|
return false;
|
|
15343
15359
|
}
|
|
15344
15360
|
}
|
|
@@ -15346,13 +15362,13 @@ function isSameKey(a, b) {
|
|
|
15346
15362
|
}
|
|
15347
15363
|
function getParentCondition(node) {
|
|
15348
15364
|
while (true) {
|
|
15349
|
-
if (node.type ===
|
|
15350
|
-
if (node.alternate.type ===
|
|
15365
|
+
if (node.type === 19) {
|
|
15366
|
+
if (node.alternate.type === 19) {
|
|
15351
15367
|
node = node.alternate;
|
|
15352
15368
|
} else {
|
|
15353
15369
|
return node;
|
|
15354
15370
|
}
|
|
15355
|
-
} else if (node.type ===
|
|
15371
|
+
} else if (node.type === 20) {
|
|
15356
15372
|
node = node.value;
|
|
15357
15373
|
}
|
|
15358
15374
|
}
|
|
@@ -15369,9 +15385,9 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
15369
15385
|
const isTemplate = isTemplateNode(node);
|
|
15370
15386
|
const memo = findDir(node, "memo");
|
|
15371
15387
|
const keyProp = findProp(node, `key`);
|
|
15372
|
-
const keyExp = keyProp && (keyProp.type ===
|
|
15388
|
+
const keyExp = keyProp && (keyProp.type === 6 ? createSimpleExpression(keyProp.value.content, true) : keyProp.exp);
|
|
15373
15389
|
const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
|
|
15374
|
-
const isStableFragment = forNode.source.type ===
|
|
15390
|
+
const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
|
|
15375
15391
|
const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
|
|
15376
15392
|
forNode.codegenNode = createVNodeCall(
|
|
15377
15393
|
context,
|
|
@@ -15391,12 +15407,12 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
15391
15407
|
const { children } = forNode;
|
|
15392
15408
|
if ((process.env.NODE_ENV !== "production" || false) && isTemplate) {
|
|
15393
15409
|
node.children.some((c) => {
|
|
15394
|
-
if (c.type ===
|
|
15410
|
+
if (c.type === 1) {
|
|
15395
15411
|
const key = findProp(c, "key");
|
|
15396
15412
|
if (key) {
|
|
15397
15413
|
context.onError(
|
|
15398
15414
|
createCompilerError(
|
|
15399
|
-
|
|
15415
|
+
33,
|
|
15400
15416
|
key.loc
|
|
15401
15417
|
)
|
|
15402
15418
|
);
|
|
@@ -15405,7 +15421,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
15405
15421
|
}
|
|
15406
15422
|
});
|
|
15407
15423
|
}
|
|
15408
|
-
const needFragmentWrapper = children.length !== 1 || children[0].type !==
|
|
15424
|
+
const needFragmentWrapper = children.length !== 1 || children[0].type !== 1;
|
|
15409
15425
|
const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null;
|
|
15410
15426
|
if (slotOutlet) {
|
|
15411
15427
|
childBlock = slotOutlet.codegenNode;
|
|
@@ -15492,7 +15508,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
15492
15508
|
function processFor(node, dir, context, processCodegen) {
|
|
15493
15509
|
if (!dir.exp) {
|
|
15494
15510
|
context.onError(
|
|
15495
|
-
createCompilerError(
|
|
15511
|
+
createCompilerError(31, dir.loc)
|
|
15496
15512
|
);
|
|
15497
15513
|
return;
|
|
15498
15514
|
}
|
|
@@ -15504,14 +15520,14 @@ function processFor(node, dir, context, processCodegen) {
|
|
|
15504
15520
|
);
|
|
15505
15521
|
if (!parseResult) {
|
|
15506
15522
|
context.onError(
|
|
15507
|
-
createCompilerError(
|
|
15523
|
+
createCompilerError(32, dir.loc)
|
|
15508
15524
|
);
|
|
15509
15525
|
return;
|
|
15510
15526
|
}
|
|
15511
15527
|
const { addIdentifiers, removeIdentifiers, scopes } = context;
|
|
15512
15528
|
const { source, value, key, index } = parseResult;
|
|
15513
15529
|
const forNode = {
|
|
15514
|
-
type:
|
|
15530
|
+
type: 11,
|
|
15515
15531
|
loc: dir.loc,
|
|
15516
15532
|
source,
|
|
15517
15533
|
valueAlias: value,
|
|
@@ -15624,7 +15640,7 @@ function createParamsList(args) {
|
|
|
15624
15640
|
|
|
15625
15641
|
const defaultFallback = createSimpleExpression(`undefined`, false);
|
|
15626
15642
|
const trackSlotScopes = (node, context) => {
|
|
15627
|
-
if (node.type ===
|
|
15643
|
+
if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) {
|
|
15628
15644
|
const vSlot = findDir(node, "slot");
|
|
15629
15645
|
if (vSlot) {
|
|
15630
15646
|
vSlot.exp;
|
|
@@ -15670,14 +15686,14 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15670
15686
|
const slotElement = children[i];
|
|
15671
15687
|
let slotDir;
|
|
15672
15688
|
if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) {
|
|
15673
|
-
if (slotElement.type !==
|
|
15689
|
+
if (slotElement.type !== 3) {
|
|
15674
15690
|
implicitDefaultChildren.push(slotElement);
|
|
15675
15691
|
}
|
|
15676
15692
|
continue;
|
|
15677
15693
|
}
|
|
15678
15694
|
if (onComponentSlot) {
|
|
15679
15695
|
context.onError(
|
|
15680
|
-
createCompilerError(
|
|
15696
|
+
createCompilerError(37, slotDir.loc)
|
|
15681
15697
|
);
|
|
15682
15698
|
break;
|
|
15683
15699
|
}
|
|
@@ -15717,7 +15733,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15717
15733
|
let prev;
|
|
15718
15734
|
while (j--) {
|
|
15719
15735
|
prev = children[j];
|
|
15720
|
-
if (prev.type !==
|
|
15736
|
+
if (prev.type !== 3) {
|
|
15721
15737
|
break;
|
|
15722
15738
|
}
|
|
15723
15739
|
}
|
|
@@ -15725,7 +15741,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15725
15741
|
children.splice(i, 1);
|
|
15726
15742
|
i--;
|
|
15727
15743
|
let conditional = dynamicSlots[dynamicSlots.length - 1];
|
|
15728
|
-
while (conditional.alternate.type ===
|
|
15744
|
+
while (conditional.alternate.type === 19) {
|
|
15729
15745
|
conditional = conditional.alternate;
|
|
15730
15746
|
}
|
|
15731
15747
|
conditional.alternate = vElse.exp ? createConditionalExpression(
|
|
@@ -15739,7 +15755,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15739
15755
|
) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++);
|
|
15740
15756
|
} else {
|
|
15741
15757
|
context.onError(
|
|
15742
|
-
createCompilerError(
|
|
15758
|
+
createCompilerError(30, vElse.loc)
|
|
15743
15759
|
);
|
|
15744
15760
|
}
|
|
15745
15761
|
} else if (vFor = findDir(slotElement, "for")) {
|
|
@@ -15759,7 +15775,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15759
15775
|
);
|
|
15760
15776
|
} else {
|
|
15761
15777
|
context.onError(
|
|
15762
|
-
createCompilerError(
|
|
15778
|
+
createCompilerError(32, vFor.loc)
|
|
15763
15779
|
);
|
|
15764
15780
|
}
|
|
15765
15781
|
} else {
|
|
@@ -15767,7 +15783,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15767
15783
|
if (seenSlotNames.has(staticSlotName)) {
|
|
15768
15784
|
context.onError(
|
|
15769
15785
|
createCompilerError(
|
|
15770
|
-
|
|
15786
|
+
38,
|
|
15771
15787
|
dirLoc
|
|
15772
15788
|
)
|
|
15773
15789
|
);
|
|
@@ -15798,7 +15814,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15798
15814
|
if (hasNamedDefaultSlot) {
|
|
15799
15815
|
context.onError(
|
|
15800
15816
|
createCompilerError(
|
|
15801
|
-
|
|
15817
|
+
39,
|
|
15802
15818
|
implicitDefaultChildren[0].loc
|
|
15803
15819
|
)
|
|
15804
15820
|
);
|
|
@@ -15851,17 +15867,17 @@ function hasForwardedSlots(children) {
|
|
|
15851
15867
|
for (let i = 0; i < children.length; i++) {
|
|
15852
15868
|
const child = children[i];
|
|
15853
15869
|
switch (child.type) {
|
|
15854
|
-
case
|
|
15855
|
-
if (child.tagType ===
|
|
15870
|
+
case 1:
|
|
15871
|
+
if (child.tagType === 2 || hasForwardedSlots(child.children)) {
|
|
15856
15872
|
return true;
|
|
15857
15873
|
}
|
|
15858
15874
|
break;
|
|
15859
|
-
case
|
|
15875
|
+
case 9:
|
|
15860
15876
|
if (hasForwardedSlots(child.branches))
|
|
15861
15877
|
return true;
|
|
15862
15878
|
break;
|
|
15863
|
-
case
|
|
15864
|
-
case
|
|
15879
|
+
case 10:
|
|
15880
|
+
case 11:
|
|
15865
15881
|
if (hasForwardedSlots(child.children))
|
|
15866
15882
|
return true;
|
|
15867
15883
|
break;
|
|
@@ -15870,20 +15886,20 @@ function hasForwardedSlots(children) {
|
|
|
15870
15886
|
return false;
|
|
15871
15887
|
}
|
|
15872
15888
|
function isNonWhitespaceContent(node) {
|
|
15873
|
-
if (node.type !==
|
|
15889
|
+
if (node.type !== 2 && node.type !== 12)
|
|
15874
15890
|
return true;
|
|
15875
|
-
return node.type ===
|
|
15891
|
+
return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content);
|
|
15876
15892
|
}
|
|
15877
15893
|
|
|
15878
15894
|
const directiveImportMap = /* @__PURE__ */ new WeakMap();
|
|
15879
15895
|
const transformElement = (node, context) => {
|
|
15880
15896
|
return function postTransformElement() {
|
|
15881
15897
|
node = context.currentNode;
|
|
15882
|
-
if (!(node.type ===
|
|
15898
|
+
if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) {
|
|
15883
15899
|
return;
|
|
15884
15900
|
}
|
|
15885
15901
|
const { tag, props } = node;
|
|
15886
|
-
const isComponent = node.tagType ===
|
|
15902
|
+
const isComponent = node.tagType === 1;
|
|
15887
15903
|
let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`;
|
|
15888
15904
|
const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
|
|
15889
15905
|
let vnodeProps;
|
|
@@ -15926,7 +15942,7 @@ const transformElement = (node, context) => {
|
|
|
15926
15942
|
patchFlag |= 1024;
|
|
15927
15943
|
if (process.env.NODE_ENV !== "production" && node.children.length > 1) {
|
|
15928
15944
|
context.onError(
|
|
15929
|
-
createCompilerError(
|
|
15945
|
+
createCompilerError(46, {
|
|
15930
15946
|
start: node.children[0].loc.start,
|
|
15931
15947
|
end: node.children[node.children.length - 1].loc.end,
|
|
15932
15948
|
source: ""
|
|
@@ -15946,11 +15962,11 @@ const transformElement = (node, context) => {
|
|
|
15946
15962
|
} else if (node.children.length === 1 && vnodeTag !== TELEPORT) {
|
|
15947
15963
|
const child = node.children[0];
|
|
15948
15964
|
const type = child.type;
|
|
15949
|
-
const hasDynamicTextChild = type ===
|
|
15965
|
+
const hasDynamicTextChild = type === 5 || type === 8;
|
|
15950
15966
|
if (hasDynamicTextChild && getConstantType(child, context) === 0) {
|
|
15951
15967
|
patchFlag |= 1;
|
|
15952
15968
|
}
|
|
15953
|
-
if (hasDynamicTextChild || type ===
|
|
15969
|
+
if (hasDynamicTextChild || type === 2) {
|
|
15954
15970
|
vnodeChildren = child;
|
|
15955
15971
|
} else {
|
|
15956
15972
|
vnodeChildren = node.children;
|
|
@@ -15998,13 +16014,13 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
15998
16014
|
"COMPILER_IS_ON_ELEMENT",
|
|
15999
16015
|
context
|
|
16000
16016
|
)) {
|
|
16001
|
-
const exp = isProp.type ===
|
|
16017
|
+
const exp = isProp.type === 6 ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp;
|
|
16002
16018
|
if (exp) {
|
|
16003
16019
|
return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
|
|
16004
16020
|
exp
|
|
16005
16021
|
]);
|
|
16006
16022
|
}
|
|
16007
|
-
} else if (isProp.type ===
|
|
16023
|
+
} else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) {
|
|
16008
16024
|
tag = isProp.value.content.slice(4);
|
|
16009
16025
|
}
|
|
16010
16026
|
}
|
|
@@ -16063,7 +16079,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16063
16079
|
if (isEventHandler && isReservedProp(name)) {
|
|
16064
16080
|
hasVnodeHook = true;
|
|
16065
16081
|
}
|
|
16066
|
-
if (value.type ===
|
|
16082
|
+
if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
|
|
16067
16083
|
return;
|
|
16068
16084
|
}
|
|
16069
16085
|
if (name === "ref") {
|
|
@@ -16084,7 +16100,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16084
16100
|
};
|
|
16085
16101
|
for (let i = 0; i < props.length; i++) {
|
|
16086
16102
|
const prop = props[i];
|
|
16087
|
-
if (prop.type ===
|
|
16103
|
+
if (prop.type === 6) {
|
|
16088
16104
|
const { loc, name, value } = prop;
|
|
16089
16105
|
let isStatic = true;
|
|
16090
16106
|
if (name === "ref") {
|
|
@@ -16125,7 +16141,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16125
16141
|
if (name === "slot") {
|
|
16126
16142
|
if (!isComponent) {
|
|
16127
16143
|
context.onError(
|
|
16128
|
-
createCompilerError(
|
|
16144
|
+
createCompilerError(40, loc)
|
|
16129
16145
|
);
|
|
16130
16146
|
}
|
|
16131
16147
|
continue;
|
|
@@ -16166,9 +16182,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16166
16182
|
{
|
|
16167
16183
|
if (process.env.NODE_ENV !== "production") {
|
|
16168
16184
|
const hasOverridableKeys = mergeArgs.some((arg2) => {
|
|
16169
|
-
if (arg2.type ===
|
|
16185
|
+
if (arg2.type === 15) {
|
|
16170
16186
|
return arg2.properties.some(({ key }) => {
|
|
16171
|
-
if (key.type !==
|
|
16187
|
+
if (key.type !== 4 || !key.isStatic) {
|
|
16172
16188
|
return true;
|
|
16173
16189
|
}
|
|
16174
16190
|
return key.content !== "class" && key.content !== "style" && !isOn(key.content);
|
|
@@ -16196,7 +16212,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16196
16212
|
mergeArgs.push(exp);
|
|
16197
16213
|
} else {
|
|
16198
16214
|
pushMergeArg({
|
|
16199
|
-
type:
|
|
16215
|
+
type: 14,
|
|
16200
16216
|
loc,
|
|
16201
16217
|
callee: context.helper(TO_HANDLERS),
|
|
16202
16218
|
arguments: isComponent ? [exp] : [exp, `true`]
|
|
@@ -16205,7 +16221,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16205
16221
|
} else {
|
|
16206
16222
|
context.onError(
|
|
16207
16223
|
createCompilerError(
|
|
16208
|
-
isVBind ?
|
|
16224
|
+
isVBind ? 34 : 35,
|
|
16209
16225
|
loc
|
|
16210
16226
|
)
|
|
16211
16227
|
);
|
|
@@ -16274,7 +16290,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16274
16290
|
}
|
|
16275
16291
|
if (!context.inSSR && propsExpression) {
|
|
16276
16292
|
switch (propsExpression.type) {
|
|
16277
|
-
case
|
|
16293
|
+
case 15:
|
|
16278
16294
|
let classKeyIndex = -1;
|
|
16279
16295
|
let styleKeyIndex = -1;
|
|
16280
16296
|
let hasDynamicKey = false;
|
|
@@ -16301,9 +16317,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16301
16317
|
}
|
|
16302
16318
|
if (styleProp && // the static style is compiled into an object,
|
|
16303
16319
|
// so use `hasStyleBinding` to ensure that it is a dynamic style binding
|
|
16304
|
-
(hasStyleBinding || styleProp.value.type ===
|
|
16320
|
+
(hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist,
|
|
16305
16321
|
// v-bind:style with static literal object
|
|
16306
|
-
styleProp.value.type ===
|
|
16322
|
+
styleProp.value.type === 17)) {
|
|
16307
16323
|
styleProp.value = createCallExpression(
|
|
16308
16324
|
context.helper(NORMALIZE_STYLE),
|
|
16309
16325
|
[styleProp.value]
|
|
@@ -16316,7 +16332,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16316
16332
|
);
|
|
16317
16333
|
}
|
|
16318
16334
|
break;
|
|
16319
|
-
case
|
|
16335
|
+
case 14:
|
|
16320
16336
|
break;
|
|
16321
16337
|
default:
|
|
16322
16338
|
propsExpression = createCallExpression(
|
|
@@ -16343,7 +16359,7 @@ function dedupeProperties(properties) {
|
|
|
16343
16359
|
const deduped = [];
|
|
16344
16360
|
for (let i = 0; i < properties.length; i++) {
|
|
16345
16361
|
const prop = properties[i];
|
|
16346
|
-
if (prop.key.type ===
|
|
16362
|
+
if (prop.key.type === 8 || !prop.key.isStatic) {
|
|
16347
16363
|
deduped.push(prop);
|
|
16348
16364
|
continue;
|
|
16349
16365
|
}
|
|
@@ -16361,7 +16377,7 @@ function dedupeProperties(properties) {
|
|
|
16361
16377
|
return deduped;
|
|
16362
16378
|
}
|
|
16363
16379
|
function mergeAsArray(existing, incoming) {
|
|
16364
|
-
if (existing.value.type ===
|
|
16380
|
+
if (existing.value.type === 17) {
|
|
16365
16381
|
existing.value.elements.push(incoming.value);
|
|
16366
16382
|
} else {
|
|
16367
16383
|
existing.value = createArrayExpression(
|
|
@@ -16460,7 +16476,7 @@ function processSlotOutlet(node, context) {
|
|
|
16460
16476
|
const nonNameProps = [];
|
|
16461
16477
|
for (let i = 0; i < node.props.length; i++) {
|
|
16462
16478
|
const p = node.props[i];
|
|
16463
|
-
if (p.type ===
|
|
16479
|
+
if (p.type === 6) {
|
|
16464
16480
|
if (p.value) {
|
|
16465
16481
|
if (p.name === "name") {
|
|
16466
16482
|
slotName = JSON.stringify(p.value.content);
|
|
@@ -16493,7 +16509,7 @@ function processSlotOutlet(node, context) {
|
|
|
16493
16509
|
if (directives.length) {
|
|
16494
16510
|
context.onError(
|
|
16495
16511
|
createCompilerError(
|
|
16496
|
-
|
|
16512
|
+
36,
|
|
16497
16513
|
directives[0].loc
|
|
16498
16514
|
)
|
|
16499
16515
|
);
|
|
@@ -16509,16 +16525,16 @@ const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+
|
|
|
16509
16525
|
const transformOn$1 = (dir, node, context, augmentor) => {
|
|
16510
16526
|
const { loc, modifiers, arg } = dir;
|
|
16511
16527
|
if (!dir.exp && !modifiers.length) {
|
|
16512
|
-
context.onError(createCompilerError(
|
|
16528
|
+
context.onError(createCompilerError(35, loc));
|
|
16513
16529
|
}
|
|
16514
16530
|
let eventName;
|
|
16515
|
-
if (arg.type ===
|
|
16531
|
+
if (arg.type === 4) {
|
|
16516
16532
|
if (arg.isStatic) {
|
|
16517
16533
|
let rawName = arg.content;
|
|
16518
16534
|
if (rawName.startsWith("vue:")) {
|
|
16519
16535
|
rawName = `vnode-${rawName.slice(4)}`;
|
|
16520
16536
|
}
|
|
16521
|
-
const eventString = node.tagType !==
|
|
16537
|
+
const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? (
|
|
16522
16538
|
// for non-element and vnode lifecycle event listeners, auto convert
|
|
16523
16539
|
// it to camelCase. See issue #2249
|
|
16524
16540
|
toHandlerKey(camelize(rawName))
|
|
@@ -16586,14 +16602,14 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
16586
16602
|
const transformBind = (dir, _node, context) => {
|
|
16587
16603
|
const { exp, modifiers, loc } = dir;
|
|
16588
16604
|
const arg = dir.arg;
|
|
16589
|
-
if (arg.type !==
|
|
16605
|
+
if (arg.type !== 4) {
|
|
16590
16606
|
arg.children.unshift(`(`);
|
|
16591
16607
|
arg.children.push(`) || ""`);
|
|
16592
16608
|
} else if (!arg.isStatic) {
|
|
16593
16609
|
arg.content = `${arg.content} || ""`;
|
|
16594
16610
|
}
|
|
16595
16611
|
if (modifiers.includes("camel")) {
|
|
16596
|
-
if (arg.type ===
|
|
16612
|
+
if (arg.type === 4) {
|
|
16597
16613
|
if (arg.isStatic) {
|
|
16598
16614
|
arg.content = camelize(arg.content);
|
|
16599
16615
|
} else {
|
|
@@ -16612,8 +16628,8 @@ const transformBind = (dir, _node, context) => {
|
|
|
16612
16628
|
injectPrefix(arg, "^");
|
|
16613
16629
|
}
|
|
16614
16630
|
}
|
|
16615
|
-
if (!exp || exp.type ===
|
|
16616
|
-
context.onError(createCompilerError(
|
|
16631
|
+
if (!exp || exp.type === 4 && !exp.content.trim()) {
|
|
16632
|
+
context.onError(createCompilerError(34, loc));
|
|
16617
16633
|
return {
|
|
16618
16634
|
props: [createObjectProperty(arg, createSimpleExpression("", true, loc))]
|
|
16619
16635
|
};
|
|
@@ -16623,7 +16639,7 @@ const transformBind = (dir, _node, context) => {
|
|
|
16623
16639
|
};
|
|
16624
16640
|
};
|
|
16625
16641
|
const injectPrefix = (arg, prefix) => {
|
|
16626
|
-
if (arg.type ===
|
|
16642
|
+
if (arg.type === 4) {
|
|
16627
16643
|
if (arg.isStatic) {
|
|
16628
16644
|
arg.content = prefix + arg.content;
|
|
16629
16645
|
} else {
|
|
@@ -16636,7 +16652,7 @@ const injectPrefix = (arg, prefix) => {
|
|
|
16636
16652
|
};
|
|
16637
16653
|
|
|
16638
16654
|
const transformText = (node, context) => {
|
|
16639
|
-
if (node.type ===
|
|
16655
|
+
if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) {
|
|
16640
16656
|
return () => {
|
|
16641
16657
|
const children = node.children;
|
|
16642
16658
|
let currentContainer = void 0;
|
|
@@ -16668,13 +16684,13 @@ const transformText = (node, context) => {
|
|
|
16668
16684
|
// as-is since the runtime has dedicated fast path for this by directly
|
|
16669
16685
|
// setting textContent of the element.
|
|
16670
16686
|
// for component root it's always normalized anyway.
|
|
16671
|
-
children.length === 1 && (node.type ===
|
|
16687
|
+
children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756
|
|
16672
16688
|
// custom directives can potentially add DOM elements arbitrarily,
|
|
16673
16689
|
// we need to avoid setting textContent of the element at runtime
|
|
16674
16690
|
// to avoid accidentally overwriting the DOM elements added
|
|
16675
16691
|
// by the user through custom directives.
|
|
16676
16692
|
!node.props.find(
|
|
16677
|
-
(p) => p.type ===
|
|
16693
|
+
(p) => p.type === 7 && !context.directiveTransforms[p.name]
|
|
16678
16694
|
) && // in compat mode, <template> tags with no special directives
|
|
16679
16695
|
// will be rendered as a fragment so its children must be
|
|
16680
16696
|
// converted into vnodes.
|
|
@@ -16683,9 +16699,9 @@ const transformText = (node, context) => {
|
|
|
16683
16699
|
}
|
|
16684
16700
|
for (let i = 0; i < children.length; i++) {
|
|
16685
16701
|
const child = children[i];
|
|
16686
|
-
if (isText$1(child) || child.type ===
|
|
16702
|
+
if (isText$1(child) || child.type === 8) {
|
|
16687
16703
|
const callArgs = [];
|
|
16688
|
-
if (child.type !==
|
|
16704
|
+
if (child.type !== 2 || child.content !== " ") {
|
|
16689
16705
|
callArgs.push(child);
|
|
16690
16706
|
}
|
|
16691
16707
|
if (!context.ssr && getConstantType(child, context) === 0) {
|
|
@@ -16694,7 +16710,7 @@ const transformText = (node, context) => {
|
|
|
16694
16710
|
);
|
|
16695
16711
|
}
|
|
16696
16712
|
children[i] = {
|
|
16697
|
-
type:
|
|
16713
|
+
type: 12,
|
|
16698
16714
|
content: child,
|
|
16699
16715
|
loc: child.loc,
|
|
16700
16716
|
codegenNode: createCallExpression(
|
|
@@ -16710,7 +16726,7 @@ const transformText = (node, context) => {
|
|
|
16710
16726
|
|
|
16711
16727
|
const seen$1 = /* @__PURE__ */ new WeakSet();
|
|
16712
16728
|
const transformOnce = (node, context) => {
|
|
16713
|
-
if (node.type ===
|
|
16729
|
+
if (node.type === 1 && findDir(node, "once", true)) {
|
|
16714
16730
|
if (seen$1.has(node) || context.inVOnce) {
|
|
16715
16731
|
return;
|
|
16716
16732
|
}
|
|
@@ -16735,21 +16751,21 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
16735
16751
|
const { exp, arg } = dir;
|
|
16736
16752
|
if (!exp) {
|
|
16737
16753
|
context.onError(
|
|
16738
|
-
createCompilerError(
|
|
16754
|
+
createCompilerError(41, dir.loc)
|
|
16739
16755
|
);
|
|
16740
16756
|
return createTransformProps();
|
|
16741
16757
|
}
|
|
16742
16758
|
const rawExp = exp.loc.source;
|
|
16743
|
-
const expString = exp.type ===
|
|
16759
|
+
const expString = exp.type === 4 ? exp.content : rawExp;
|
|
16744
16760
|
const bindingType = context.bindingMetadata[rawExp];
|
|
16745
16761
|
if (bindingType === "props" || bindingType === "props-aliased") {
|
|
16746
|
-
context.onError(createCompilerError(
|
|
16762
|
+
context.onError(createCompilerError(44, exp.loc));
|
|
16747
16763
|
return createTransformProps();
|
|
16748
16764
|
}
|
|
16749
16765
|
const maybeRef = false;
|
|
16750
16766
|
if (!expString.trim() || !isMemberExpression(expString) && !maybeRef) {
|
|
16751
16767
|
context.onError(
|
|
16752
|
-
createCompilerError(
|
|
16768
|
+
createCompilerError(42, exp.loc)
|
|
16753
16769
|
);
|
|
16754
16770
|
return createTransformProps();
|
|
16755
16771
|
}
|
|
@@ -16770,7 +16786,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
16770
16786
|
// "onUpdate:modelValue": $event => (foo = $event)
|
|
16771
16787
|
createObjectProperty(eventName, assignmentExp)
|
|
16772
16788
|
];
|
|
16773
|
-
if (dir.modifiers.length && node.tagType ===
|
|
16789
|
+
if (dir.modifiers.length && node.tagType === 1) {
|
|
16774
16790
|
const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
|
|
16775
16791
|
const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
|
|
16776
16792
|
props.push(
|
|
@@ -16780,7 +16796,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
16780
16796
|
`{ ${modifiers} }`,
|
|
16781
16797
|
false,
|
|
16782
16798
|
dir.loc,
|
|
16783
|
-
|
|
16799
|
+
2
|
|
16784
16800
|
)
|
|
16785
16801
|
)
|
|
16786
16802
|
);
|
|
@@ -16796,30 +16812,30 @@ const transformFilter = (node, context) => {
|
|
|
16796
16812
|
if (!isCompatEnabled("COMPILER_FILTER", context)) {
|
|
16797
16813
|
return;
|
|
16798
16814
|
}
|
|
16799
|
-
if (node.type ===
|
|
16815
|
+
if (node.type === 5) {
|
|
16800
16816
|
rewriteFilter(node.content, context);
|
|
16801
16817
|
}
|
|
16802
|
-
if (node.type ===
|
|
16818
|
+
if (node.type === 1) {
|
|
16803
16819
|
node.props.forEach((prop) => {
|
|
16804
|
-
if (prop.type ===
|
|
16820
|
+
if (prop.type === 7 && prop.name !== "for" && prop.exp) {
|
|
16805
16821
|
rewriteFilter(prop.exp, context);
|
|
16806
16822
|
}
|
|
16807
16823
|
});
|
|
16808
16824
|
}
|
|
16809
16825
|
};
|
|
16810
16826
|
function rewriteFilter(node, context) {
|
|
16811
|
-
if (node.type ===
|
|
16827
|
+
if (node.type === 4) {
|
|
16812
16828
|
parseFilter(node, context);
|
|
16813
16829
|
} else {
|
|
16814
16830
|
for (let i = 0; i < node.children.length; i++) {
|
|
16815
16831
|
const child = node.children[i];
|
|
16816
16832
|
if (typeof child !== "object")
|
|
16817
16833
|
continue;
|
|
16818
|
-
if (child.type ===
|
|
16834
|
+
if (child.type === 4) {
|
|
16819
16835
|
parseFilter(child, context);
|
|
16820
|
-
} else if (child.type ===
|
|
16836
|
+
} else if (child.type === 8) {
|
|
16821
16837
|
rewriteFilter(node, context);
|
|
16822
|
-
} else if (child.type ===
|
|
16838
|
+
} else if (child.type === 5) {
|
|
16823
16839
|
rewriteFilter(child.content, context);
|
|
16824
16840
|
}
|
|
16825
16841
|
}
|
|
@@ -16940,7 +16956,7 @@ function wrapFilter(exp, filter, context) {
|
|
|
16940
16956
|
|
|
16941
16957
|
const seen = /* @__PURE__ */ new WeakSet();
|
|
16942
16958
|
const transformMemo = (node, context) => {
|
|
16943
|
-
if (node.type ===
|
|
16959
|
+
if (node.type === 1) {
|
|
16944
16960
|
const dir = findDir(node, "memo");
|
|
16945
16961
|
if (!dir || seen.has(node)) {
|
|
16946
16962
|
return;
|
|
@@ -16948,9 +16964,9 @@ const transformMemo = (node, context) => {
|
|
|
16948
16964
|
seen.add(node);
|
|
16949
16965
|
return () => {
|
|
16950
16966
|
const codegenNode = node.codegenNode || context.currentNode.codegenNode;
|
|
16951
|
-
if (codegenNode && codegenNode.type ===
|
|
16952
|
-
if (node.tagType !==
|
|
16953
|
-
|
|
16967
|
+
if (codegenNode && codegenNode.type === 13) {
|
|
16968
|
+
if (node.tagType !== 1) {
|
|
16969
|
+
convertToBlock(codegenNode, context);
|
|
16954
16970
|
}
|
|
16955
16971
|
node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
|
|
16956
16972
|
dir.exp,
|
|
@@ -16989,17 +17005,17 @@ function baseCompile(template, options = {}) {
|
|
|
16989
17005
|
const isModuleMode = options.mode === "module";
|
|
16990
17006
|
{
|
|
16991
17007
|
if (options.prefixIdentifiers === true) {
|
|
16992
|
-
onError(createCompilerError(
|
|
17008
|
+
onError(createCompilerError(47));
|
|
16993
17009
|
} else if (isModuleMode) {
|
|
16994
|
-
onError(createCompilerError(
|
|
17010
|
+
onError(createCompilerError(48));
|
|
16995
17011
|
}
|
|
16996
17012
|
}
|
|
16997
17013
|
const prefixIdentifiers = false;
|
|
16998
17014
|
if (options.cacheHandlers) {
|
|
16999
|
-
onError(createCompilerError(
|
|
17015
|
+
onError(createCompilerError(49));
|
|
17000
17016
|
}
|
|
17001
17017
|
if (options.scopeId && !isModuleMode) {
|
|
17002
|
-
onError(createCompilerError(
|
|
17018
|
+
onError(createCompilerError(50));
|
|
17003
17019
|
}
|
|
17004
17020
|
const ast = isString(template) ? baseParse(template, options) : template;
|
|
17005
17021
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
|
|
@@ -17086,30 +17102,30 @@ const parserOptions = {
|
|
|
17086
17102
|
// https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
|
|
17087
17103
|
getNamespace(tag, parent) {
|
|
17088
17104
|
let ns = parent ? parent.ns : 0;
|
|
17089
|
-
if (parent && ns ===
|
|
17105
|
+
if (parent && ns === 2) {
|
|
17090
17106
|
if (parent.tag === "annotation-xml") {
|
|
17091
17107
|
if (tag === "svg") {
|
|
17092
|
-
return
|
|
17108
|
+
return 1;
|
|
17093
17109
|
}
|
|
17094
17110
|
if (parent.props.some(
|
|
17095
|
-
(a) => a.type ===
|
|
17111
|
+
(a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml")
|
|
17096
17112
|
)) {
|
|
17097
17113
|
ns = 0;
|
|
17098
17114
|
}
|
|
17099
17115
|
} else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") {
|
|
17100
17116
|
ns = 0;
|
|
17101
17117
|
}
|
|
17102
|
-
} else if (parent && ns ===
|
|
17118
|
+
} else if (parent && ns === 1) {
|
|
17103
17119
|
if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") {
|
|
17104
17120
|
ns = 0;
|
|
17105
17121
|
}
|
|
17106
17122
|
}
|
|
17107
17123
|
if (ns === 0) {
|
|
17108
17124
|
if (tag === "svg") {
|
|
17109
|
-
return
|
|
17125
|
+
return 1;
|
|
17110
17126
|
}
|
|
17111
17127
|
if (tag === "math") {
|
|
17112
|
-
return
|
|
17128
|
+
return 2;
|
|
17113
17129
|
}
|
|
17114
17130
|
}
|
|
17115
17131
|
return ns;
|
|
@@ -17118,22 +17134,22 @@ const parserOptions = {
|
|
|
17118
17134
|
getTextMode({ tag, ns }) {
|
|
17119
17135
|
if (ns === 0) {
|
|
17120
17136
|
if (tag === "textarea" || tag === "title") {
|
|
17121
|
-
return
|
|
17137
|
+
return 1;
|
|
17122
17138
|
}
|
|
17123
17139
|
if (isRawTextContainer(tag)) {
|
|
17124
|
-
return
|
|
17140
|
+
return 2;
|
|
17125
17141
|
}
|
|
17126
17142
|
}
|
|
17127
|
-
return
|
|
17143
|
+
return 0;
|
|
17128
17144
|
}
|
|
17129
17145
|
};
|
|
17130
17146
|
|
|
17131
17147
|
const transformStyle = (node) => {
|
|
17132
|
-
if (node.type ===
|
|
17148
|
+
if (node.type === 1) {
|
|
17133
17149
|
node.props.forEach((p, i) => {
|
|
17134
|
-
if (p.type ===
|
|
17150
|
+
if (p.type === 6 && p.name === "style" && p.value) {
|
|
17135
17151
|
node.props[i] = {
|
|
17136
|
-
type:
|
|
17152
|
+
type: 7,
|
|
17137
17153
|
name: `bind`,
|
|
17138
17154
|
arg: createSimpleExpression(`style`, true, p.loc),
|
|
17139
17155
|
exp: parseInlineCSS(p.value.content, p.loc),
|
|
@@ -17150,7 +17166,7 @@ const parseInlineCSS = (cssText, loc) => {
|
|
|
17150
17166
|
JSON.stringify(normalized),
|
|
17151
17167
|
false,
|
|
17152
17168
|
loc,
|
|
17153
|
-
|
|
17169
|
+
3
|
|
17154
17170
|
);
|
|
17155
17171
|
};
|
|
17156
17172
|
|
|
@@ -17163,16 +17179,16 @@ function createDOMCompilerError(code, loc) {
|
|
|
17163
17179
|
}
|
|
17164
17180
|
const DOMErrorMessages = {
|
|
17165
17181
|
[51]: `v-html is missing expression.`,
|
|
17166
|
-
[
|
|
17167
|
-
[
|
|
17168
|
-
[
|
|
17169
|
-
[
|
|
17170
|
-
[
|
|
17171
|
-
[
|
|
17172
|
-
[
|
|
17173
|
-
[
|
|
17174
|
-
[
|
|
17175
|
-
[
|
|
17182
|
+
[52]: `v-html will override element children.`,
|
|
17183
|
+
[53]: `v-text is missing expression.`,
|
|
17184
|
+
[54]: `v-text will override element children.`,
|
|
17185
|
+
[55]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
17186
|
+
[56]: `v-model argument is not supported on plain elements.`,
|
|
17187
|
+
[57]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
|
17188
|
+
[58]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
17189
|
+
[59]: `v-show is missing expression.`,
|
|
17190
|
+
[60]: `<Transition> expects exactly one child element or component.`,
|
|
17191
|
+
[61]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
17176
17192
|
};
|
|
17177
17193
|
|
|
17178
17194
|
const transformVHtml = (dir, node, context) => {
|
|
@@ -17184,7 +17200,7 @@ const transformVHtml = (dir, node, context) => {
|
|
|
17184
17200
|
}
|
|
17185
17201
|
if (node.children.length) {
|
|
17186
17202
|
context.onError(
|
|
17187
|
-
createDOMCompilerError(
|
|
17203
|
+
createDOMCompilerError(52, loc)
|
|
17188
17204
|
);
|
|
17189
17205
|
node.children.length = 0;
|
|
17190
17206
|
}
|
|
@@ -17202,12 +17218,12 @@ const transformVText = (dir, node, context) => {
|
|
|
17202
17218
|
const { exp, loc } = dir;
|
|
17203
17219
|
if (!exp) {
|
|
17204
17220
|
context.onError(
|
|
17205
|
-
createDOMCompilerError(
|
|
17221
|
+
createDOMCompilerError(53, loc)
|
|
17206
17222
|
);
|
|
17207
17223
|
}
|
|
17208
17224
|
if (node.children.length) {
|
|
17209
17225
|
context.onError(
|
|
17210
|
-
createDOMCompilerError(
|
|
17226
|
+
createDOMCompilerError(54, loc)
|
|
17211
17227
|
);
|
|
17212
17228
|
node.children.length = 0;
|
|
17213
17229
|
}
|
|
@@ -17227,13 +17243,13 @@ const transformVText = (dir, node, context) => {
|
|
|
17227
17243
|
|
|
17228
17244
|
const transformModel = (dir, node, context) => {
|
|
17229
17245
|
const baseResult = transformModel$1(dir, node, context);
|
|
17230
|
-
if (!baseResult.props.length || node.tagType ===
|
|
17246
|
+
if (!baseResult.props.length || node.tagType === 1) {
|
|
17231
17247
|
return baseResult;
|
|
17232
17248
|
}
|
|
17233
17249
|
if (dir.arg) {
|
|
17234
17250
|
context.onError(
|
|
17235
17251
|
createDOMCompilerError(
|
|
17236
|
-
|
|
17252
|
+
56,
|
|
17237
17253
|
dir.arg.loc
|
|
17238
17254
|
)
|
|
17239
17255
|
);
|
|
@@ -17243,7 +17259,7 @@ const transformModel = (dir, node, context) => {
|
|
|
17243
17259
|
if (value) {
|
|
17244
17260
|
context.onError(
|
|
17245
17261
|
createDOMCompilerError(
|
|
17246
|
-
|
|
17262
|
+
58,
|
|
17247
17263
|
value.loc
|
|
17248
17264
|
)
|
|
17249
17265
|
);
|
|
@@ -17257,7 +17273,7 @@ const transformModel = (dir, node, context) => {
|
|
|
17257
17273
|
if (tag === "input" || isCustomElement) {
|
|
17258
17274
|
const type = findProp(node, `type`);
|
|
17259
17275
|
if (type) {
|
|
17260
|
-
if (type.type ===
|
|
17276
|
+
if (type.type === 7) {
|
|
17261
17277
|
directiveToUse = V_MODEL_DYNAMIC;
|
|
17262
17278
|
} else if (type.value) {
|
|
17263
17279
|
switch (type.value.content) {
|
|
@@ -17271,7 +17287,7 @@ const transformModel = (dir, node, context) => {
|
|
|
17271
17287
|
isInvalidType = true;
|
|
17272
17288
|
context.onError(
|
|
17273
17289
|
createDOMCompilerError(
|
|
17274
|
-
|
|
17290
|
+
57,
|
|
17275
17291
|
dir.loc
|
|
17276
17292
|
)
|
|
17277
17293
|
);
|
|
@@ -17297,13 +17313,13 @@ const transformModel = (dir, node, context) => {
|
|
|
17297
17313
|
} else {
|
|
17298
17314
|
context.onError(
|
|
17299
17315
|
createDOMCompilerError(
|
|
17300
|
-
|
|
17316
|
+
55,
|
|
17301
17317
|
dir.loc
|
|
17302
17318
|
)
|
|
17303
17319
|
);
|
|
17304
17320
|
}
|
|
17305
17321
|
baseResult.props = baseResult.props.filter(
|
|
17306
|
-
(p) => !(p.key.type ===
|
|
17322
|
+
(p) => !(p.key.type === 4 && p.key.content === "modelValue")
|
|
17307
17323
|
);
|
|
17308
17324
|
return baseResult;
|
|
17309
17325
|
};
|
|
@@ -17361,7 +17377,7 @@ const resolveModifiers = (key, modifiers, context, loc) => {
|
|
|
17361
17377
|
};
|
|
17362
17378
|
const transformClick = (key, event) => {
|
|
17363
17379
|
const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === "onclick";
|
|
17364
|
-
return isStaticClick ? createSimpleExpression(event, true) : key.type !==
|
|
17380
|
+
return isStaticClick ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([
|
|
17365
17381
|
`(`,
|
|
17366
17382
|
key,
|
|
17367
17383
|
`) === "onClick" ? "${event}" : (`,
|
|
@@ -17409,7 +17425,7 @@ const transformShow = (dir, node, context) => {
|
|
|
17409
17425
|
const { exp, loc } = dir;
|
|
17410
17426
|
if (!exp) {
|
|
17411
17427
|
context.onError(
|
|
17412
|
-
createDOMCompilerError(
|
|
17428
|
+
createDOMCompilerError(59, loc)
|
|
17413
17429
|
);
|
|
17414
17430
|
}
|
|
17415
17431
|
return {
|
|
@@ -17419,7 +17435,7 @@ const transformShow = (dir, node, context) => {
|
|
|
17419
17435
|
};
|
|
17420
17436
|
|
|
17421
17437
|
const transformTransition = (node, context) => {
|
|
17422
|
-
if (node.type ===
|
|
17438
|
+
if (node.type === 1 && node.tagType === 1) {
|
|
17423
17439
|
const component = context.isBuiltInComponent(node.tag);
|
|
17424
17440
|
if (component === TRANSITION) {
|
|
17425
17441
|
return () => {
|
|
@@ -17429,7 +17445,7 @@ const transformTransition = (node, context) => {
|
|
|
17429
17445
|
if (hasMultipleChildren(node)) {
|
|
17430
17446
|
context.onError(
|
|
17431
17447
|
createDOMCompilerError(
|
|
17432
|
-
|
|
17448
|
+
60,
|
|
17433
17449
|
{
|
|
17434
17450
|
start: node.children[0].loc.start,
|
|
17435
17451
|
end: node.children[node.children.length - 1].loc.end,
|
|
@@ -17439,11 +17455,11 @@ const transformTransition = (node, context) => {
|
|
|
17439
17455
|
);
|
|
17440
17456
|
}
|
|
17441
17457
|
const child = node.children[0];
|
|
17442
|
-
if (child.type ===
|
|
17458
|
+
if (child.type === 1) {
|
|
17443
17459
|
for (const p of child.props) {
|
|
17444
|
-
if (p.type ===
|
|
17460
|
+
if (p.type === 7 && p.name === "show") {
|
|
17445
17461
|
node.props.push({
|
|
17446
|
-
type:
|
|
17462
|
+
type: 6,
|
|
17447
17463
|
name: "persisted",
|
|
17448
17464
|
value: void 0,
|
|
17449
17465
|
loc: node.loc
|
|
@@ -17457,16 +17473,16 @@ const transformTransition = (node, context) => {
|
|
|
17457
17473
|
};
|
|
17458
17474
|
function hasMultipleChildren(node) {
|
|
17459
17475
|
const children = node.children = node.children.filter(
|
|
17460
|
-
(c) => c.type !==
|
|
17476
|
+
(c) => c.type !== 3 && !(c.type === 2 && !c.content.trim())
|
|
17461
17477
|
);
|
|
17462
17478
|
const child = children[0];
|
|
17463
|
-
return children.length !== 1 || child.type ===
|
|
17479
|
+
return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren);
|
|
17464
17480
|
}
|
|
17465
17481
|
|
|
17466
17482
|
const ignoreSideEffectTags = (node, context) => {
|
|
17467
|
-
if (node.type ===
|
|
17483
|
+
if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
|
|
17468
17484
|
context.onError(
|
|
17469
|
-
createDOMCompilerError(
|
|
17485
|
+
createDOMCompilerError(61, node.loc)
|
|
17470
17486
|
);
|
|
17471
17487
|
context.removeNode();
|
|
17472
17488
|
}
|