@vue/compat 3.3.0-alpha.2 → 3.3.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue.cjs.js +491 -491
- package/dist/vue.cjs.prod.js +459 -459
- package/dist/vue.esm-browser.js +445 -445
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +446 -446
- package/dist/vue.global.js +445 -445
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +53 -53
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +54 -54
- package/dist/vue.runtime.global.js +53 -53
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
package/dist/vue.cjs.js
CHANGED
|
@@ -1538,7 +1538,7 @@ function warn(msg, ...args) {
|
|
|
1538
1538
|
callWithErrorHandling(
|
|
1539
1539
|
appWarnHandler,
|
|
1540
1540
|
instance,
|
|
1541
|
-
11,
|
|
1541
|
+
"11",
|
|
1542
1542
|
[
|
|
1543
1543
|
msg + args.join(""),
|
|
1544
1544
|
instance && instance.proxy,
|
|
@@ -1651,21 +1651,21 @@ const ErrorTypeStrings = {
|
|
|
1651
1651
|
["ec"]: "errorCaptured hook",
|
|
1652
1652
|
["rtc"]: "renderTracked hook",
|
|
1653
1653
|
["rtg"]: "renderTriggered hook",
|
|
1654
|
-
[0]: "setup function",
|
|
1655
|
-
[1]: "render function",
|
|
1656
|
-
[2]: "watcher getter",
|
|
1657
|
-
[3]: "watcher callback",
|
|
1658
|
-
[4]: "watcher cleanup function",
|
|
1659
|
-
[5]: "native event handler",
|
|
1660
|
-
[6]: "component event handler",
|
|
1661
|
-
[7]: "vnode hook",
|
|
1662
|
-
[8]: "directive hook",
|
|
1663
|
-
[9]: "transition hook",
|
|
1664
|
-
[10]: "app errorHandler",
|
|
1665
|
-
[11]: "app warnHandler",
|
|
1666
|
-
[12]: "ref function",
|
|
1667
|
-
[13]: "async component loader",
|
|
1668
|
-
[14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
|
|
1654
|
+
["0"]: "setup function",
|
|
1655
|
+
["1"]: "render function",
|
|
1656
|
+
["2"]: "watcher getter",
|
|
1657
|
+
["3"]: "watcher callback",
|
|
1658
|
+
["4"]: "watcher cleanup function",
|
|
1659
|
+
["5"]: "native event handler",
|
|
1660
|
+
["6"]: "component event handler",
|
|
1661
|
+
["7"]: "vnode hook",
|
|
1662
|
+
["8"]: "directive hook",
|
|
1663
|
+
["9"]: "transition hook",
|
|
1664
|
+
["10"]: "app errorHandler",
|
|
1665
|
+
["11"]: "app warnHandler",
|
|
1666
|
+
["12"]: "ref function",
|
|
1667
|
+
["13"]: "async component loader",
|
|
1668
|
+
["14"]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
|
|
1669
1669
|
};
|
|
1670
1670
|
function callWithErrorHandling(fn, instance, type, args) {
|
|
1671
1671
|
let res;
|
|
@@ -1714,7 +1714,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
1714
1714
|
callWithErrorHandling(
|
|
1715
1715
|
appErrorHandler,
|
|
1716
1716
|
null,
|
|
1717
|
-
10,
|
|
1717
|
+
"10",
|
|
1718
1718
|
[err, exposedInstance, errorInfo]
|
|
1719
1719
|
);
|
|
1720
1720
|
return;
|
|
@@ -1867,7 +1867,7 @@ function flushJobs(seen) {
|
|
|
1867
1867
|
if (check(job)) {
|
|
1868
1868
|
continue;
|
|
1869
1869
|
}
|
|
1870
|
-
callWithErrorHandling(job, null, 14);
|
|
1870
|
+
callWithErrorHandling(job, null, "14");
|
|
1871
1871
|
}
|
|
1872
1872
|
}
|
|
1873
1873
|
} finally {
|
|
@@ -2485,7 +2485,7 @@ function emit$1(instance, event, args) {
|
|
|
2485
2485
|
callWithAsyncErrorHandling(
|
|
2486
2486
|
cbs.map((cb) => cb.bind(instance.proxy)),
|
|
2487
2487
|
instance,
|
|
2488
|
-
6,
|
|
2488
|
+
"6",
|
|
2489
2489
|
args
|
|
2490
2490
|
);
|
|
2491
2491
|
}
|
|
@@ -2547,7 +2547,7 @@ function compatModelEmit(instance, event, args) {
|
|
|
2547
2547
|
callWithErrorHandling(
|
|
2548
2548
|
modelHandler,
|
|
2549
2549
|
instance,
|
|
2550
|
-
6,
|
|
2550
|
+
"6",
|
|
2551
2551
|
args
|
|
2552
2552
|
);
|
|
2553
2553
|
}
|
|
@@ -2619,7 +2619,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
2619
2619
|
callWithAsyncErrorHandling(
|
|
2620
2620
|
handler,
|
|
2621
2621
|
instance,
|
|
2622
|
-
6,
|
|
2622
|
+
"6",
|
|
2623
2623
|
args
|
|
2624
2624
|
);
|
|
2625
2625
|
}
|
|
@@ -2634,7 +2634,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
2634
2634
|
callWithAsyncErrorHandling(
|
|
2635
2635
|
onceHandler,
|
|
2636
2636
|
instance,
|
|
2637
|
-
6,
|
|
2637
|
+
"6",
|
|
2638
2638
|
args
|
|
2639
2639
|
);
|
|
2640
2640
|
}
|
|
@@ -2818,7 +2818,7 @@ function renderComponentRoot(instance) {
|
|
|
2818
2818
|
}
|
|
2819
2819
|
} catch (err) {
|
|
2820
2820
|
blockStack.length = 0;
|
|
2821
|
-
handleError(err, instance, 1);
|
|
2821
|
+
handleError(err, instance, "1");
|
|
2822
2822
|
result = createVNode(Comment);
|
|
2823
2823
|
}
|
|
2824
2824
|
let root = result;
|
|
@@ -3345,7 +3345,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3345
3345
|
if (delayEnter) {
|
|
3346
3346
|
activeBranch.transition.afterLeave = () => {
|
|
3347
3347
|
if (pendingId === suspense.pendingId) {
|
|
3348
|
-
move(pendingBranch, container2, anchor2, 0);
|
|
3348
|
+
move(pendingBranch, container2, anchor2, "0");
|
|
3349
3349
|
}
|
|
3350
3350
|
};
|
|
3351
3351
|
}
|
|
@@ -3355,7 +3355,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3355
3355
|
unmount(activeBranch, parentComponent2, suspense, true);
|
|
3356
3356
|
}
|
|
3357
3357
|
if (!delayEnter) {
|
|
3358
|
-
move(pendingBranch, container2, anchor2, 0);
|
|
3358
|
+
move(pendingBranch, container2, anchor2, "0");
|
|
3359
3359
|
}
|
|
3360
3360
|
}
|
|
3361
3361
|
setActiveBranch(suspense, pendingBranch);
|
|
@@ -3433,7 +3433,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3433
3433
|
}
|
|
3434
3434
|
const hydratedEl = instance.vnode.el;
|
|
3435
3435
|
instance.asyncDep.catch((err) => {
|
|
3436
|
-
handleError(err, instance, 0);
|
|
3436
|
+
handleError(err, instance, "0");
|
|
3437
3437
|
}).then((asyncSetupResult) => {
|
|
3438
3438
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
|
|
3439
3439
|
return;
|
|
@@ -3677,14 +3677,14 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3677
3677
|
} else if (isReactive(s)) {
|
|
3678
3678
|
return traverse(s);
|
|
3679
3679
|
} else if (isFunction(s)) {
|
|
3680
|
-
return callWithErrorHandling(s, instance, 2);
|
|
3680
|
+
return callWithErrorHandling(s, instance, "2");
|
|
3681
3681
|
} else {
|
|
3682
3682
|
warnInvalidSource(s);
|
|
3683
3683
|
}
|
|
3684
3684
|
});
|
|
3685
3685
|
} else if (isFunction(source)) {
|
|
3686
3686
|
if (cb) {
|
|
3687
|
-
getter = () => callWithErrorHandling(source, instance, 2);
|
|
3687
|
+
getter = () => callWithErrorHandling(source, instance, "2");
|
|
3688
3688
|
} else {
|
|
3689
3689
|
getter = () => {
|
|
3690
3690
|
if (instance && instance.isUnmounted) {
|
|
@@ -3696,7 +3696,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3696
3696
|
return callWithAsyncErrorHandling(
|
|
3697
3697
|
source,
|
|
3698
3698
|
instance,
|
|
3699
|
-
3,
|
|
3699
|
+
"3",
|
|
3700
3700
|
[onCleanup]
|
|
3701
3701
|
);
|
|
3702
3702
|
};
|
|
@@ -3722,7 +3722,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3722
3722
|
let cleanup;
|
|
3723
3723
|
let onCleanup = (fn) => {
|
|
3724
3724
|
cleanup = effect.onStop = () => {
|
|
3725
|
-
callWithErrorHandling(fn, instance, 4);
|
|
3725
|
+
callWithErrorHandling(fn, instance, "4");
|
|
3726
3726
|
};
|
|
3727
3727
|
};
|
|
3728
3728
|
let ssrCleanup;
|
|
@@ -3731,7 +3731,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3731
3731
|
if (!cb) {
|
|
3732
3732
|
getter();
|
|
3733
3733
|
} else if (immediate) {
|
|
3734
|
-
callWithAsyncErrorHandling(cb, instance, 3, [
|
|
3734
|
+
callWithAsyncErrorHandling(cb, instance, "3", [
|
|
3735
3735
|
getter(),
|
|
3736
3736
|
isMultiSource ? [] : void 0,
|
|
3737
3737
|
onCleanup
|
|
@@ -3757,7 +3757,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3757
3757
|
if (cleanup) {
|
|
3758
3758
|
cleanup();
|
|
3759
3759
|
}
|
|
3760
|
-
callWithAsyncErrorHandling(cb, instance, 3, [
|
|
3760
|
+
callWithAsyncErrorHandling(cb, instance, "3", [
|
|
3761
3761
|
newValue,
|
|
3762
3762
|
// pass undefined as the old value when it's changed for the first time
|
|
3763
3763
|
oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
|
|
@@ -4037,7 +4037,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
|
|
|
4037
4037
|
hook && callWithAsyncErrorHandling(
|
|
4038
4038
|
hook,
|
|
4039
4039
|
instance,
|
|
4040
|
-
9,
|
|
4040
|
+
"9",
|
|
4041
4041
|
args
|
|
4042
4042
|
);
|
|
4043
4043
|
};
|
|
@@ -4269,7 +4269,7 @@ function defineAsyncComponent(source) {
|
|
|
4269
4269
|
handleError(
|
|
4270
4270
|
err,
|
|
4271
4271
|
instance,
|
|
4272
|
-
13,
|
|
4272
|
+
"13",
|
|
4273
4273
|
!errorComponent
|
|
4274
4274
|
/* do not throw in dev if user provided error component */
|
|
4275
4275
|
);
|
|
@@ -4374,7 +4374,7 @@ const KeepAliveImpl = {
|
|
|
4374
4374
|
const storageContainer = createElement("div");
|
|
4375
4375
|
sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
|
|
4376
4376
|
const instance2 = vnode.component;
|
|
4377
|
-
move(vnode, container, anchor, 0, parentSuspense);
|
|
4377
|
+
move(vnode, container, anchor, "0", parentSuspense);
|
|
4378
4378
|
patch(
|
|
4379
4379
|
instance2.vnode,
|
|
4380
4380
|
vnode,
|
|
@@ -4402,7 +4402,7 @@ const KeepAliveImpl = {
|
|
|
4402
4402
|
};
|
|
4403
4403
|
sharedContext.deactivate = (vnode) => {
|
|
4404
4404
|
const instance2 = vnode.component;
|
|
4405
|
-
move(vnode, storageContainer, null, 1, parentSuspense);
|
|
4405
|
+
move(vnode, storageContainer, null, "1", parentSuspense);
|
|
4406
4406
|
queuePostRenderEffect(() => {
|
|
4407
4407
|
if (instance2.da) {
|
|
4408
4408
|
invokeArrayFns(instance2.da);
|
|
@@ -4760,7 +4760,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
4760
4760
|
}
|
|
4761
4761
|
if (hook) {
|
|
4762
4762
|
pauseTracking();
|
|
4763
|
-
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
4763
|
+
callWithAsyncErrorHandling(hook, instance, "8", [
|
|
4764
4764
|
vnode.el,
|
|
4765
4765
|
binding,
|
|
4766
4766
|
vnode,
|
|
@@ -6743,7 +6743,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6743
6743
|
return vm;
|
|
6744
6744
|
}
|
|
6745
6745
|
}
|
|
6746
|
-
Vue.version = `2.6.14-compat:${"3.3.0-alpha.
|
|
6746
|
+
Vue.version = `2.6.14-compat:${"3.3.0-alpha.3"}`;
|
|
6747
6747
|
Vue.config = singletonApp.config;
|
|
6748
6748
|
Vue.use = (p, ...options) => {
|
|
6749
6749
|
if (p && isFunction(p.install)) {
|
|
@@ -7324,7 +7324,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7324
7324
|
}
|
|
7325
7325
|
}
|
|
7326
7326
|
if (isFunction(ref)) {
|
|
7327
|
-
callWithErrorHandling(ref, owner, 12, [value, refs]);
|
|
7327
|
+
callWithErrorHandling(ref, owner, "12", [value, refs]);
|
|
7328
7328
|
} else {
|
|
7329
7329
|
const _isString = isString(ref);
|
|
7330
7330
|
const _isRef = isRef(ref);
|
|
@@ -8997,7 +8997,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8997
8997
|
);
|
|
8998
8998
|
} else if (moved) {
|
|
8999
8999
|
if (j < 0 || i !== increasingNewIndexSequence[j]) {
|
|
9000
|
-
move(nextChild, container, anchor, 2);
|
|
9000
|
+
move(nextChild, container, anchor, "2");
|
|
9001
9001
|
} else {
|
|
9002
9002
|
j--;
|
|
9003
9003
|
}
|
|
@@ -9031,9 +9031,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9031
9031
|
moveStaticNode(vnode, container, anchor);
|
|
9032
9032
|
return;
|
|
9033
9033
|
}
|
|
9034
|
-
const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
|
|
9034
|
+
const needTransition = moveType !== "2" && shapeFlag & 1 && transition;
|
|
9035
9035
|
if (needTransition) {
|
|
9036
|
-
if (moveType === 0) {
|
|
9036
|
+
if (moveType === "0") {
|
|
9037
9037
|
transition.beforeEnter(el);
|
|
9038
9038
|
hostInsert(el, container, anchor);
|
|
9039
9039
|
queuePostRenderEffect(() => transition.enter(el), parentSuspense);
|
|
@@ -9440,7 +9440,7 @@ const TeleportImpl = {
|
|
|
9440
9440
|
container,
|
|
9441
9441
|
mainAnchor,
|
|
9442
9442
|
internals,
|
|
9443
|
-
1
|
|
9443
|
+
"1"
|
|
9444
9444
|
);
|
|
9445
9445
|
}
|
|
9446
9446
|
} else {
|
|
@@ -9455,7 +9455,7 @@ const TeleportImpl = {
|
|
|
9455
9455
|
nextTarget,
|
|
9456
9456
|
null,
|
|
9457
9457
|
internals,
|
|
9458
|
-
0
|
|
9458
|
+
"0"
|
|
9459
9459
|
);
|
|
9460
9460
|
} else {
|
|
9461
9461
|
warn(
|
|
@@ -9470,7 +9470,7 @@ const TeleportImpl = {
|
|
|
9470
9470
|
target,
|
|
9471
9471
|
targetAnchor,
|
|
9472
9472
|
internals,
|
|
9473
|
-
1
|
|
9473
|
+
"1"
|
|
9474
9474
|
);
|
|
9475
9475
|
}
|
|
9476
9476
|
}
|
|
@@ -9501,12 +9501,12 @@ const TeleportImpl = {
|
|
|
9501
9501
|
move: moveTeleport,
|
|
9502
9502
|
hydrate: hydrateTeleport
|
|
9503
9503
|
};
|
|
9504
|
-
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
|
|
9505
|
-
if (moveType === 0) {
|
|
9504
|
+
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = "2") {
|
|
9505
|
+
if (moveType === "0") {
|
|
9506
9506
|
insert(vnode.targetAnchor, container, parentAnchor);
|
|
9507
9507
|
}
|
|
9508
9508
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
9509
|
-
const isReorder = moveType === 2;
|
|
9509
|
+
const isReorder = moveType === "2";
|
|
9510
9510
|
if (isReorder) {
|
|
9511
9511
|
insert(el, container, parentAnchor);
|
|
9512
9512
|
}
|
|
@@ -9517,7 +9517,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
9517
9517
|
children[i],
|
|
9518
9518
|
container,
|
|
9519
9519
|
parentAnchor,
|
|
9520
|
-
2
|
|
9520
|
+
"2"
|
|
9521
9521
|
);
|
|
9522
9522
|
}
|
|
9523
9523
|
}
|
|
@@ -10006,7 +10006,7 @@ function mergeProps(...args) {
|
|
|
10006
10006
|
return ret;
|
|
10007
10007
|
}
|
|
10008
10008
|
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
10009
|
-
callWithAsyncErrorHandling(hook, instance, 7, [
|
|
10009
|
+
callWithAsyncErrorHandling(hook, instance, "7", [
|
|
10010
10010
|
vnode,
|
|
10011
10011
|
prevVNode
|
|
10012
10012
|
]);
|
|
@@ -10172,7 +10172,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10172
10172
|
const setupResult = callWithErrorHandling(
|
|
10173
10173
|
setup,
|
|
10174
10174
|
instance,
|
|
10175
|
-
0,
|
|
10175
|
+
"0",
|
|
10176
10176
|
[shallowReadonly(instance.props) , setupContext]
|
|
10177
10177
|
);
|
|
10178
10178
|
resetTracking();
|
|
@@ -10183,7 +10183,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10183
10183
|
return setupResult.then((resolvedResult) => {
|
|
10184
10184
|
handleSetupResult(instance, resolvedResult, isSSR);
|
|
10185
10185
|
}).catch((e) => {
|
|
10186
|
-
handleError(e, instance, 0);
|
|
10186
|
+
handleError(e, instance, "0");
|
|
10187
10187
|
});
|
|
10188
10188
|
} else {
|
|
10189
10189
|
instance.asyncDep = setupResult;
|
|
@@ -10737,7 +10737,7 @@ function isMemoSame(cached, memo) {
|
|
|
10737
10737
|
return true;
|
|
10738
10738
|
}
|
|
10739
10739
|
|
|
10740
|
-
const version = "3.3.0-alpha.
|
|
10740
|
+
const version = "3.3.0-alpha.3";
|
|
10741
10741
|
const _ssrUtils = {
|
|
10742
10742
|
createComponentInstance,
|
|
10743
10743
|
setupComponent,
|
|
@@ -11077,7 +11077,7 @@ function createInvoker(initialValue, instance) {
|
|
|
11077
11077
|
callWithAsyncErrorHandling(
|
|
11078
11078
|
patchStopImmediatePropagation(e, invoker.value),
|
|
11079
11079
|
instance,
|
|
11080
|
-
5,
|
|
11080
|
+
"5",
|
|
11081
11081
|
[e]
|
|
11082
11082
|
);
|
|
11083
11083
|
};
|
|
@@ -12533,63 +12533,63 @@ function createCompilerError(code, loc, messages, additionalMessage) {
|
|
|
12533
12533
|
}
|
|
12534
12534
|
const errorMessages = {
|
|
12535
12535
|
// parse errors
|
|
12536
|
-
[0]: "Illegal comment.",
|
|
12537
|
-
[1]: "CDATA section is allowed only in XML context.",
|
|
12538
|
-
[2]: "Duplicate attribute.",
|
|
12539
|
-
[3]: "End tag cannot have attributes.",
|
|
12540
|
-
[4]: "Illegal '/' in tags.",
|
|
12541
|
-
[5]: "Unexpected EOF in tag.",
|
|
12542
|
-
[6]: "Unexpected EOF in CDATA section.",
|
|
12543
|
-
[7]: "Unexpected EOF in comment.",
|
|
12544
|
-
[8]: "Unexpected EOF in script.",
|
|
12545
|
-
[9]: "Unexpected EOF in tag.",
|
|
12546
|
-
[10]: "Incorrectly closed comment.",
|
|
12547
|
-
[11]: "Incorrectly opened comment.",
|
|
12548
|
-
[12]: "Illegal tag name. Use '<' to print '<'.",
|
|
12549
|
-
[13]: "Attribute value was expected.",
|
|
12550
|
-
[14]: "End tag name was expected.",
|
|
12551
|
-
[15]: "Whitespace was expected.",
|
|
12552
|
-
[16]: "Unexpected '<!--' in comment.",
|
|
12553
|
-
[17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
|
|
12554
|
-
[18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
|
|
12555
|
-
[19]: "Attribute name cannot start with '='.",
|
|
12556
|
-
[21]: "'<?' is allowed only in XML context.",
|
|
12557
|
-
[20]: `Unexpected null character.`,
|
|
12558
|
-
[22]: "Illegal '/' in tags.",
|
|
12536
|
+
["0"]: "Illegal comment.",
|
|
12537
|
+
["1"]: "CDATA section is allowed only in XML context.",
|
|
12538
|
+
["2"]: "Duplicate attribute.",
|
|
12539
|
+
["3"]: "End tag cannot have attributes.",
|
|
12540
|
+
["4"]: "Illegal '/' in tags.",
|
|
12541
|
+
["5"]: "Unexpected EOF in tag.",
|
|
12542
|
+
["6"]: "Unexpected EOF in CDATA section.",
|
|
12543
|
+
["7"]: "Unexpected EOF in comment.",
|
|
12544
|
+
["8"]: "Unexpected EOF in script.",
|
|
12545
|
+
["9"]: "Unexpected EOF in tag.",
|
|
12546
|
+
["10"]: "Incorrectly closed comment.",
|
|
12547
|
+
["11"]: "Incorrectly opened comment.",
|
|
12548
|
+
["12"]: "Illegal tag name. Use '<' to print '<'.",
|
|
12549
|
+
["13"]: "Attribute value was expected.",
|
|
12550
|
+
["14"]: "End tag name was expected.",
|
|
12551
|
+
["15"]: "Whitespace was expected.",
|
|
12552
|
+
["16"]: "Unexpected '<!--' in comment.",
|
|
12553
|
+
["17"]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
|
|
12554
|
+
["18"]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
|
|
12555
|
+
["19"]: "Attribute name cannot start with '='.",
|
|
12556
|
+
["21"]: "'<?' is allowed only in XML context.",
|
|
12557
|
+
["20"]: `Unexpected null character.`,
|
|
12558
|
+
["22"]: "Illegal '/' in tags.",
|
|
12559
12559
|
// Vue-specific parse errors
|
|
12560
|
-
[23]: "Invalid end tag.",
|
|
12561
|
-
[24]: "Element is missing end tag.",
|
|
12562
|
-
[25]: "Interpolation end sign was not found.",
|
|
12563
|
-
[27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
|
|
12564
|
-
[26]: "Legal directive name was expected.",
|
|
12560
|
+
["23"]: "Invalid end tag.",
|
|
12561
|
+
["24"]: "Element is missing end tag.",
|
|
12562
|
+
["25"]: "Interpolation end sign was not found.",
|
|
12563
|
+
["27"]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
|
|
12564
|
+
["26"]: "Legal directive name was expected.",
|
|
12565
12565
|
// transform errors
|
|
12566
|
-
[28]: `v-if/v-else-if is missing expression.`,
|
|
12567
|
-
[29]: `v-if/else branches must use unique keys.`,
|
|
12568
|
-
[30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
|
|
12569
|
-
[31]: `v-for is missing expression.`,
|
|
12570
|
-
[32]: `v-for has invalid expression.`,
|
|
12571
|
-
[33]: `<template v-for> key should be placed on the <template> tag.`,
|
|
12572
|
-
[34]: `v-bind is missing expression.`,
|
|
12573
|
-
[35]: `v-on is missing expression.`,
|
|
12574
|
-
[36]: `Unexpected custom directive on <slot> outlet.`,
|
|
12575
|
-
[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.`,
|
|
12576
|
-
[38]: `Duplicate slot names found. `,
|
|
12577
|
-
[39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
|
|
12578
|
-
[40]: `v-slot can only be used on components or <template> tags.`,
|
|
12579
|
-
[41]: `v-model is missing expression.`,
|
|
12580
|
-
[42]: `v-model value must be a valid JavaScript member expression.`,
|
|
12581
|
-
[43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
|
|
12582
|
-
[44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
|
|
12566
|
+
["28"]: `v-if/v-else-if is missing expression.`,
|
|
12567
|
+
["29"]: `v-if/else branches must use unique keys.`,
|
|
12568
|
+
["30"]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
|
|
12569
|
+
["31"]: `v-for is missing expression.`,
|
|
12570
|
+
["32"]: `v-for has invalid expression.`,
|
|
12571
|
+
["33"]: `<template v-for> key should be placed on the <template> tag.`,
|
|
12572
|
+
["34"]: `v-bind is missing expression.`,
|
|
12573
|
+
["35"]: `v-on is missing expression.`,
|
|
12574
|
+
["36"]: `Unexpected custom directive on <slot> outlet.`,
|
|
12575
|
+
["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.`,
|
|
12576
|
+
["38"]: `Duplicate slot names found. `,
|
|
12577
|
+
["39"]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
|
|
12578
|
+
["40"]: `v-slot can only be used on components or <template> tags.`,
|
|
12579
|
+
["41"]: `v-model is missing expression.`,
|
|
12580
|
+
["42"]: `v-model value must be a valid JavaScript member expression.`,
|
|
12581
|
+
["43"]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
|
|
12582
|
+
["44"]: `v-model cannot be used on a prop, because local prop bindings are not writable.
|
|
12583
12583
|
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
12584
|
-
[45]: `Error parsing JavaScript expression: `,
|
|
12585
|
-
[46]: `<KeepAlive> expects exactly one child component.`,
|
|
12584
|
+
["45"]: `Error parsing JavaScript expression: `,
|
|
12585
|
+
["46"]: `<KeepAlive> expects exactly one child component.`,
|
|
12586
12586
|
// generic errors
|
|
12587
|
-
[47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
12588
|
-
[48]: `ES module mode is not supported in this build of compiler.`,
|
|
12589
|
-
[49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
12590
|
-
[50]: `"scopeId" option is only supported in module mode.`,
|
|
12587
|
+
["47"]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
12588
|
+
["48"]: `ES module mode is not supported in this build of compiler.`,
|
|
12589
|
+
["49"]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
12590
|
+
["50"]: `"scopeId" option is only supported in module mode.`,
|
|
12591
12591
|
// just to fulfill types
|
|
12592
|
-
[51]: ``
|
|
12592
|
+
["51"]: ``
|
|
12593
12593
|
};
|
|
12594
12594
|
|
|
12595
12595
|
const FRAGMENT = Symbol(`Fragment` );
|
|
@@ -12687,7 +12687,7 @@ const locStub = {
|
|
|
12687
12687
|
};
|
|
12688
12688
|
function createRoot(children, loc = locStub) {
|
|
12689
12689
|
return {
|
|
12690
|
-
type: 0,
|
|
12690
|
+
type: "0",
|
|
12691
12691
|
children,
|
|
12692
12692
|
helpers: /* @__PURE__ */ new Set(),
|
|
12693
12693
|
components: [],
|
|
@@ -12713,7 +12713,7 @@ function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps,
|
|
|
12713
12713
|
}
|
|
12714
12714
|
}
|
|
12715
12715
|
return {
|
|
12716
|
-
type: 13,
|
|
12716
|
+
type: "13",
|
|
12717
12717
|
tag,
|
|
12718
12718
|
props,
|
|
12719
12719
|
children,
|
|
@@ -12728,21 +12728,21 @@ function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps,
|
|
|
12728
12728
|
}
|
|
12729
12729
|
function createArrayExpression(elements, loc = locStub) {
|
|
12730
12730
|
return {
|
|
12731
|
-
type: 17,
|
|
12731
|
+
type: "17",
|
|
12732
12732
|
loc,
|
|
12733
12733
|
elements
|
|
12734
12734
|
};
|
|
12735
12735
|
}
|
|
12736
12736
|
function createObjectExpression(properties, loc = locStub) {
|
|
12737
12737
|
return {
|
|
12738
|
-
type: 15,
|
|
12738
|
+
type: "15",
|
|
12739
12739
|
loc,
|
|
12740
12740
|
properties
|
|
12741
12741
|
};
|
|
12742
12742
|
}
|
|
12743
12743
|
function createObjectProperty(key, value) {
|
|
12744
12744
|
return {
|
|
12745
|
-
type: 16,
|
|
12745
|
+
type: "16",
|
|
12746
12746
|
loc: locStub,
|
|
12747
12747
|
key: isString(key) ? createSimpleExpression(key, true) : key,
|
|
12748
12748
|
value
|
|
@@ -12750,23 +12750,23 @@ function createObjectProperty(key, value) {
|
|
|
12750
12750
|
}
|
|
12751
12751
|
function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) {
|
|
12752
12752
|
return {
|
|
12753
|
-
type: 4,
|
|
12753
|
+
type: "4",
|
|
12754
12754
|
loc,
|
|
12755
12755
|
content,
|
|
12756
12756
|
isStatic,
|
|
12757
|
-
constType: isStatic ? 3 : constType
|
|
12757
|
+
constType: isStatic ? "3" : constType
|
|
12758
12758
|
};
|
|
12759
12759
|
}
|
|
12760
12760
|
function createCompoundExpression(children, loc = locStub) {
|
|
12761
12761
|
return {
|
|
12762
|
-
type: 8,
|
|
12762
|
+
type: "8",
|
|
12763
12763
|
loc,
|
|
12764
12764
|
children
|
|
12765
12765
|
};
|
|
12766
12766
|
}
|
|
12767
12767
|
function createCallExpression(callee, args = [], loc = locStub) {
|
|
12768
12768
|
return {
|
|
12769
|
-
type: 14,
|
|
12769
|
+
type: "14",
|
|
12770
12770
|
loc,
|
|
12771
12771
|
callee,
|
|
12772
12772
|
arguments: args
|
|
@@ -12774,7 +12774,7 @@ function createCallExpression(callee, args = [], loc = locStub) {
|
|
|
12774
12774
|
}
|
|
12775
12775
|
function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) {
|
|
12776
12776
|
return {
|
|
12777
|
-
type: 18,
|
|
12777
|
+
type: "18",
|
|
12778
12778
|
params,
|
|
12779
12779
|
returns,
|
|
12780
12780
|
newline,
|
|
@@ -12784,7 +12784,7 @@ function createFunctionExpression(params, returns = void 0, newline = false, isS
|
|
|
12784
12784
|
}
|
|
12785
12785
|
function createConditionalExpression(test, consequent, alternate, newline = true) {
|
|
12786
12786
|
return {
|
|
12787
|
-
type: 19,
|
|
12787
|
+
type: "19",
|
|
12788
12788
|
test,
|
|
12789
12789
|
consequent,
|
|
12790
12790
|
alternate,
|
|
@@ -12794,7 +12794,7 @@ function createConditionalExpression(test, consequent, alternate, newline = true
|
|
|
12794
12794
|
}
|
|
12795
12795
|
function createCacheExpression(index, value, isVNode = false) {
|
|
12796
12796
|
return {
|
|
12797
|
-
type: 20,
|
|
12797
|
+
type: "20",
|
|
12798
12798
|
index,
|
|
12799
12799
|
value,
|
|
12800
12800
|
isVNode,
|
|
@@ -12803,13 +12803,13 @@ function createCacheExpression(index, value, isVNode = false) {
|
|
|
12803
12803
|
}
|
|
12804
12804
|
function createBlockStatement(body) {
|
|
12805
12805
|
return {
|
|
12806
|
-
type: 21,
|
|
12806
|
+
type: "21",
|
|
12807
12807
|
body,
|
|
12808
12808
|
loc: locStub
|
|
12809
12809
|
};
|
|
12810
12810
|
}
|
|
12811
12811
|
|
|
12812
|
-
const isStaticExp = (p) => p.type === 4 && p.isStatic;
|
|
12812
|
+
const isStaticExp = (p) => p.type === "4" && p.isStatic;
|
|
12813
12813
|
const isBuiltInType = (tag, expected) => tag === expected || tag === hyphenate(expected);
|
|
12814
12814
|
function isCoreComponent(tag) {
|
|
12815
12815
|
if (isBuiltInType(tag, "Teleport")) {
|
|
@@ -12883,7 +12883,7 @@ function assert(condition, msg) {
|
|
|
12883
12883
|
function findDir(node, name, allowEmpty = false) {
|
|
12884
12884
|
for (let i = 0; i < node.props.length; i++) {
|
|
12885
12885
|
const p = node.props[i];
|
|
12886
|
-
if (p.type === 7 && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) {
|
|
12886
|
+
if (p.type === "7" && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) {
|
|
12887
12887
|
return p;
|
|
12888
12888
|
}
|
|
12889
12889
|
}
|
|
@@ -12891,7 +12891,7 @@ function findDir(node, name, allowEmpty = false) {
|
|
|
12891
12891
|
function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
|
|
12892
12892
|
for (let i = 0; i < node.props.length; i++) {
|
|
12893
12893
|
const p = node.props[i];
|
|
12894
|
-
if (p.type === 6) {
|
|
12894
|
+
if (p.type === "6") {
|
|
12895
12895
|
if (dynamicOnly)
|
|
12896
12896
|
continue;
|
|
12897
12897
|
if (p.name === name && (p.value || allowEmpty)) {
|
|
@@ -12907,23 +12907,23 @@ function isStaticArgOf(arg, name) {
|
|
|
12907
12907
|
}
|
|
12908
12908
|
function hasDynamicKeyVBind(node) {
|
|
12909
12909
|
return node.props.some(
|
|
12910
|
-
(p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj"
|
|
12911
|
-
p.arg.type !== 4 || // v-bind:[_ctx.foo]
|
|
12910
|
+
(p) => p.type === "7" && p.name === "bind" && (!p.arg || // v-bind="obj"
|
|
12911
|
+
p.arg.type !== "4" || // v-bind:[_ctx.foo]
|
|
12912
12912
|
!p.arg.isStatic)
|
|
12913
12913
|
// v-bind:[foo]
|
|
12914
12914
|
);
|
|
12915
12915
|
}
|
|
12916
12916
|
function isText$1(node) {
|
|
12917
|
-
return node.type === 5 || node.type === "
|
|
12917
|
+
return node.type === "5" || node.type === "2";
|
|
12918
12918
|
}
|
|
12919
12919
|
function isVSlot(p) {
|
|
12920
|
-
return p.type === 7 && p.name === "slot";
|
|
12920
|
+
return p.type === "7" && p.name === "slot";
|
|
12921
12921
|
}
|
|
12922
12922
|
function isTemplateNode(node) {
|
|
12923
|
-
return node.type === "
|
|
12923
|
+
return node.type === "1" && node.tagType === "3";
|
|
12924
12924
|
}
|
|
12925
12925
|
function isSlotOutlet(node) {
|
|
12926
|
-
return node.type === "
|
|
12926
|
+
return node.type === "1" && node.tagType === "2";
|
|
12927
12927
|
}
|
|
12928
12928
|
function getVNodeHelper(ssr, isComponent) {
|
|
12929
12929
|
return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
|
|
@@ -12933,7 +12933,7 @@ function getVNodeBlockHelper(ssr, isComponent) {
|
|
|
12933
12933
|
}
|
|
12934
12934
|
const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
|
|
12935
12935
|
function getUnnormalizedProps(props, callPath = []) {
|
|
12936
|
-
if (props && !isString(props) && props.type === 14) {
|
|
12936
|
+
if (props && !isString(props) && props.type === "14") {
|
|
12937
12937
|
const callee = props.callee;
|
|
12938
12938
|
if (!isString(callee) && propsHelperSet.has(callee)) {
|
|
12939
12939
|
return getUnnormalizedProps(
|
|
@@ -12946,10 +12946,10 @@ function getUnnormalizedProps(props, callPath = []) {
|
|
|
12946
12946
|
}
|
|
12947
12947
|
function injectProp(node, prop, context) {
|
|
12948
12948
|
let propsWithInjection;
|
|
12949
|
-
let props = node.type === 13 ? node.props : node.arguments[2];
|
|
12949
|
+
let props = node.type === "13" ? node.props : node.arguments[2];
|
|
12950
12950
|
let callPath = [];
|
|
12951
12951
|
let parentCall;
|
|
12952
|
-
if (props && !isString(props) && props.type === 14) {
|
|
12952
|
+
if (props && !isString(props) && props.type === "14") {
|
|
12953
12953
|
const ret = getUnnormalizedProps(props);
|
|
12954
12954
|
props = ret[0];
|
|
12955
12955
|
callPath = ret[1];
|
|
@@ -12957,9 +12957,9 @@ function injectProp(node, prop, context) {
|
|
|
12957
12957
|
}
|
|
12958
12958
|
if (props == null || isString(props)) {
|
|
12959
12959
|
propsWithInjection = createObjectExpression([prop]);
|
|
12960
|
-
} else if (props.type === 14) {
|
|
12960
|
+
} else if (props.type === "14") {
|
|
12961
12961
|
const first = props.arguments[0];
|
|
12962
|
-
if (!isString(first) && first.type === 15) {
|
|
12962
|
+
if (!isString(first) && first.type === "15") {
|
|
12963
12963
|
if (!hasProp(prop, first)) {
|
|
12964
12964
|
first.properties.unshift(prop);
|
|
12965
12965
|
}
|
|
@@ -12974,7 +12974,7 @@ function injectProp(node, prop, context) {
|
|
|
12974
12974
|
}
|
|
12975
12975
|
}
|
|
12976
12976
|
!propsWithInjection && (propsWithInjection = props);
|
|
12977
|
-
} else if (props.type === 15) {
|
|
12977
|
+
} else if (props.type === "15") {
|
|
12978
12978
|
if (!hasProp(prop, props)) {
|
|
12979
12979
|
props.properties.unshift(prop);
|
|
12980
12980
|
}
|
|
@@ -12988,7 +12988,7 @@ function injectProp(node, prop, context) {
|
|
|
12988
12988
|
parentCall = callPath[callPath.length - 2];
|
|
12989
12989
|
}
|
|
12990
12990
|
}
|
|
12991
|
-
if (node.type === 13) {
|
|
12991
|
+
if (node.type === "13") {
|
|
12992
12992
|
if (parentCall) {
|
|
12993
12993
|
parentCall.arguments[0] = propsWithInjection;
|
|
12994
12994
|
} else {
|
|
@@ -13004,10 +13004,10 @@ function injectProp(node, prop, context) {
|
|
|
13004
13004
|
}
|
|
13005
13005
|
function hasProp(prop, props) {
|
|
13006
13006
|
let result = false;
|
|
13007
|
-
if (prop.key.type === 4) {
|
|
13007
|
+
if (prop.key.type === "4") {
|
|
13008
13008
|
const propKeyName = prop.key.content;
|
|
13009
13009
|
result = props.properties.some(
|
|
13010
|
-
(p) => p.key.type === 4 && p.key.content === propKeyName
|
|
13010
|
+
(p) => p.key.type === "4" && p.key.content === propKeyName
|
|
13011
13011
|
);
|
|
13012
13012
|
}
|
|
13013
13013
|
return result;
|
|
@@ -13022,42 +13022,42 @@ function hasScopeRef(node, ids) {
|
|
|
13022
13022
|
return false;
|
|
13023
13023
|
}
|
|
13024
13024
|
switch (node.type) {
|
|
13025
|
-
case "
|
|
13025
|
+
case "1":
|
|
13026
13026
|
for (let i = 0; i < node.props.length; i++) {
|
|
13027
13027
|
const p = node.props[i];
|
|
13028
|
-
if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) {
|
|
13028
|
+
if (p.type === "7" && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) {
|
|
13029
13029
|
return true;
|
|
13030
13030
|
}
|
|
13031
13031
|
}
|
|
13032
13032
|
return node.children.some((c) => hasScopeRef(c, ids));
|
|
13033
|
-
case 11:
|
|
13033
|
+
case "11":
|
|
13034
13034
|
if (hasScopeRef(node.source, ids)) {
|
|
13035
13035
|
return true;
|
|
13036
13036
|
}
|
|
13037
13037
|
return node.children.some((c) => hasScopeRef(c, ids));
|
|
13038
|
-
case 9:
|
|
13038
|
+
case "9":
|
|
13039
13039
|
return node.branches.some((b) => hasScopeRef(b, ids));
|
|
13040
|
-
case 10:
|
|
13040
|
+
case "10":
|
|
13041
13041
|
if (hasScopeRef(node.condition, ids)) {
|
|
13042
13042
|
return true;
|
|
13043
13043
|
}
|
|
13044
13044
|
return node.children.some((c) => hasScopeRef(c, ids));
|
|
13045
|
-
case 4:
|
|
13045
|
+
case "4":
|
|
13046
13046
|
return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content];
|
|
13047
|
-
case 8:
|
|
13047
|
+
case "8":
|
|
13048
13048
|
return node.children.some((c) => isObject(c) && hasScopeRef(c, ids));
|
|
13049
|
-
case 5:
|
|
13050
|
-
case 12:
|
|
13049
|
+
case "5":
|
|
13050
|
+
case "12":
|
|
13051
13051
|
return hasScopeRef(node.content, ids);
|
|
13052
|
-
case "
|
|
13053
|
-
case "
|
|
13052
|
+
case "2":
|
|
13053
|
+
case "3":
|
|
13054
13054
|
return false;
|
|
13055
13055
|
default:
|
|
13056
13056
|
return false;
|
|
13057
13057
|
}
|
|
13058
13058
|
}
|
|
13059
13059
|
function getMemoedVNodeCall(node) {
|
|
13060
|
-
if (node.type === 14 && node.callee === WITH_MEMO) {
|
|
13060
|
+
if (node.type === "14" && node.callee === WITH_MEMO) {
|
|
13061
13061
|
return node.arguments[1].returns;
|
|
13062
13062
|
} else {
|
|
13063
13063
|
return node;
|
|
@@ -13154,8 +13154,8 @@ const decodeMap = {
|
|
|
13154
13154
|
};
|
|
13155
13155
|
const defaultParserOptions = {
|
|
13156
13156
|
delimiters: [`{{`, `}}`],
|
|
13157
|
-
getNamespace: () => 0,
|
|
13158
|
-
getTextMode: () => 0,
|
|
13157
|
+
getNamespace: () => "0",
|
|
13158
|
+
getTextMode: () => "0",
|
|
13159
13159
|
isVoidTag: NO,
|
|
13160
13160
|
isPreTag: NO,
|
|
13161
13161
|
isCustomElement: NO,
|
|
@@ -13168,7 +13168,7 @@ function baseParse(content, options = {}) {
|
|
|
13168
13168
|
const context = createParserContext(content, options);
|
|
13169
13169
|
const start = getCursor(context);
|
|
13170
13170
|
return createRoot(
|
|
13171
|
-
parseChildren(context, 0, []),
|
|
13171
|
+
parseChildren(context, "0", []),
|
|
13172
13172
|
getSelection(context, start)
|
|
13173
13173
|
);
|
|
13174
13174
|
}
|
|
@@ -13192,48 +13192,48 @@ function createParserContext(content, rawOptions) {
|
|
|
13192
13192
|
}
|
|
13193
13193
|
function parseChildren(context, mode, ancestors) {
|
|
13194
13194
|
const parent = last(ancestors);
|
|
13195
|
-
const ns = parent ? parent.ns : 0;
|
|
13195
|
+
const ns = parent ? parent.ns : "0";
|
|
13196
13196
|
const nodes = [];
|
|
13197
13197
|
while (!isEnd(context, mode, ancestors)) {
|
|
13198
13198
|
const s = context.source;
|
|
13199
13199
|
let node = void 0;
|
|
13200
|
-
if (mode === 0 || mode === 1) {
|
|
13200
|
+
if (mode === "0" || mode === "1") {
|
|
13201
13201
|
if (!context.inVPre && startsWith(s, context.options.delimiters[0])) {
|
|
13202
13202
|
node = parseInterpolation(context, mode);
|
|
13203
|
-
} else if (mode === 0 && s[0] === "<") {
|
|
13203
|
+
} else if (mode === "0" && s[0] === "<") {
|
|
13204
13204
|
if (s.length === 1) {
|
|
13205
|
-
emitError(context, 5, 1);
|
|
13205
|
+
emitError(context, "5", 1);
|
|
13206
13206
|
} else if (s[1] === "!") {
|
|
13207
13207
|
if (startsWith(s, "<!--")) {
|
|
13208
13208
|
node = parseComment(context);
|
|
13209
13209
|
} else if (startsWith(s, "<!DOCTYPE")) {
|
|
13210
13210
|
node = parseBogusComment(context);
|
|
13211
13211
|
} else if (startsWith(s, "<![CDATA[")) {
|
|
13212
|
-
if (ns !== 0) {
|
|
13212
|
+
if (ns !== "0") {
|
|
13213
13213
|
node = parseCDATA(context, ancestors);
|
|
13214
13214
|
} else {
|
|
13215
|
-
emitError(context, 1);
|
|
13215
|
+
emitError(context, "1");
|
|
13216
13216
|
node = parseBogusComment(context);
|
|
13217
13217
|
}
|
|
13218
13218
|
} else {
|
|
13219
|
-
emitError(context, 11);
|
|
13219
|
+
emitError(context, "11");
|
|
13220
13220
|
node = parseBogusComment(context);
|
|
13221
13221
|
}
|
|
13222
13222
|
} else if (s[1] === "/") {
|
|
13223
13223
|
if (s.length === 2) {
|
|
13224
|
-
emitError(context, 5, 2);
|
|
13224
|
+
emitError(context, "5", 2);
|
|
13225
13225
|
} else if (s[2] === ">") {
|
|
13226
|
-
emitError(context, 14, 2);
|
|
13226
|
+
emitError(context, "14", 2);
|
|
13227
13227
|
advanceBy(context, 3);
|
|
13228
13228
|
continue;
|
|
13229
13229
|
} else if (/[a-z]/i.test(s[2])) {
|
|
13230
|
-
emitError(context, 23);
|
|
13230
|
+
emitError(context, "23");
|
|
13231
13231
|
parseTag(context, TagType.End, parent);
|
|
13232
13232
|
continue;
|
|
13233
13233
|
} else {
|
|
13234
13234
|
emitError(
|
|
13235
13235
|
context,
|
|
13236
|
-
12,
|
|
13236
|
+
"12",
|
|
13237
13237
|
2
|
|
13238
13238
|
);
|
|
13239
13239
|
node = parseBogusComment(context);
|
|
@@ -13244,7 +13244,7 @@ function parseChildren(context, mode, ancestors) {
|
|
|
13244
13244
|
"COMPILER_NATIVE_TEMPLATE",
|
|
13245
13245
|
context
|
|
13246
13246
|
) && node && node.tag === "template" && !node.props.some(
|
|
13247
|
-
(p) => p.type === 7 && isSpecialTemplateDirective(p.name)
|
|
13247
|
+
(p) => p.type === "7" && isSpecialTemplateDirective(p.name)
|
|
13248
13248
|
)) {
|
|
13249
13249
|
warnDeprecation(
|
|
13250
13250
|
"COMPILER_NATIVE_TEMPLATE",
|
|
@@ -13256,12 +13256,12 @@ function parseChildren(context, mode, ancestors) {
|
|
|
13256
13256
|
} else if (s[1] === "?") {
|
|
13257
13257
|
emitError(
|
|
13258
13258
|
context,
|
|
13259
|
-
21,
|
|
13259
|
+
"21",
|
|
13260
13260
|
1
|
|
13261
13261
|
);
|
|
13262
13262
|
node = parseBogusComment(context);
|
|
13263
13263
|
} else {
|
|
13264
|
-
emitError(context, 12, 1);
|
|
13264
|
+
emitError(context, "12", 1);
|
|
13265
13265
|
}
|
|
13266
13266
|
}
|
|
13267
13267
|
}
|
|
@@ -13277,16 +13277,16 @@ function parseChildren(context, mode, ancestors) {
|
|
|
13277
13277
|
}
|
|
13278
13278
|
}
|
|
13279
13279
|
let removedWhitespace = false;
|
|
13280
|
-
if (mode !== 2 && mode !== 1) {
|
|
13280
|
+
if (mode !== "2" && mode !== "1") {
|
|
13281
13281
|
const shouldCondense = context.options.whitespace !== "preserve";
|
|
13282
13282
|
for (let i = 0; i < nodes.length; i++) {
|
|
13283
13283
|
const node = nodes[i];
|
|
13284
|
-
if (node.type === "
|
|
13284
|
+
if (node.type === "2") {
|
|
13285
13285
|
if (!context.inPre) {
|
|
13286
13286
|
if (!/[^\t\r\n\f ]/.test(node.content)) {
|
|
13287
13287
|
const prev = nodes[i - 1];
|
|
13288
13288
|
const next = nodes[i + 1];
|
|
13289
|
-
if (!prev || !next || shouldCondense && (prev.type === "
|
|
13289
|
+
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))) {
|
|
13290
13290
|
removedWhitespace = true;
|
|
13291
13291
|
nodes[i] = null;
|
|
13292
13292
|
} else {
|
|
@@ -13298,14 +13298,14 @@ function parseChildren(context, mode, ancestors) {
|
|
|
13298
13298
|
} else {
|
|
13299
13299
|
node.content = node.content.replace(/\r\n/g, "\n");
|
|
13300
13300
|
}
|
|
13301
|
-
} else if (node.type === "
|
|
13301
|
+
} else if (node.type === "3" && !context.options.comments) {
|
|
13302
13302
|
removedWhitespace = true;
|
|
13303
13303
|
nodes[i] = null;
|
|
13304
13304
|
}
|
|
13305
13305
|
}
|
|
13306
13306
|
if (context.inPre && parent && context.options.isPreTag(parent.tag)) {
|
|
13307
13307
|
const first = nodes[0];
|
|
13308
|
-
if (first && first.type === "
|
|
13308
|
+
if (first && first.type === "2") {
|
|
13309
13309
|
first.content = first.content.replace(/^\r?\n/, "");
|
|
13310
13310
|
}
|
|
13311
13311
|
}
|
|
@@ -13313,9 +13313,9 @@ function parseChildren(context, mode, ancestors) {
|
|
|
13313
13313
|
return removedWhitespace ? nodes.filter(Boolean) : nodes;
|
|
13314
13314
|
}
|
|
13315
13315
|
function pushNode(nodes, node) {
|
|
13316
|
-
if (node.type === "
|
|
13316
|
+
if (node.type === "2") {
|
|
13317
13317
|
const prev = last(nodes);
|
|
13318
|
-
if (prev && prev.type === "
|
|
13318
|
+
if (prev && prev.type === "2" && prev.loc.end.offset === node.loc.start.offset) {
|
|
13319
13319
|
prev.content += node.content;
|
|
13320
13320
|
prev.loc.end = node.loc.end;
|
|
13321
13321
|
prev.loc.source += node.loc.source;
|
|
@@ -13326,9 +13326,9 @@ function pushNode(nodes, node) {
|
|
|
13326
13326
|
}
|
|
13327
13327
|
function parseCDATA(context, ancestors) {
|
|
13328
13328
|
advanceBy(context, 9);
|
|
13329
|
-
const nodes = parseChildren(context, 3, ancestors);
|
|
13329
|
+
const nodes = parseChildren(context, "3", ancestors);
|
|
13330
13330
|
if (context.source.length === 0) {
|
|
13331
|
-
emitError(context, 6);
|
|
13331
|
+
emitError(context, "6");
|
|
13332
13332
|
} else {
|
|
13333
13333
|
advanceBy(context, 3);
|
|
13334
13334
|
}
|
|
@@ -13341,13 +13341,13 @@ function parseComment(context) {
|
|
|
13341
13341
|
if (!match) {
|
|
13342
13342
|
content = context.source.slice(4);
|
|
13343
13343
|
advanceBy(context, context.source.length);
|
|
13344
|
-
emitError(context, 7);
|
|
13344
|
+
emitError(context, "7");
|
|
13345
13345
|
} else {
|
|
13346
13346
|
if (match.index <= 3) {
|
|
13347
|
-
emitError(context, 0);
|
|
13347
|
+
emitError(context, "0");
|
|
13348
13348
|
}
|
|
13349
13349
|
if (match[1]) {
|
|
13350
|
-
emitError(context, 10);
|
|
13350
|
+
emitError(context, "10");
|
|
13351
13351
|
}
|
|
13352
13352
|
content = context.source.slice(4, match.index);
|
|
13353
13353
|
const s = context.source.slice(0, match.index);
|
|
@@ -13355,14 +13355,14 @@ function parseComment(context) {
|
|
|
13355
13355
|
while ((nestedIndex = s.indexOf("<!--", prevIndex)) !== -1) {
|
|
13356
13356
|
advanceBy(context, nestedIndex - prevIndex + 1);
|
|
13357
13357
|
if (nestedIndex + 4 < s.length) {
|
|
13358
|
-
emitError(context, 16);
|
|
13358
|
+
emitError(context, "16");
|
|
13359
13359
|
}
|
|
13360
13360
|
prevIndex = nestedIndex + 1;
|
|
13361
13361
|
}
|
|
13362
13362
|
advanceBy(context, match.index + match[0].length - prevIndex + 1);
|
|
13363
13363
|
}
|
|
13364
13364
|
return {
|
|
13365
|
-
type: "
|
|
13365
|
+
type: "3",
|
|
13366
13366
|
content,
|
|
13367
13367
|
loc: getSelection(context, start)
|
|
13368
13368
|
};
|
|
@@ -13380,7 +13380,7 @@ function parseBogusComment(context) {
|
|
|
13380
13380
|
advanceBy(context, closeIndex + 1);
|
|
13381
13381
|
}
|
|
13382
13382
|
return {
|
|
13383
|
-
type: "
|
|
13383
|
+
type: "3",
|
|
13384
13384
|
content,
|
|
13385
13385
|
loc: getSelection(context, start)
|
|
13386
13386
|
};
|
|
@@ -13407,7 +13407,7 @@ function parseElement(context, ancestors) {
|
|
|
13407
13407
|
ancestors.pop();
|
|
13408
13408
|
{
|
|
13409
13409
|
const inlineTemplateProp = element.props.find(
|
|
13410
|
-
(p) => p.type === 6 && p.name === "inline-template"
|
|
13410
|
+
(p) => p.type === "6" && p.name === "inline-template"
|
|
13411
13411
|
);
|
|
13412
13412
|
if (inlineTemplateProp && checkCompatEnabled(
|
|
13413
13413
|
"COMPILER_INLINE_TEMPLATE",
|
|
@@ -13416,7 +13416,7 @@ function parseElement(context, ancestors) {
|
|
|
13416
13416
|
)) {
|
|
13417
13417
|
const loc = getSelection(context, element.loc.end);
|
|
13418
13418
|
inlineTemplateProp.value = {
|
|
13419
|
-
type: "
|
|
13419
|
+
type: "2",
|
|
13420
13420
|
content: loc.source,
|
|
13421
13421
|
loc
|
|
13422
13422
|
};
|
|
@@ -13426,11 +13426,11 @@ function parseElement(context, ancestors) {
|
|
|
13426
13426
|
if (startsWithEndTagOpen(context.source, element.tag)) {
|
|
13427
13427
|
parseTag(context, TagType.End, parent);
|
|
13428
13428
|
} else {
|
|
13429
|
-
emitError(context, 24, 0, element.loc.start);
|
|
13429
|
+
emitError(context, "24", 0, element.loc.start);
|
|
13430
13430
|
if (context.source.length === 0 && element.tag.toLowerCase() === "script") {
|
|
13431
13431
|
const first = children[0];
|
|
13432
13432
|
if (first && startsWith(first.loc.source, "<!--")) {
|
|
13433
|
-
emitError(context, 8);
|
|
13433
|
+
emitError(context, "8");
|
|
13434
13434
|
}
|
|
13435
13435
|
}
|
|
13436
13436
|
}
|
|
@@ -13464,7 +13464,7 @@ function parseTag(context, type, parent) {
|
|
|
13464
13464
|
context.inPre = true;
|
|
13465
13465
|
}
|
|
13466
13466
|
let props = parseAttributes(context, type);
|
|
13467
|
-
if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type === 7 && p.name === "pre")) {
|
|
13467
|
+
if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type === "7" && p.name === "pre")) {
|
|
13468
13468
|
context.inVPre = true;
|
|
13469
13469
|
extend(context, cursor);
|
|
13470
13470
|
context.source = currentSource;
|
|
@@ -13472,11 +13472,11 @@ function parseTag(context, type, parent) {
|
|
|
13472
13472
|
}
|
|
13473
13473
|
let isSelfClosing = false;
|
|
13474
13474
|
if (context.source.length === 0) {
|
|
13475
|
-
emitError(context, 9);
|
|
13475
|
+
emitError(context, "9");
|
|
13476
13476
|
} else {
|
|
13477
13477
|
isSelfClosing = startsWith(context.source, "/>");
|
|
13478
13478
|
if (type === 1 /* End */ && isSelfClosing) {
|
|
13479
|
-
emitError(context, 4);
|
|
13479
|
+
emitError(context, "4");
|
|
13480
13480
|
}
|
|
13481
13481
|
advanceBy(context, isSelfClosing ? 2 : 1);
|
|
13482
13482
|
}
|
|
@@ -13491,7 +13491,7 @@ function parseTag(context, type, parent) {
|
|
|
13491
13491
|
let hasFor = false;
|
|
13492
13492
|
for (let i = 0; i < props.length; i++) {
|
|
13493
13493
|
const p = props[i];
|
|
13494
|
-
if (p.type === 7) {
|
|
13494
|
+
if (p.type === "7") {
|
|
13495
13495
|
if (p.name === "if") {
|
|
13496
13496
|
hasIf = true;
|
|
13497
13497
|
} else if (p.name === "for") {
|
|
@@ -13508,22 +13508,22 @@ function parseTag(context, type, parent) {
|
|
|
13508
13508
|
}
|
|
13509
13509
|
}
|
|
13510
13510
|
}
|
|
13511
|
-
let tagType = 0;
|
|
13511
|
+
let tagType = "0";
|
|
13512
13512
|
if (!context.inVPre) {
|
|
13513
13513
|
if (tag === "slot") {
|
|
13514
|
-
tagType = 2;
|
|
13514
|
+
tagType = "2";
|
|
13515
13515
|
} else if (tag === "template") {
|
|
13516
13516
|
if (props.some(
|
|
13517
|
-
(p) => p.type === 7 && isSpecialTemplateDirective(p.name)
|
|
13517
|
+
(p) => p.type === "7" && isSpecialTemplateDirective(p.name)
|
|
13518
13518
|
)) {
|
|
13519
|
-
tagType = 3;
|
|
13519
|
+
tagType = "3";
|
|
13520
13520
|
}
|
|
13521
13521
|
} else if (isComponent(tag, props, context)) {
|
|
13522
|
-
tagType = 1;
|
|
13522
|
+
tagType = "1";
|
|
13523
13523
|
}
|
|
13524
13524
|
}
|
|
13525
13525
|
return {
|
|
13526
|
-
type: "
|
|
13526
|
+
type: "1",
|
|
13527
13527
|
ns,
|
|
13528
13528
|
tag,
|
|
13529
13529
|
tagType,
|
|
@@ -13545,7 +13545,7 @@ function isComponent(tag, props, context) {
|
|
|
13545
13545
|
}
|
|
13546
13546
|
for (let i = 0; i < props.length; i++) {
|
|
13547
13547
|
const p = props[i];
|
|
13548
|
-
if (p.type === 6) {
|
|
13548
|
+
if (p.type === "6") {
|
|
13549
13549
|
if (p.name === "is" && p.value) {
|
|
13550
13550
|
if (p.value.content.startsWith("vue:")) {
|
|
13551
13551
|
return true;
|
|
@@ -13578,23 +13578,23 @@ function parseAttributes(context, type) {
|
|
|
13578
13578
|
const attributeNames = /* @__PURE__ */ new Set();
|
|
13579
13579
|
while (context.source.length > 0 && !startsWith(context.source, ">") && !startsWith(context.source, "/>")) {
|
|
13580
13580
|
if (startsWith(context.source, "/")) {
|
|
13581
|
-
emitError(context, 22);
|
|
13581
|
+
emitError(context, "22");
|
|
13582
13582
|
advanceBy(context, 1);
|
|
13583
13583
|
advanceSpaces(context);
|
|
13584
13584
|
continue;
|
|
13585
13585
|
}
|
|
13586
13586
|
if (type === 1 /* End */) {
|
|
13587
|
-
emitError(context, 3);
|
|
13587
|
+
emitError(context, "3");
|
|
13588
13588
|
}
|
|
13589
13589
|
const attr = parseAttribute(context, attributeNames);
|
|
13590
|
-
if (attr.type === 6 && attr.value && attr.name === "class") {
|
|
13590
|
+
if (attr.type === "6" && attr.value && attr.name === "class") {
|
|
13591
13591
|
attr.value.content = attr.value.content.replace(/\s+/g, " ").trim();
|
|
13592
13592
|
}
|
|
13593
13593
|
if (type === 0 /* Start */) {
|
|
13594
13594
|
props.push(attr);
|
|
13595
13595
|
}
|
|
13596
13596
|
if (/^[^\t\r\n\f />]/.test(context.source)) {
|
|
13597
|
-
emitError(context, 15);
|
|
13597
|
+
emitError(context, "15");
|
|
13598
13598
|
}
|
|
13599
13599
|
advanceSpaces(context);
|
|
13600
13600
|
}
|
|
@@ -13605,11 +13605,11 @@ function parseAttribute(context, nameSet) {
|
|
|
13605
13605
|
const match = /^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(context.source);
|
|
13606
13606
|
const name = match[0];
|
|
13607
13607
|
if (nameSet.has(name)) {
|
|
13608
|
-
emitError(context, 2);
|
|
13608
|
+
emitError(context, "2");
|
|
13609
13609
|
}
|
|
13610
13610
|
nameSet.add(name);
|
|
13611
13611
|
if (name[0] === "=") {
|
|
13612
|
-
emitError(context, 19);
|
|
13612
|
+
emitError(context, "19");
|
|
13613
13613
|
}
|
|
13614
13614
|
{
|
|
13615
13615
|
const pattern = /["'<]/g;
|
|
@@ -13617,7 +13617,7 @@ function parseAttribute(context, nameSet) {
|
|
|
13617
13617
|
while (m = pattern.exec(name)) {
|
|
13618
13618
|
emitError(
|
|
13619
13619
|
context,
|
|
13620
|
-
17,
|
|
13620
|
+
"17",
|
|
13621
13621
|
m.index
|
|
13622
13622
|
);
|
|
13623
13623
|
}
|
|
@@ -13630,7 +13630,7 @@ function parseAttribute(context, nameSet) {
|
|
|
13630
13630
|
advanceSpaces(context);
|
|
13631
13631
|
value = parseAttributeValue(context);
|
|
13632
13632
|
if (!value) {
|
|
13633
|
-
emitError(context, 13);
|
|
13633
|
+
emitError(context, "13");
|
|
13634
13634
|
}
|
|
13635
13635
|
}
|
|
13636
13636
|
const loc = getSelection(context, start);
|
|
@@ -13660,7 +13660,7 @@ function parseAttribute(context, nameSet) {
|
|
|
13660
13660
|
if (!content.endsWith("]")) {
|
|
13661
13661
|
emitError(
|
|
13662
13662
|
context,
|
|
13663
|
-
27
|
|
13663
|
+
"27"
|
|
13664
13664
|
);
|
|
13665
13665
|
content = content.slice(1);
|
|
13666
13666
|
} else {
|
|
@@ -13670,10 +13670,10 @@ function parseAttribute(context, nameSet) {
|
|
|
13670
13670
|
content += match2[3] || "";
|
|
13671
13671
|
}
|
|
13672
13672
|
arg = {
|
|
13673
|
-
type: 4,
|
|
13673
|
+
type: "4",
|
|
13674
13674
|
content,
|
|
13675
13675
|
isStatic,
|
|
13676
|
-
constType: isStatic ? 3 : 0,
|
|
13676
|
+
constType: isStatic ? "3" : 0,
|
|
13677
13677
|
loc: loc2
|
|
13678
13678
|
};
|
|
13679
13679
|
}
|
|
@@ -13706,10 +13706,10 @@ function parseAttribute(context, nameSet) {
|
|
|
13706
13706
|
}
|
|
13707
13707
|
}
|
|
13708
13708
|
return {
|
|
13709
|
-
type: 7,
|
|
13709
|
+
type: "7",
|
|
13710
13710
|
name: dirName,
|
|
13711
13711
|
exp: value && {
|
|
13712
|
-
type: 4,
|
|
13712
|
+
type: "4",
|
|
13713
13713
|
content: value.content,
|
|
13714
13714
|
isStatic: false,
|
|
13715
13715
|
// Treat as non-constant by default. This can be potentially set to
|
|
@@ -13723,13 +13723,13 @@ function parseAttribute(context, nameSet) {
|
|
|
13723
13723
|
};
|
|
13724
13724
|
}
|
|
13725
13725
|
if (!context.inVPre && startsWith(name, "v-")) {
|
|
13726
|
-
emitError(context, 26);
|
|
13726
|
+
emitError(context, "26");
|
|
13727
13727
|
}
|
|
13728
13728
|
return {
|
|
13729
|
-
type: 6,
|
|
13729
|
+
type: "6",
|
|
13730
13730
|
name,
|
|
13731
13731
|
value: value && {
|
|
13732
|
-
type: "
|
|
13732
|
+
type: "2",
|
|
13733
13733
|
content: value.content,
|
|
13734
13734
|
loc: value.loc
|
|
13735
13735
|
},
|
|
@@ -13748,10 +13748,10 @@ function parseAttributeValue(context) {
|
|
|
13748
13748
|
content = parseTextData(
|
|
13749
13749
|
context,
|
|
13750
13750
|
context.source.length,
|
|
13751
|
-
4
|
|
13751
|
+
"4"
|
|
13752
13752
|
);
|
|
13753
13753
|
} else {
|
|
13754
|
-
content = parseTextData(context, endIndex, 4);
|
|
13754
|
+
content = parseTextData(context, endIndex, "4");
|
|
13755
13755
|
advanceBy(context, 1);
|
|
13756
13756
|
}
|
|
13757
13757
|
} else {
|
|
@@ -13764,11 +13764,11 @@ function parseAttributeValue(context) {
|
|
|
13764
13764
|
while (m = unexpectedChars.exec(match[0])) {
|
|
13765
13765
|
emitError(
|
|
13766
13766
|
context,
|
|
13767
|
-
18,
|
|
13767
|
+
"18",
|
|
13768
13768
|
m.index
|
|
13769
13769
|
);
|
|
13770
13770
|
}
|
|
13771
|
-
content = parseTextData(context, match[0].length, 4);
|
|
13771
|
+
content = parseTextData(context, match[0].length, "4");
|
|
13772
13772
|
}
|
|
13773
13773
|
return { content, isQuoted, loc: getSelection(context, start) };
|
|
13774
13774
|
}
|
|
@@ -13776,7 +13776,7 @@ function parseInterpolation(context, mode) {
|
|
|
13776
13776
|
const [open, close] = context.options.delimiters;
|
|
13777
13777
|
const closeIndex = context.source.indexOf(close, open.length);
|
|
13778
13778
|
if (closeIndex === -1) {
|
|
13779
|
-
emitError(context, 25);
|
|
13779
|
+
emitError(context, "25");
|
|
13780
13780
|
return void 0;
|
|
13781
13781
|
}
|
|
13782
13782
|
const start = getCursor(context);
|
|
@@ -13795,9 +13795,9 @@ function parseInterpolation(context, mode) {
|
|
|
13795
13795
|
advancePositionWithMutation(innerEnd, rawContent, endOffset);
|
|
13796
13796
|
advanceBy(context, close.length);
|
|
13797
13797
|
return {
|
|
13798
|
-
type: 5,
|
|
13798
|
+
type: "5",
|
|
13799
13799
|
content: {
|
|
13800
|
-
type: 4,
|
|
13800
|
+
type: "4",
|
|
13801
13801
|
isStatic: false,
|
|
13802
13802
|
// Set `isConstant` to false by default and will decide in transformExpression
|
|
13803
13803
|
constType: 0,
|
|
@@ -13808,7 +13808,7 @@ function parseInterpolation(context, mode) {
|
|
|
13808
13808
|
};
|
|
13809
13809
|
}
|
|
13810
13810
|
function parseText(context, mode) {
|
|
13811
|
-
const endTokens = mode === 3 ? ["]]>"] : ["<", context.options.delimiters[0]];
|
|
13811
|
+
const endTokens = mode === "3" ? ["]]>"] : ["<", context.options.delimiters[0]];
|
|
13812
13812
|
let endIndex = context.source.length;
|
|
13813
13813
|
for (let i = 0; i < endTokens.length; i++) {
|
|
13814
13814
|
const index = context.source.indexOf(endTokens[i], 1);
|
|
@@ -13819,7 +13819,7 @@ function parseText(context, mode) {
|
|
|
13819
13819
|
const start = getCursor(context);
|
|
13820
13820
|
const content = parseTextData(context, endIndex, mode);
|
|
13821
13821
|
return {
|
|
13822
|
-
type: "
|
|
13822
|
+
type: "2",
|
|
13823
13823
|
content,
|
|
13824
13824
|
loc: getSelection(context, start)
|
|
13825
13825
|
};
|
|
@@ -13827,12 +13827,12 @@ function parseText(context, mode) {
|
|
|
13827
13827
|
function parseTextData(context, length, mode) {
|
|
13828
13828
|
const rawText = context.source.slice(0, length);
|
|
13829
13829
|
advanceBy(context, length);
|
|
13830
|
-
if (mode === 2 || mode === 3 || !rawText.includes("&")) {
|
|
13830
|
+
if (mode === "2" || mode === "3" || !rawText.includes("&")) {
|
|
13831
13831
|
return rawText;
|
|
13832
13832
|
} else {
|
|
13833
13833
|
return context.options.decodeEntities(
|
|
13834
13834
|
rawText,
|
|
13835
|
-
mode === 4
|
|
13835
|
+
mode === "4"
|
|
13836
13836
|
);
|
|
13837
13837
|
}
|
|
13838
13838
|
}
|
|
@@ -13888,7 +13888,7 @@ function emitError(context, code, offset, loc = getCursor(context)) {
|
|
|
13888
13888
|
function isEnd(context, mode, ancestors) {
|
|
13889
13889
|
const s = context.source;
|
|
13890
13890
|
switch (mode) {
|
|
13891
|
-
case 0:
|
|
13891
|
+
case "0":
|
|
13892
13892
|
if (startsWith(s, "</")) {
|
|
13893
13893
|
for (let i = ancestors.length - 1; i >= 0; --i) {
|
|
13894
13894
|
if (startsWithEndTagOpen(s, ancestors[i].tag)) {
|
|
@@ -13897,15 +13897,15 @@ function isEnd(context, mode, ancestors) {
|
|
|
13897
13897
|
}
|
|
13898
13898
|
}
|
|
13899
13899
|
break;
|
|
13900
|
-
case 1:
|
|
13901
|
-
case 2: {
|
|
13900
|
+
case "1":
|
|
13901
|
+
case "2": {
|
|
13902
13902
|
const parent = last(ancestors);
|
|
13903
13903
|
if (parent && startsWithEndTagOpen(s, parent.tag)) {
|
|
13904
13904
|
return true;
|
|
13905
13905
|
}
|
|
13906
13906
|
break;
|
|
13907
13907
|
}
|
|
13908
|
-
case 3:
|
|
13908
|
+
case "3":
|
|
13909
13909
|
if (startsWith(s, "]]>")) {
|
|
13910
13910
|
return true;
|
|
13911
13911
|
}
|
|
@@ -13928,7 +13928,7 @@ function hoistStatic(root, context) {
|
|
|
13928
13928
|
}
|
|
13929
13929
|
function isSingleElementRoot(root, child) {
|
|
13930
13930
|
const { children } = root;
|
|
13931
|
-
return children.length === 1 && child.type === "
|
|
13931
|
+
return children.length === 1 && child.type === "1" && !isSlotOutlet(child);
|
|
13932
13932
|
}
|
|
13933
13933
|
function walk(node, context, doNotHoistNode = false) {
|
|
13934
13934
|
const { children } = node;
|
|
@@ -13936,10 +13936,10 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
13936
13936
|
let hoistedCount = 0;
|
|
13937
13937
|
for (let i = 0; i < children.length; i++) {
|
|
13938
13938
|
const child = children[i];
|
|
13939
|
-
if (child.type === "
|
|
13939
|
+
if (child.type === "1" && child.tagType === "0") {
|
|
13940
13940
|
const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
|
|
13941
13941
|
if (constantType > 0) {
|
|
13942
|
-
if (constantType >= 2) {
|
|
13942
|
+
if (constantType >= "2") {
|
|
13943
13943
|
child.codegenNode.patchFlag = -1 + (` /* HOISTED */` );
|
|
13944
13944
|
child.codegenNode = context.hoist(child.codegenNode);
|
|
13945
13945
|
hoistedCount++;
|
|
@@ -13947,9 +13947,9 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
13947
13947
|
}
|
|
13948
13948
|
} else {
|
|
13949
13949
|
const codegenNode = child.codegenNode;
|
|
13950
|
-
if (codegenNode.type === 13) {
|
|
13950
|
+
if (codegenNode.type === "13") {
|
|
13951
13951
|
const flag = getPatchFlag(codegenNode);
|
|
13952
|
-
if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {
|
|
13952
|
+
if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= "2") {
|
|
13953
13953
|
const props = getNodeProps(child);
|
|
13954
13954
|
if (props) {
|
|
13955
13955
|
codegenNode.props = context.hoist(props);
|
|
@@ -13961,8 +13961,8 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
13961
13961
|
}
|
|
13962
13962
|
}
|
|
13963
13963
|
}
|
|
13964
|
-
if (child.type === "
|
|
13965
|
-
const isComponent = child.tagType === 1;
|
|
13964
|
+
if (child.type === "1") {
|
|
13965
|
+
const isComponent = child.tagType === "1";
|
|
13966
13966
|
if (isComponent) {
|
|
13967
13967
|
context.scopes.vSlot++;
|
|
13968
13968
|
}
|
|
@@ -13970,9 +13970,9 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
13970
13970
|
if (isComponent) {
|
|
13971
13971
|
context.scopes.vSlot--;
|
|
13972
13972
|
}
|
|
13973
|
-
} else if (child.type === 11) {
|
|
13973
|
+
} else if (child.type === "11") {
|
|
13974
13974
|
walk(child, context, child.children.length === 1);
|
|
13975
|
-
} else if (child.type === 9) {
|
|
13975
|
+
} else if (child.type === "9") {
|
|
13976
13976
|
for (let i2 = 0; i2 < child.branches.length; i2++) {
|
|
13977
13977
|
walk(
|
|
13978
13978
|
child.branches[i2],
|
|
@@ -13985,7 +13985,7 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
13985
13985
|
if (hoistedCount && context.transformHoist) {
|
|
13986
13986
|
context.transformHoist(children, context, node);
|
|
13987
13987
|
}
|
|
13988
|
-
if (hoistedCount && hoistedCount === originalCount && node.type === "
|
|
13988
|
+
if (hoistedCount && hoistedCount === originalCount && node.type === "1" && node.tagType === "0" && node.codegenNode && node.codegenNode.type === "13" && isArray(node.codegenNode.children)) {
|
|
13989
13989
|
node.codegenNode.children = context.hoist(
|
|
13990
13990
|
createArrayExpression(node.codegenNode.children)
|
|
13991
13991
|
);
|
|
@@ -13994,8 +13994,8 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
13994
13994
|
function getConstantType(node, context) {
|
|
13995
13995
|
const { constantCache } = context;
|
|
13996
13996
|
switch (node.type) {
|
|
13997
|
-
case "
|
|
13998
|
-
if (node.tagType !== 0) {
|
|
13997
|
+
case "1":
|
|
13998
|
+
if (node.tagType !== "0") {
|
|
13999
13999
|
return 0;
|
|
14000
14000
|
}
|
|
14001
14001
|
const cached = constantCache.get(node);
|
|
@@ -14003,7 +14003,7 @@ function getConstantType(node, context) {
|
|
|
14003
14003
|
return cached;
|
|
14004
14004
|
}
|
|
14005
14005
|
const codegenNode = node.codegenNode;
|
|
14006
|
-
if (codegenNode.type !== 13) {
|
|
14006
|
+
if (codegenNode.type !== "13") {
|
|
14007
14007
|
return 0;
|
|
14008
14008
|
}
|
|
14009
14009
|
if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject") {
|
|
@@ -14011,7 +14011,7 @@ function getConstantType(node, context) {
|
|
|
14011
14011
|
}
|
|
14012
14012
|
const flag = getPatchFlag(codegenNode);
|
|
14013
14013
|
if (!flag) {
|
|
14014
|
-
let returnType2 = 3;
|
|
14014
|
+
let returnType2 = "3";
|
|
14015
14015
|
const generatedPropsType = getGeneratedPropsConstantType(node, context);
|
|
14016
14016
|
if (generatedPropsType === 0) {
|
|
14017
14017
|
constantCache.set(node, 0);
|
|
@@ -14030,10 +14030,10 @@ function getConstantType(node, context) {
|
|
|
14030
14030
|
returnType2 = childType;
|
|
14031
14031
|
}
|
|
14032
14032
|
}
|
|
14033
|
-
if (returnType2 > 1) {
|
|
14033
|
+
if (returnType2 > "1") {
|
|
14034
14034
|
for (let i = 0; i < node.props.length; i++) {
|
|
14035
14035
|
const p = node.props[i];
|
|
14036
|
-
if (p.type === 7 && p.name === "bind" && p.exp) {
|
|
14036
|
+
if (p.type === "7" && p.name === "bind" && p.exp) {
|
|
14037
14037
|
const expType = getConstantType(p.exp, context);
|
|
14038
14038
|
if (expType === 0) {
|
|
14039
14039
|
constantCache.set(node, 0);
|
|
@@ -14048,7 +14048,7 @@ function getConstantType(node, context) {
|
|
|
14048
14048
|
if (codegenNode.isBlock) {
|
|
14049
14049
|
for (let i = 0; i < node.props.length; i++) {
|
|
14050
14050
|
const p = node.props[i];
|
|
14051
|
-
if (p.type === 7) {
|
|
14051
|
+
if (p.type === "7") {
|
|
14052
14052
|
constantCache.set(node, 0);
|
|
14053
14053
|
return 0;
|
|
14054
14054
|
}
|
|
@@ -14066,20 +14066,20 @@ function getConstantType(node, context) {
|
|
|
14066
14066
|
constantCache.set(node, 0);
|
|
14067
14067
|
return 0;
|
|
14068
14068
|
}
|
|
14069
|
-
case "
|
|
14070
|
-
case "
|
|
14071
|
-
return 3;
|
|
14072
|
-
case 9:
|
|
14073
|
-
case 11:
|
|
14074
|
-
case 10:
|
|
14069
|
+
case "2":
|
|
14070
|
+
case "3":
|
|
14071
|
+
return "3";
|
|
14072
|
+
case "9":
|
|
14073
|
+
case "11":
|
|
14074
|
+
case "10":
|
|
14075
14075
|
return 0;
|
|
14076
|
-
case 5:
|
|
14077
|
-
case 12:
|
|
14076
|
+
case "5":
|
|
14077
|
+
case "12":
|
|
14078
14078
|
return getConstantType(node.content, context);
|
|
14079
|
-
case 4:
|
|
14079
|
+
case "4":
|
|
14080
14080
|
return node.constType;
|
|
14081
|
-
case 8:
|
|
14082
|
-
let returnType = 3;
|
|
14081
|
+
case "8":
|
|
14082
|
+
let returnType = "3";
|
|
14083
14083
|
for (let i = 0; i < node.children.length; i++) {
|
|
14084
14084
|
const child = node.children[i];
|
|
14085
14085
|
if (isString(child) || isSymbol(child)) {
|
|
@@ -14104,20 +14104,20 @@ const allowHoistedHelperSet = /* @__PURE__ */ new Set([
|
|
|
14104
14104
|
GUARD_REACTIVE_PROPS
|
|
14105
14105
|
]);
|
|
14106
14106
|
function getConstantTypeOfHelperCall(value, context) {
|
|
14107
|
-
if (value.type === 14 && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {
|
|
14107
|
+
if (value.type === "14" && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {
|
|
14108
14108
|
const arg = value.arguments[0];
|
|
14109
|
-
if (arg.type === 4) {
|
|
14109
|
+
if (arg.type === "4") {
|
|
14110
14110
|
return getConstantType(arg, context);
|
|
14111
|
-
} else if (arg.type === 14) {
|
|
14111
|
+
} else if (arg.type === "14") {
|
|
14112
14112
|
return getConstantTypeOfHelperCall(arg, context);
|
|
14113
14113
|
}
|
|
14114
14114
|
}
|
|
14115
14115
|
return 0;
|
|
14116
14116
|
}
|
|
14117
14117
|
function getGeneratedPropsConstantType(node, context) {
|
|
14118
|
-
let returnType = 3;
|
|
14118
|
+
let returnType = "3";
|
|
14119
14119
|
const props = getNodeProps(node);
|
|
14120
|
-
if (props && props.type === 15) {
|
|
14120
|
+
if (props && props.type === "15") {
|
|
14121
14121
|
const { properties } = props;
|
|
14122
14122
|
for (let i = 0; i < properties.length; i++) {
|
|
14123
14123
|
const { key, value } = properties[i];
|
|
@@ -14129,9 +14129,9 @@ function getGeneratedPropsConstantType(node, context) {
|
|
|
14129
14129
|
returnType = keyType;
|
|
14130
14130
|
}
|
|
14131
14131
|
let valueType;
|
|
14132
|
-
if (value.type === 4) {
|
|
14132
|
+
if (value.type === "4") {
|
|
14133
14133
|
valueType = getConstantType(value, context);
|
|
14134
|
-
} else if (value.type === 14) {
|
|
14134
|
+
} else if (value.type === "14") {
|
|
14135
14135
|
valueType = getConstantTypeOfHelperCall(value, context);
|
|
14136
14136
|
} else {
|
|
14137
14137
|
valueType = 0;
|
|
@@ -14148,7 +14148,7 @@ function getGeneratedPropsConstantType(node, context) {
|
|
|
14148
14148
|
}
|
|
14149
14149
|
function getNodeProps(node) {
|
|
14150
14150
|
const codegenNode = node.codegenNode;
|
|
14151
|
-
if (codegenNode.type === 13) {
|
|
14151
|
+
if (codegenNode.type === "13") {
|
|
14152
14152
|
return codegenNode.props;
|
|
14153
14153
|
}
|
|
14154
14154
|
}
|
|
@@ -14284,7 +14284,7 @@ function createTransformContext(root, {
|
|
|
14284
14284
|
addId(exp);
|
|
14285
14285
|
} else if (exp.identifiers) {
|
|
14286
14286
|
exp.identifiers.forEach(addId);
|
|
14287
|
-
} else if (exp.type === 4) {
|
|
14287
|
+
} else if (exp.type === "4") {
|
|
14288
14288
|
addId(exp.content);
|
|
14289
14289
|
}
|
|
14290
14290
|
}
|
|
@@ -14295,7 +14295,7 @@ function createTransformContext(root, {
|
|
|
14295
14295
|
removeId(exp);
|
|
14296
14296
|
} else if (exp.identifiers) {
|
|
14297
14297
|
exp.identifiers.forEach(removeId);
|
|
14298
|
-
} else if (exp.type === 4) {
|
|
14298
|
+
} else if (exp.type === "4") {
|
|
14299
14299
|
removeId(exp.content);
|
|
14300
14300
|
}
|
|
14301
14301
|
}
|
|
@@ -14308,7 +14308,7 @@ function createTransformContext(root, {
|
|
|
14308
14308
|
`_hoisted_${context.hoists.length}`,
|
|
14309
14309
|
false,
|
|
14310
14310
|
exp.loc,
|
|
14311
|
-
2
|
|
14311
|
+
"2"
|
|
14312
14312
|
);
|
|
14313
14313
|
identifier.hoisted = exp;
|
|
14314
14314
|
return identifier;
|
|
@@ -14359,7 +14359,7 @@ function createRootCodegen(root, context) {
|
|
|
14359
14359
|
const child = children[0];
|
|
14360
14360
|
if (isSingleElementRoot(root, child) && child.codegenNode) {
|
|
14361
14361
|
const codegenNode = child.codegenNode;
|
|
14362
|
-
if (codegenNode.type === 13) {
|
|
14362
|
+
if (codegenNode.type === "13") {
|
|
14363
14363
|
makeBlock(codegenNode, context);
|
|
14364
14364
|
}
|
|
14365
14365
|
root.codegenNode = codegenNode;
|
|
@@ -14369,7 +14369,7 @@ function createRootCodegen(root, context) {
|
|
|
14369
14369
|
} else if (children.length > 1) {
|
|
14370
14370
|
let patchFlag = 64;
|
|
14371
14371
|
let patchFlagText = PatchFlagNames[64];
|
|
14372
|
-
if (children.filter((c) => c.type !== "
|
|
14372
|
+
if (children.filter((c) => c.type !== "3").length === 1) {
|
|
14373
14373
|
patchFlag |= 2048;
|
|
14374
14374
|
patchFlagText += `, ${PatchFlagNames[2048]}`;
|
|
14375
14375
|
}
|
|
@@ -14423,25 +14423,25 @@ function traverseNode(node, context) {
|
|
|
14423
14423
|
}
|
|
14424
14424
|
}
|
|
14425
14425
|
switch (node.type) {
|
|
14426
|
-
case "
|
|
14426
|
+
case "3":
|
|
14427
14427
|
if (!context.ssr) {
|
|
14428
14428
|
context.helper(CREATE_COMMENT);
|
|
14429
14429
|
}
|
|
14430
14430
|
break;
|
|
14431
|
-
case 5:
|
|
14431
|
+
case "5":
|
|
14432
14432
|
if (!context.ssr) {
|
|
14433
14433
|
context.helper(TO_DISPLAY_STRING);
|
|
14434
14434
|
}
|
|
14435
14435
|
break;
|
|
14436
|
-
case 9:
|
|
14436
|
+
case "9":
|
|
14437
14437
|
for (let i2 = 0; i2 < node.branches.length; i2++) {
|
|
14438
14438
|
traverseNode(node.branches[i2], context);
|
|
14439
14439
|
}
|
|
14440
14440
|
break;
|
|
14441
|
-
case 10:
|
|
14442
|
-
case 11:
|
|
14443
|
-
case "
|
|
14444
|
-
case 0:
|
|
14441
|
+
case "10":
|
|
14442
|
+
case "11":
|
|
14443
|
+
case "1":
|
|
14444
|
+
case "0":
|
|
14445
14445
|
traverseChildren(node, context);
|
|
14446
14446
|
break;
|
|
14447
14447
|
}
|
|
@@ -14454,15 +14454,15 @@ function traverseNode(node, context) {
|
|
|
14454
14454
|
function createStructuralDirectiveTransform(name, fn) {
|
|
14455
14455
|
const matches = isString(name) ? (n) => n === name : (n) => name.test(n);
|
|
14456
14456
|
return (node, context) => {
|
|
14457
|
-
if (node.type === "
|
|
14457
|
+
if (node.type === "1") {
|
|
14458
14458
|
const { props } = node;
|
|
14459
|
-
if (node.tagType === 3 && props.some(isVSlot)) {
|
|
14459
|
+
if (node.tagType === "3" && props.some(isVSlot)) {
|
|
14460
14460
|
return;
|
|
14461
14461
|
}
|
|
14462
14462
|
const exitFns = [];
|
|
14463
14463
|
for (let i = 0; i < props.length; i++) {
|
|
14464
14464
|
const prop = props[i];
|
|
14465
|
-
if (prop.type === 7 && matches(prop.name)) {
|
|
14465
|
+
if (prop.type === "7" && matches(prop.name)) {
|
|
14466
14466
|
props.splice(i, 1);
|
|
14467
14467
|
i--;
|
|
14468
14468
|
const onExit = fn(node, prop, context);
|
|
@@ -14520,7 +14520,7 @@ function createCodegenContext(ast, {
|
|
|
14520
14520
|
if (context.map) {
|
|
14521
14521
|
if (node) {
|
|
14522
14522
|
let name;
|
|
14523
|
-
if (node.type === 4 && !node.isStatic) {
|
|
14523
|
+
if (node.type === "4" && !node.isStatic) {
|
|
14524
14524
|
const content = node.content.replace(/^_ctx\./, "");
|
|
14525
14525
|
if (content !== node.content && isSimpleIdentifier(content)) {
|
|
14526
14526
|
name = content;
|
|
@@ -14796,7 +14796,7 @@ function genHoists(hoists, context) {
|
|
|
14796
14796
|
for (let i = 0; i < hoists.length; i++) {
|
|
14797
14797
|
const exp = hoists[i];
|
|
14798
14798
|
if (exp) {
|
|
14799
|
-
const needScopeIdWrapper = genScopeId && exp.type === 13;
|
|
14799
|
+
const needScopeIdWrapper = genScopeId && exp.type === "13";
|
|
14800
14800
|
push(
|
|
14801
14801
|
`const _hoisted_${i + 1} = ${needScopeIdWrapper ? `${PURE_ANNOTATION} _withScopeId(() => ` : ``}`
|
|
14802
14802
|
);
|
|
@@ -14821,7 +14821,7 @@ function genImports(importsOptions, context) {
|
|
|
14821
14821
|
});
|
|
14822
14822
|
}
|
|
14823
14823
|
function isText(n) {
|
|
14824
|
-
return isString(n) || n.type === 4 || n.type === "
|
|
14824
|
+
return isString(n) || n.type === "4" || n.type === "2" || n.type === "5" || n.type === "8";
|
|
14825
14825
|
}
|
|
14826
14826
|
function genNodeListAsArray(nodes, context) {
|
|
14827
14827
|
const multilines = nodes.length > 3 || nodes.some((n) => isArray(n) || !isText(n));
|
|
@@ -14862,73 +14862,73 @@ function genNode(node, context) {
|
|
|
14862
14862
|
return;
|
|
14863
14863
|
}
|
|
14864
14864
|
switch (node.type) {
|
|
14865
|
-
case "
|
|
14866
|
-
case 9:
|
|
14867
|
-
case 11:
|
|
14865
|
+
case "1":
|
|
14866
|
+
case "9":
|
|
14867
|
+
case "11":
|
|
14868
14868
|
assert(
|
|
14869
14869
|
node.codegenNode != null,
|
|
14870
14870
|
`Codegen node is missing for element/if/for node. Apply appropriate transforms first.`
|
|
14871
14871
|
);
|
|
14872
14872
|
genNode(node.codegenNode, context);
|
|
14873
14873
|
break;
|
|
14874
|
-
case "
|
|
14874
|
+
case "2":
|
|
14875
14875
|
genText(node, context);
|
|
14876
14876
|
break;
|
|
14877
|
-
case 4:
|
|
14877
|
+
case "4":
|
|
14878
14878
|
genExpression(node, context);
|
|
14879
14879
|
break;
|
|
14880
|
-
case 5:
|
|
14880
|
+
case "5":
|
|
14881
14881
|
genInterpolation(node, context);
|
|
14882
14882
|
break;
|
|
14883
|
-
case 12:
|
|
14883
|
+
case "12":
|
|
14884
14884
|
genNode(node.codegenNode, context);
|
|
14885
14885
|
break;
|
|
14886
|
-
case 8:
|
|
14886
|
+
case "8":
|
|
14887
14887
|
genCompoundExpression(node, context);
|
|
14888
14888
|
break;
|
|
14889
|
-
case "
|
|
14889
|
+
case "3":
|
|
14890
14890
|
genComment(node, context);
|
|
14891
14891
|
break;
|
|
14892
|
-
case 13:
|
|
14892
|
+
case "13":
|
|
14893
14893
|
genVNodeCall(node, context);
|
|
14894
14894
|
break;
|
|
14895
|
-
case 14:
|
|
14895
|
+
case "14":
|
|
14896
14896
|
genCallExpression(node, context);
|
|
14897
14897
|
break;
|
|
14898
|
-
case 15:
|
|
14898
|
+
case "15":
|
|
14899
14899
|
genObjectExpression(node, context);
|
|
14900
14900
|
break;
|
|
14901
|
-
case 17:
|
|
14901
|
+
case "17":
|
|
14902
14902
|
genArrayExpression(node, context);
|
|
14903
14903
|
break;
|
|
14904
|
-
case 18:
|
|
14904
|
+
case "18":
|
|
14905
14905
|
genFunctionExpression(node, context);
|
|
14906
14906
|
break;
|
|
14907
|
-
case 19:
|
|
14907
|
+
case "19":
|
|
14908
14908
|
genConditionalExpression(node, context);
|
|
14909
14909
|
break;
|
|
14910
|
-
case 20:
|
|
14910
|
+
case "20":
|
|
14911
14911
|
genCacheExpression(node, context);
|
|
14912
14912
|
break;
|
|
14913
|
-
case 21:
|
|
14913
|
+
case "21":
|
|
14914
14914
|
genNodeList(node.body, context, true, false);
|
|
14915
14915
|
break;
|
|
14916
|
-
case 22:
|
|
14916
|
+
case "22":
|
|
14917
14917
|
genTemplateLiteral(node, context);
|
|
14918
14918
|
break;
|
|
14919
|
-
case 23:
|
|
14919
|
+
case "23":
|
|
14920
14920
|
genIfStatement(node, context);
|
|
14921
14921
|
break;
|
|
14922
|
-
case 24:
|
|
14922
|
+
case "24":
|
|
14923
14923
|
genAssignmentExpression(node, context);
|
|
14924
14924
|
break;
|
|
14925
|
-
case 25:
|
|
14925
|
+
case "25":
|
|
14926
14926
|
genSequenceExpression(node, context);
|
|
14927
14927
|
break;
|
|
14928
|
-
case 26:
|
|
14928
|
+
case "26":
|
|
14929
14929
|
genReturnStatement(node, context);
|
|
14930
14930
|
break;
|
|
14931
|
-
case 10:
|
|
14931
|
+
case "10":
|
|
14932
14932
|
break;
|
|
14933
14933
|
default:
|
|
14934
14934
|
{
|
|
@@ -14965,7 +14965,7 @@ function genCompoundExpression(node, context) {
|
|
|
14965
14965
|
}
|
|
14966
14966
|
function genExpressionAsPropertyKey(node, context) {
|
|
14967
14967
|
const { push } = context;
|
|
14968
|
-
if (node.type === 8) {
|
|
14968
|
+
if (node.type === "8") {
|
|
14969
14969
|
push(`[`);
|
|
14970
14970
|
genCompoundExpression(node, context);
|
|
14971
14971
|
push(`]`);
|
|
@@ -15046,7 +15046,7 @@ function genObjectExpression(node, context) {
|
|
|
15046
15046
|
push(`{}`, node);
|
|
15047
15047
|
return;
|
|
15048
15048
|
}
|
|
15049
|
-
const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4);
|
|
15049
|
+
const multilines = properties.length > 1 || properties.some((p) => p.value.type !== "4");
|
|
15050
15050
|
push(multilines ? `{` : `{ `);
|
|
15051
15051
|
multilines && indent();
|
|
15052
15052
|
for (let i = 0; i < properties.length; i++) {
|
|
@@ -15108,7 +15108,7 @@ function genFunctionExpression(node, context) {
|
|
|
15108
15108
|
function genConditionalExpression(node, context) {
|
|
15109
15109
|
const { test, consequent, alternate, newline: needNewline } = node;
|
|
15110
15110
|
const { push, indent, deindent, newline } = context;
|
|
15111
|
-
if (test.type === 4) {
|
|
15111
|
+
if (test.type === "4") {
|
|
15112
15112
|
const needsParens = !isSimpleIdentifier(test.content);
|
|
15113
15113
|
needsParens && push(`(`);
|
|
15114
15114
|
genExpression(test, context);
|
|
@@ -15127,7 +15127,7 @@ function genConditionalExpression(node, context) {
|
|
|
15127
15127
|
needNewline && newline();
|
|
15128
15128
|
needNewline || push(` `);
|
|
15129
15129
|
push(`: `);
|
|
15130
|
-
const isNested = alternate.type === 19;
|
|
15130
|
+
const isNested = alternate.type === "19";
|
|
15131
15131
|
if (!isNested) {
|
|
15132
15132
|
context.indentLevel++;
|
|
15133
15133
|
}
|
|
@@ -15193,7 +15193,7 @@ function genIfStatement(node, context) {
|
|
|
15193
15193
|
push(`}`);
|
|
15194
15194
|
if (alternate) {
|
|
15195
15195
|
push(` else `);
|
|
15196
|
-
if (alternate.type === 23) {
|
|
15196
|
+
if (alternate.type === "23") {
|
|
15197
15197
|
genIfStatement(alternate, context);
|
|
15198
15198
|
} else {
|
|
15199
15199
|
push(`{`);
|
|
@@ -15462,18 +15462,18 @@ function isReferenced(node, parent, grandparent) {
|
|
|
15462
15462
|
|
|
15463
15463
|
const isLiteralWhitelisted = /* @__PURE__ */ makeMap("true,false,null,this");
|
|
15464
15464
|
const transformExpression = (node, context) => {
|
|
15465
|
-
if (node.type === 5) {
|
|
15465
|
+
if (node.type === "5") {
|
|
15466
15466
|
node.content = processExpression(
|
|
15467
15467
|
node.content,
|
|
15468
15468
|
context
|
|
15469
15469
|
);
|
|
15470
|
-
} else if (node.type === "
|
|
15470
|
+
} else if (node.type === "1") {
|
|
15471
15471
|
for (let i = 0; i < node.props.length; i++) {
|
|
15472
15472
|
const dir = node.props[i];
|
|
15473
|
-
if (dir.type === 7 && dir.name !== "for") {
|
|
15473
|
+
if (dir.type === "7" && dir.name !== "for") {
|
|
15474
15474
|
const exp = dir.exp;
|
|
15475
15475
|
const arg = dir.arg;
|
|
15476
|
-
if (exp && exp.type === 4 && !(dir.name === "on" && arg)) {
|
|
15476
|
+
if (exp && exp.type === "4" && !(dir.name === "on" && arg)) {
|
|
15477
15477
|
dir.exp = processExpression(
|
|
15478
15478
|
exp,
|
|
15479
15479
|
context,
|
|
@@ -15481,7 +15481,7 @@ const transformExpression = (node, context) => {
|
|
|
15481
15481
|
dir.name === "slot"
|
|
15482
15482
|
);
|
|
15483
15483
|
}
|
|
15484
|
-
if (arg && arg.type === 4 && !arg.isStatic) {
|
|
15484
|
+
if (arg && arg.type === "4" && !arg.isStatic) {
|
|
15485
15485
|
dir.arg = processExpression(arg, context);
|
|
15486
15486
|
}
|
|
15487
15487
|
}
|
|
@@ -15557,14 +15557,14 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
15557
15557
|
const isLiteral = isLiteralWhitelisted(rawExp);
|
|
15558
15558
|
if (!asParams && !isScopeVarReference && !isAllowedGlobal && !isLiteral) {
|
|
15559
15559
|
if (bindingMetadata[node.content] === "setup-const") {
|
|
15560
|
-
node.constType = 1;
|
|
15560
|
+
node.constType = "1";
|
|
15561
15561
|
}
|
|
15562
15562
|
node.content = rewriteIdentifier(rawExp);
|
|
15563
15563
|
} else if (!isScopeVarReference) {
|
|
15564
15564
|
if (isLiteral) {
|
|
15565
|
-
node.constType = 3;
|
|
15565
|
+
node.constType = "3";
|
|
15566
15566
|
} else {
|
|
15567
|
-
node.constType = 2;
|
|
15567
|
+
node.constType = "2";
|
|
15568
15568
|
}
|
|
15569
15569
|
}
|
|
15570
15570
|
return node;
|
|
@@ -15578,7 +15578,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
15578
15578
|
} catch (e) {
|
|
15579
15579
|
context.onError(
|
|
15580
15580
|
createCompilerError(
|
|
15581
|
-
45,
|
|
15581
|
+
"45",
|
|
15582
15582
|
node.loc,
|
|
15583
15583
|
void 0,
|
|
15584
15584
|
e.message
|
|
@@ -15637,7 +15637,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
15637
15637
|
start: advancePositionWithClone(node.loc.start, source2, start),
|
|
15638
15638
|
end: advancePositionWithClone(node.loc.start, source2, end)
|
|
15639
15639
|
},
|
|
15640
|
-
id.isConstant ? 3 : 0
|
|
15640
|
+
id.isConstant ? "3" : 0
|
|
15641
15641
|
)
|
|
15642
15642
|
);
|
|
15643
15643
|
if (i === ids.length - 1 && end < rawExp.length) {
|
|
@@ -15649,7 +15649,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
15649
15649
|
ret = createCompoundExpression(children, node.loc);
|
|
15650
15650
|
} else {
|
|
15651
15651
|
ret = node;
|
|
15652
|
-
ret.constType = bailConstant ? 0 : 3;
|
|
15652
|
+
ret.constType = bailConstant ? 0 : "3";
|
|
15653
15653
|
}
|
|
15654
15654
|
ret.identifiers = Object.keys(knownIds);
|
|
15655
15655
|
return ret;
|
|
@@ -15666,7 +15666,7 @@ function canPrefix(id) {
|
|
|
15666
15666
|
function stringifyExpression(exp) {
|
|
15667
15667
|
if (isString(exp)) {
|
|
15668
15668
|
return exp;
|
|
15669
|
-
} else if (exp.type === 4) {
|
|
15669
|
+
} else if (exp.type === "4") {
|
|
15670
15670
|
return exp.content;
|
|
15671
15671
|
} else {
|
|
15672
15672
|
return exp.children.map(stringifyExpression).join("");
|
|
@@ -15682,7 +15682,7 @@ const transformIf = createStructuralDirectiveTransform(
|
|
|
15682
15682
|
let key = 0;
|
|
15683
15683
|
while (i-- >= 0) {
|
|
15684
15684
|
const sibling = siblings[i];
|
|
15685
|
-
if (sibling && sibling.type === 9) {
|
|
15685
|
+
if (sibling && sibling.type === "9") {
|
|
15686
15686
|
key += sibling.branches.length;
|
|
15687
15687
|
}
|
|
15688
15688
|
}
|
|
@@ -15709,7 +15709,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15709
15709
|
if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) {
|
|
15710
15710
|
const loc = dir.exp ? dir.exp.loc : node.loc;
|
|
15711
15711
|
context.onError(
|
|
15712
|
-
createCompilerError(28, dir.loc)
|
|
15712
|
+
createCompilerError("28", dir.loc)
|
|
15713
15713
|
);
|
|
15714
15714
|
dir.exp = createSimpleExpression(`true`, false, loc);
|
|
15715
15715
|
}
|
|
@@ -15719,7 +15719,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15719
15719
|
if (dir.name === "if") {
|
|
15720
15720
|
const branch = createIfBranch(node, dir);
|
|
15721
15721
|
const ifNode = {
|
|
15722
|
-
type: 9,
|
|
15722
|
+
type: "9",
|
|
15723
15723
|
loc: node.loc,
|
|
15724
15724
|
branches: [branch]
|
|
15725
15725
|
};
|
|
@@ -15733,25 +15733,25 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15733
15733
|
let i = siblings.indexOf(node);
|
|
15734
15734
|
while (i-- >= -1) {
|
|
15735
15735
|
const sibling = siblings[i];
|
|
15736
|
-
if (sibling && sibling.type === "
|
|
15736
|
+
if (sibling && sibling.type === "3") {
|
|
15737
15737
|
context.removeNode(sibling);
|
|
15738
15738
|
comments.unshift(sibling);
|
|
15739
15739
|
continue;
|
|
15740
15740
|
}
|
|
15741
|
-
if (sibling && sibling.type === "
|
|
15741
|
+
if (sibling && sibling.type === "2" && !sibling.content.trim().length) {
|
|
15742
15742
|
context.removeNode(sibling);
|
|
15743
15743
|
continue;
|
|
15744
15744
|
}
|
|
15745
|
-
if (sibling && sibling.type === 9) {
|
|
15745
|
+
if (sibling && sibling.type === "9") {
|
|
15746
15746
|
if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
|
|
15747
15747
|
context.onError(
|
|
15748
|
-
createCompilerError(30, node.loc)
|
|
15748
|
+
createCompilerError("30", node.loc)
|
|
15749
15749
|
);
|
|
15750
15750
|
}
|
|
15751
15751
|
context.removeNode();
|
|
15752
15752
|
const branch = createIfBranch(node, dir);
|
|
15753
15753
|
if (comments.length && // #3619 ignore comments if the v-if is direct child of <transition>
|
|
15754
|
-
!(context.parent && context.parent.type === "
|
|
15754
|
+
!(context.parent && context.parent.type === "1" && isBuiltInType(context.parent.tag, "transition"))) {
|
|
15755
15755
|
branch.children = [...comments, ...branch.children];
|
|
15756
15756
|
}
|
|
15757
15757
|
{
|
|
@@ -15761,7 +15761,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15761
15761
|
if (isSameKey(userKey, key)) {
|
|
15762
15762
|
context.onError(
|
|
15763
15763
|
createCompilerError(
|
|
15764
|
-
29,
|
|
15764
|
+
"29",
|
|
15765
15765
|
branch.userKey.loc
|
|
15766
15766
|
)
|
|
15767
15767
|
);
|
|
@@ -15777,7 +15777,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15777
15777
|
context.currentNode = null;
|
|
15778
15778
|
} else {
|
|
15779
15779
|
context.onError(
|
|
15780
|
-
createCompilerError(30, node.loc)
|
|
15780
|
+
createCompilerError("30", node.loc)
|
|
15781
15781
|
);
|
|
15782
15782
|
}
|
|
15783
15783
|
break;
|
|
@@ -15785,9 +15785,9 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15785
15785
|
}
|
|
15786
15786
|
}
|
|
15787
15787
|
function createIfBranch(node, dir) {
|
|
15788
|
-
const isTemplateIf = node.tagType === 3;
|
|
15788
|
+
const isTemplateIf = node.tagType === "3";
|
|
15789
15789
|
return {
|
|
15790
|
-
type: 10,
|
|
15790
|
+
type: "10",
|
|
15791
15791
|
loc: node.loc,
|
|
15792
15792
|
condition: dir.name === "else" ? void 0 : dir.exp,
|
|
15793
15793
|
children: isTemplateIf && !findDir(node, "for") ? node.children : [node],
|
|
@@ -15819,21 +15819,21 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
|
|
|
15819
15819
|
`${keyIndex}`,
|
|
15820
15820
|
false,
|
|
15821
15821
|
locStub,
|
|
15822
|
-
2
|
|
15822
|
+
"2"
|
|
15823
15823
|
)
|
|
15824
15824
|
);
|
|
15825
15825
|
const { children } = branch;
|
|
15826
15826
|
const firstChild = children[0];
|
|
15827
|
-
const needFragmentWrapper = children.length !== 1 || firstChild.type !== "
|
|
15827
|
+
const needFragmentWrapper = children.length !== 1 || firstChild.type !== "1";
|
|
15828
15828
|
if (needFragmentWrapper) {
|
|
15829
|
-
if (children.length === 1 && firstChild.type === 11) {
|
|
15829
|
+
if (children.length === 1 && firstChild.type === "11") {
|
|
15830
15830
|
const vnodeCall = firstChild.codegenNode;
|
|
15831
15831
|
injectProp(vnodeCall, keyProperty, context);
|
|
15832
15832
|
return vnodeCall;
|
|
15833
15833
|
} else {
|
|
15834
15834
|
let patchFlag = 64;
|
|
15835
15835
|
let patchFlagText = PatchFlagNames[64];
|
|
15836
|
-
if (!branch.isTemplateIf && children.filter((c) => c.type !== "
|
|
15836
|
+
if (!branch.isTemplateIf && children.filter((c) => c.type !== "3").length === 1) {
|
|
15837
15837
|
patchFlag |= 2048;
|
|
15838
15838
|
patchFlagText += `, ${PatchFlagNames[2048]}`;
|
|
15839
15839
|
}
|
|
@@ -15854,7 +15854,7 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
|
|
|
15854
15854
|
} else {
|
|
15855
15855
|
const ret = firstChild.codegenNode;
|
|
15856
15856
|
const vnodeCall = getMemoedVNodeCall(ret);
|
|
15857
|
-
if (vnodeCall.type === 13) {
|
|
15857
|
+
if (vnodeCall.type === "13") {
|
|
15858
15858
|
makeBlock(vnodeCall, context);
|
|
15859
15859
|
}
|
|
15860
15860
|
injectProp(vnodeCall, keyProperty, context);
|
|
@@ -15865,7 +15865,7 @@ function isSameKey(a, b) {
|
|
|
15865
15865
|
if (!a || a.type !== b.type) {
|
|
15866
15866
|
return false;
|
|
15867
15867
|
}
|
|
15868
|
-
if (a.type === 6) {
|
|
15868
|
+
if (a.type === "6") {
|
|
15869
15869
|
if (a.value.content !== b.value.content) {
|
|
15870
15870
|
return false;
|
|
15871
15871
|
}
|
|
@@ -15875,7 +15875,7 @@ function isSameKey(a, b) {
|
|
|
15875
15875
|
if (exp.type !== branchExp.type) {
|
|
15876
15876
|
return false;
|
|
15877
15877
|
}
|
|
15878
|
-
if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) {
|
|
15878
|
+
if (exp.type !== "4" || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) {
|
|
15879
15879
|
return false;
|
|
15880
15880
|
}
|
|
15881
15881
|
}
|
|
@@ -15883,13 +15883,13 @@ function isSameKey(a, b) {
|
|
|
15883
15883
|
}
|
|
15884
15884
|
function getParentCondition(node) {
|
|
15885
15885
|
while (true) {
|
|
15886
|
-
if (node.type === 19) {
|
|
15887
|
-
if (node.alternate.type === 19) {
|
|
15886
|
+
if (node.type === "19") {
|
|
15887
|
+
if (node.alternate.type === "19") {
|
|
15888
15888
|
node = node.alternate;
|
|
15889
15889
|
} else {
|
|
15890
15890
|
return node;
|
|
15891
15891
|
}
|
|
15892
|
-
} else if (node.type === 20) {
|
|
15892
|
+
} else if (node.type === "20") {
|
|
15893
15893
|
node = node.value;
|
|
15894
15894
|
}
|
|
15895
15895
|
}
|
|
@@ -15906,7 +15906,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
15906
15906
|
const isTemplate = isTemplateNode(node);
|
|
15907
15907
|
const memo = findDir(node, "memo");
|
|
15908
15908
|
const keyProp = findProp(node, `key`);
|
|
15909
|
-
const keyExp = keyProp && (keyProp.type === 6 ? createSimpleExpression(keyProp.value.content, true) : keyProp.exp);
|
|
15909
|
+
const keyExp = keyProp && (keyProp.type === "6" ? createSimpleExpression(keyProp.value.content, true) : keyProp.exp);
|
|
15910
15910
|
const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
|
|
15911
15911
|
if (isTemplate) {
|
|
15912
15912
|
if (memo) {
|
|
@@ -15915,14 +15915,14 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
15915
15915
|
context
|
|
15916
15916
|
);
|
|
15917
15917
|
}
|
|
15918
|
-
if (keyProperty && keyProp.type !== 6) {
|
|
15918
|
+
if (keyProperty && keyProp.type !== "6") {
|
|
15919
15919
|
keyProperty.value = processExpression(
|
|
15920
15920
|
keyProperty.value,
|
|
15921
15921
|
context
|
|
15922
15922
|
);
|
|
15923
15923
|
}
|
|
15924
15924
|
}
|
|
15925
|
-
const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
|
|
15925
|
+
const isStableFragment = forNode.source.type === "4" && forNode.source.constType > 0;
|
|
15926
15926
|
const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
|
|
15927
15927
|
forNode.codegenNode = createVNodeCall(
|
|
15928
15928
|
context,
|
|
@@ -15942,12 +15942,12 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
15942
15942
|
const { children } = forNode;
|
|
15943
15943
|
if (isTemplate) {
|
|
15944
15944
|
node.children.some((c) => {
|
|
15945
|
-
if (c.type === "
|
|
15945
|
+
if (c.type === "1") {
|
|
15946
15946
|
const key = findProp(c, "key");
|
|
15947
15947
|
if (key) {
|
|
15948
15948
|
context.onError(
|
|
15949
15949
|
createCompilerError(
|
|
15950
|
-
33,
|
|
15950
|
+
"33",
|
|
15951
15951
|
key.loc
|
|
15952
15952
|
)
|
|
15953
15953
|
);
|
|
@@ -15956,7 +15956,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
15956
15956
|
}
|
|
15957
15957
|
});
|
|
15958
15958
|
}
|
|
15959
|
-
const needFragmentWrapper = children.length !== 1 || children[0].type !== "
|
|
15959
|
+
const needFragmentWrapper = children.length !== 1 || children[0].type !== "1";
|
|
15960
15960
|
const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null;
|
|
15961
15961
|
if (slotOutlet) {
|
|
15962
15962
|
childBlock = slotOutlet.codegenNode;
|
|
@@ -16043,7 +16043,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
16043
16043
|
function processFor(node, dir, context, processCodegen) {
|
|
16044
16044
|
if (!dir.exp) {
|
|
16045
16045
|
context.onError(
|
|
16046
|
-
createCompilerError(31, dir.loc)
|
|
16046
|
+
createCompilerError("31", dir.loc)
|
|
16047
16047
|
);
|
|
16048
16048
|
return;
|
|
16049
16049
|
}
|
|
@@ -16055,14 +16055,14 @@ function processFor(node, dir, context, processCodegen) {
|
|
|
16055
16055
|
);
|
|
16056
16056
|
if (!parseResult) {
|
|
16057
16057
|
context.onError(
|
|
16058
|
-
createCompilerError(32, dir.loc)
|
|
16058
|
+
createCompilerError("32", dir.loc)
|
|
16059
16059
|
);
|
|
16060
16060
|
return;
|
|
16061
16061
|
}
|
|
16062
16062
|
const { addIdentifiers, removeIdentifiers, scopes } = context;
|
|
16063
16063
|
const { source, value, key, index } = parseResult;
|
|
16064
16064
|
const forNode = {
|
|
16065
|
-
type: 11,
|
|
16065
|
+
type: "11",
|
|
16066
16066
|
loc: dir.loc,
|
|
16067
16067
|
source,
|
|
16068
16068
|
valueAlias: value,
|
|
@@ -16176,7 +16176,7 @@ function createParamsList(args) {
|
|
|
16176
16176
|
|
|
16177
16177
|
const defaultFallback = createSimpleExpression(`undefined`, false);
|
|
16178
16178
|
const trackSlotScopes = (node, context) => {
|
|
16179
|
-
if (node.type === "
|
|
16179
|
+
if (node.type === "1" && (node.tagType === "1" || node.tagType === "3")) {
|
|
16180
16180
|
const vSlot = findDir(node, "slot");
|
|
16181
16181
|
if (vSlot) {
|
|
16182
16182
|
const slotProps = vSlot.exp;
|
|
@@ -16252,14 +16252,14 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
16252
16252
|
const slotElement = children[i];
|
|
16253
16253
|
let slotDir;
|
|
16254
16254
|
if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) {
|
|
16255
|
-
if (slotElement.type !== "
|
|
16255
|
+
if (slotElement.type !== "3") {
|
|
16256
16256
|
implicitDefaultChildren.push(slotElement);
|
|
16257
16257
|
}
|
|
16258
16258
|
continue;
|
|
16259
16259
|
}
|
|
16260
16260
|
if (onComponentSlot) {
|
|
16261
16261
|
context.onError(
|
|
16262
|
-
createCompilerError(37, slotDir.loc)
|
|
16262
|
+
createCompilerError("37", slotDir.loc)
|
|
16263
16263
|
);
|
|
16264
16264
|
break;
|
|
16265
16265
|
}
|
|
@@ -16299,7 +16299,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
16299
16299
|
let prev;
|
|
16300
16300
|
while (j--) {
|
|
16301
16301
|
prev = children[j];
|
|
16302
|
-
if (prev.type !== "
|
|
16302
|
+
if (prev.type !== "3") {
|
|
16303
16303
|
break;
|
|
16304
16304
|
}
|
|
16305
16305
|
}
|
|
@@ -16307,7 +16307,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
16307
16307
|
children.splice(i, 1);
|
|
16308
16308
|
i--;
|
|
16309
16309
|
let conditional = dynamicSlots[dynamicSlots.length - 1];
|
|
16310
|
-
while (conditional.alternate.type === 19) {
|
|
16310
|
+
while (conditional.alternate.type === "19") {
|
|
16311
16311
|
conditional = conditional.alternate;
|
|
16312
16312
|
}
|
|
16313
16313
|
conditional.alternate = vElse.exp ? createConditionalExpression(
|
|
@@ -16321,7 +16321,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
16321
16321
|
) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++);
|
|
16322
16322
|
} else {
|
|
16323
16323
|
context.onError(
|
|
16324
|
-
createCompilerError(30, vElse.loc)
|
|
16324
|
+
createCompilerError("30", vElse.loc)
|
|
16325
16325
|
);
|
|
16326
16326
|
}
|
|
16327
16327
|
} else if (vFor = findDir(slotElement, "for")) {
|
|
@@ -16341,7 +16341,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
16341
16341
|
);
|
|
16342
16342
|
} else {
|
|
16343
16343
|
context.onError(
|
|
16344
|
-
createCompilerError(32, vFor.loc)
|
|
16344
|
+
createCompilerError("32", vFor.loc)
|
|
16345
16345
|
);
|
|
16346
16346
|
}
|
|
16347
16347
|
} else {
|
|
@@ -16349,7 +16349,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
16349
16349
|
if (seenSlotNames.has(staticSlotName)) {
|
|
16350
16350
|
context.onError(
|
|
16351
16351
|
createCompilerError(
|
|
16352
|
-
38,
|
|
16352
|
+
"38",
|
|
16353
16353
|
dirLoc
|
|
16354
16354
|
)
|
|
16355
16355
|
);
|
|
@@ -16380,7 +16380,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
16380
16380
|
if (hasNamedDefaultSlot) {
|
|
16381
16381
|
context.onError(
|
|
16382
16382
|
createCompilerError(
|
|
16383
|
-
39,
|
|
16383
|
+
"39",
|
|
16384
16384
|
implicitDefaultChildren[0].loc
|
|
16385
16385
|
)
|
|
16386
16386
|
);
|
|
@@ -16433,17 +16433,17 @@ function hasForwardedSlots(children) {
|
|
|
16433
16433
|
for (let i = 0; i < children.length; i++) {
|
|
16434
16434
|
const child = children[i];
|
|
16435
16435
|
switch (child.type) {
|
|
16436
|
-
case "
|
|
16437
|
-
if (child.tagType === 2 || hasForwardedSlots(child.children)) {
|
|
16436
|
+
case "1":
|
|
16437
|
+
if (child.tagType === "2" || hasForwardedSlots(child.children)) {
|
|
16438
16438
|
return true;
|
|
16439
16439
|
}
|
|
16440
16440
|
break;
|
|
16441
|
-
case 9:
|
|
16441
|
+
case "9":
|
|
16442
16442
|
if (hasForwardedSlots(child.branches))
|
|
16443
16443
|
return true;
|
|
16444
16444
|
break;
|
|
16445
|
-
case 10:
|
|
16446
|
-
case 11:
|
|
16445
|
+
case "10":
|
|
16446
|
+
case "11":
|
|
16447
16447
|
if (hasForwardedSlots(child.children))
|
|
16448
16448
|
return true;
|
|
16449
16449
|
break;
|
|
@@ -16452,20 +16452,20 @@ function hasForwardedSlots(children) {
|
|
|
16452
16452
|
return false;
|
|
16453
16453
|
}
|
|
16454
16454
|
function isNonWhitespaceContent(node) {
|
|
16455
|
-
if (node.type !== "
|
|
16455
|
+
if (node.type !== "2" && node.type !== "12")
|
|
16456
16456
|
return true;
|
|
16457
|
-
return node.type === "
|
|
16457
|
+
return node.type === "2" ? !!node.content.trim() : isNonWhitespaceContent(node.content);
|
|
16458
16458
|
}
|
|
16459
16459
|
|
|
16460
16460
|
const directiveImportMap = /* @__PURE__ */ new WeakMap();
|
|
16461
16461
|
const transformElement = (node, context) => {
|
|
16462
16462
|
return function postTransformElement() {
|
|
16463
16463
|
node = context.currentNode;
|
|
16464
|
-
if (!(node.type === "
|
|
16464
|
+
if (!(node.type === "1" && (node.tagType === "0" || node.tagType === "1"))) {
|
|
16465
16465
|
return;
|
|
16466
16466
|
}
|
|
16467
16467
|
const { tag, props } = node;
|
|
16468
|
-
const isComponent = node.tagType === 1;
|
|
16468
|
+
const isComponent = node.tagType === "1";
|
|
16469
16469
|
let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`;
|
|
16470
16470
|
const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
|
|
16471
16471
|
let vnodeProps;
|
|
@@ -16508,7 +16508,7 @@ const transformElement = (node, context) => {
|
|
|
16508
16508
|
patchFlag |= 1024;
|
|
16509
16509
|
if (node.children.length > 1) {
|
|
16510
16510
|
context.onError(
|
|
16511
|
-
createCompilerError(46, {
|
|
16511
|
+
createCompilerError("46", {
|
|
16512
16512
|
start: node.children[0].loc.start,
|
|
16513
16513
|
end: node.children[node.children.length - 1].loc.end,
|
|
16514
16514
|
source: ""
|
|
@@ -16528,11 +16528,11 @@ const transformElement = (node, context) => {
|
|
|
16528
16528
|
} else if (node.children.length === 1 && vnodeTag !== TELEPORT) {
|
|
16529
16529
|
const child = node.children[0];
|
|
16530
16530
|
const type = child.type;
|
|
16531
|
-
const hasDynamicTextChild = type === 5 || type === 8;
|
|
16531
|
+
const hasDynamicTextChild = type === "5" || type === "8";
|
|
16532
16532
|
if (hasDynamicTextChild && getConstantType(child, context) === 0) {
|
|
16533
16533
|
patchFlag |= 1;
|
|
16534
16534
|
}
|
|
16535
|
-
if (hasDynamicTextChild || type === "
|
|
16535
|
+
if (hasDynamicTextChild || type === "2") {
|
|
16536
16536
|
vnodeChildren = child;
|
|
16537
16537
|
} else {
|
|
16538
16538
|
vnodeChildren = node.children;
|
|
@@ -16578,13 +16578,13 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
16578
16578
|
"COMPILER_IS_ON_ELEMENT",
|
|
16579
16579
|
context
|
|
16580
16580
|
)) {
|
|
16581
|
-
const exp = isProp.type === 6 ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp;
|
|
16581
|
+
const exp = isProp.type === "6" ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp;
|
|
16582
16582
|
if (exp) {
|
|
16583
16583
|
return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
|
|
16584
16584
|
exp
|
|
16585
16585
|
]);
|
|
16586
16586
|
}
|
|
16587
|
-
} else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) {
|
|
16587
|
+
} else if (isProp.type === "6" && isProp.value.content.startsWith("vue:")) {
|
|
16588
16588
|
tag = isProp.value.content.slice(4);
|
|
16589
16589
|
}
|
|
16590
16590
|
}
|
|
@@ -16694,7 +16694,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16694
16694
|
if (isEventHandler && isReservedProp(name)) {
|
|
16695
16695
|
hasVnodeHook = true;
|
|
16696
16696
|
}
|
|
16697
|
-
if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
|
|
16697
|
+
if (value.type === "20" || (value.type === "4" || value.type === "8") && getConstantType(value, context) > 0) {
|
|
16698
16698
|
return;
|
|
16699
16699
|
}
|
|
16700
16700
|
if (name === "ref") {
|
|
@@ -16715,7 +16715,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16715
16715
|
};
|
|
16716
16716
|
for (let i = 0; i < props.length; i++) {
|
|
16717
16717
|
const prop = props[i];
|
|
16718
|
-
if (prop.type === 6) {
|
|
16718
|
+
if (prop.type === "6") {
|
|
16719
16719
|
const { loc, name, value } = prop;
|
|
16720
16720
|
let isStatic = true;
|
|
16721
16721
|
if (name === "ref") {
|
|
@@ -16768,7 +16768,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16768
16768
|
if (name === "slot") {
|
|
16769
16769
|
if (!isComponent) {
|
|
16770
16770
|
context.onError(
|
|
16771
|
-
createCompilerError(40, loc)
|
|
16771
|
+
createCompilerError("40", loc)
|
|
16772
16772
|
);
|
|
16773
16773
|
}
|
|
16774
16774
|
continue;
|
|
@@ -16809,9 +16809,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16809
16809
|
{
|
|
16810
16810
|
{
|
|
16811
16811
|
const hasOverridableKeys = mergeArgs.some((arg2) => {
|
|
16812
|
-
if (arg2.type === 15) {
|
|
16812
|
+
if (arg2.type === "15") {
|
|
16813
16813
|
return arg2.properties.some(({ key }) => {
|
|
16814
|
-
if (key.type !== 4 || !key.isStatic) {
|
|
16814
|
+
if (key.type !== "4" || !key.isStatic) {
|
|
16815
16815
|
return true;
|
|
16816
16816
|
}
|
|
16817
16817
|
return key.content !== "class" && key.content !== "style" && !isOn(key.content);
|
|
@@ -16839,7 +16839,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16839
16839
|
mergeArgs.push(exp);
|
|
16840
16840
|
} else {
|
|
16841
16841
|
pushMergeArg({
|
|
16842
|
-
type: 14,
|
|
16842
|
+
type: "14",
|
|
16843
16843
|
loc,
|
|
16844
16844
|
callee: context.helper(TO_HANDLERS),
|
|
16845
16845
|
arguments: isComponent ? [exp] : [exp, `true`]
|
|
@@ -16848,7 +16848,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16848
16848
|
} else {
|
|
16849
16849
|
context.onError(
|
|
16850
16850
|
createCompilerError(
|
|
16851
|
-
isVBind ? 34 : 35,
|
|
16851
|
+
isVBind ? "34" : "35",
|
|
16852
16852
|
loc
|
|
16853
16853
|
)
|
|
16854
16854
|
);
|
|
@@ -16917,7 +16917,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16917
16917
|
}
|
|
16918
16918
|
if (!context.inSSR && propsExpression) {
|
|
16919
16919
|
switch (propsExpression.type) {
|
|
16920
|
-
case 15:
|
|
16920
|
+
case "15":
|
|
16921
16921
|
let classKeyIndex = -1;
|
|
16922
16922
|
let styleKeyIndex = -1;
|
|
16923
16923
|
let hasDynamicKey = false;
|
|
@@ -16944,9 +16944,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16944
16944
|
}
|
|
16945
16945
|
if (styleProp && // the static style is compiled into an object,
|
|
16946
16946
|
// so use `hasStyleBinding` to ensure that it is a dynamic style binding
|
|
16947
|
-
(hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist,
|
|
16947
|
+
(hasStyleBinding || styleProp.value.type === "4" && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist,
|
|
16948
16948
|
// v-bind:style with static literal object
|
|
16949
|
-
styleProp.value.type === 17)) {
|
|
16949
|
+
styleProp.value.type === "17")) {
|
|
16950
16950
|
styleProp.value = createCallExpression(
|
|
16951
16951
|
context.helper(NORMALIZE_STYLE),
|
|
16952
16952
|
[styleProp.value]
|
|
@@ -16959,7 +16959,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16959
16959
|
);
|
|
16960
16960
|
}
|
|
16961
16961
|
break;
|
|
16962
|
-
case 14:
|
|
16962
|
+
case "14":
|
|
16963
16963
|
break;
|
|
16964
16964
|
default:
|
|
16965
16965
|
propsExpression = createCallExpression(
|
|
@@ -16986,7 +16986,7 @@ function dedupeProperties(properties) {
|
|
|
16986
16986
|
const deduped = [];
|
|
16987
16987
|
for (let i = 0; i < properties.length; i++) {
|
|
16988
16988
|
const prop = properties[i];
|
|
16989
|
-
if (prop.key.type === 8 || !prop.key.isStatic) {
|
|
16989
|
+
if (prop.key.type === "8" || !prop.key.isStatic) {
|
|
16990
16990
|
deduped.push(prop);
|
|
16991
16991
|
continue;
|
|
16992
16992
|
}
|
|
@@ -17004,7 +17004,7 @@ function dedupeProperties(properties) {
|
|
|
17004
17004
|
return deduped;
|
|
17005
17005
|
}
|
|
17006
17006
|
function mergeAsArray(existing, incoming) {
|
|
17007
|
-
if (existing.value.type === 17) {
|
|
17007
|
+
if (existing.value.type === "17") {
|
|
17008
17008
|
existing.value.elements.push(incoming.value);
|
|
17009
17009
|
} else {
|
|
17010
17010
|
existing.value = createArrayExpression(
|
|
@@ -17106,7 +17106,7 @@ function processSlotOutlet(node, context) {
|
|
|
17106
17106
|
const nonNameProps = [];
|
|
17107
17107
|
for (let i = 0; i < node.props.length; i++) {
|
|
17108
17108
|
const p = node.props[i];
|
|
17109
|
-
if (p.type === 6) {
|
|
17109
|
+
if (p.type === "6") {
|
|
17110
17110
|
if (p.value) {
|
|
17111
17111
|
if (p.name === "name") {
|
|
17112
17112
|
slotName = JSON.stringify(p.value.content);
|
|
@@ -17139,7 +17139,7 @@ function processSlotOutlet(node, context) {
|
|
|
17139
17139
|
if (directives.length) {
|
|
17140
17140
|
context.onError(
|
|
17141
17141
|
createCompilerError(
|
|
17142
|
-
36,
|
|
17142
|
+
"36",
|
|
17143
17143
|
directives[0].loc
|
|
17144
17144
|
)
|
|
17145
17145
|
);
|
|
@@ -17155,16 +17155,16 @@ const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+
|
|
|
17155
17155
|
const transformOn$1 = (dir, node, context, augmentor) => {
|
|
17156
17156
|
const { loc, modifiers, arg } = dir;
|
|
17157
17157
|
if (!dir.exp && !modifiers.length) {
|
|
17158
|
-
context.onError(createCompilerError(35, loc));
|
|
17158
|
+
context.onError(createCompilerError("35", loc));
|
|
17159
17159
|
}
|
|
17160
17160
|
let eventName;
|
|
17161
|
-
if (arg.type === 4) {
|
|
17161
|
+
if (arg.type === "4") {
|
|
17162
17162
|
if (arg.isStatic) {
|
|
17163
17163
|
let rawName = arg.content;
|
|
17164
17164
|
if (rawName.startsWith("vue:")) {
|
|
17165
17165
|
rawName = `vnode-${rawName.slice(4)}`;
|
|
17166
17166
|
}
|
|
17167
|
-
const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? (
|
|
17167
|
+
const eventString = node.tagType !== "0" || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? (
|
|
17168
17168
|
// for non-element and vnode lifecycle event listeners, auto convert
|
|
17169
17169
|
// it to camelCase. See issue #2249
|
|
17170
17170
|
toHandlerKey(camelize(rawName))
|
|
@@ -17207,16 +17207,16 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
17207
17207
|
shouldCache = context.cacheHandlers && // unnecessary to cache inside v-once
|
|
17208
17208
|
!context.inVOnce && // runtime constants don't need to be cached
|
|
17209
17209
|
// (this is analyzed by compileScript in SFC <script setup>)
|
|
17210
|
-
!(exp.type === 4 && exp.constType > 0) && // #1541 bail if this is a member exp handler passed to a component -
|
|
17210
|
+
!(exp.type === "4" && exp.constType > 0) && // #1541 bail if this is a member exp handler passed to a component -
|
|
17211
17211
|
// we need to use the original function to preserve arity,
|
|
17212
17212
|
// e.g. <transition> relies on checking cb.length to determine
|
|
17213
17213
|
// transition end handling. Inline function is ok since its arity
|
|
17214
17214
|
// is preserved even when cached.
|
|
17215
|
-
!(isMemberExp && node.tagType === 1) && // bail if the function references closure variables (v-for, v-slot)
|
|
17215
|
+
!(isMemberExp && node.tagType === "1") && // bail if the function references closure variables (v-for, v-slot)
|
|
17216
17216
|
// it must be passed fresh to avoid stale values.
|
|
17217
17217
|
!hasScopeRef(exp, context.identifiers);
|
|
17218
17218
|
if (shouldCache && isMemberExp) {
|
|
17219
|
-
if (exp.type === 4) {
|
|
17219
|
+
if (exp.type === "4") {
|
|
17220
17220
|
exp.content = `${exp.content} && ${exp.content}(...args)`;
|
|
17221
17221
|
} else {
|
|
17222
17222
|
exp.children = [...exp.children, ` && `, ...exp.children, `(...args)`];
|
|
@@ -17254,14 +17254,14 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
17254
17254
|
const transformBind = (dir, _node, context) => {
|
|
17255
17255
|
const { exp, modifiers, loc } = dir;
|
|
17256
17256
|
const arg = dir.arg;
|
|
17257
|
-
if (arg.type !== 4) {
|
|
17257
|
+
if (arg.type !== "4") {
|
|
17258
17258
|
arg.children.unshift(`(`);
|
|
17259
17259
|
arg.children.push(`) || ""`);
|
|
17260
17260
|
} else if (!arg.isStatic) {
|
|
17261
17261
|
arg.content = `${arg.content} || ""`;
|
|
17262
17262
|
}
|
|
17263
17263
|
if (modifiers.includes("camel")) {
|
|
17264
|
-
if (arg.type === 4) {
|
|
17264
|
+
if (arg.type === "4") {
|
|
17265
17265
|
if (arg.isStatic) {
|
|
17266
17266
|
arg.content = camelize(arg.content);
|
|
17267
17267
|
} else {
|
|
@@ -17280,8 +17280,8 @@ const transformBind = (dir, _node, context) => {
|
|
|
17280
17280
|
injectPrefix(arg, "^");
|
|
17281
17281
|
}
|
|
17282
17282
|
}
|
|
17283
|
-
if (!exp || exp.type === 4 && !exp.content.trim()) {
|
|
17284
|
-
context.onError(createCompilerError(34, loc));
|
|
17283
|
+
if (!exp || exp.type === "4" && !exp.content.trim()) {
|
|
17284
|
+
context.onError(createCompilerError("34", loc));
|
|
17285
17285
|
return {
|
|
17286
17286
|
props: [createObjectProperty(arg, createSimpleExpression("", true, loc))]
|
|
17287
17287
|
};
|
|
@@ -17291,7 +17291,7 @@ const transformBind = (dir, _node, context) => {
|
|
|
17291
17291
|
};
|
|
17292
17292
|
};
|
|
17293
17293
|
const injectPrefix = (arg, prefix) => {
|
|
17294
|
-
if (arg.type === 4) {
|
|
17294
|
+
if (arg.type === "4") {
|
|
17295
17295
|
if (arg.isStatic) {
|
|
17296
17296
|
arg.content = prefix + arg.content;
|
|
17297
17297
|
} else {
|
|
@@ -17304,7 +17304,7 @@ const injectPrefix = (arg, prefix) => {
|
|
|
17304
17304
|
};
|
|
17305
17305
|
|
|
17306
17306
|
const transformText = (node, context) => {
|
|
17307
|
-
if (node.type === 0 || node.type === "
|
|
17307
|
+
if (node.type === "0" || node.type === "1" || node.type === "11" || node.type === "10") {
|
|
17308
17308
|
return () => {
|
|
17309
17309
|
const children = node.children;
|
|
17310
17310
|
let currentContainer = void 0;
|
|
@@ -17336,13 +17336,13 @@ const transformText = (node, context) => {
|
|
|
17336
17336
|
// as-is since the runtime has dedicated fast path for this by directly
|
|
17337
17337
|
// setting textContent of the element.
|
|
17338
17338
|
// for component root it's always normalized anyway.
|
|
17339
|
-
children.length === 1 && (node.type === 0 || node.type === "
|
|
17339
|
+
children.length === 1 && (node.type === "0" || node.type === "1" && node.tagType === "0" && // #3756
|
|
17340
17340
|
// custom directives can potentially add DOM elements arbitrarily,
|
|
17341
17341
|
// we need to avoid setting textContent of the element at runtime
|
|
17342
17342
|
// to avoid accidentally overwriting the DOM elements added
|
|
17343
17343
|
// by the user through custom directives.
|
|
17344
17344
|
!node.props.find(
|
|
17345
|
-
(p) => p.type === 7 && !context.directiveTransforms[p.name]
|
|
17345
|
+
(p) => p.type === "7" && !context.directiveTransforms[p.name]
|
|
17346
17346
|
) && // in compat mode, <template> tags with no special directives
|
|
17347
17347
|
// will be rendered as a fragment so its children must be
|
|
17348
17348
|
// converted into vnodes.
|
|
@@ -17351,9 +17351,9 @@ const transformText = (node, context) => {
|
|
|
17351
17351
|
}
|
|
17352
17352
|
for (let i = 0; i < children.length; i++) {
|
|
17353
17353
|
const child = children[i];
|
|
17354
|
-
if (isText$1(child) || child.type === 8) {
|
|
17354
|
+
if (isText$1(child) || child.type === "8") {
|
|
17355
17355
|
const callArgs = [];
|
|
17356
|
-
if (child.type !== "
|
|
17356
|
+
if (child.type !== "2" || child.content !== " ") {
|
|
17357
17357
|
callArgs.push(child);
|
|
17358
17358
|
}
|
|
17359
17359
|
if (!context.ssr && getConstantType(child, context) === 0) {
|
|
@@ -17362,7 +17362,7 @@ const transformText = (node, context) => {
|
|
|
17362
17362
|
);
|
|
17363
17363
|
}
|
|
17364
17364
|
children[i] = {
|
|
17365
|
-
type: 12,
|
|
17365
|
+
type: "12",
|
|
17366
17366
|
content: child,
|
|
17367
17367
|
loc: child.loc,
|
|
17368
17368
|
codegenNode: createCallExpression(
|
|
@@ -17378,7 +17378,7 @@ const transformText = (node, context) => {
|
|
|
17378
17378
|
|
|
17379
17379
|
const seen$1 = /* @__PURE__ */ new WeakSet();
|
|
17380
17380
|
const transformOnce = (node, context) => {
|
|
17381
|
-
if (node.type === "
|
|
17381
|
+
if (node.type === "1" && findDir(node, "once", true)) {
|
|
17382
17382
|
if (seen$1.has(node) || context.inVOnce) {
|
|
17383
17383
|
return;
|
|
17384
17384
|
}
|
|
@@ -17403,27 +17403,27 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
17403
17403
|
const { exp, arg } = dir;
|
|
17404
17404
|
if (!exp) {
|
|
17405
17405
|
context.onError(
|
|
17406
|
-
createCompilerError(41, dir.loc)
|
|
17406
|
+
createCompilerError("41", dir.loc)
|
|
17407
17407
|
);
|
|
17408
17408
|
return createTransformProps();
|
|
17409
17409
|
}
|
|
17410
17410
|
const rawExp = exp.loc.source;
|
|
17411
|
-
const expString = exp.type === 4 ? exp.content : rawExp;
|
|
17411
|
+
const expString = exp.type === "4" ? exp.content : rawExp;
|
|
17412
17412
|
const bindingType = context.bindingMetadata[rawExp];
|
|
17413
17413
|
if (bindingType === "props" || bindingType === "props-aliased") {
|
|
17414
|
-
context.onError(createCompilerError(44, exp.loc));
|
|
17414
|
+
context.onError(createCompilerError("44", exp.loc));
|
|
17415
17415
|
return createTransformProps();
|
|
17416
17416
|
}
|
|
17417
17417
|
const maybeRef = context.inline && (bindingType === "setup-let" || bindingType === "setup-ref" || bindingType === "setup-maybe-ref");
|
|
17418
17418
|
if (!expString.trim() || !isMemberExpression(expString, context) && !maybeRef) {
|
|
17419
17419
|
context.onError(
|
|
17420
|
-
createCompilerError(42, exp.loc)
|
|
17420
|
+
createCompilerError("42", exp.loc)
|
|
17421
17421
|
);
|
|
17422
17422
|
return createTransformProps();
|
|
17423
17423
|
}
|
|
17424
17424
|
if (context.prefixIdentifiers && isSimpleIdentifier(expString) && context.identifiers[expString]) {
|
|
17425
17425
|
context.onError(
|
|
17426
|
-
createCompilerError(43, exp.loc)
|
|
17426
|
+
createCompilerError("43", exp.loc)
|
|
17427
17427
|
);
|
|
17428
17428
|
return createTransformProps();
|
|
17429
17429
|
}
|
|
@@ -17462,7 +17462,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
17462
17462
|
if (context.prefixIdentifiers && !context.inVOnce && context.cacheHandlers && !hasScopeRef(exp, context.identifiers)) {
|
|
17463
17463
|
props[1].value = context.cache(props[1].value);
|
|
17464
17464
|
}
|
|
17465
|
-
if (dir.modifiers.length && node.tagType === 1) {
|
|
17465
|
+
if (dir.modifiers.length && node.tagType === "1") {
|
|
17466
17466
|
const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
|
|
17467
17467
|
const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
|
|
17468
17468
|
props.push(
|
|
@@ -17472,7 +17472,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
17472
17472
|
`{ ${modifiers} }`,
|
|
17473
17473
|
false,
|
|
17474
17474
|
dir.loc,
|
|
17475
|
-
2
|
|
17475
|
+
"2"
|
|
17476
17476
|
)
|
|
17477
17477
|
)
|
|
17478
17478
|
);
|
|
@@ -17488,30 +17488,30 @@ const transformFilter = (node, context) => {
|
|
|
17488
17488
|
if (!isCompatEnabled("COMPILER_FILTER", context)) {
|
|
17489
17489
|
return;
|
|
17490
17490
|
}
|
|
17491
|
-
if (node.type === 5) {
|
|
17491
|
+
if (node.type === "5") {
|
|
17492
17492
|
rewriteFilter(node.content, context);
|
|
17493
17493
|
}
|
|
17494
|
-
if (node.type === "
|
|
17494
|
+
if (node.type === "1") {
|
|
17495
17495
|
node.props.forEach((prop) => {
|
|
17496
|
-
if (prop.type === 7 && prop.name !== "for" && prop.exp) {
|
|
17496
|
+
if (prop.type === "7" && prop.name !== "for" && prop.exp) {
|
|
17497
17497
|
rewriteFilter(prop.exp, context);
|
|
17498
17498
|
}
|
|
17499
17499
|
});
|
|
17500
17500
|
}
|
|
17501
17501
|
};
|
|
17502
17502
|
function rewriteFilter(node, context) {
|
|
17503
|
-
if (node.type === 4) {
|
|
17503
|
+
if (node.type === "4") {
|
|
17504
17504
|
parseFilter(node, context);
|
|
17505
17505
|
} else {
|
|
17506
17506
|
for (let i = 0; i < node.children.length; i++) {
|
|
17507
17507
|
const child = node.children[i];
|
|
17508
17508
|
if (typeof child !== "object")
|
|
17509
17509
|
continue;
|
|
17510
|
-
if (child.type === 4) {
|
|
17510
|
+
if (child.type === "4") {
|
|
17511
17511
|
parseFilter(child, context);
|
|
17512
|
-
} else if (child.type === 8) {
|
|
17512
|
+
} else if (child.type === "8") {
|
|
17513
17513
|
rewriteFilter(node, context);
|
|
17514
|
-
} else if (child.type === 5) {
|
|
17514
|
+
} else if (child.type === "5") {
|
|
17515
17515
|
rewriteFilter(child.content, context);
|
|
17516
17516
|
}
|
|
17517
17517
|
}
|
|
@@ -17632,7 +17632,7 @@ function wrapFilter(exp, filter, context) {
|
|
|
17632
17632
|
|
|
17633
17633
|
const seen = /* @__PURE__ */ new WeakSet();
|
|
17634
17634
|
const transformMemo = (node, context) => {
|
|
17635
|
-
if (node.type === "
|
|
17635
|
+
if (node.type === "1") {
|
|
17636
17636
|
const dir = findDir(node, "memo");
|
|
17637
17637
|
if (!dir || seen.has(node)) {
|
|
17638
17638
|
return;
|
|
@@ -17640,8 +17640,8 @@ const transformMemo = (node, context) => {
|
|
|
17640
17640
|
seen.add(node);
|
|
17641
17641
|
return () => {
|
|
17642
17642
|
const codegenNode = node.codegenNode || context.currentNode.codegenNode;
|
|
17643
|
-
if (codegenNode && codegenNode.type === 13) {
|
|
17644
|
-
if (node.tagType !== 1) {
|
|
17643
|
+
if (codegenNode && codegenNode.type === "13") {
|
|
17644
|
+
if (node.tagType !== "1") {
|
|
17645
17645
|
makeBlock(codegenNode, context);
|
|
17646
17646
|
}
|
|
17647
17647
|
node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
|
|
@@ -17685,10 +17685,10 @@ function baseCompile(template, options = {}) {
|
|
|
17685
17685
|
const isModuleMode = options.mode === "module";
|
|
17686
17686
|
const prefixIdentifiers = options.prefixIdentifiers === true || isModuleMode;
|
|
17687
17687
|
if (!prefixIdentifiers && options.cacheHandlers) {
|
|
17688
|
-
onError(createCompilerError(49));
|
|
17688
|
+
onError(createCompilerError("49"));
|
|
17689
17689
|
}
|
|
17690
17690
|
if (options.scopeId && !isModuleMode) {
|
|
17691
|
-
onError(createCompilerError(50));
|
|
17691
|
+
onError(createCompilerError("50"));
|
|
17692
17692
|
}
|
|
17693
17693
|
const ast = isString(template) ? baseParse(template, options) : template;
|
|
17694
17694
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(prefixIdentifiers);
|
|
@@ -20106,30 +20106,30 @@ const parserOptions = {
|
|
|
20106
20106
|
// https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
|
|
20107
20107
|
getNamespace(tag, parent) {
|
|
20108
20108
|
let ns = parent ? parent.ns : 0;
|
|
20109
|
-
if (parent && ns === 2) {
|
|
20109
|
+
if (parent && ns === "2") {
|
|
20110
20110
|
if (parent.tag === "annotation-xml") {
|
|
20111
20111
|
if (tag === "svg") {
|
|
20112
|
-
return 1;
|
|
20112
|
+
return "1";
|
|
20113
20113
|
}
|
|
20114
20114
|
if (parent.props.some(
|
|
20115
|
-
(a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml")
|
|
20115
|
+
(a) => a.type === "6" && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml")
|
|
20116
20116
|
)) {
|
|
20117
20117
|
ns = 0;
|
|
20118
20118
|
}
|
|
20119
20119
|
} else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") {
|
|
20120
20120
|
ns = 0;
|
|
20121
20121
|
}
|
|
20122
|
-
} else if (parent && ns === 1) {
|
|
20122
|
+
} else if (parent && ns === "1") {
|
|
20123
20123
|
if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") {
|
|
20124
20124
|
ns = 0;
|
|
20125
20125
|
}
|
|
20126
20126
|
}
|
|
20127
20127
|
if (ns === 0) {
|
|
20128
20128
|
if (tag === "svg") {
|
|
20129
|
-
return 1;
|
|
20129
|
+
return "1";
|
|
20130
20130
|
}
|
|
20131
20131
|
if (tag === "math") {
|
|
20132
|
-
return 2;
|
|
20132
|
+
return "2";
|
|
20133
20133
|
}
|
|
20134
20134
|
}
|
|
20135
20135
|
return ns;
|
|
@@ -20138,22 +20138,22 @@ const parserOptions = {
|
|
|
20138
20138
|
getTextMode({ tag, ns }) {
|
|
20139
20139
|
if (ns === 0) {
|
|
20140
20140
|
if (tag === "textarea" || tag === "title") {
|
|
20141
|
-
return 1;
|
|
20141
|
+
return "1";
|
|
20142
20142
|
}
|
|
20143
20143
|
if (isRawTextContainer(tag)) {
|
|
20144
|
-
return 2;
|
|
20144
|
+
return "2";
|
|
20145
20145
|
}
|
|
20146
20146
|
}
|
|
20147
|
-
return 0;
|
|
20147
|
+
return "0";
|
|
20148
20148
|
}
|
|
20149
20149
|
};
|
|
20150
20150
|
|
|
20151
20151
|
const transformStyle = (node) => {
|
|
20152
|
-
if (node.type === "
|
|
20152
|
+
if (node.type === "1") {
|
|
20153
20153
|
node.props.forEach((p, i) => {
|
|
20154
|
-
if (p.type === 6 && p.name === "style" && p.value) {
|
|
20154
|
+
if (p.type === "6" && p.name === "style" && p.value) {
|
|
20155
20155
|
node.props[i] = {
|
|
20156
|
-
type: 7,
|
|
20156
|
+
type: "7",
|
|
20157
20157
|
name: `bind`,
|
|
20158
20158
|
arg: createSimpleExpression(`style`, true, p.loc),
|
|
20159
20159
|
exp: parseInlineCSS(p.value.content, p.loc),
|
|
@@ -20170,7 +20170,7 @@ const parseInlineCSS = (cssText, loc) => {
|
|
|
20170
20170
|
JSON.stringify(normalized),
|
|
20171
20171
|
false,
|
|
20172
20172
|
loc,
|
|
20173
|
-
3
|
|
20173
|
+
"3"
|
|
20174
20174
|
);
|
|
20175
20175
|
};
|
|
20176
20176
|
|
|
@@ -20183,16 +20183,16 @@ function createDOMCompilerError(code, loc) {
|
|
|
20183
20183
|
}
|
|
20184
20184
|
const DOMErrorMessages = {
|
|
20185
20185
|
[51]: `v-html is missing expression.`,
|
|
20186
|
-
[52]: `v-html will override element children.`,
|
|
20187
|
-
[53]: `v-text is missing expression.`,
|
|
20188
|
-
[54]: `v-text will override element children.`,
|
|
20189
|
-
[55]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
20190
|
-
[56]: `v-model argument is not supported on plain elements.`,
|
|
20191
|
-
[57]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
|
20192
|
-
[58]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
20193
|
-
[59]: `v-show is missing expression.`,
|
|
20194
|
-
[60]: `<Transition> expects exactly one child element or component.`,
|
|
20195
|
-
[61]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
20186
|
+
["52"]: `v-html will override element children.`,
|
|
20187
|
+
["53"]: `v-text is missing expression.`,
|
|
20188
|
+
["54"]: `v-text will override element children.`,
|
|
20189
|
+
["55"]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
20190
|
+
["56"]: `v-model argument is not supported on plain elements.`,
|
|
20191
|
+
["57"]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
|
20192
|
+
["58"]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
20193
|
+
["59"]: `v-show is missing expression.`,
|
|
20194
|
+
["60"]: `<Transition> expects exactly one child element or component.`,
|
|
20195
|
+
["61"]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
20196
20196
|
};
|
|
20197
20197
|
|
|
20198
20198
|
const transformVHtml = (dir, node, context) => {
|
|
@@ -20204,7 +20204,7 @@ const transformVHtml = (dir, node, context) => {
|
|
|
20204
20204
|
}
|
|
20205
20205
|
if (node.children.length) {
|
|
20206
20206
|
context.onError(
|
|
20207
|
-
createDOMCompilerError(52, loc)
|
|
20207
|
+
createDOMCompilerError("52", loc)
|
|
20208
20208
|
);
|
|
20209
20209
|
node.children.length = 0;
|
|
20210
20210
|
}
|
|
@@ -20222,12 +20222,12 @@ const transformVText = (dir, node, context) => {
|
|
|
20222
20222
|
const { exp, loc } = dir;
|
|
20223
20223
|
if (!exp) {
|
|
20224
20224
|
context.onError(
|
|
20225
|
-
createDOMCompilerError(53, loc)
|
|
20225
|
+
createDOMCompilerError("53", loc)
|
|
20226
20226
|
);
|
|
20227
20227
|
}
|
|
20228
20228
|
if (node.children.length) {
|
|
20229
20229
|
context.onError(
|
|
20230
|
-
createDOMCompilerError(54, loc)
|
|
20230
|
+
createDOMCompilerError("54", loc)
|
|
20231
20231
|
);
|
|
20232
20232
|
node.children.length = 0;
|
|
20233
20233
|
}
|
|
@@ -20247,13 +20247,13 @@ const transformVText = (dir, node, context) => {
|
|
|
20247
20247
|
|
|
20248
20248
|
const transformModel = (dir, node, context) => {
|
|
20249
20249
|
const baseResult = transformModel$1(dir, node, context);
|
|
20250
|
-
if (!baseResult.props.length || node.tagType === 1) {
|
|
20250
|
+
if (!baseResult.props.length || node.tagType === "1") {
|
|
20251
20251
|
return baseResult;
|
|
20252
20252
|
}
|
|
20253
20253
|
if (dir.arg) {
|
|
20254
20254
|
context.onError(
|
|
20255
20255
|
createDOMCompilerError(
|
|
20256
|
-
56,
|
|
20256
|
+
"56",
|
|
20257
20257
|
dir.arg.loc
|
|
20258
20258
|
)
|
|
20259
20259
|
);
|
|
@@ -20263,7 +20263,7 @@ const transformModel = (dir, node, context) => {
|
|
|
20263
20263
|
if (value) {
|
|
20264
20264
|
context.onError(
|
|
20265
20265
|
createDOMCompilerError(
|
|
20266
|
-
58,
|
|
20266
|
+
"58",
|
|
20267
20267
|
value.loc
|
|
20268
20268
|
)
|
|
20269
20269
|
);
|
|
@@ -20277,7 +20277,7 @@ const transformModel = (dir, node, context) => {
|
|
|
20277
20277
|
if (tag === "input" || isCustomElement) {
|
|
20278
20278
|
const type = findProp(node, `type`);
|
|
20279
20279
|
if (type) {
|
|
20280
|
-
if (type.type === 7) {
|
|
20280
|
+
if (type.type === "7") {
|
|
20281
20281
|
directiveToUse = V_MODEL_DYNAMIC;
|
|
20282
20282
|
} else if (type.value) {
|
|
20283
20283
|
switch (type.value.content) {
|
|
@@ -20291,7 +20291,7 @@ const transformModel = (dir, node, context) => {
|
|
|
20291
20291
|
isInvalidType = true;
|
|
20292
20292
|
context.onError(
|
|
20293
20293
|
createDOMCompilerError(
|
|
20294
|
-
57,
|
|
20294
|
+
"57",
|
|
20295
20295
|
dir.loc
|
|
20296
20296
|
)
|
|
20297
20297
|
);
|
|
@@ -20317,13 +20317,13 @@ const transformModel = (dir, node, context) => {
|
|
|
20317
20317
|
} else {
|
|
20318
20318
|
context.onError(
|
|
20319
20319
|
createDOMCompilerError(
|
|
20320
|
-
55,
|
|
20320
|
+
"55",
|
|
20321
20321
|
dir.loc
|
|
20322
20322
|
)
|
|
20323
20323
|
);
|
|
20324
20324
|
}
|
|
20325
20325
|
baseResult.props = baseResult.props.filter(
|
|
20326
|
-
(p) => !(p.key.type === 4 && p.key.content === "modelValue")
|
|
20326
|
+
(p) => !(p.key.type === "4" && p.key.content === "modelValue")
|
|
20327
20327
|
);
|
|
20328
20328
|
return baseResult;
|
|
20329
20329
|
};
|
|
@@ -20381,7 +20381,7 @@ const resolveModifiers = (key, modifiers, context, loc) => {
|
|
|
20381
20381
|
};
|
|
20382
20382
|
const transformClick = (key, event) => {
|
|
20383
20383
|
const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === "onclick";
|
|
20384
|
-
return isStaticClick ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([
|
|
20384
|
+
return isStaticClick ? createSimpleExpression(event, true) : key.type !== "4" ? createCompoundExpression([
|
|
20385
20385
|
`(`,
|
|
20386
20386
|
key,
|
|
20387
20387
|
`) === "onClick" ? "${event}" : (`,
|
|
@@ -20429,7 +20429,7 @@ const transformShow = (dir, node, context) => {
|
|
|
20429
20429
|
const { exp, loc } = dir;
|
|
20430
20430
|
if (!exp) {
|
|
20431
20431
|
context.onError(
|
|
20432
|
-
createDOMCompilerError(59, loc)
|
|
20432
|
+
createDOMCompilerError("59", loc)
|
|
20433
20433
|
);
|
|
20434
20434
|
}
|
|
20435
20435
|
return {
|
|
@@ -20439,7 +20439,7 @@ const transformShow = (dir, node, context) => {
|
|
|
20439
20439
|
};
|
|
20440
20440
|
|
|
20441
20441
|
const transformTransition = (node, context) => {
|
|
20442
|
-
if (node.type === "
|
|
20442
|
+
if (node.type === "1" && node.tagType === "1") {
|
|
20443
20443
|
const component = context.isBuiltInComponent(node.tag);
|
|
20444
20444
|
if (component === TRANSITION) {
|
|
20445
20445
|
return () => {
|
|
@@ -20449,7 +20449,7 @@ const transformTransition = (node, context) => {
|
|
|
20449
20449
|
if (hasMultipleChildren(node)) {
|
|
20450
20450
|
context.onError(
|
|
20451
20451
|
createDOMCompilerError(
|
|
20452
|
-
60,
|
|
20452
|
+
"60",
|
|
20453
20453
|
{
|
|
20454
20454
|
start: node.children[0].loc.start,
|
|
20455
20455
|
end: node.children[node.children.length - 1].loc.end,
|
|
@@ -20459,11 +20459,11 @@ const transformTransition = (node, context) => {
|
|
|
20459
20459
|
);
|
|
20460
20460
|
}
|
|
20461
20461
|
const child = node.children[0];
|
|
20462
|
-
if (child.type === "
|
|
20462
|
+
if (child.type === "1") {
|
|
20463
20463
|
for (const p of child.props) {
|
|
20464
|
-
if (p.type === 7 && p.name === "show") {
|
|
20464
|
+
if (p.type === "7" && p.name === "show") {
|
|
20465
20465
|
node.props.push({
|
|
20466
|
-
type: 6,
|
|
20466
|
+
type: "6",
|
|
20467
20467
|
name: "persisted",
|
|
20468
20468
|
value: void 0,
|
|
20469
20469
|
loc: node.loc
|
|
@@ -20477,10 +20477,10 @@ const transformTransition = (node, context) => {
|
|
|
20477
20477
|
};
|
|
20478
20478
|
function hasMultipleChildren(node) {
|
|
20479
20479
|
const children = node.children = node.children.filter(
|
|
20480
|
-
(c) => c.type !== "
|
|
20480
|
+
(c) => c.type !== "3" && !(c.type === "2" && !c.content.trim())
|
|
20481
20481
|
);
|
|
20482
20482
|
const child = children[0];
|
|
20483
|
-
return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren);
|
|
20483
|
+
return children.length !== 1 || child.type === "11" || child.type === "9" && child.branches.some(hasMultipleChildren);
|
|
20484
20484
|
}
|
|
20485
20485
|
|
|
20486
20486
|
const expReplaceRE = /__VUE_EXP_START__(.*?)__VUE_EXP_END__/g;
|
|
@@ -20534,10 +20534,10 @@ const stringifyStatic = (children, context, parent) => {
|
|
|
20534
20534
|
}
|
|
20535
20535
|
stringifyCurrentChunk(i);
|
|
20536
20536
|
};
|
|
20537
|
-
const getHoistedNode = (node) => (node.type === "
|
|
20537
|
+
const getHoistedNode = (node) => (node.type === "1" && node.tagType === "0" || node.type == "12") && node.codegenNode && node.codegenNode.type === "4" && node.codegenNode.hoisted;
|
|
20538
20538
|
const dataAriaRE = /^(data|aria)-/;
|
|
20539
20539
|
const isStringifiableAttr = (name, ns) => {
|
|
20540
|
-
return (ns === 0 ? isKnownHtmlAttr(name) : ns === 1 ? isKnownSvgAttr(name) : false) || dataAriaRE.test(name);
|
|
20540
|
+
return (ns === 0 ? isKnownHtmlAttr(name) : ns === "1" ? isKnownSvgAttr(name) : false) || dataAriaRE.test(name);
|
|
20541
20541
|
};
|
|
20542
20542
|
const replaceHoist = (node, replacement, context) => {
|
|
20543
20543
|
const hoistToReplace = node.codegenNode.hoisted;
|
|
@@ -20547,10 +20547,10 @@ const isNonStringifiable = /* @__PURE__ */ makeMap(
|
|
|
20547
20547
|
`caption,thead,tr,th,tbody,td,tfoot,colgroup,col`
|
|
20548
20548
|
);
|
|
20549
20549
|
function analyzeNode(node) {
|
|
20550
|
-
if (node.type === "
|
|
20550
|
+
if (node.type === "1" && isNonStringifiable(node.tag)) {
|
|
20551
20551
|
return false;
|
|
20552
20552
|
}
|
|
20553
|
-
if (node.type === 12) {
|
|
20553
|
+
if (node.type === "12") {
|
|
20554
20554
|
return [1, 0];
|
|
20555
20555
|
}
|
|
20556
20556
|
let nc = 1;
|
|
@@ -20563,14 +20563,14 @@ function analyzeNode(node) {
|
|
|
20563
20563
|
function walk(node2) {
|
|
20564
20564
|
for (let i = 0; i < node2.props.length; i++) {
|
|
20565
20565
|
const p = node2.props[i];
|
|
20566
|
-
if (p.type === 6 && !isStringifiableAttr(p.name, node2.ns)) {
|
|
20566
|
+
if (p.type === "6" && !isStringifiableAttr(p.name, node2.ns)) {
|
|
20567
20567
|
return bail();
|
|
20568
20568
|
}
|
|
20569
|
-
if (p.type === 7 && p.name === "bind") {
|
|
20570
|
-
if (p.arg && (p.arg.type === 8 || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node2.ns))) {
|
|
20569
|
+
if (p.type === "7" && p.name === "bind") {
|
|
20570
|
+
if (p.arg && (p.arg.type === "8" || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node2.ns))) {
|
|
20571
20571
|
return bail();
|
|
20572
20572
|
}
|
|
20573
|
-
if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) {
|
|
20573
|
+
if (p.exp && (p.exp.type === "8" || p.exp.constType < "3")) {
|
|
20574
20574
|
return bail();
|
|
20575
20575
|
}
|
|
20576
20576
|
}
|
|
@@ -20578,7 +20578,7 @@ function analyzeNode(node) {
|
|
|
20578
20578
|
for (let i = 0; i < node2.children.length; i++) {
|
|
20579
20579
|
nc++;
|
|
20580
20580
|
const child = node2.children[i];
|
|
20581
|
-
if (child.type === "
|
|
20581
|
+
if (child.type === "1") {
|
|
20582
20582
|
if (child.props.length > 0) {
|
|
20583
20583
|
ec++;
|
|
20584
20584
|
}
|
|
@@ -20600,17 +20600,17 @@ function stringifyNode(node, context) {
|
|
|
20600
20600
|
return ``;
|
|
20601
20601
|
}
|
|
20602
20602
|
switch (node.type) {
|
|
20603
|
-
case "
|
|
20603
|
+
case "1":
|
|
20604
20604
|
return stringifyElement(node, context);
|
|
20605
|
-
case "
|
|
20605
|
+
case "2":
|
|
20606
20606
|
return escapeHtml(node.content);
|
|
20607
|
-
case "
|
|
20607
|
+
case "3":
|
|
20608
20608
|
return `<!--${escapeHtml(node.content)}-->`;
|
|
20609
|
-
case 5:
|
|
20609
|
+
case "5":
|
|
20610
20610
|
return escapeHtml(toDisplayString(evaluateConstant(node.content)));
|
|
20611
|
-
case 8:
|
|
20611
|
+
case "8":
|
|
20612
20612
|
return escapeHtml(evaluateConstant(node));
|
|
20613
|
-
case 12:
|
|
20613
|
+
case "12":
|
|
20614
20614
|
return stringifyNode(node.content, context);
|
|
20615
20615
|
default:
|
|
20616
20616
|
return "";
|
|
@@ -20621,12 +20621,12 @@ function stringifyElement(node, context) {
|
|
|
20621
20621
|
let innerHTML = "";
|
|
20622
20622
|
for (let i = 0; i < node.props.length; i++) {
|
|
20623
20623
|
const p = node.props[i];
|
|
20624
|
-
if (p.type === 6) {
|
|
20624
|
+
if (p.type === "6") {
|
|
20625
20625
|
res += ` ${p.name}`;
|
|
20626
20626
|
if (p.value) {
|
|
20627
20627
|
res += `="${escapeHtml(p.value.content)}"`;
|
|
20628
20628
|
}
|
|
20629
|
-
} else if (p.type === 7) {
|
|
20629
|
+
} else if (p.type === "7") {
|
|
20630
20630
|
if (p.name === "bind") {
|
|
20631
20631
|
const exp = p.exp;
|
|
20632
20632
|
if (exp.content[0] === "_") {
|
|
@@ -20674,7 +20674,7 @@ function stringifyElement(node, context) {
|
|
|
20674
20674
|
return res;
|
|
20675
20675
|
}
|
|
20676
20676
|
function evaluateConstant(exp) {
|
|
20677
|
-
if (exp.type === 4) {
|
|
20677
|
+
if (exp.type === "4") {
|
|
20678
20678
|
return new Function(`return ${exp.content}`)();
|
|
20679
20679
|
} else {
|
|
20680
20680
|
let res = ``;
|
|
@@ -20682,9 +20682,9 @@ function evaluateConstant(exp) {
|
|
|
20682
20682
|
if (isString(c) || isSymbol(c)) {
|
|
20683
20683
|
return;
|
|
20684
20684
|
}
|
|
20685
|
-
if (c.type === "
|
|
20685
|
+
if (c.type === "2") {
|
|
20686
20686
|
res += c.content;
|
|
20687
|
-
} else if (c.type === 5) {
|
|
20687
|
+
} else if (c.type === "5") {
|
|
20688
20688
|
res += toDisplayString(evaluateConstant(c.content));
|
|
20689
20689
|
} else {
|
|
20690
20690
|
res += evaluateConstant(c);
|
|
@@ -20695,9 +20695,9 @@ function evaluateConstant(exp) {
|
|
|
20695
20695
|
}
|
|
20696
20696
|
|
|
20697
20697
|
const ignoreSideEffectTags = (node, context) => {
|
|
20698
|
-
if (node.type === "
|
|
20698
|
+
if (node.type === "1" && node.tagType === "0" && (node.tag === "script" || node.tag === "style")) {
|
|
20699
20699
|
context.onError(
|
|
20700
|
-
createDOMCompilerError(61, node.loc)
|
|
20700
|
+
createDOMCompilerError("61", node.loc)
|
|
20701
20701
|
);
|
|
20702
20702
|
context.removeNode();
|
|
20703
20703
|
}
|