@vue/compat 3.3.0-alpha.3 → 3.3.0-alpha.4
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.esm-browser.js
CHANGED
|
@@ -1465,7 +1465,7 @@ function warn(msg, ...args) {
|
|
|
1465
1465
|
callWithErrorHandling(
|
|
1466
1466
|
appWarnHandler,
|
|
1467
1467
|
instance,
|
|
1468
|
-
|
|
1468
|
+
11,
|
|
1469
1469
|
[
|
|
1470
1470
|
msg + args.join(""),
|
|
1471
1471
|
instance && instance.proxy,
|
|
@@ -1578,21 +1578,21 @@ const ErrorTypeStrings = {
|
|
|
1578
1578
|
["ec"]: "errorCaptured hook",
|
|
1579
1579
|
["rtc"]: "renderTracked hook",
|
|
1580
1580
|
["rtg"]: "renderTriggered hook",
|
|
1581
|
-
[
|
|
1582
|
-
[
|
|
1583
|
-
[
|
|
1584
|
-
[
|
|
1585
|
-
[
|
|
1586
|
-
[
|
|
1587
|
-
[
|
|
1588
|
-
[
|
|
1589
|
-
[
|
|
1590
|
-
[
|
|
1591
|
-
[
|
|
1592
|
-
[
|
|
1593
|
-
[
|
|
1594
|
-
[
|
|
1595
|
-
[
|
|
1581
|
+
[0]: "setup function",
|
|
1582
|
+
[1]: "render function",
|
|
1583
|
+
[2]: "watcher getter",
|
|
1584
|
+
[3]: "watcher callback",
|
|
1585
|
+
[4]: "watcher cleanup function",
|
|
1586
|
+
[5]: "native event handler",
|
|
1587
|
+
[6]: "component event handler",
|
|
1588
|
+
[7]: "vnode hook",
|
|
1589
|
+
[8]: "directive hook",
|
|
1590
|
+
[9]: "transition hook",
|
|
1591
|
+
[10]: "app errorHandler",
|
|
1592
|
+
[11]: "app warnHandler",
|
|
1593
|
+
[12]: "ref function",
|
|
1594
|
+
[13]: "async component loader",
|
|
1595
|
+
[14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
|
|
1596
1596
|
};
|
|
1597
1597
|
function callWithErrorHandling(fn, instance, type, args) {
|
|
1598
1598
|
let res;
|
|
@@ -1641,7 +1641,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
1641
1641
|
callWithErrorHandling(
|
|
1642
1642
|
appErrorHandler,
|
|
1643
1643
|
null,
|
|
1644
|
-
|
|
1644
|
+
10,
|
|
1645
1645
|
[err, exposedInstance, errorInfo]
|
|
1646
1646
|
);
|
|
1647
1647
|
return;
|
|
@@ -1794,7 +1794,7 @@ function flushJobs(seen) {
|
|
|
1794
1794
|
if (check(job)) {
|
|
1795
1795
|
continue;
|
|
1796
1796
|
}
|
|
1797
|
-
callWithErrorHandling(job, null,
|
|
1797
|
+
callWithErrorHandling(job, null, 14);
|
|
1798
1798
|
}
|
|
1799
1799
|
}
|
|
1800
1800
|
} finally {
|
|
@@ -2412,7 +2412,7 @@ function emit$1(instance, event, args) {
|
|
|
2412
2412
|
callWithAsyncErrorHandling(
|
|
2413
2413
|
cbs.map((cb) => cb.bind(instance.proxy)),
|
|
2414
2414
|
instance,
|
|
2415
|
-
|
|
2415
|
+
6,
|
|
2416
2416
|
args
|
|
2417
2417
|
);
|
|
2418
2418
|
}
|
|
@@ -2474,7 +2474,7 @@ function compatModelEmit(instance, event, args) {
|
|
|
2474
2474
|
callWithErrorHandling(
|
|
2475
2475
|
modelHandler,
|
|
2476
2476
|
instance,
|
|
2477
|
-
|
|
2477
|
+
6,
|
|
2478
2478
|
args
|
|
2479
2479
|
);
|
|
2480
2480
|
}
|
|
@@ -2546,7 +2546,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
2546
2546
|
callWithAsyncErrorHandling(
|
|
2547
2547
|
handler,
|
|
2548
2548
|
instance,
|
|
2549
|
-
|
|
2549
|
+
6,
|
|
2550
2550
|
args
|
|
2551
2551
|
);
|
|
2552
2552
|
}
|
|
@@ -2561,7 +2561,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
2561
2561
|
callWithAsyncErrorHandling(
|
|
2562
2562
|
onceHandler,
|
|
2563
2563
|
instance,
|
|
2564
|
-
|
|
2564
|
+
6,
|
|
2565
2565
|
args
|
|
2566
2566
|
);
|
|
2567
2567
|
}
|
|
@@ -2745,7 +2745,7 @@ function renderComponentRoot(instance) {
|
|
|
2745
2745
|
}
|
|
2746
2746
|
} catch (err) {
|
|
2747
2747
|
blockStack.length = 0;
|
|
2748
|
-
handleError(err, instance,
|
|
2748
|
+
handleError(err, instance, 1);
|
|
2749
2749
|
result = createVNode(Comment);
|
|
2750
2750
|
}
|
|
2751
2751
|
let root = result;
|
|
@@ -3272,7 +3272,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3272
3272
|
if (delayEnter) {
|
|
3273
3273
|
activeBranch.transition.afterLeave = () => {
|
|
3274
3274
|
if (pendingId === suspense.pendingId) {
|
|
3275
|
-
move(pendingBranch, container2, anchor2,
|
|
3275
|
+
move(pendingBranch, container2, anchor2, 0);
|
|
3276
3276
|
}
|
|
3277
3277
|
};
|
|
3278
3278
|
}
|
|
@@ -3282,7 +3282,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3282
3282
|
unmount(activeBranch, parentComponent2, suspense, true);
|
|
3283
3283
|
}
|
|
3284
3284
|
if (!delayEnter) {
|
|
3285
|
-
move(pendingBranch, container2, anchor2,
|
|
3285
|
+
move(pendingBranch, container2, anchor2, 0);
|
|
3286
3286
|
}
|
|
3287
3287
|
}
|
|
3288
3288
|
setActiveBranch(suspense, pendingBranch);
|
|
@@ -3360,7 +3360,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
3360
3360
|
}
|
|
3361
3361
|
const hydratedEl = instance.vnode.el;
|
|
3362
3362
|
instance.asyncDep.catch((err) => {
|
|
3363
|
-
handleError(err, instance,
|
|
3363
|
+
handleError(err, instance, 0);
|
|
3364
3364
|
}).then((asyncSetupResult) => {
|
|
3365
3365
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
|
|
3366
3366
|
return;
|
|
@@ -3604,14 +3604,14 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3604
3604
|
} else if (isReactive(s)) {
|
|
3605
3605
|
return traverse(s);
|
|
3606
3606
|
} else if (isFunction(s)) {
|
|
3607
|
-
return callWithErrorHandling(s, instance,
|
|
3607
|
+
return callWithErrorHandling(s, instance, 2);
|
|
3608
3608
|
} else {
|
|
3609
3609
|
warnInvalidSource(s);
|
|
3610
3610
|
}
|
|
3611
3611
|
});
|
|
3612
3612
|
} else if (isFunction(source)) {
|
|
3613
3613
|
if (cb) {
|
|
3614
|
-
getter = () => callWithErrorHandling(source, instance,
|
|
3614
|
+
getter = () => callWithErrorHandling(source, instance, 2);
|
|
3615
3615
|
} else {
|
|
3616
3616
|
getter = () => {
|
|
3617
3617
|
if (instance && instance.isUnmounted) {
|
|
@@ -3623,7 +3623,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3623
3623
|
return callWithAsyncErrorHandling(
|
|
3624
3624
|
source,
|
|
3625
3625
|
instance,
|
|
3626
|
-
|
|
3626
|
+
3,
|
|
3627
3627
|
[onCleanup]
|
|
3628
3628
|
);
|
|
3629
3629
|
};
|
|
@@ -3649,7 +3649,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3649
3649
|
let cleanup;
|
|
3650
3650
|
let onCleanup = (fn) => {
|
|
3651
3651
|
cleanup = effect.onStop = () => {
|
|
3652
|
-
callWithErrorHandling(fn, instance,
|
|
3652
|
+
callWithErrorHandling(fn, instance, 4);
|
|
3653
3653
|
};
|
|
3654
3654
|
};
|
|
3655
3655
|
let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
|
|
@@ -3665,7 +3665,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3665
3665
|
if (cleanup) {
|
|
3666
3666
|
cleanup();
|
|
3667
3667
|
}
|
|
3668
|
-
callWithAsyncErrorHandling(cb, instance,
|
|
3668
|
+
callWithAsyncErrorHandling(cb, instance, 3, [
|
|
3669
3669
|
newValue,
|
|
3670
3670
|
// pass undefined as the old value when it's changed for the first time
|
|
3671
3671
|
oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
|
|
@@ -3943,7 +3943,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
|
|
|
3943
3943
|
hook && callWithAsyncErrorHandling(
|
|
3944
3944
|
hook,
|
|
3945
3945
|
instance,
|
|
3946
|
-
|
|
3946
|
+
9,
|
|
3947
3947
|
args
|
|
3948
3948
|
);
|
|
3949
3949
|
};
|
|
@@ -4175,7 +4175,7 @@ function defineAsyncComponent(source) {
|
|
|
4175
4175
|
handleError(
|
|
4176
4176
|
err,
|
|
4177
4177
|
instance,
|
|
4178
|
-
|
|
4178
|
+
13,
|
|
4179
4179
|
!errorComponent
|
|
4180
4180
|
/* do not throw in dev if user provided error component */
|
|
4181
4181
|
);
|
|
@@ -4274,7 +4274,7 @@ const KeepAliveImpl = {
|
|
|
4274
4274
|
const storageContainer = createElement("div");
|
|
4275
4275
|
sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
|
|
4276
4276
|
const instance2 = vnode.component;
|
|
4277
|
-
move(vnode, container, anchor,
|
|
4277
|
+
move(vnode, container, anchor, 0, parentSuspense);
|
|
4278
4278
|
patch(
|
|
4279
4279
|
instance2.vnode,
|
|
4280
4280
|
vnode,
|
|
@@ -4302,7 +4302,7 @@ const KeepAliveImpl = {
|
|
|
4302
4302
|
};
|
|
4303
4303
|
sharedContext.deactivate = (vnode) => {
|
|
4304
4304
|
const instance2 = vnode.component;
|
|
4305
|
-
move(vnode, storageContainer, null,
|
|
4305
|
+
move(vnode, storageContainer, null, 1, parentSuspense);
|
|
4306
4306
|
queuePostRenderEffect(() => {
|
|
4307
4307
|
if (instance2.da) {
|
|
4308
4308
|
invokeArrayFns(instance2.da);
|
|
@@ -4660,7 +4660,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
4660
4660
|
}
|
|
4661
4661
|
if (hook) {
|
|
4662
4662
|
pauseTracking();
|
|
4663
|
-
callWithAsyncErrorHandling(hook, instance,
|
|
4663
|
+
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
4664
4664
|
vnode.el,
|
|
4665
4665
|
binding,
|
|
4666
4666
|
vnode,
|
|
@@ -6643,7 +6643,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6643
6643
|
return vm;
|
|
6644
6644
|
}
|
|
6645
6645
|
}
|
|
6646
|
-
Vue.version = `2.6.14-compat:${"3.3.0-alpha.
|
|
6646
|
+
Vue.version = `2.6.14-compat:${"3.3.0-alpha.4"}`;
|
|
6647
6647
|
Vue.config = singletonApp.config;
|
|
6648
6648
|
Vue.use = (p, ...options) => {
|
|
6649
6649
|
if (p && isFunction(p.install)) {
|
|
@@ -7224,7 +7224,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
7224
7224
|
}
|
|
7225
7225
|
}
|
|
7226
7226
|
if (isFunction(ref)) {
|
|
7227
|
-
callWithErrorHandling(ref, owner,
|
|
7227
|
+
callWithErrorHandling(ref, owner, 12, [value, refs]);
|
|
7228
7228
|
} else {
|
|
7229
7229
|
const _isString = isString(ref);
|
|
7230
7230
|
const _isRef = isRef(ref);
|
|
@@ -8897,7 +8897,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8897
8897
|
);
|
|
8898
8898
|
} else if (moved) {
|
|
8899
8899
|
if (j < 0 || i !== increasingNewIndexSequence[j]) {
|
|
8900
|
-
move(nextChild, container, anchor,
|
|
8900
|
+
move(nextChild, container, anchor, 2);
|
|
8901
8901
|
} else {
|
|
8902
8902
|
j--;
|
|
8903
8903
|
}
|
|
@@ -8931,9 +8931,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8931
8931
|
moveStaticNode(vnode, container, anchor);
|
|
8932
8932
|
return;
|
|
8933
8933
|
}
|
|
8934
|
-
const needTransition = moveType !==
|
|
8934
|
+
const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
|
|
8935
8935
|
if (needTransition) {
|
|
8936
|
-
if (moveType ===
|
|
8936
|
+
if (moveType === 0) {
|
|
8937
8937
|
transition.beforeEnter(el);
|
|
8938
8938
|
hostInsert(el, container, anchor);
|
|
8939
8939
|
queuePostRenderEffect(() => transition.enter(el), parentSuspense);
|
|
@@ -9340,7 +9340,7 @@ const TeleportImpl = {
|
|
|
9340
9340
|
container,
|
|
9341
9341
|
mainAnchor,
|
|
9342
9342
|
internals,
|
|
9343
|
-
|
|
9343
|
+
1
|
|
9344
9344
|
);
|
|
9345
9345
|
}
|
|
9346
9346
|
} else {
|
|
@@ -9355,7 +9355,7 @@ const TeleportImpl = {
|
|
|
9355
9355
|
nextTarget,
|
|
9356
9356
|
null,
|
|
9357
9357
|
internals,
|
|
9358
|
-
|
|
9358
|
+
0
|
|
9359
9359
|
);
|
|
9360
9360
|
} else {
|
|
9361
9361
|
warn(
|
|
@@ -9370,7 +9370,7 @@ const TeleportImpl = {
|
|
|
9370
9370
|
target,
|
|
9371
9371
|
targetAnchor,
|
|
9372
9372
|
internals,
|
|
9373
|
-
|
|
9373
|
+
1
|
|
9374
9374
|
);
|
|
9375
9375
|
}
|
|
9376
9376
|
}
|
|
@@ -9401,12 +9401,12 @@ const TeleportImpl = {
|
|
|
9401
9401
|
move: moveTeleport,
|
|
9402
9402
|
hydrate: hydrateTeleport
|
|
9403
9403
|
};
|
|
9404
|
-
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType =
|
|
9405
|
-
if (moveType ===
|
|
9404
|
+
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
|
|
9405
|
+
if (moveType === 0) {
|
|
9406
9406
|
insert(vnode.targetAnchor, container, parentAnchor);
|
|
9407
9407
|
}
|
|
9408
9408
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
9409
|
-
const isReorder = moveType ===
|
|
9409
|
+
const isReorder = moveType === 2;
|
|
9410
9410
|
if (isReorder) {
|
|
9411
9411
|
insert(el, container, parentAnchor);
|
|
9412
9412
|
}
|
|
@@ -9417,7 +9417,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
9417
9417
|
children[i],
|
|
9418
9418
|
container,
|
|
9419
9419
|
parentAnchor,
|
|
9420
|
-
|
|
9420
|
+
2
|
|
9421
9421
|
);
|
|
9422
9422
|
}
|
|
9423
9423
|
}
|
|
@@ -9906,7 +9906,7 @@ function mergeProps(...args) {
|
|
|
9906
9906
|
return ret;
|
|
9907
9907
|
}
|
|
9908
9908
|
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
9909
|
-
callWithAsyncErrorHandling(hook, instance,
|
|
9909
|
+
callWithAsyncErrorHandling(hook, instance, 7, [
|
|
9910
9910
|
vnode,
|
|
9911
9911
|
prevVNode
|
|
9912
9912
|
]);
|
|
@@ -10072,7 +10072,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10072
10072
|
const setupResult = callWithErrorHandling(
|
|
10073
10073
|
setup,
|
|
10074
10074
|
instance,
|
|
10075
|
-
|
|
10075
|
+
0,
|
|
10076
10076
|
[shallowReadonly(instance.props) , setupContext]
|
|
10077
10077
|
);
|
|
10078
10078
|
resetTracking();
|
|
@@ -10083,7 +10083,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10083
10083
|
return setupResult.then((resolvedResult) => {
|
|
10084
10084
|
handleSetupResult(instance, resolvedResult, isSSR);
|
|
10085
10085
|
}).catch((e) => {
|
|
10086
|
-
handleError(e, instance,
|
|
10086
|
+
handleError(e, instance, 0);
|
|
10087
10087
|
});
|
|
10088
10088
|
} else {
|
|
10089
10089
|
instance.asyncDep = setupResult;
|
|
@@ -10635,7 +10635,7 @@ function isMemoSame(cached, memo) {
|
|
|
10635
10635
|
return true;
|
|
10636
10636
|
}
|
|
10637
10637
|
|
|
10638
|
-
const version = "3.3.0-alpha.
|
|
10638
|
+
const version = "3.3.0-alpha.4";
|
|
10639
10639
|
const ssrUtils = null;
|
|
10640
10640
|
const resolveFilter = resolveFilter$1 ;
|
|
10641
10641
|
const _compatUtils = {
|
|
@@ -10967,7 +10967,7 @@ function createInvoker(initialValue, instance) {
|
|
|
10967
10967
|
callWithAsyncErrorHandling(
|
|
10968
10968
|
patchStopImmediatePropagation(e, invoker.value),
|
|
10969
10969
|
instance,
|
|
10970
|
-
|
|
10970
|
+
5,
|
|
10971
10971
|
[e]
|
|
10972
10972
|
);
|
|
10973
10973
|
};
|
|
@@ -12445,63 +12445,63 @@ function createCompilerError(code, loc, messages, additionalMessage) {
|
|
|
12445
12445
|
}
|
|
12446
12446
|
const errorMessages = {
|
|
12447
12447
|
// parse errors
|
|
12448
|
-
[
|
|
12449
|
-
[
|
|
12450
|
-
[
|
|
12451
|
-
[
|
|
12452
|
-
[
|
|
12453
|
-
[
|
|
12454
|
-
[
|
|
12455
|
-
[
|
|
12456
|
-
[
|
|
12457
|
-
[
|
|
12458
|
-
[
|
|
12459
|
-
[
|
|
12460
|
-
[
|
|
12461
|
-
[
|
|
12462
|
-
[
|
|
12463
|
-
[
|
|
12464
|
-
[
|
|
12465
|
-
[
|
|
12466
|
-
[
|
|
12467
|
-
[
|
|
12468
|
-
[
|
|
12469
|
-
[
|
|
12470
|
-
[
|
|
12448
|
+
[0]: "Illegal comment.",
|
|
12449
|
+
[1]: "CDATA section is allowed only in XML context.",
|
|
12450
|
+
[2]: "Duplicate attribute.",
|
|
12451
|
+
[3]: "End tag cannot have attributes.",
|
|
12452
|
+
[4]: "Illegal '/' in tags.",
|
|
12453
|
+
[5]: "Unexpected EOF in tag.",
|
|
12454
|
+
[6]: "Unexpected EOF in CDATA section.",
|
|
12455
|
+
[7]: "Unexpected EOF in comment.",
|
|
12456
|
+
[8]: "Unexpected EOF in script.",
|
|
12457
|
+
[9]: "Unexpected EOF in tag.",
|
|
12458
|
+
[10]: "Incorrectly closed comment.",
|
|
12459
|
+
[11]: "Incorrectly opened comment.",
|
|
12460
|
+
[12]: "Illegal tag name. Use '<' to print '<'.",
|
|
12461
|
+
[13]: "Attribute value was expected.",
|
|
12462
|
+
[14]: "End tag name was expected.",
|
|
12463
|
+
[15]: "Whitespace was expected.",
|
|
12464
|
+
[16]: "Unexpected '<!--' in comment.",
|
|
12465
|
+
[17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
|
|
12466
|
+
[18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
|
|
12467
|
+
[19]: "Attribute name cannot start with '='.",
|
|
12468
|
+
[21]: "'<?' is allowed only in XML context.",
|
|
12469
|
+
[20]: `Unexpected null character.`,
|
|
12470
|
+
[22]: "Illegal '/' in tags.",
|
|
12471
12471
|
// Vue-specific parse errors
|
|
12472
|
-
[
|
|
12473
|
-
[
|
|
12474
|
-
[
|
|
12475
|
-
[
|
|
12476
|
-
[
|
|
12472
|
+
[23]: "Invalid end tag.",
|
|
12473
|
+
[24]: "Element is missing end tag.",
|
|
12474
|
+
[25]: "Interpolation end sign was not found.",
|
|
12475
|
+
[27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
|
|
12476
|
+
[26]: "Legal directive name was expected.",
|
|
12477
12477
|
// transform errors
|
|
12478
|
-
[
|
|
12479
|
-
[
|
|
12480
|
-
[
|
|
12481
|
-
[
|
|
12482
|
-
[
|
|
12483
|
-
[
|
|
12484
|
-
[
|
|
12485
|
-
[
|
|
12486
|
-
[
|
|
12487
|
-
[
|
|
12488
|
-
[
|
|
12489
|
-
[
|
|
12490
|
-
[
|
|
12491
|
-
[
|
|
12492
|
-
[
|
|
12493
|
-
[
|
|
12494
|
-
[
|
|
12478
|
+
[28]: `v-if/v-else-if is missing expression.`,
|
|
12479
|
+
[29]: `v-if/else branches must use unique keys.`,
|
|
12480
|
+
[30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
|
|
12481
|
+
[31]: `v-for is missing expression.`,
|
|
12482
|
+
[32]: `v-for has invalid expression.`,
|
|
12483
|
+
[33]: `<template v-for> key should be placed on the <template> tag.`,
|
|
12484
|
+
[34]: `v-bind is missing expression.`,
|
|
12485
|
+
[35]: `v-on is missing expression.`,
|
|
12486
|
+
[36]: `Unexpected custom directive on <slot> outlet.`,
|
|
12487
|
+
[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.`,
|
|
12488
|
+
[38]: `Duplicate slot names found. `,
|
|
12489
|
+
[39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
|
|
12490
|
+
[40]: `v-slot can only be used on components or <template> tags.`,
|
|
12491
|
+
[41]: `v-model is missing expression.`,
|
|
12492
|
+
[42]: `v-model value must be a valid JavaScript member expression.`,
|
|
12493
|
+
[43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
|
|
12494
|
+
[44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
|
|
12495
12495
|
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
12496
|
-
[
|
|
12497
|
-
[
|
|
12496
|
+
[45]: `Error parsing JavaScript expression: `,
|
|
12497
|
+
[46]: `<KeepAlive> expects exactly one child component.`,
|
|
12498
12498
|
// generic errors
|
|
12499
|
-
[
|
|
12500
|
-
[
|
|
12501
|
-
[
|
|
12502
|
-
[
|
|
12499
|
+
[47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
12500
|
+
[48]: `ES module mode is not supported in this build of compiler.`,
|
|
12501
|
+
[49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
12502
|
+
[50]: `"scopeId" option is only supported in module mode.`,
|
|
12503
12503
|
// just to fulfill types
|
|
12504
|
-
[
|
|
12504
|
+
[51]: ``
|
|
12505
12505
|
};
|
|
12506
12506
|
|
|
12507
12507
|
const FRAGMENT = Symbol(`Fragment` );
|
|
@@ -12599,7 +12599,7 @@ const locStub = {
|
|
|
12599
12599
|
};
|
|
12600
12600
|
function createRoot(children, loc = locStub) {
|
|
12601
12601
|
return {
|
|
12602
|
-
type:
|
|
12602
|
+
type: 0,
|
|
12603
12603
|
children,
|
|
12604
12604
|
helpers: /* @__PURE__ */ new Set(),
|
|
12605
12605
|
components: [],
|
|
@@ -12625,7 +12625,7 @@ function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps,
|
|
|
12625
12625
|
}
|
|
12626
12626
|
}
|
|
12627
12627
|
return {
|
|
12628
|
-
type:
|
|
12628
|
+
type: 13,
|
|
12629
12629
|
tag,
|
|
12630
12630
|
props,
|
|
12631
12631
|
children,
|
|
@@ -12640,21 +12640,21 @@ function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps,
|
|
|
12640
12640
|
}
|
|
12641
12641
|
function createArrayExpression(elements, loc = locStub) {
|
|
12642
12642
|
return {
|
|
12643
|
-
type:
|
|
12643
|
+
type: 17,
|
|
12644
12644
|
loc,
|
|
12645
12645
|
elements
|
|
12646
12646
|
};
|
|
12647
12647
|
}
|
|
12648
12648
|
function createObjectExpression(properties, loc = locStub) {
|
|
12649
12649
|
return {
|
|
12650
|
-
type:
|
|
12650
|
+
type: 15,
|
|
12651
12651
|
loc,
|
|
12652
12652
|
properties
|
|
12653
12653
|
};
|
|
12654
12654
|
}
|
|
12655
12655
|
function createObjectProperty(key, value) {
|
|
12656
12656
|
return {
|
|
12657
|
-
type:
|
|
12657
|
+
type: 16,
|
|
12658
12658
|
loc: locStub,
|
|
12659
12659
|
key: isString(key) ? createSimpleExpression(key, true) : key,
|
|
12660
12660
|
value
|
|
@@ -12662,23 +12662,23 @@ function createObjectProperty(key, value) {
|
|
|
12662
12662
|
}
|
|
12663
12663
|
function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) {
|
|
12664
12664
|
return {
|
|
12665
|
-
type:
|
|
12665
|
+
type: 4,
|
|
12666
12666
|
loc,
|
|
12667
12667
|
content,
|
|
12668
12668
|
isStatic,
|
|
12669
|
-
constType: isStatic ?
|
|
12669
|
+
constType: isStatic ? 3 : constType
|
|
12670
12670
|
};
|
|
12671
12671
|
}
|
|
12672
12672
|
function createCompoundExpression(children, loc = locStub) {
|
|
12673
12673
|
return {
|
|
12674
|
-
type:
|
|
12674
|
+
type: 8,
|
|
12675
12675
|
loc,
|
|
12676
12676
|
children
|
|
12677
12677
|
};
|
|
12678
12678
|
}
|
|
12679
12679
|
function createCallExpression(callee, args = [], loc = locStub) {
|
|
12680
12680
|
return {
|
|
12681
|
-
type:
|
|
12681
|
+
type: 14,
|
|
12682
12682
|
loc,
|
|
12683
12683
|
callee,
|
|
12684
12684
|
arguments: args
|
|
@@ -12686,7 +12686,7 @@ function createCallExpression(callee, args = [], loc = locStub) {
|
|
|
12686
12686
|
}
|
|
12687
12687
|
function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) {
|
|
12688
12688
|
return {
|
|
12689
|
-
type:
|
|
12689
|
+
type: 18,
|
|
12690
12690
|
params,
|
|
12691
12691
|
returns,
|
|
12692
12692
|
newline,
|
|
@@ -12696,7 +12696,7 @@ function createFunctionExpression(params, returns = void 0, newline = false, isS
|
|
|
12696
12696
|
}
|
|
12697
12697
|
function createConditionalExpression(test, consequent, alternate, newline = true) {
|
|
12698
12698
|
return {
|
|
12699
|
-
type:
|
|
12699
|
+
type: 19,
|
|
12700
12700
|
test,
|
|
12701
12701
|
consequent,
|
|
12702
12702
|
alternate,
|
|
@@ -12706,7 +12706,7 @@ function createConditionalExpression(test, consequent, alternate, newline = true
|
|
|
12706
12706
|
}
|
|
12707
12707
|
function createCacheExpression(index, value, isVNode = false) {
|
|
12708
12708
|
return {
|
|
12709
|
-
type:
|
|
12709
|
+
type: 20,
|
|
12710
12710
|
index,
|
|
12711
12711
|
value,
|
|
12712
12712
|
isVNode,
|
|
@@ -12715,13 +12715,13 @@ function createCacheExpression(index, value, isVNode = false) {
|
|
|
12715
12715
|
}
|
|
12716
12716
|
function createBlockStatement(body) {
|
|
12717
12717
|
return {
|
|
12718
|
-
type:
|
|
12718
|
+
type: 21,
|
|
12719
12719
|
body,
|
|
12720
12720
|
loc: locStub
|
|
12721
12721
|
};
|
|
12722
12722
|
}
|
|
12723
12723
|
|
|
12724
|
-
const isStaticExp = (p) => p.type ===
|
|
12724
|
+
const isStaticExp = (p) => p.type === 4 && p.isStatic;
|
|
12725
12725
|
const isBuiltInType = (tag, expected) => tag === expected || tag === hyphenate(expected);
|
|
12726
12726
|
function isCoreComponent(tag) {
|
|
12727
12727
|
if (isBuiltInType(tag, "Teleport")) {
|
|
@@ -12847,7 +12847,7 @@ function assert(condition, msg) {
|
|
|
12847
12847
|
function findDir(node, name, allowEmpty = false) {
|
|
12848
12848
|
for (let i = 0; i < node.props.length; i++) {
|
|
12849
12849
|
const p = node.props[i];
|
|
12850
|
-
if (p.type ===
|
|
12850
|
+
if (p.type === 7 && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) {
|
|
12851
12851
|
return p;
|
|
12852
12852
|
}
|
|
12853
12853
|
}
|
|
@@ -12855,7 +12855,7 @@ function findDir(node, name, allowEmpty = false) {
|
|
|
12855
12855
|
function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
|
|
12856
12856
|
for (let i = 0; i < node.props.length; i++) {
|
|
12857
12857
|
const p = node.props[i];
|
|
12858
|
-
if (p.type ===
|
|
12858
|
+
if (p.type === 6) {
|
|
12859
12859
|
if (dynamicOnly)
|
|
12860
12860
|
continue;
|
|
12861
12861
|
if (p.name === name && (p.value || allowEmpty)) {
|
|
@@ -12871,23 +12871,23 @@ function isStaticArgOf(arg, name) {
|
|
|
12871
12871
|
}
|
|
12872
12872
|
function hasDynamicKeyVBind(node) {
|
|
12873
12873
|
return node.props.some(
|
|
12874
|
-
(p) => p.type ===
|
|
12875
|
-
p.arg.type !==
|
|
12874
|
+
(p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj"
|
|
12875
|
+
p.arg.type !== 4 || // v-bind:[_ctx.foo]
|
|
12876
12876
|
!p.arg.isStatic)
|
|
12877
12877
|
// v-bind:[foo]
|
|
12878
12878
|
);
|
|
12879
12879
|
}
|
|
12880
12880
|
function isText$1(node) {
|
|
12881
|
-
return node.type ===
|
|
12881
|
+
return node.type === 5 || node.type === 2;
|
|
12882
12882
|
}
|
|
12883
12883
|
function isVSlot(p) {
|
|
12884
|
-
return p.type ===
|
|
12884
|
+
return p.type === 7 && p.name === "slot";
|
|
12885
12885
|
}
|
|
12886
12886
|
function isTemplateNode(node) {
|
|
12887
|
-
return node.type ===
|
|
12887
|
+
return node.type === 1 && node.tagType === 3;
|
|
12888
12888
|
}
|
|
12889
12889
|
function isSlotOutlet(node) {
|
|
12890
|
-
return node.type ===
|
|
12890
|
+
return node.type === 1 && node.tagType === 2;
|
|
12891
12891
|
}
|
|
12892
12892
|
function getVNodeHelper(ssr, isComponent) {
|
|
12893
12893
|
return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
|
|
@@ -12897,7 +12897,7 @@ function getVNodeBlockHelper(ssr, isComponent) {
|
|
|
12897
12897
|
}
|
|
12898
12898
|
const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
|
|
12899
12899
|
function getUnnormalizedProps(props, callPath = []) {
|
|
12900
|
-
if (props && !isString(props) && props.type ===
|
|
12900
|
+
if (props && !isString(props) && props.type === 14) {
|
|
12901
12901
|
const callee = props.callee;
|
|
12902
12902
|
if (!isString(callee) && propsHelperSet.has(callee)) {
|
|
12903
12903
|
return getUnnormalizedProps(
|
|
@@ -12910,10 +12910,10 @@ function getUnnormalizedProps(props, callPath = []) {
|
|
|
12910
12910
|
}
|
|
12911
12911
|
function injectProp(node, prop, context) {
|
|
12912
12912
|
let propsWithInjection;
|
|
12913
|
-
let props = node.type ===
|
|
12913
|
+
let props = node.type === 13 ? node.props : node.arguments[2];
|
|
12914
12914
|
let callPath = [];
|
|
12915
12915
|
let parentCall;
|
|
12916
|
-
if (props && !isString(props) && props.type ===
|
|
12916
|
+
if (props && !isString(props) && props.type === 14) {
|
|
12917
12917
|
const ret = getUnnormalizedProps(props);
|
|
12918
12918
|
props = ret[0];
|
|
12919
12919
|
callPath = ret[1];
|
|
@@ -12921,9 +12921,9 @@ function injectProp(node, prop, context) {
|
|
|
12921
12921
|
}
|
|
12922
12922
|
if (props == null || isString(props)) {
|
|
12923
12923
|
propsWithInjection = createObjectExpression([prop]);
|
|
12924
|
-
} else if (props.type ===
|
|
12924
|
+
} else if (props.type === 14) {
|
|
12925
12925
|
const first = props.arguments[0];
|
|
12926
|
-
if (!isString(first) && first.type ===
|
|
12926
|
+
if (!isString(first) && first.type === 15) {
|
|
12927
12927
|
if (!hasProp(prop, first)) {
|
|
12928
12928
|
first.properties.unshift(prop);
|
|
12929
12929
|
}
|
|
@@ -12938,7 +12938,7 @@ function injectProp(node, prop, context) {
|
|
|
12938
12938
|
}
|
|
12939
12939
|
}
|
|
12940
12940
|
!propsWithInjection && (propsWithInjection = props);
|
|
12941
|
-
} else if (props.type ===
|
|
12941
|
+
} else if (props.type === 15) {
|
|
12942
12942
|
if (!hasProp(prop, props)) {
|
|
12943
12943
|
props.properties.unshift(prop);
|
|
12944
12944
|
}
|
|
@@ -12952,7 +12952,7 @@ function injectProp(node, prop, context) {
|
|
|
12952
12952
|
parentCall = callPath[callPath.length - 2];
|
|
12953
12953
|
}
|
|
12954
12954
|
}
|
|
12955
|
-
if (node.type ===
|
|
12955
|
+
if (node.type === 13) {
|
|
12956
12956
|
if (parentCall) {
|
|
12957
12957
|
parentCall.arguments[0] = propsWithInjection;
|
|
12958
12958
|
} else {
|
|
@@ -12968,10 +12968,10 @@ function injectProp(node, prop, context) {
|
|
|
12968
12968
|
}
|
|
12969
12969
|
function hasProp(prop, props) {
|
|
12970
12970
|
let result = false;
|
|
12971
|
-
if (prop.key.type ===
|
|
12971
|
+
if (prop.key.type === 4) {
|
|
12972
12972
|
const propKeyName = prop.key.content;
|
|
12973
12973
|
result = props.properties.some(
|
|
12974
|
-
(p) => p.key.type ===
|
|
12974
|
+
(p) => p.key.type === 4 && p.key.content === propKeyName
|
|
12975
12975
|
);
|
|
12976
12976
|
}
|
|
12977
12977
|
return result;
|
|
@@ -12982,7 +12982,7 @@ function toValidAssetId(name, type) {
|
|
|
12982
12982
|
})}`;
|
|
12983
12983
|
}
|
|
12984
12984
|
function getMemoedVNodeCall(node) {
|
|
12985
|
-
if (node.type ===
|
|
12985
|
+
if (node.type === 14 && node.callee === WITH_MEMO) {
|
|
12986
12986
|
return node.arguments[1].returns;
|
|
12987
12987
|
} else {
|
|
12988
12988
|
return node;
|
|
@@ -13079,8 +13079,8 @@ const decodeMap = {
|
|
|
13079
13079
|
};
|
|
13080
13080
|
const defaultParserOptions = {
|
|
13081
13081
|
delimiters: [`{{`, `}}`],
|
|
13082
|
-
getNamespace: () =>
|
|
13083
|
-
getTextMode: () =>
|
|
13082
|
+
getNamespace: () => 0,
|
|
13083
|
+
getTextMode: () => 0,
|
|
13084
13084
|
isVoidTag: NO,
|
|
13085
13085
|
isPreTag: NO,
|
|
13086
13086
|
isCustomElement: NO,
|
|
@@ -13093,7 +13093,7 @@ function baseParse(content, options = {}) {
|
|
|
13093
13093
|
const context = createParserContext(content, options);
|
|
13094
13094
|
const start = getCursor(context);
|
|
13095
13095
|
return createRoot(
|
|
13096
|
-
parseChildren(context,
|
|
13096
|
+
parseChildren(context, 0, []),
|
|
13097
13097
|
getSelection(context, start)
|
|
13098
13098
|
);
|
|
13099
13099
|
}
|
|
@@ -13117,48 +13117,48 @@ function createParserContext(content, rawOptions) {
|
|
|
13117
13117
|
}
|
|
13118
13118
|
function parseChildren(context, mode, ancestors) {
|
|
13119
13119
|
const parent = last(ancestors);
|
|
13120
|
-
const ns = parent ? parent.ns :
|
|
13120
|
+
const ns = parent ? parent.ns : 0;
|
|
13121
13121
|
const nodes = [];
|
|
13122
13122
|
while (!isEnd(context, mode, ancestors)) {
|
|
13123
13123
|
const s = context.source;
|
|
13124
13124
|
let node = void 0;
|
|
13125
|
-
if (mode ===
|
|
13125
|
+
if (mode === 0 || mode === 1) {
|
|
13126
13126
|
if (!context.inVPre && startsWith(s, context.options.delimiters[0])) {
|
|
13127
13127
|
node = parseInterpolation(context, mode);
|
|
13128
|
-
} else if (mode ===
|
|
13128
|
+
} else if (mode === 0 && s[0] === "<") {
|
|
13129
13129
|
if (s.length === 1) {
|
|
13130
|
-
emitError(context,
|
|
13130
|
+
emitError(context, 5, 1);
|
|
13131
13131
|
} else if (s[1] === "!") {
|
|
13132
13132
|
if (startsWith(s, "<!--")) {
|
|
13133
13133
|
node = parseComment(context);
|
|
13134
13134
|
} else if (startsWith(s, "<!DOCTYPE")) {
|
|
13135
13135
|
node = parseBogusComment(context);
|
|
13136
13136
|
} else if (startsWith(s, "<![CDATA[")) {
|
|
13137
|
-
if (ns !==
|
|
13137
|
+
if (ns !== 0) {
|
|
13138
13138
|
node = parseCDATA(context, ancestors);
|
|
13139
13139
|
} else {
|
|
13140
|
-
emitError(context,
|
|
13140
|
+
emitError(context, 1);
|
|
13141
13141
|
node = parseBogusComment(context);
|
|
13142
13142
|
}
|
|
13143
13143
|
} else {
|
|
13144
|
-
emitError(context,
|
|
13144
|
+
emitError(context, 11);
|
|
13145
13145
|
node = parseBogusComment(context);
|
|
13146
13146
|
}
|
|
13147
13147
|
} else if (s[1] === "/") {
|
|
13148
13148
|
if (s.length === 2) {
|
|
13149
|
-
emitError(context,
|
|
13149
|
+
emitError(context, 5, 2);
|
|
13150
13150
|
} else if (s[2] === ">") {
|
|
13151
|
-
emitError(context,
|
|
13151
|
+
emitError(context, 14, 2);
|
|
13152
13152
|
advanceBy(context, 3);
|
|
13153
13153
|
continue;
|
|
13154
13154
|
} else if (/[a-z]/i.test(s[2])) {
|
|
13155
|
-
emitError(context,
|
|
13155
|
+
emitError(context, 23);
|
|
13156
13156
|
parseTag(context, TagType.End, parent);
|
|
13157
13157
|
continue;
|
|
13158
13158
|
} else {
|
|
13159
13159
|
emitError(
|
|
13160
13160
|
context,
|
|
13161
|
-
|
|
13161
|
+
12,
|
|
13162
13162
|
2
|
|
13163
13163
|
);
|
|
13164
13164
|
node = parseBogusComment(context);
|
|
@@ -13169,7 +13169,7 @@ function parseChildren(context, mode, ancestors) {
|
|
|
13169
13169
|
"COMPILER_NATIVE_TEMPLATE",
|
|
13170
13170
|
context
|
|
13171
13171
|
) && node && node.tag === "template" && !node.props.some(
|
|
13172
|
-
(p) => p.type ===
|
|
13172
|
+
(p) => p.type === 7 && isSpecialTemplateDirective(p.name)
|
|
13173
13173
|
)) {
|
|
13174
13174
|
warnDeprecation(
|
|
13175
13175
|
"COMPILER_NATIVE_TEMPLATE",
|
|
@@ -13181,12 +13181,12 @@ function parseChildren(context, mode, ancestors) {
|
|
|
13181
13181
|
} else if (s[1] === "?") {
|
|
13182
13182
|
emitError(
|
|
13183
13183
|
context,
|
|
13184
|
-
|
|
13184
|
+
21,
|
|
13185
13185
|
1
|
|
13186
13186
|
);
|
|
13187
13187
|
node = parseBogusComment(context);
|
|
13188
13188
|
} else {
|
|
13189
|
-
emitError(context,
|
|
13189
|
+
emitError(context, 12, 1);
|
|
13190
13190
|
}
|
|
13191
13191
|
}
|
|
13192
13192
|
}
|
|
@@ -13202,16 +13202,16 @@ function parseChildren(context, mode, ancestors) {
|
|
|
13202
13202
|
}
|
|
13203
13203
|
}
|
|
13204
13204
|
let removedWhitespace = false;
|
|
13205
|
-
if (mode !==
|
|
13205
|
+
if (mode !== 2 && mode !== 1) {
|
|
13206
13206
|
const shouldCondense = context.options.whitespace !== "preserve";
|
|
13207
13207
|
for (let i = 0; i < nodes.length; i++) {
|
|
13208
13208
|
const node = nodes[i];
|
|
13209
|
-
if (node.type ===
|
|
13209
|
+
if (node.type === 2) {
|
|
13210
13210
|
if (!context.inPre) {
|
|
13211
13211
|
if (!/[^\t\r\n\f ]/.test(node.content)) {
|
|
13212
13212
|
const prev = nodes[i - 1];
|
|
13213
13213
|
const next = nodes[i + 1];
|
|
13214
|
-
if (!prev || !next || shouldCondense && (prev.type ===
|
|
13214
|
+
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))) {
|
|
13215
13215
|
removedWhitespace = true;
|
|
13216
13216
|
nodes[i] = null;
|
|
13217
13217
|
} else {
|
|
@@ -13223,14 +13223,14 @@ function parseChildren(context, mode, ancestors) {
|
|
|
13223
13223
|
} else {
|
|
13224
13224
|
node.content = node.content.replace(/\r\n/g, "\n");
|
|
13225
13225
|
}
|
|
13226
|
-
} else if (node.type ===
|
|
13226
|
+
} else if (node.type === 3 && !context.options.comments) {
|
|
13227
13227
|
removedWhitespace = true;
|
|
13228
13228
|
nodes[i] = null;
|
|
13229
13229
|
}
|
|
13230
13230
|
}
|
|
13231
13231
|
if (context.inPre && parent && context.options.isPreTag(parent.tag)) {
|
|
13232
13232
|
const first = nodes[0];
|
|
13233
|
-
if (first && first.type ===
|
|
13233
|
+
if (first && first.type === 2) {
|
|
13234
13234
|
first.content = first.content.replace(/^\r?\n/, "");
|
|
13235
13235
|
}
|
|
13236
13236
|
}
|
|
@@ -13238,9 +13238,9 @@ function parseChildren(context, mode, ancestors) {
|
|
|
13238
13238
|
return removedWhitespace ? nodes.filter(Boolean) : nodes;
|
|
13239
13239
|
}
|
|
13240
13240
|
function pushNode(nodes, node) {
|
|
13241
|
-
if (node.type ===
|
|
13241
|
+
if (node.type === 2) {
|
|
13242
13242
|
const prev = last(nodes);
|
|
13243
|
-
if (prev && prev.type ===
|
|
13243
|
+
if (prev && prev.type === 2 && prev.loc.end.offset === node.loc.start.offset) {
|
|
13244
13244
|
prev.content += node.content;
|
|
13245
13245
|
prev.loc.end = node.loc.end;
|
|
13246
13246
|
prev.loc.source += node.loc.source;
|
|
@@ -13251,9 +13251,9 @@ function pushNode(nodes, node) {
|
|
|
13251
13251
|
}
|
|
13252
13252
|
function parseCDATA(context, ancestors) {
|
|
13253
13253
|
advanceBy(context, 9);
|
|
13254
|
-
const nodes = parseChildren(context,
|
|
13254
|
+
const nodes = parseChildren(context, 3, ancestors);
|
|
13255
13255
|
if (context.source.length === 0) {
|
|
13256
|
-
emitError(context,
|
|
13256
|
+
emitError(context, 6);
|
|
13257
13257
|
} else {
|
|
13258
13258
|
advanceBy(context, 3);
|
|
13259
13259
|
}
|
|
@@ -13266,13 +13266,13 @@ function parseComment(context) {
|
|
|
13266
13266
|
if (!match) {
|
|
13267
13267
|
content = context.source.slice(4);
|
|
13268
13268
|
advanceBy(context, context.source.length);
|
|
13269
|
-
emitError(context,
|
|
13269
|
+
emitError(context, 7);
|
|
13270
13270
|
} else {
|
|
13271
13271
|
if (match.index <= 3) {
|
|
13272
|
-
emitError(context,
|
|
13272
|
+
emitError(context, 0);
|
|
13273
13273
|
}
|
|
13274
13274
|
if (match[1]) {
|
|
13275
|
-
emitError(context,
|
|
13275
|
+
emitError(context, 10);
|
|
13276
13276
|
}
|
|
13277
13277
|
content = context.source.slice(4, match.index);
|
|
13278
13278
|
const s = context.source.slice(0, match.index);
|
|
@@ -13280,14 +13280,14 @@ function parseComment(context) {
|
|
|
13280
13280
|
while ((nestedIndex = s.indexOf("<!--", prevIndex)) !== -1) {
|
|
13281
13281
|
advanceBy(context, nestedIndex - prevIndex + 1);
|
|
13282
13282
|
if (nestedIndex + 4 < s.length) {
|
|
13283
|
-
emitError(context,
|
|
13283
|
+
emitError(context, 16);
|
|
13284
13284
|
}
|
|
13285
13285
|
prevIndex = nestedIndex + 1;
|
|
13286
13286
|
}
|
|
13287
13287
|
advanceBy(context, match.index + match[0].length - prevIndex + 1);
|
|
13288
13288
|
}
|
|
13289
13289
|
return {
|
|
13290
|
-
type:
|
|
13290
|
+
type: 3,
|
|
13291
13291
|
content,
|
|
13292
13292
|
loc: getSelection(context, start)
|
|
13293
13293
|
};
|
|
@@ -13305,7 +13305,7 @@ function parseBogusComment(context) {
|
|
|
13305
13305
|
advanceBy(context, closeIndex + 1);
|
|
13306
13306
|
}
|
|
13307
13307
|
return {
|
|
13308
|
-
type:
|
|
13308
|
+
type: 3,
|
|
13309
13309
|
content,
|
|
13310
13310
|
loc: getSelection(context, start)
|
|
13311
13311
|
};
|
|
@@ -13332,7 +13332,7 @@ function parseElement(context, ancestors) {
|
|
|
13332
13332
|
ancestors.pop();
|
|
13333
13333
|
{
|
|
13334
13334
|
const inlineTemplateProp = element.props.find(
|
|
13335
|
-
(p) => p.type ===
|
|
13335
|
+
(p) => p.type === 6 && p.name === "inline-template"
|
|
13336
13336
|
);
|
|
13337
13337
|
if (inlineTemplateProp && checkCompatEnabled(
|
|
13338
13338
|
"COMPILER_INLINE_TEMPLATE",
|
|
@@ -13341,7 +13341,7 @@ function parseElement(context, ancestors) {
|
|
|
13341
13341
|
)) {
|
|
13342
13342
|
const loc = getSelection(context, element.loc.end);
|
|
13343
13343
|
inlineTemplateProp.value = {
|
|
13344
|
-
type:
|
|
13344
|
+
type: 2,
|
|
13345
13345
|
content: loc.source,
|
|
13346
13346
|
loc
|
|
13347
13347
|
};
|
|
@@ -13351,11 +13351,11 @@ function parseElement(context, ancestors) {
|
|
|
13351
13351
|
if (startsWithEndTagOpen(context.source, element.tag)) {
|
|
13352
13352
|
parseTag(context, TagType.End, parent);
|
|
13353
13353
|
} else {
|
|
13354
|
-
emitError(context,
|
|
13354
|
+
emitError(context, 24, 0, element.loc.start);
|
|
13355
13355
|
if (context.source.length === 0 && element.tag.toLowerCase() === "script") {
|
|
13356
13356
|
const first = children[0];
|
|
13357
13357
|
if (first && startsWith(first.loc.source, "<!--")) {
|
|
13358
|
-
emitError(context,
|
|
13358
|
+
emitError(context, 8);
|
|
13359
13359
|
}
|
|
13360
13360
|
}
|
|
13361
13361
|
}
|
|
@@ -13389,7 +13389,7 @@ function parseTag(context, type, parent) {
|
|
|
13389
13389
|
context.inPre = true;
|
|
13390
13390
|
}
|
|
13391
13391
|
let props = parseAttributes(context, type);
|
|
13392
|
-
if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type ===
|
|
13392
|
+
if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type === 7 && p.name === "pre")) {
|
|
13393
13393
|
context.inVPre = true;
|
|
13394
13394
|
extend(context, cursor);
|
|
13395
13395
|
context.source = currentSource;
|
|
@@ -13397,11 +13397,11 @@ function parseTag(context, type, parent) {
|
|
|
13397
13397
|
}
|
|
13398
13398
|
let isSelfClosing = false;
|
|
13399
13399
|
if (context.source.length === 0) {
|
|
13400
|
-
emitError(context,
|
|
13400
|
+
emitError(context, 9);
|
|
13401
13401
|
} else {
|
|
13402
13402
|
isSelfClosing = startsWith(context.source, "/>");
|
|
13403
13403
|
if (type === 1 /* End */ && isSelfClosing) {
|
|
13404
|
-
emitError(context,
|
|
13404
|
+
emitError(context, 4);
|
|
13405
13405
|
}
|
|
13406
13406
|
advanceBy(context, isSelfClosing ? 2 : 1);
|
|
13407
13407
|
}
|
|
@@ -13416,7 +13416,7 @@ function parseTag(context, type, parent) {
|
|
|
13416
13416
|
let hasFor = false;
|
|
13417
13417
|
for (let i = 0; i < props.length; i++) {
|
|
13418
13418
|
const p = props[i];
|
|
13419
|
-
if (p.type ===
|
|
13419
|
+
if (p.type === 7) {
|
|
13420
13420
|
if (p.name === "if") {
|
|
13421
13421
|
hasIf = true;
|
|
13422
13422
|
} else if (p.name === "for") {
|
|
@@ -13433,22 +13433,22 @@ function parseTag(context, type, parent) {
|
|
|
13433
13433
|
}
|
|
13434
13434
|
}
|
|
13435
13435
|
}
|
|
13436
|
-
let tagType =
|
|
13436
|
+
let tagType = 0;
|
|
13437
13437
|
if (!context.inVPre) {
|
|
13438
13438
|
if (tag === "slot") {
|
|
13439
|
-
tagType =
|
|
13439
|
+
tagType = 2;
|
|
13440
13440
|
} else if (tag === "template") {
|
|
13441
13441
|
if (props.some(
|
|
13442
|
-
(p) => p.type ===
|
|
13442
|
+
(p) => p.type === 7 && isSpecialTemplateDirective(p.name)
|
|
13443
13443
|
)) {
|
|
13444
|
-
tagType =
|
|
13444
|
+
tagType = 3;
|
|
13445
13445
|
}
|
|
13446
13446
|
} else if (isComponent(tag, props, context)) {
|
|
13447
|
-
tagType =
|
|
13447
|
+
tagType = 1;
|
|
13448
13448
|
}
|
|
13449
13449
|
}
|
|
13450
13450
|
return {
|
|
13451
|
-
type:
|
|
13451
|
+
type: 1,
|
|
13452
13452
|
ns,
|
|
13453
13453
|
tag,
|
|
13454
13454
|
tagType,
|
|
@@ -13470,7 +13470,7 @@ function isComponent(tag, props, context) {
|
|
|
13470
13470
|
}
|
|
13471
13471
|
for (let i = 0; i < props.length; i++) {
|
|
13472
13472
|
const p = props[i];
|
|
13473
|
-
if (p.type ===
|
|
13473
|
+
if (p.type === 6) {
|
|
13474
13474
|
if (p.name === "is" && p.value) {
|
|
13475
13475
|
if (p.value.content.startsWith("vue:")) {
|
|
13476
13476
|
return true;
|
|
@@ -13503,23 +13503,23 @@ function parseAttributes(context, type) {
|
|
|
13503
13503
|
const attributeNames = /* @__PURE__ */ new Set();
|
|
13504
13504
|
while (context.source.length > 0 && !startsWith(context.source, ">") && !startsWith(context.source, "/>")) {
|
|
13505
13505
|
if (startsWith(context.source, "/")) {
|
|
13506
|
-
emitError(context,
|
|
13506
|
+
emitError(context, 22);
|
|
13507
13507
|
advanceBy(context, 1);
|
|
13508
13508
|
advanceSpaces(context);
|
|
13509
13509
|
continue;
|
|
13510
13510
|
}
|
|
13511
13511
|
if (type === 1 /* End */) {
|
|
13512
|
-
emitError(context,
|
|
13512
|
+
emitError(context, 3);
|
|
13513
13513
|
}
|
|
13514
13514
|
const attr = parseAttribute(context, attributeNames);
|
|
13515
|
-
if (attr.type ===
|
|
13515
|
+
if (attr.type === 6 && attr.value && attr.name === "class") {
|
|
13516
13516
|
attr.value.content = attr.value.content.replace(/\s+/g, " ").trim();
|
|
13517
13517
|
}
|
|
13518
13518
|
if (type === 0 /* Start */) {
|
|
13519
13519
|
props.push(attr);
|
|
13520
13520
|
}
|
|
13521
13521
|
if (/^[^\t\r\n\f />]/.test(context.source)) {
|
|
13522
|
-
emitError(context,
|
|
13522
|
+
emitError(context, 15);
|
|
13523
13523
|
}
|
|
13524
13524
|
advanceSpaces(context);
|
|
13525
13525
|
}
|
|
@@ -13530,11 +13530,11 @@ function parseAttribute(context, nameSet) {
|
|
|
13530
13530
|
const match = /^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(context.source);
|
|
13531
13531
|
const name = match[0];
|
|
13532
13532
|
if (nameSet.has(name)) {
|
|
13533
|
-
emitError(context,
|
|
13533
|
+
emitError(context, 2);
|
|
13534
13534
|
}
|
|
13535
13535
|
nameSet.add(name);
|
|
13536
13536
|
if (name[0] === "=") {
|
|
13537
|
-
emitError(context,
|
|
13537
|
+
emitError(context, 19);
|
|
13538
13538
|
}
|
|
13539
13539
|
{
|
|
13540
13540
|
const pattern = /["'<]/g;
|
|
@@ -13542,7 +13542,7 @@ function parseAttribute(context, nameSet) {
|
|
|
13542
13542
|
while (m = pattern.exec(name)) {
|
|
13543
13543
|
emitError(
|
|
13544
13544
|
context,
|
|
13545
|
-
|
|
13545
|
+
17,
|
|
13546
13546
|
m.index
|
|
13547
13547
|
);
|
|
13548
13548
|
}
|
|
@@ -13555,7 +13555,7 @@ function parseAttribute(context, nameSet) {
|
|
|
13555
13555
|
advanceSpaces(context);
|
|
13556
13556
|
value = parseAttributeValue(context);
|
|
13557
13557
|
if (!value) {
|
|
13558
|
-
emitError(context,
|
|
13558
|
+
emitError(context, 13);
|
|
13559
13559
|
}
|
|
13560
13560
|
}
|
|
13561
13561
|
const loc = getSelection(context, start);
|
|
@@ -13585,7 +13585,7 @@ function parseAttribute(context, nameSet) {
|
|
|
13585
13585
|
if (!content.endsWith("]")) {
|
|
13586
13586
|
emitError(
|
|
13587
13587
|
context,
|
|
13588
|
-
|
|
13588
|
+
27
|
|
13589
13589
|
);
|
|
13590
13590
|
content = content.slice(1);
|
|
13591
13591
|
} else {
|
|
@@ -13595,10 +13595,10 @@ function parseAttribute(context, nameSet) {
|
|
|
13595
13595
|
content += match2[3] || "";
|
|
13596
13596
|
}
|
|
13597
13597
|
arg = {
|
|
13598
|
-
type:
|
|
13598
|
+
type: 4,
|
|
13599
13599
|
content,
|
|
13600
13600
|
isStatic,
|
|
13601
|
-
constType: isStatic ?
|
|
13601
|
+
constType: isStatic ? 3 : 0,
|
|
13602
13602
|
loc: loc2
|
|
13603
13603
|
};
|
|
13604
13604
|
}
|
|
@@ -13631,10 +13631,10 @@ function parseAttribute(context, nameSet) {
|
|
|
13631
13631
|
}
|
|
13632
13632
|
}
|
|
13633
13633
|
return {
|
|
13634
|
-
type:
|
|
13634
|
+
type: 7,
|
|
13635
13635
|
name: dirName,
|
|
13636
13636
|
exp: value && {
|
|
13637
|
-
type:
|
|
13637
|
+
type: 4,
|
|
13638
13638
|
content: value.content,
|
|
13639
13639
|
isStatic: false,
|
|
13640
13640
|
// Treat as non-constant by default. This can be potentially set to
|
|
@@ -13648,13 +13648,13 @@ function parseAttribute(context, nameSet) {
|
|
|
13648
13648
|
};
|
|
13649
13649
|
}
|
|
13650
13650
|
if (!context.inVPre && startsWith(name, "v-")) {
|
|
13651
|
-
emitError(context,
|
|
13651
|
+
emitError(context, 26);
|
|
13652
13652
|
}
|
|
13653
13653
|
return {
|
|
13654
|
-
type:
|
|
13654
|
+
type: 6,
|
|
13655
13655
|
name,
|
|
13656
13656
|
value: value && {
|
|
13657
|
-
type:
|
|
13657
|
+
type: 2,
|
|
13658
13658
|
content: value.content,
|
|
13659
13659
|
loc: value.loc
|
|
13660
13660
|
},
|
|
@@ -13673,10 +13673,10 @@ function parseAttributeValue(context) {
|
|
|
13673
13673
|
content = parseTextData(
|
|
13674
13674
|
context,
|
|
13675
13675
|
context.source.length,
|
|
13676
|
-
|
|
13676
|
+
4
|
|
13677
13677
|
);
|
|
13678
13678
|
} else {
|
|
13679
|
-
content = parseTextData(context, endIndex,
|
|
13679
|
+
content = parseTextData(context, endIndex, 4);
|
|
13680
13680
|
advanceBy(context, 1);
|
|
13681
13681
|
}
|
|
13682
13682
|
} else {
|
|
@@ -13689,11 +13689,11 @@ function parseAttributeValue(context) {
|
|
|
13689
13689
|
while (m = unexpectedChars.exec(match[0])) {
|
|
13690
13690
|
emitError(
|
|
13691
13691
|
context,
|
|
13692
|
-
|
|
13692
|
+
18,
|
|
13693
13693
|
m.index
|
|
13694
13694
|
);
|
|
13695
13695
|
}
|
|
13696
|
-
content = parseTextData(context, match[0].length,
|
|
13696
|
+
content = parseTextData(context, match[0].length, 4);
|
|
13697
13697
|
}
|
|
13698
13698
|
return { content, isQuoted, loc: getSelection(context, start) };
|
|
13699
13699
|
}
|
|
@@ -13701,7 +13701,7 @@ function parseInterpolation(context, mode) {
|
|
|
13701
13701
|
const [open, close] = context.options.delimiters;
|
|
13702
13702
|
const closeIndex = context.source.indexOf(close, open.length);
|
|
13703
13703
|
if (closeIndex === -1) {
|
|
13704
|
-
emitError(context,
|
|
13704
|
+
emitError(context, 25);
|
|
13705
13705
|
return void 0;
|
|
13706
13706
|
}
|
|
13707
13707
|
const start = getCursor(context);
|
|
@@ -13720,9 +13720,9 @@ function parseInterpolation(context, mode) {
|
|
|
13720
13720
|
advancePositionWithMutation(innerEnd, rawContent, endOffset);
|
|
13721
13721
|
advanceBy(context, close.length);
|
|
13722
13722
|
return {
|
|
13723
|
-
type:
|
|
13723
|
+
type: 5,
|
|
13724
13724
|
content: {
|
|
13725
|
-
type:
|
|
13725
|
+
type: 4,
|
|
13726
13726
|
isStatic: false,
|
|
13727
13727
|
// Set `isConstant` to false by default and will decide in transformExpression
|
|
13728
13728
|
constType: 0,
|
|
@@ -13733,7 +13733,7 @@ function parseInterpolation(context, mode) {
|
|
|
13733
13733
|
};
|
|
13734
13734
|
}
|
|
13735
13735
|
function parseText(context, mode) {
|
|
13736
|
-
const endTokens = mode ===
|
|
13736
|
+
const endTokens = mode === 3 ? ["]]>"] : ["<", context.options.delimiters[0]];
|
|
13737
13737
|
let endIndex = context.source.length;
|
|
13738
13738
|
for (let i = 0; i < endTokens.length; i++) {
|
|
13739
13739
|
const index = context.source.indexOf(endTokens[i], 1);
|
|
@@ -13744,7 +13744,7 @@ function parseText(context, mode) {
|
|
|
13744
13744
|
const start = getCursor(context);
|
|
13745
13745
|
const content = parseTextData(context, endIndex, mode);
|
|
13746
13746
|
return {
|
|
13747
|
-
type:
|
|
13747
|
+
type: 2,
|
|
13748
13748
|
content,
|
|
13749
13749
|
loc: getSelection(context, start)
|
|
13750
13750
|
};
|
|
@@ -13752,12 +13752,12 @@ function parseText(context, mode) {
|
|
|
13752
13752
|
function parseTextData(context, length, mode) {
|
|
13753
13753
|
const rawText = context.source.slice(0, length);
|
|
13754
13754
|
advanceBy(context, length);
|
|
13755
|
-
if (mode ===
|
|
13755
|
+
if (mode === 2 || mode === 3 || !rawText.includes("&")) {
|
|
13756
13756
|
return rawText;
|
|
13757
13757
|
} else {
|
|
13758
13758
|
return context.options.decodeEntities(
|
|
13759
13759
|
rawText,
|
|
13760
|
-
mode ===
|
|
13760
|
+
mode === 4
|
|
13761
13761
|
);
|
|
13762
13762
|
}
|
|
13763
13763
|
}
|
|
@@ -13813,7 +13813,7 @@ function emitError(context, code, offset, loc = getCursor(context)) {
|
|
|
13813
13813
|
function isEnd(context, mode, ancestors) {
|
|
13814
13814
|
const s = context.source;
|
|
13815
13815
|
switch (mode) {
|
|
13816
|
-
case
|
|
13816
|
+
case 0:
|
|
13817
13817
|
if (startsWith(s, "</")) {
|
|
13818
13818
|
for (let i = ancestors.length - 1; i >= 0; --i) {
|
|
13819
13819
|
if (startsWithEndTagOpen(s, ancestors[i].tag)) {
|
|
@@ -13822,15 +13822,15 @@ function isEnd(context, mode, ancestors) {
|
|
|
13822
13822
|
}
|
|
13823
13823
|
}
|
|
13824
13824
|
break;
|
|
13825
|
-
case
|
|
13826
|
-
case
|
|
13825
|
+
case 1:
|
|
13826
|
+
case 2: {
|
|
13827
13827
|
const parent = last(ancestors);
|
|
13828
13828
|
if (parent && startsWithEndTagOpen(s, parent.tag)) {
|
|
13829
13829
|
return true;
|
|
13830
13830
|
}
|
|
13831
13831
|
break;
|
|
13832
13832
|
}
|
|
13833
|
-
case
|
|
13833
|
+
case 3:
|
|
13834
13834
|
if (startsWith(s, "]]>")) {
|
|
13835
13835
|
return true;
|
|
13836
13836
|
}
|
|
@@ -13853,7 +13853,7 @@ function hoistStatic(root, context) {
|
|
|
13853
13853
|
}
|
|
13854
13854
|
function isSingleElementRoot(root, child) {
|
|
13855
13855
|
const { children } = root;
|
|
13856
|
-
return children.length === 1 && child.type ===
|
|
13856
|
+
return children.length === 1 && child.type === 1 && !isSlotOutlet(child);
|
|
13857
13857
|
}
|
|
13858
13858
|
function walk(node, context, doNotHoistNode = false) {
|
|
13859
13859
|
const { children } = node;
|
|
@@ -13861,10 +13861,10 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
13861
13861
|
let hoistedCount = 0;
|
|
13862
13862
|
for (let i = 0; i < children.length; i++) {
|
|
13863
13863
|
const child = children[i];
|
|
13864
|
-
if (child.type ===
|
|
13864
|
+
if (child.type === 1 && child.tagType === 0) {
|
|
13865
13865
|
const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
|
|
13866
13866
|
if (constantType > 0) {
|
|
13867
|
-
if (constantType >=
|
|
13867
|
+
if (constantType >= 2) {
|
|
13868
13868
|
child.codegenNode.patchFlag = -1 + (` /* HOISTED */` );
|
|
13869
13869
|
child.codegenNode = context.hoist(child.codegenNode);
|
|
13870
13870
|
hoistedCount++;
|
|
@@ -13872,9 +13872,9 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
13872
13872
|
}
|
|
13873
13873
|
} else {
|
|
13874
13874
|
const codegenNode = child.codegenNode;
|
|
13875
|
-
if (codegenNode.type ===
|
|
13875
|
+
if (codegenNode.type === 13) {
|
|
13876
13876
|
const flag = getPatchFlag(codegenNode);
|
|
13877
|
-
if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >=
|
|
13877
|
+
if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {
|
|
13878
13878
|
const props = getNodeProps(child);
|
|
13879
13879
|
if (props) {
|
|
13880
13880
|
codegenNode.props = context.hoist(props);
|
|
@@ -13886,8 +13886,8 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
13886
13886
|
}
|
|
13887
13887
|
}
|
|
13888
13888
|
}
|
|
13889
|
-
if (child.type ===
|
|
13890
|
-
const isComponent = child.tagType ===
|
|
13889
|
+
if (child.type === 1) {
|
|
13890
|
+
const isComponent = child.tagType === 1;
|
|
13891
13891
|
if (isComponent) {
|
|
13892
13892
|
context.scopes.vSlot++;
|
|
13893
13893
|
}
|
|
@@ -13895,9 +13895,9 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
13895
13895
|
if (isComponent) {
|
|
13896
13896
|
context.scopes.vSlot--;
|
|
13897
13897
|
}
|
|
13898
|
-
} else if (child.type ===
|
|
13898
|
+
} else if (child.type === 11) {
|
|
13899
13899
|
walk(child, context, child.children.length === 1);
|
|
13900
|
-
} else if (child.type ===
|
|
13900
|
+
} else if (child.type === 9) {
|
|
13901
13901
|
for (let i2 = 0; i2 < child.branches.length; i2++) {
|
|
13902
13902
|
walk(
|
|
13903
13903
|
child.branches[i2],
|
|
@@ -13910,7 +13910,7 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
13910
13910
|
if (hoistedCount && context.transformHoist) {
|
|
13911
13911
|
context.transformHoist(children, context, node);
|
|
13912
13912
|
}
|
|
13913
|
-
if (hoistedCount && hoistedCount === originalCount && node.type ===
|
|
13913
|
+
if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
|
|
13914
13914
|
node.codegenNode.children = context.hoist(
|
|
13915
13915
|
createArrayExpression(node.codegenNode.children)
|
|
13916
13916
|
);
|
|
@@ -13919,8 +13919,8 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
13919
13919
|
function getConstantType(node, context) {
|
|
13920
13920
|
const { constantCache } = context;
|
|
13921
13921
|
switch (node.type) {
|
|
13922
|
-
case
|
|
13923
|
-
if (node.tagType !==
|
|
13922
|
+
case 1:
|
|
13923
|
+
if (node.tagType !== 0) {
|
|
13924
13924
|
return 0;
|
|
13925
13925
|
}
|
|
13926
13926
|
const cached = constantCache.get(node);
|
|
@@ -13928,7 +13928,7 @@ function getConstantType(node, context) {
|
|
|
13928
13928
|
return cached;
|
|
13929
13929
|
}
|
|
13930
13930
|
const codegenNode = node.codegenNode;
|
|
13931
|
-
if (codegenNode.type !==
|
|
13931
|
+
if (codegenNode.type !== 13) {
|
|
13932
13932
|
return 0;
|
|
13933
13933
|
}
|
|
13934
13934
|
if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject") {
|
|
@@ -13936,7 +13936,7 @@ function getConstantType(node, context) {
|
|
|
13936
13936
|
}
|
|
13937
13937
|
const flag = getPatchFlag(codegenNode);
|
|
13938
13938
|
if (!flag) {
|
|
13939
|
-
let returnType2 =
|
|
13939
|
+
let returnType2 = 3;
|
|
13940
13940
|
const generatedPropsType = getGeneratedPropsConstantType(node, context);
|
|
13941
13941
|
if (generatedPropsType === 0) {
|
|
13942
13942
|
constantCache.set(node, 0);
|
|
@@ -13955,10 +13955,10 @@ function getConstantType(node, context) {
|
|
|
13955
13955
|
returnType2 = childType;
|
|
13956
13956
|
}
|
|
13957
13957
|
}
|
|
13958
|
-
if (returnType2 >
|
|
13958
|
+
if (returnType2 > 1) {
|
|
13959
13959
|
for (let i = 0; i < node.props.length; i++) {
|
|
13960
13960
|
const p = node.props[i];
|
|
13961
|
-
if (p.type ===
|
|
13961
|
+
if (p.type === 7 && p.name === "bind" && p.exp) {
|
|
13962
13962
|
const expType = getConstantType(p.exp, context);
|
|
13963
13963
|
if (expType === 0) {
|
|
13964
13964
|
constantCache.set(node, 0);
|
|
@@ -13973,7 +13973,7 @@ function getConstantType(node, context) {
|
|
|
13973
13973
|
if (codegenNode.isBlock) {
|
|
13974
13974
|
for (let i = 0; i < node.props.length; i++) {
|
|
13975
13975
|
const p = node.props[i];
|
|
13976
|
-
if (p.type ===
|
|
13976
|
+
if (p.type === 7) {
|
|
13977
13977
|
constantCache.set(node, 0);
|
|
13978
13978
|
return 0;
|
|
13979
13979
|
}
|
|
@@ -13991,20 +13991,20 @@ function getConstantType(node, context) {
|
|
|
13991
13991
|
constantCache.set(node, 0);
|
|
13992
13992
|
return 0;
|
|
13993
13993
|
}
|
|
13994
|
-
case
|
|
13995
|
-
case
|
|
13996
|
-
return
|
|
13997
|
-
case
|
|
13998
|
-
case
|
|
13999
|
-
case
|
|
13994
|
+
case 2:
|
|
13995
|
+
case 3:
|
|
13996
|
+
return 3;
|
|
13997
|
+
case 9:
|
|
13998
|
+
case 11:
|
|
13999
|
+
case 10:
|
|
14000
14000
|
return 0;
|
|
14001
|
-
case
|
|
14002
|
-
case
|
|
14001
|
+
case 5:
|
|
14002
|
+
case 12:
|
|
14003
14003
|
return getConstantType(node.content, context);
|
|
14004
|
-
case
|
|
14004
|
+
case 4:
|
|
14005
14005
|
return node.constType;
|
|
14006
|
-
case
|
|
14007
|
-
let returnType =
|
|
14006
|
+
case 8:
|
|
14007
|
+
let returnType = 3;
|
|
14008
14008
|
for (let i = 0; i < node.children.length; i++) {
|
|
14009
14009
|
const child = node.children[i];
|
|
14010
14010
|
if (isString(child) || isSymbol(child)) {
|
|
@@ -14029,20 +14029,20 @@ const allowHoistedHelperSet = /* @__PURE__ */ new Set([
|
|
|
14029
14029
|
GUARD_REACTIVE_PROPS
|
|
14030
14030
|
]);
|
|
14031
14031
|
function getConstantTypeOfHelperCall(value, context) {
|
|
14032
|
-
if (value.type ===
|
|
14032
|
+
if (value.type === 14 && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {
|
|
14033
14033
|
const arg = value.arguments[0];
|
|
14034
|
-
if (arg.type ===
|
|
14034
|
+
if (arg.type === 4) {
|
|
14035
14035
|
return getConstantType(arg, context);
|
|
14036
|
-
} else if (arg.type ===
|
|
14036
|
+
} else if (arg.type === 14) {
|
|
14037
14037
|
return getConstantTypeOfHelperCall(arg, context);
|
|
14038
14038
|
}
|
|
14039
14039
|
}
|
|
14040
14040
|
return 0;
|
|
14041
14041
|
}
|
|
14042
14042
|
function getGeneratedPropsConstantType(node, context) {
|
|
14043
|
-
let returnType =
|
|
14043
|
+
let returnType = 3;
|
|
14044
14044
|
const props = getNodeProps(node);
|
|
14045
|
-
if (props && props.type ===
|
|
14045
|
+
if (props && props.type === 15) {
|
|
14046
14046
|
const { properties } = props;
|
|
14047
14047
|
for (let i = 0; i < properties.length; i++) {
|
|
14048
14048
|
const { key, value } = properties[i];
|
|
@@ -14054,9 +14054,9 @@ function getGeneratedPropsConstantType(node, context) {
|
|
|
14054
14054
|
returnType = keyType;
|
|
14055
14055
|
}
|
|
14056
14056
|
let valueType;
|
|
14057
|
-
if (value.type ===
|
|
14057
|
+
if (value.type === 4) {
|
|
14058
14058
|
valueType = getConstantType(value, context);
|
|
14059
|
-
} else if (value.type ===
|
|
14059
|
+
} else if (value.type === 14) {
|
|
14060
14060
|
valueType = getConstantTypeOfHelperCall(value, context);
|
|
14061
14061
|
} else {
|
|
14062
14062
|
valueType = 0;
|
|
@@ -14073,7 +14073,7 @@ function getGeneratedPropsConstantType(node, context) {
|
|
|
14073
14073
|
}
|
|
14074
14074
|
function getNodeProps(node) {
|
|
14075
14075
|
const codegenNode = node.codegenNode;
|
|
14076
|
-
if (codegenNode.type ===
|
|
14076
|
+
if (codegenNode.type === 13) {
|
|
14077
14077
|
return codegenNode.props;
|
|
14078
14078
|
}
|
|
14079
14079
|
}
|
|
@@ -14215,7 +14215,7 @@ function createTransformContext(root, {
|
|
|
14215
14215
|
`_hoisted_${context.hoists.length}`,
|
|
14216
14216
|
false,
|
|
14217
14217
|
exp.loc,
|
|
14218
|
-
|
|
14218
|
+
2
|
|
14219
14219
|
);
|
|
14220
14220
|
identifier.hoisted = exp;
|
|
14221
14221
|
return identifier;
|
|
@@ -14256,7 +14256,7 @@ function createRootCodegen(root, context) {
|
|
|
14256
14256
|
const child = children[0];
|
|
14257
14257
|
if (isSingleElementRoot(root, child) && child.codegenNode) {
|
|
14258
14258
|
const codegenNode = child.codegenNode;
|
|
14259
|
-
if (codegenNode.type ===
|
|
14259
|
+
if (codegenNode.type === 13) {
|
|
14260
14260
|
makeBlock(codegenNode, context);
|
|
14261
14261
|
}
|
|
14262
14262
|
root.codegenNode = codegenNode;
|
|
@@ -14266,7 +14266,7 @@ function createRootCodegen(root, context) {
|
|
|
14266
14266
|
} else if (children.length > 1) {
|
|
14267
14267
|
let patchFlag = 64;
|
|
14268
14268
|
let patchFlagText = PatchFlagNames[64];
|
|
14269
|
-
if (children.filter((c) => c.type !==
|
|
14269
|
+
if (children.filter((c) => c.type !== 3).length === 1) {
|
|
14270
14270
|
patchFlag |= 2048;
|
|
14271
14271
|
patchFlagText += `, ${PatchFlagNames[2048]}`;
|
|
14272
14272
|
}
|
|
@@ -14320,25 +14320,25 @@ function traverseNode(node, context) {
|
|
|
14320
14320
|
}
|
|
14321
14321
|
}
|
|
14322
14322
|
switch (node.type) {
|
|
14323
|
-
case
|
|
14323
|
+
case 3:
|
|
14324
14324
|
if (!context.ssr) {
|
|
14325
14325
|
context.helper(CREATE_COMMENT);
|
|
14326
14326
|
}
|
|
14327
14327
|
break;
|
|
14328
|
-
case
|
|
14328
|
+
case 5:
|
|
14329
14329
|
if (!context.ssr) {
|
|
14330
14330
|
context.helper(TO_DISPLAY_STRING);
|
|
14331
14331
|
}
|
|
14332
14332
|
break;
|
|
14333
|
-
case
|
|
14333
|
+
case 9:
|
|
14334
14334
|
for (let i2 = 0; i2 < node.branches.length; i2++) {
|
|
14335
14335
|
traverseNode(node.branches[i2], context);
|
|
14336
14336
|
}
|
|
14337
14337
|
break;
|
|
14338
|
-
case
|
|
14339
|
-
case
|
|
14340
|
-
case
|
|
14341
|
-
case
|
|
14338
|
+
case 10:
|
|
14339
|
+
case 11:
|
|
14340
|
+
case 1:
|
|
14341
|
+
case 0:
|
|
14342
14342
|
traverseChildren(node, context);
|
|
14343
14343
|
break;
|
|
14344
14344
|
}
|
|
@@ -14351,15 +14351,15 @@ function traverseNode(node, context) {
|
|
|
14351
14351
|
function createStructuralDirectiveTransform(name, fn) {
|
|
14352
14352
|
const matches = isString(name) ? (n) => n === name : (n) => name.test(n);
|
|
14353
14353
|
return (node, context) => {
|
|
14354
|
-
if (node.type ===
|
|
14354
|
+
if (node.type === 1) {
|
|
14355
14355
|
const { props } = node;
|
|
14356
|
-
if (node.tagType ===
|
|
14356
|
+
if (node.tagType === 3 && props.some(isVSlot)) {
|
|
14357
14357
|
return;
|
|
14358
14358
|
}
|
|
14359
14359
|
const exitFns = [];
|
|
14360
14360
|
for (let i = 0; i < props.length; i++) {
|
|
14361
14361
|
const prop = props[i];
|
|
14362
|
-
if (prop.type ===
|
|
14362
|
+
if (prop.type === 7 && matches(prop.name)) {
|
|
14363
14363
|
props.splice(i, 1);
|
|
14364
14364
|
i--;
|
|
14365
14365
|
const onExit = fn(node, prop, context);
|
|
@@ -14594,7 +14594,7 @@ function genHoists(hoists, context) {
|
|
|
14594
14594
|
context.pure = false;
|
|
14595
14595
|
}
|
|
14596
14596
|
function isText(n) {
|
|
14597
|
-
return isString(n) || n.type ===
|
|
14597
|
+
return isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8;
|
|
14598
14598
|
}
|
|
14599
14599
|
function genNodeListAsArray(nodes, context) {
|
|
14600
14600
|
const multilines = nodes.length > 3 || nodes.some((n) => isArray(n) || !isText(n));
|
|
@@ -14635,68 +14635,68 @@ function genNode(node, context) {
|
|
|
14635
14635
|
return;
|
|
14636
14636
|
}
|
|
14637
14637
|
switch (node.type) {
|
|
14638
|
-
case
|
|
14639
|
-
case
|
|
14640
|
-
case
|
|
14638
|
+
case 1:
|
|
14639
|
+
case 9:
|
|
14640
|
+
case 11:
|
|
14641
14641
|
assert(
|
|
14642
14642
|
node.codegenNode != null,
|
|
14643
14643
|
`Codegen node is missing for element/if/for node. Apply appropriate transforms first.`
|
|
14644
14644
|
);
|
|
14645
14645
|
genNode(node.codegenNode, context);
|
|
14646
14646
|
break;
|
|
14647
|
-
case
|
|
14647
|
+
case 2:
|
|
14648
14648
|
genText(node, context);
|
|
14649
14649
|
break;
|
|
14650
|
-
case
|
|
14650
|
+
case 4:
|
|
14651
14651
|
genExpression(node, context);
|
|
14652
14652
|
break;
|
|
14653
|
-
case
|
|
14653
|
+
case 5:
|
|
14654
14654
|
genInterpolation(node, context);
|
|
14655
14655
|
break;
|
|
14656
|
-
case
|
|
14656
|
+
case 12:
|
|
14657
14657
|
genNode(node.codegenNode, context);
|
|
14658
14658
|
break;
|
|
14659
|
-
case
|
|
14659
|
+
case 8:
|
|
14660
14660
|
genCompoundExpression(node, context);
|
|
14661
14661
|
break;
|
|
14662
|
-
case
|
|
14662
|
+
case 3:
|
|
14663
14663
|
genComment(node, context);
|
|
14664
14664
|
break;
|
|
14665
|
-
case
|
|
14665
|
+
case 13:
|
|
14666
14666
|
genVNodeCall(node, context);
|
|
14667
14667
|
break;
|
|
14668
|
-
case
|
|
14668
|
+
case 14:
|
|
14669
14669
|
genCallExpression(node, context);
|
|
14670
14670
|
break;
|
|
14671
|
-
case
|
|
14671
|
+
case 15:
|
|
14672
14672
|
genObjectExpression(node, context);
|
|
14673
14673
|
break;
|
|
14674
|
-
case
|
|
14674
|
+
case 17:
|
|
14675
14675
|
genArrayExpression(node, context);
|
|
14676
14676
|
break;
|
|
14677
|
-
case
|
|
14677
|
+
case 18:
|
|
14678
14678
|
genFunctionExpression(node, context);
|
|
14679
14679
|
break;
|
|
14680
|
-
case
|
|
14680
|
+
case 19:
|
|
14681
14681
|
genConditionalExpression(node, context);
|
|
14682
14682
|
break;
|
|
14683
|
-
case
|
|
14683
|
+
case 20:
|
|
14684
14684
|
genCacheExpression(node, context);
|
|
14685
14685
|
break;
|
|
14686
|
-
case
|
|
14686
|
+
case 21:
|
|
14687
14687
|
genNodeList(node.body, context, true, false);
|
|
14688
14688
|
break;
|
|
14689
|
-
case
|
|
14689
|
+
case 22:
|
|
14690
14690
|
break;
|
|
14691
|
-
case
|
|
14691
|
+
case 23:
|
|
14692
14692
|
break;
|
|
14693
|
-
case
|
|
14693
|
+
case 24:
|
|
14694
14694
|
break;
|
|
14695
|
-
case
|
|
14695
|
+
case 25:
|
|
14696
14696
|
break;
|
|
14697
|
-
case
|
|
14697
|
+
case 26:
|
|
14698
14698
|
break;
|
|
14699
|
-
case
|
|
14699
|
+
case 10:
|
|
14700
14700
|
break;
|
|
14701
14701
|
default:
|
|
14702
14702
|
{
|
|
@@ -14733,7 +14733,7 @@ function genCompoundExpression(node, context) {
|
|
|
14733
14733
|
}
|
|
14734
14734
|
function genExpressionAsPropertyKey(node, context) {
|
|
14735
14735
|
const { push } = context;
|
|
14736
|
-
if (node.type ===
|
|
14736
|
+
if (node.type === 8) {
|
|
14737
14737
|
push(`[`);
|
|
14738
14738
|
genCompoundExpression(node, context);
|
|
14739
14739
|
push(`]`);
|
|
@@ -14814,7 +14814,7 @@ function genObjectExpression(node, context) {
|
|
|
14814
14814
|
push(`{}`, node);
|
|
14815
14815
|
return;
|
|
14816
14816
|
}
|
|
14817
|
-
const multilines = properties.length > 1 || properties.some((p) => p.value.type !==
|
|
14817
|
+
const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4);
|
|
14818
14818
|
push(multilines ? `{` : `{ `);
|
|
14819
14819
|
multilines && indent();
|
|
14820
14820
|
for (let i = 0; i < properties.length; i++) {
|
|
@@ -14876,7 +14876,7 @@ function genFunctionExpression(node, context) {
|
|
|
14876
14876
|
function genConditionalExpression(node, context) {
|
|
14877
14877
|
const { test, consequent, alternate, newline: needNewline } = node;
|
|
14878
14878
|
const { push, indent, deindent, newline } = context;
|
|
14879
|
-
if (test.type ===
|
|
14879
|
+
if (test.type === 4) {
|
|
14880
14880
|
const needsParens = !isSimpleIdentifier(test.content);
|
|
14881
14881
|
needsParens && push(`(`);
|
|
14882
14882
|
genExpression(test, context);
|
|
@@ -14895,7 +14895,7 @@ function genConditionalExpression(node, context) {
|
|
|
14895
14895
|
needNewline && newline();
|
|
14896
14896
|
needNewline || push(` `);
|
|
14897
14897
|
push(`: `);
|
|
14898
|
-
const isNested = alternate.type ===
|
|
14898
|
+
const isNested = alternate.type === 19;
|
|
14899
14899
|
if (!isNested) {
|
|
14900
14900
|
context.indentLevel++;
|
|
14901
14901
|
}
|
|
@@ -14950,7 +14950,7 @@ function validateBrowserExpression(node, context, asParams = false, asRawStateme
|
|
|
14950
14950
|
}
|
|
14951
14951
|
context.onError(
|
|
14952
14952
|
createCompilerError(
|
|
14953
|
-
|
|
14953
|
+
45,
|
|
14954
14954
|
node.loc,
|
|
14955
14955
|
void 0,
|
|
14956
14956
|
message
|
|
@@ -14960,18 +14960,18 @@ function validateBrowserExpression(node, context, asParams = false, asRawStateme
|
|
|
14960
14960
|
}
|
|
14961
14961
|
|
|
14962
14962
|
const transformExpression = (node, context) => {
|
|
14963
|
-
if (node.type ===
|
|
14963
|
+
if (node.type === 5) {
|
|
14964
14964
|
node.content = processExpression(
|
|
14965
14965
|
node.content,
|
|
14966
14966
|
context
|
|
14967
14967
|
);
|
|
14968
|
-
} else if (node.type ===
|
|
14968
|
+
} else if (node.type === 1) {
|
|
14969
14969
|
for (let i = 0; i < node.props.length; i++) {
|
|
14970
14970
|
const dir = node.props[i];
|
|
14971
|
-
if (dir.type ===
|
|
14971
|
+
if (dir.type === 7 && dir.name !== "for") {
|
|
14972
14972
|
const exp = dir.exp;
|
|
14973
14973
|
const arg = dir.arg;
|
|
14974
|
-
if (exp && exp.type ===
|
|
14974
|
+
if (exp && exp.type === 4 && !(dir.name === "on" && arg)) {
|
|
14975
14975
|
dir.exp = processExpression(
|
|
14976
14976
|
exp,
|
|
14977
14977
|
context,
|
|
@@ -14979,7 +14979,7 @@ const transformExpression = (node, context) => {
|
|
|
14979
14979
|
dir.name === "slot"
|
|
14980
14980
|
);
|
|
14981
14981
|
}
|
|
14982
|
-
if (arg && arg.type ===
|
|
14982
|
+
if (arg && arg.type === 4 && !arg.isStatic) {
|
|
14983
14983
|
dir.arg = processExpression(arg, context);
|
|
14984
14984
|
}
|
|
14985
14985
|
}
|
|
@@ -15004,7 +15004,7 @@ const transformIf = createStructuralDirectiveTransform(
|
|
|
15004
15004
|
let key = 0;
|
|
15005
15005
|
while (i-- >= 0) {
|
|
15006
15006
|
const sibling = siblings[i];
|
|
15007
|
-
if (sibling && sibling.type ===
|
|
15007
|
+
if (sibling && sibling.type === 9) {
|
|
15008
15008
|
key += sibling.branches.length;
|
|
15009
15009
|
}
|
|
15010
15010
|
}
|
|
@@ -15031,7 +15031,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15031
15031
|
if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) {
|
|
15032
15032
|
const loc = dir.exp ? dir.exp.loc : node.loc;
|
|
15033
15033
|
context.onError(
|
|
15034
|
-
createCompilerError(
|
|
15034
|
+
createCompilerError(28, dir.loc)
|
|
15035
15035
|
);
|
|
15036
15036
|
dir.exp = createSimpleExpression(`true`, false, loc);
|
|
15037
15037
|
}
|
|
@@ -15041,7 +15041,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15041
15041
|
if (dir.name === "if") {
|
|
15042
15042
|
const branch = createIfBranch(node, dir);
|
|
15043
15043
|
const ifNode = {
|
|
15044
|
-
type:
|
|
15044
|
+
type: 9,
|
|
15045
15045
|
loc: node.loc,
|
|
15046
15046
|
branches: [branch]
|
|
15047
15047
|
};
|
|
@@ -15055,25 +15055,25 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15055
15055
|
let i = siblings.indexOf(node);
|
|
15056
15056
|
while (i-- >= -1) {
|
|
15057
15057
|
const sibling = siblings[i];
|
|
15058
|
-
if (sibling && sibling.type ===
|
|
15058
|
+
if (sibling && sibling.type === 3) {
|
|
15059
15059
|
context.removeNode(sibling);
|
|
15060
15060
|
comments.unshift(sibling);
|
|
15061
15061
|
continue;
|
|
15062
15062
|
}
|
|
15063
|
-
if (sibling && sibling.type ===
|
|
15063
|
+
if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
|
|
15064
15064
|
context.removeNode(sibling);
|
|
15065
15065
|
continue;
|
|
15066
15066
|
}
|
|
15067
|
-
if (sibling && sibling.type ===
|
|
15067
|
+
if (sibling && sibling.type === 9) {
|
|
15068
15068
|
if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
|
|
15069
15069
|
context.onError(
|
|
15070
|
-
createCompilerError(
|
|
15070
|
+
createCompilerError(30, node.loc)
|
|
15071
15071
|
);
|
|
15072
15072
|
}
|
|
15073
15073
|
context.removeNode();
|
|
15074
15074
|
const branch = createIfBranch(node, dir);
|
|
15075
15075
|
if (comments.length && // #3619 ignore comments if the v-if is direct child of <transition>
|
|
15076
|
-
!(context.parent && context.parent.type ===
|
|
15076
|
+
!(context.parent && context.parent.type === 1 && isBuiltInType(context.parent.tag, "transition"))) {
|
|
15077
15077
|
branch.children = [...comments, ...branch.children];
|
|
15078
15078
|
}
|
|
15079
15079
|
{
|
|
@@ -15083,7 +15083,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15083
15083
|
if (isSameKey(userKey, key)) {
|
|
15084
15084
|
context.onError(
|
|
15085
15085
|
createCompilerError(
|
|
15086
|
-
|
|
15086
|
+
29,
|
|
15087
15087
|
branch.userKey.loc
|
|
15088
15088
|
)
|
|
15089
15089
|
);
|
|
@@ -15099,7 +15099,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15099
15099
|
context.currentNode = null;
|
|
15100
15100
|
} else {
|
|
15101
15101
|
context.onError(
|
|
15102
|
-
createCompilerError(
|
|
15102
|
+
createCompilerError(30, node.loc)
|
|
15103
15103
|
);
|
|
15104
15104
|
}
|
|
15105
15105
|
break;
|
|
@@ -15107,9 +15107,9 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15107
15107
|
}
|
|
15108
15108
|
}
|
|
15109
15109
|
function createIfBranch(node, dir) {
|
|
15110
|
-
const isTemplateIf = node.tagType ===
|
|
15110
|
+
const isTemplateIf = node.tagType === 3;
|
|
15111
15111
|
return {
|
|
15112
|
-
type:
|
|
15112
|
+
type: 10,
|
|
15113
15113
|
loc: node.loc,
|
|
15114
15114
|
condition: dir.name === "else" ? void 0 : dir.exp,
|
|
15115
15115
|
children: isTemplateIf && !findDir(node, "for") ? node.children : [node],
|
|
@@ -15141,21 +15141,21 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
|
|
|
15141
15141
|
`${keyIndex}`,
|
|
15142
15142
|
false,
|
|
15143
15143
|
locStub,
|
|
15144
|
-
|
|
15144
|
+
2
|
|
15145
15145
|
)
|
|
15146
15146
|
);
|
|
15147
15147
|
const { children } = branch;
|
|
15148
15148
|
const firstChild = children[0];
|
|
15149
|
-
const needFragmentWrapper = children.length !== 1 || firstChild.type !==
|
|
15149
|
+
const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1;
|
|
15150
15150
|
if (needFragmentWrapper) {
|
|
15151
|
-
if (children.length === 1 && firstChild.type ===
|
|
15151
|
+
if (children.length === 1 && firstChild.type === 11) {
|
|
15152
15152
|
const vnodeCall = firstChild.codegenNode;
|
|
15153
15153
|
injectProp(vnodeCall, keyProperty, context);
|
|
15154
15154
|
return vnodeCall;
|
|
15155
15155
|
} else {
|
|
15156
15156
|
let patchFlag = 64;
|
|
15157
15157
|
let patchFlagText = PatchFlagNames[64];
|
|
15158
|
-
if (!branch.isTemplateIf && children.filter((c) => c.type !==
|
|
15158
|
+
if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) {
|
|
15159
15159
|
patchFlag |= 2048;
|
|
15160
15160
|
patchFlagText += `, ${PatchFlagNames[2048]}`;
|
|
15161
15161
|
}
|
|
@@ -15176,7 +15176,7 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
|
|
|
15176
15176
|
} else {
|
|
15177
15177
|
const ret = firstChild.codegenNode;
|
|
15178
15178
|
const vnodeCall = getMemoedVNodeCall(ret);
|
|
15179
|
-
if (vnodeCall.type ===
|
|
15179
|
+
if (vnodeCall.type === 13) {
|
|
15180
15180
|
makeBlock(vnodeCall, context);
|
|
15181
15181
|
}
|
|
15182
15182
|
injectProp(vnodeCall, keyProperty, context);
|
|
@@ -15187,7 +15187,7 @@ function isSameKey(a, b) {
|
|
|
15187
15187
|
if (!a || a.type !== b.type) {
|
|
15188
15188
|
return false;
|
|
15189
15189
|
}
|
|
15190
|
-
if (a.type ===
|
|
15190
|
+
if (a.type === 6) {
|
|
15191
15191
|
if (a.value.content !== b.value.content) {
|
|
15192
15192
|
return false;
|
|
15193
15193
|
}
|
|
@@ -15197,7 +15197,7 @@ function isSameKey(a, b) {
|
|
|
15197
15197
|
if (exp.type !== branchExp.type) {
|
|
15198
15198
|
return false;
|
|
15199
15199
|
}
|
|
15200
|
-
if (exp.type !==
|
|
15200
|
+
if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) {
|
|
15201
15201
|
return false;
|
|
15202
15202
|
}
|
|
15203
15203
|
}
|
|
@@ -15205,13 +15205,13 @@ function isSameKey(a, b) {
|
|
|
15205
15205
|
}
|
|
15206
15206
|
function getParentCondition(node) {
|
|
15207
15207
|
while (true) {
|
|
15208
|
-
if (node.type ===
|
|
15209
|
-
if (node.alternate.type ===
|
|
15208
|
+
if (node.type === 19) {
|
|
15209
|
+
if (node.alternate.type === 19) {
|
|
15210
15210
|
node = node.alternate;
|
|
15211
15211
|
} else {
|
|
15212
15212
|
return node;
|
|
15213
15213
|
}
|
|
15214
|
-
} else if (node.type ===
|
|
15214
|
+
} else if (node.type === 20) {
|
|
15215
15215
|
node = node.value;
|
|
15216
15216
|
}
|
|
15217
15217
|
}
|
|
@@ -15228,9 +15228,9 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
15228
15228
|
const isTemplate = isTemplateNode(node);
|
|
15229
15229
|
const memo = findDir(node, "memo");
|
|
15230
15230
|
const keyProp = findProp(node, `key`);
|
|
15231
|
-
const keyExp = keyProp && (keyProp.type ===
|
|
15231
|
+
const keyExp = keyProp && (keyProp.type === 6 ? createSimpleExpression(keyProp.value.content, true) : keyProp.exp);
|
|
15232
15232
|
const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
|
|
15233
|
-
const isStableFragment = forNode.source.type ===
|
|
15233
|
+
const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
|
|
15234
15234
|
const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
|
|
15235
15235
|
forNode.codegenNode = createVNodeCall(
|
|
15236
15236
|
context,
|
|
@@ -15250,12 +15250,12 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
15250
15250
|
const { children } = forNode;
|
|
15251
15251
|
if (isTemplate) {
|
|
15252
15252
|
node.children.some((c) => {
|
|
15253
|
-
if (c.type ===
|
|
15253
|
+
if (c.type === 1) {
|
|
15254
15254
|
const key = findProp(c, "key");
|
|
15255
15255
|
if (key) {
|
|
15256
15256
|
context.onError(
|
|
15257
15257
|
createCompilerError(
|
|
15258
|
-
|
|
15258
|
+
33,
|
|
15259
15259
|
key.loc
|
|
15260
15260
|
)
|
|
15261
15261
|
);
|
|
@@ -15264,7 +15264,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
15264
15264
|
}
|
|
15265
15265
|
});
|
|
15266
15266
|
}
|
|
15267
|
-
const needFragmentWrapper = children.length !== 1 || children[0].type !==
|
|
15267
|
+
const needFragmentWrapper = children.length !== 1 || children[0].type !== 1;
|
|
15268
15268
|
const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null;
|
|
15269
15269
|
if (slotOutlet) {
|
|
15270
15270
|
childBlock = slotOutlet.codegenNode;
|
|
@@ -15351,7 +15351,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
15351
15351
|
function processFor(node, dir, context, processCodegen) {
|
|
15352
15352
|
if (!dir.exp) {
|
|
15353
15353
|
context.onError(
|
|
15354
|
-
createCompilerError(
|
|
15354
|
+
createCompilerError(31, dir.loc)
|
|
15355
15355
|
);
|
|
15356
15356
|
return;
|
|
15357
15357
|
}
|
|
@@ -15363,14 +15363,14 @@ function processFor(node, dir, context, processCodegen) {
|
|
|
15363
15363
|
);
|
|
15364
15364
|
if (!parseResult) {
|
|
15365
15365
|
context.onError(
|
|
15366
|
-
createCompilerError(
|
|
15366
|
+
createCompilerError(32, dir.loc)
|
|
15367
15367
|
);
|
|
15368
15368
|
return;
|
|
15369
15369
|
}
|
|
15370
15370
|
const { addIdentifiers, removeIdentifiers, scopes } = context;
|
|
15371
15371
|
const { source, value, key, index } = parseResult;
|
|
15372
15372
|
const forNode = {
|
|
15373
|
-
type:
|
|
15373
|
+
type: 11,
|
|
15374
15374
|
loc: dir.loc,
|
|
15375
15375
|
source,
|
|
15376
15376
|
valueAlias: value,
|
|
@@ -15483,7 +15483,7 @@ function createParamsList(args) {
|
|
|
15483
15483
|
|
|
15484
15484
|
const defaultFallback = createSimpleExpression(`undefined`, false);
|
|
15485
15485
|
const trackSlotScopes = (node, context) => {
|
|
15486
|
-
if (node.type ===
|
|
15486
|
+
if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) {
|
|
15487
15487
|
const vSlot = findDir(node, "slot");
|
|
15488
15488
|
if (vSlot) {
|
|
15489
15489
|
vSlot.exp;
|
|
@@ -15529,14 +15529,14 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15529
15529
|
const slotElement = children[i];
|
|
15530
15530
|
let slotDir;
|
|
15531
15531
|
if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) {
|
|
15532
|
-
if (slotElement.type !==
|
|
15532
|
+
if (slotElement.type !== 3) {
|
|
15533
15533
|
implicitDefaultChildren.push(slotElement);
|
|
15534
15534
|
}
|
|
15535
15535
|
continue;
|
|
15536
15536
|
}
|
|
15537
15537
|
if (onComponentSlot) {
|
|
15538
15538
|
context.onError(
|
|
15539
|
-
createCompilerError(
|
|
15539
|
+
createCompilerError(37, slotDir.loc)
|
|
15540
15540
|
);
|
|
15541
15541
|
break;
|
|
15542
15542
|
}
|
|
@@ -15576,7 +15576,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15576
15576
|
let prev;
|
|
15577
15577
|
while (j--) {
|
|
15578
15578
|
prev = children[j];
|
|
15579
|
-
if (prev.type !==
|
|
15579
|
+
if (prev.type !== 3) {
|
|
15580
15580
|
break;
|
|
15581
15581
|
}
|
|
15582
15582
|
}
|
|
@@ -15584,7 +15584,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15584
15584
|
children.splice(i, 1);
|
|
15585
15585
|
i--;
|
|
15586
15586
|
let conditional = dynamicSlots[dynamicSlots.length - 1];
|
|
15587
|
-
while (conditional.alternate.type ===
|
|
15587
|
+
while (conditional.alternate.type === 19) {
|
|
15588
15588
|
conditional = conditional.alternate;
|
|
15589
15589
|
}
|
|
15590
15590
|
conditional.alternate = vElse.exp ? createConditionalExpression(
|
|
@@ -15598,7 +15598,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15598
15598
|
) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++);
|
|
15599
15599
|
} else {
|
|
15600
15600
|
context.onError(
|
|
15601
|
-
createCompilerError(
|
|
15601
|
+
createCompilerError(30, vElse.loc)
|
|
15602
15602
|
);
|
|
15603
15603
|
}
|
|
15604
15604
|
} else if (vFor = findDir(slotElement, "for")) {
|
|
@@ -15618,7 +15618,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15618
15618
|
);
|
|
15619
15619
|
} else {
|
|
15620
15620
|
context.onError(
|
|
15621
|
-
createCompilerError(
|
|
15621
|
+
createCompilerError(32, vFor.loc)
|
|
15622
15622
|
);
|
|
15623
15623
|
}
|
|
15624
15624
|
} else {
|
|
@@ -15626,7 +15626,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15626
15626
|
if (seenSlotNames.has(staticSlotName)) {
|
|
15627
15627
|
context.onError(
|
|
15628
15628
|
createCompilerError(
|
|
15629
|
-
|
|
15629
|
+
38,
|
|
15630
15630
|
dirLoc
|
|
15631
15631
|
)
|
|
15632
15632
|
);
|
|
@@ -15657,7 +15657,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15657
15657
|
if (hasNamedDefaultSlot) {
|
|
15658
15658
|
context.onError(
|
|
15659
15659
|
createCompilerError(
|
|
15660
|
-
|
|
15660
|
+
39,
|
|
15661
15661
|
implicitDefaultChildren[0].loc
|
|
15662
15662
|
)
|
|
15663
15663
|
);
|
|
@@ -15710,17 +15710,17 @@ function hasForwardedSlots(children) {
|
|
|
15710
15710
|
for (let i = 0; i < children.length; i++) {
|
|
15711
15711
|
const child = children[i];
|
|
15712
15712
|
switch (child.type) {
|
|
15713
|
-
case
|
|
15714
|
-
if (child.tagType ===
|
|
15713
|
+
case 1:
|
|
15714
|
+
if (child.tagType === 2 || hasForwardedSlots(child.children)) {
|
|
15715
15715
|
return true;
|
|
15716
15716
|
}
|
|
15717
15717
|
break;
|
|
15718
|
-
case
|
|
15718
|
+
case 9:
|
|
15719
15719
|
if (hasForwardedSlots(child.branches))
|
|
15720
15720
|
return true;
|
|
15721
15721
|
break;
|
|
15722
|
-
case
|
|
15723
|
-
case
|
|
15722
|
+
case 10:
|
|
15723
|
+
case 11:
|
|
15724
15724
|
if (hasForwardedSlots(child.children))
|
|
15725
15725
|
return true;
|
|
15726
15726
|
break;
|
|
@@ -15729,20 +15729,20 @@ function hasForwardedSlots(children) {
|
|
|
15729
15729
|
return false;
|
|
15730
15730
|
}
|
|
15731
15731
|
function isNonWhitespaceContent(node) {
|
|
15732
|
-
if (node.type !==
|
|
15732
|
+
if (node.type !== 2 && node.type !== 12)
|
|
15733
15733
|
return true;
|
|
15734
|
-
return node.type ===
|
|
15734
|
+
return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content);
|
|
15735
15735
|
}
|
|
15736
15736
|
|
|
15737
15737
|
const directiveImportMap = /* @__PURE__ */ new WeakMap();
|
|
15738
15738
|
const transformElement = (node, context) => {
|
|
15739
15739
|
return function postTransformElement() {
|
|
15740
15740
|
node = context.currentNode;
|
|
15741
|
-
if (!(node.type ===
|
|
15741
|
+
if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) {
|
|
15742
15742
|
return;
|
|
15743
15743
|
}
|
|
15744
15744
|
const { tag, props } = node;
|
|
15745
|
-
const isComponent = node.tagType ===
|
|
15745
|
+
const isComponent = node.tagType === 1;
|
|
15746
15746
|
let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`;
|
|
15747
15747
|
const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
|
|
15748
15748
|
let vnodeProps;
|
|
@@ -15785,7 +15785,7 @@ const transformElement = (node, context) => {
|
|
|
15785
15785
|
patchFlag |= 1024;
|
|
15786
15786
|
if (node.children.length > 1) {
|
|
15787
15787
|
context.onError(
|
|
15788
|
-
createCompilerError(
|
|
15788
|
+
createCompilerError(46, {
|
|
15789
15789
|
start: node.children[0].loc.start,
|
|
15790
15790
|
end: node.children[node.children.length - 1].loc.end,
|
|
15791
15791
|
source: ""
|
|
@@ -15805,11 +15805,11 @@ const transformElement = (node, context) => {
|
|
|
15805
15805
|
} else if (node.children.length === 1 && vnodeTag !== TELEPORT) {
|
|
15806
15806
|
const child = node.children[0];
|
|
15807
15807
|
const type = child.type;
|
|
15808
|
-
const hasDynamicTextChild = type ===
|
|
15808
|
+
const hasDynamicTextChild = type === 5 || type === 8;
|
|
15809
15809
|
if (hasDynamicTextChild && getConstantType(child, context) === 0) {
|
|
15810
15810
|
patchFlag |= 1;
|
|
15811
15811
|
}
|
|
15812
|
-
if (hasDynamicTextChild || type ===
|
|
15812
|
+
if (hasDynamicTextChild || type === 2) {
|
|
15813
15813
|
vnodeChildren = child;
|
|
15814
15814
|
} else {
|
|
15815
15815
|
vnodeChildren = node.children;
|
|
@@ -15855,13 +15855,13 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
15855
15855
|
"COMPILER_IS_ON_ELEMENT",
|
|
15856
15856
|
context
|
|
15857
15857
|
)) {
|
|
15858
|
-
const exp = isProp.type ===
|
|
15858
|
+
const exp = isProp.type === 6 ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp;
|
|
15859
15859
|
if (exp) {
|
|
15860
15860
|
return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
|
|
15861
15861
|
exp
|
|
15862
15862
|
]);
|
|
15863
15863
|
}
|
|
15864
|
-
} else if (isProp.type ===
|
|
15864
|
+
} else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) {
|
|
15865
15865
|
tag = isProp.value.content.slice(4);
|
|
15866
15866
|
}
|
|
15867
15867
|
}
|
|
@@ -15920,7 +15920,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
15920
15920
|
if (isEventHandler && isReservedProp(name)) {
|
|
15921
15921
|
hasVnodeHook = true;
|
|
15922
15922
|
}
|
|
15923
|
-
if (value.type ===
|
|
15923
|
+
if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
|
|
15924
15924
|
return;
|
|
15925
15925
|
}
|
|
15926
15926
|
if (name === "ref") {
|
|
@@ -15941,7 +15941,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
15941
15941
|
};
|
|
15942
15942
|
for (let i = 0; i < props.length; i++) {
|
|
15943
15943
|
const prop = props[i];
|
|
15944
|
-
if (prop.type ===
|
|
15944
|
+
if (prop.type === 6) {
|
|
15945
15945
|
const { loc, name, value } = prop;
|
|
15946
15946
|
let isStatic = true;
|
|
15947
15947
|
if (name === "ref") {
|
|
@@ -15982,7 +15982,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
15982
15982
|
if (name === "slot") {
|
|
15983
15983
|
if (!isComponent) {
|
|
15984
15984
|
context.onError(
|
|
15985
|
-
createCompilerError(
|
|
15985
|
+
createCompilerError(40, loc)
|
|
15986
15986
|
);
|
|
15987
15987
|
}
|
|
15988
15988
|
continue;
|
|
@@ -16023,9 +16023,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16023
16023
|
{
|
|
16024
16024
|
{
|
|
16025
16025
|
const hasOverridableKeys = mergeArgs.some((arg2) => {
|
|
16026
|
-
if (arg2.type ===
|
|
16026
|
+
if (arg2.type === 15) {
|
|
16027
16027
|
return arg2.properties.some(({ key }) => {
|
|
16028
|
-
if (key.type !==
|
|
16028
|
+
if (key.type !== 4 || !key.isStatic) {
|
|
16029
16029
|
return true;
|
|
16030
16030
|
}
|
|
16031
16031
|
return key.content !== "class" && key.content !== "style" && !isOn(key.content);
|
|
@@ -16053,7 +16053,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16053
16053
|
mergeArgs.push(exp);
|
|
16054
16054
|
} else {
|
|
16055
16055
|
pushMergeArg({
|
|
16056
|
-
type:
|
|
16056
|
+
type: 14,
|
|
16057
16057
|
loc,
|
|
16058
16058
|
callee: context.helper(TO_HANDLERS),
|
|
16059
16059
|
arguments: isComponent ? [exp] : [exp, `true`]
|
|
@@ -16062,7 +16062,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16062
16062
|
} else {
|
|
16063
16063
|
context.onError(
|
|
16064
16064
|
createCompilerError(
|
|
16065
|
-
isVBind ?
|
|
16065
|
+
isVBind ? 34 : 35,
|
|
16066
16066
|
loc
|
|
16067
16067
|
)
|
|
16068
16068
|
);
|
|
@@ -16131,7 +16131,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16131
16131
|
}
|
|
16132
16132
|
if (!context.inSSR && propsExpression) {
|
|
16133
16133
|
switch (propsExpression.type) {
|
|
16134
|
-
case
|
|
16134
|
+
case 15:
|
|
16135
16135
|
let classKeyIndex = -1;
|
|
16136
16136
|
let styleKeyIndex = -1;
|
|
16137
16137
|
let hasDynamicKey = false;
|
|
@@ -16158,9 +16158,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16158
16158
|
}
|
|
16159
16159
|
if (styleProp && // the static style is compiled into an object,
|
|
16160
16160
|
// so use `hasStyleBinding` to ensure that it is a dynamic style binding
|
|
16161
|
-
(hasStyleBinding || styleProp.value.type ===
|
|
16161
|
+
(hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist,
|
|
16162
16162
|
// v-bind:style with static literal object
|
|
16163
|
-
styleProp.value.type ===
|
|
16163
|
+
styleProp.value.type === 17)) {
|
|
16164
16164
|
styleProp.value = createCallExpression(
|
|
16165
16165
|
context.helper(NORMALIZE_STYLE),
|
|
16166
16166
|
[styleProp.value]
|
|
@@ -16173,7 +16173,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
16173
16173
|
);
|
|
16174
16174
|
}
|
|
16175
16175
|
break;
|
|
16176
|
-
case
|
|
16176
|
+
case 14:
|
|
16177
16177
|
break;
|
|
16178
16178
|
default:
|
|
16179
16179
|
propsExpression = createCallExpression(
|
|
@@ -16200,7 +16200,7 @@ function dedupeProperties(properties) {
|
|
|
16200
16200
|
const deduped = [];
|
|
16201
16201
|
for (let i = 0; i < properties.length; i++) {
|
|
16202
16202
|
const prop = properties[i];
|
|
16203
|
-
if (prop.key.type ===
|
|
16203
|
+
if (prop.key.type === 8 || !prop.key.isStatic) {
|
|
16204
16204
|
deduped.push(prop);
|
|
16205
16205
|
continue;
|
|
16206
16206
|
}
|
|
@@ -16218,7 +16218,7 @@ function dedupeProperties(properties) {
|
|
|
16218
16218
|
return deduped;
|
|
16219
16219
|
}
|
|
16220
16220
|
function mergeAsArray(existing, incoming) {
|
|
16221
|
-
if (existing.value.type ===
|
|
16221
|
+
if (existing.value.type === 17) {
|
|
16222
16222
|
existing.value.elements.push(incoming.value);
|
|
16223
16223
|
} else {
|
|
16224
16224
|
existing.value = createArrayExpression(
|
|
@@ -16317,7 +16317,7 @@ function processSlotOutlet(node, context) {
|
|
|
16317
16317
|
const nonNameProps = [];
|
|
16318
16318
|
for (let i = 0; i < node.props.length; i++) {
|
|
16319
16319
|
const p = node.props[i];
|
|
16320
|
-
if (p.type ===
|
|
16320
|
+
if (p.type === 6) {
|
|
16321
16321
|
if (p.value) {
|
|
16322
16322
|
if (p.name === "name") {
|
|
16323
16323
|
slotName = JSON.stringify(p.value.content);
|
|
@@ -16350,7 +16350,7 @@ function processSlotOutlet(node, context) {
|
|
|
16350
16350
|
if (directives.length) {
|
|
16351
16351
|
context.onError(
|
|
16352
16352
|
createCompilerError(
|
|
16353
|
-
|
|
16353
|
+
36,
|
|
16354
16354
|
directives[0].loc
|
|
16355
16355
|
)
|
|
16356
16356
|
);
|
|
@@ -16366,16 +16366,16 @@ const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+
|
|
|
16366
16366
|
const transformOn$1 = (dir, node, context, augmentor) => {
|
|
16367
16367
|
const { loc, modifiers, arg } = dir;
|
|
16368
16368
|
if (!dir.exp && !modifiers.length) {
|
|
16369
|
-
context.onError(createCompilerError(
|
|
16369
|
+
context.onError(createCompilerError(35, loc));
|
|
16370
16370
|
}
|
|
16371
16371
|
let eventName;
|
|
16372
|
-
if (arg.type ===
|
|
16372
|
+
if (arg.type === 4) {
|
|
16373
16373
|
if (arg.isStatic) {
|
|
16374
16374
|
let rawName = arg.content;
|
|
16375
16375
|
if (rawName.startsWith("vue:")) {
|
|
16376
16376
|
rawName = `vnode-${rawName.slice(4)}`;
|
|
16377
16377
|
}
|
|
16378
|
-
const eventString = node.tagType !==
|
|
16378
|
+
const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? (
|
|
16379
16379
|
// for non-element and vnode lifecycle event listeners, auto convert
|
|
16380
16380
|
// it to camelCase. See issue #2249
|
|
16381
16381
|
toHandlerKey(camelize(rawName))
|
|
@@ -16443,14 +16443,14 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
16443
16443
|
const transformBind = (dir, _node, context) => {
|
|
16444
16444
|
const { exp, modifiers, loc } = dir;
|
|
16445
16445
|
const arg = dir.arg;
|
|
16446
|
-
if (arg.type !==
|
|
16446
|
+
if (arg.type !== 4) {
|
|
16447
16447
|
arg.children.unshift(`(`);
|
|
16448
16448
|
arg.children.push(`) || ""`);
|
|
16449
16449
|
} else if (!arg.isStatic) {
|
|
16450
16450
|
arg.content = `${arg.content} || ""`;
|
|
16451
16451
|
}
|
|
16452
16452
|
if (modifiers.includes("camel")) {
|
|
16453
|
-
if (arg.type ===
|
|
16453
|
+
if (arg.type === 4) {
|
|
16454
16454
|
if (arg.isStatic) {
|
|
16455
16455
|
arg.content = camelize(arg.content);
|
|
16456
16456
|
} else {
|
|
@@ -16469,8 +16469,8 @@ const transformBind = (dir, _node, context) => {
|
|
|
16469
16469
|
injectPrefix(arg, "^");
|
|
16470
16470
|
}
|
|
16471
16471
|
}
|
|
16472
|
-
if (!exp || exp.type ===
|
|
16473
|
-
context.onError(createCompilerError(
|
|
16472
|
+
if (!exp || exp.type === 4 && !exp.content.trim()) {
|
|
16473
|
+
context.onError(createCompilerError(34, loc));
|
|
16474
16474
|
return {
|
|
16475
16475
|
props: [createObjectProperty(arg, createSimpleExpression("", true, loc))]
|
|
16476
16476
|
};
|
|
@@ -16480,7 +16480,7 @@ const transformBind = (dir, _node, context) => {
|
|
|
16480
16480
|
};
|
|
16481
16481
|
};
|
|
16482
16482
|
const injectPrefix = (arg, prefix) => {
|
|
16483
|
-
if (arg.type ===
|
|
16483
|
+
if (arg.type === 4) {
|
|
16484
16484
|
if (arg.isStatic) {
|
|
16485
16485
|
arg.content = prefix + arg.content;
|
|
16486
16486
|
} else {
|
|
@@ -16493,7 +16493,7 @@ const injectPrefix = (arg, prefix) => {
|
|
|
16493
16493
|
};
|
|
16494
16494
|
|
|
16495
16495
|
const transformText = (node, context) => {
|
|
16496
|
-
if (node.type ===
|
|
16496
|
+
if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) {
|
|
16497
16497
|
return () => {
|
|
16498
16498
|
const children = node.children;
|
|
16499
16499
|
let currentContainer = void 0;
|
|
@@ -16525,13 +16525,13 @@ const transformText = (node, context) => {
|
|
|
16525
16525
|
// as-is since the runtime has dedicated fast path for this by directly
|
|
16526
16526
|
// setting textContent of the element.
|
|
16527
16527
|
// for component root it's always normalized anyway.
|
|
16528
|
-
children.length === 1 && (node.type ===
|
|
16528
|
+
children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756
|
|
16529
16529
|
// custom directives can potentially add DOM elements arbitrarily,
|
|
16530
16530
|
// we need to avoid setting textContent of the element at runtime
|
|
16531
16531
|
// to avoid accidentally overwriting the DOM elements added
|
|
16532
16532
|
// by the user through custom directives.
|
|
16533
16533
|
!node.props.find(
|
|
16534
|
-
(p) => p.type ===
|
|
16534
|
+
(p) => p.type === 7 && !context.directiveTransforms[p.name]
|
|
16535
16535
|
) && // in compat mode, <template> tags with no special directives
|
|
16536
16536
|
// will be rendered as a fragment so its children must be
|
|
16537
16537
|
// converted into vnodes.
|
|
@@ -16540,9 +16540,9 @@ const transformText = (node, context) => {
|
|
|
16540
16540
|
}
|
|
16541
16541
|
for (let i = 0; i < children.length; i++) {
|
|
16542
16542
|
const child = children[i];
|
|
16543
|
-
if (isText$1(child) || child.type ===
|
|
16543
|
+
if (isText$1(child) || child.type === 8) {
|
|
16544
16544
|
const callArgs = [];
|
|
16545
|
-
if (child.type !==
|
|
16545
|
+
if (child.type !== 2 || child.content !== " ") {
|
|
16546
16546
|
callArgs.push(child);
|
|
16547
16547
|
}
|
|
16548
16548
|
if (!context.ssr && getConstantType(child, context) === 0) {
|
|
@@ -16551,7 +16551,7 @@ const transformText = (node, context) => {
|
|
|
16551
16551
|
);
|
|
16552
16552
|
}
|
|
16553
16553
|
children[i] = {
|
|
16554
|
-
type:
|
|
16554
|
+
type: 12,
|
|
16555
16555
|
content: child,
|
|
16556
16556
|
loc: child.loc,
|
|
16557
16557
|
codegenNode: createCallExpression(
|
|
@@ -16567,7 +16567,7 @@ const transformText = (node, context) => {
|
|
|
16567
16567
|
|
|
16568
16568
|
const seen$1 = /* @__PURE__ */ new WeakSet();
|
|
16569
16569
|
const transformOnce = (node, context) => {
|
|
16570
|
-
if (node.type ===
|
|
16570
|
+
if (node.type === 1 && findDir(node, "once", true)) {
|
|
16571
16571
|
if (seen$1.has(node) || context.inVOnce) {
|
|
16572
16572
|
return;
|
|
16573
16573
|
}
|
|
@@ -16592,21 +16592,21 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
16592
16592
|
const { exp, arg } = dir;
|
|
16593
16593
|
if (!exp) {
|
|
16594
16594
|
context.onError(
|
|
16595
|
-
createCompilerError(
|
|
16595
|
+
createCompilerError(41, dir.loc)
|
|
16596
16596
|
);
|
|
16597
16597
|
return createTransformProps();
|
|
16598
16598
|
}
|
|
16599
16599
|
const rawExp = exp.loc.source;
|
|
16600
|
-
const expString = exp.type ===
|
|
16600
|
+
const expString = exp.type === 4 ? exp.content : rawExp;
|
|
16601
16601
|
const bindingType = context.bindingMetadata[rawExp];
|
|
16602
16602
|
if (bindingType === "props" || bindingType === "props-aliased") {
|
|
16603
|
-
context.onError(createCompilerError(
|
|
16603
|
+
context.onError(createCompilerError(44, exp.loc));
|
|
16604
16604
|
return createTransformProps();
|
|
16605
16605
|
}
|
|
16606
16606
|
const maybeRef = false;
|
|
16607
16607
|
if (!expString.trim() || !isMemberExpression(expString) && !maybeRef) {
|
|
16608
16608
|
context.onError(
|
|
16609
|
-
createCompilerError(
|
|
16609
|
+
createCompilerError(42, exp.loc)
|
|
16610
16610
|
);
|
|
16611
16611
|
return createTransformProps();
|
|
16612
16612
|
}
|
|
@@ -16627,7 +16627,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
16627
16627
|
// "onUpdate:modelValue": $event => (foo = $event)
|
|
16628
16628
|
createObjectProperty(eventName, assignmentExp)
|
|
16629
16629
|
];
|
|
16630
|
-
if (dir.modifiers.length && node.tagType ===
|
|
16630
|
+
if (dir.modifiers.length && node.tagType === 1) {
|
|
16631
16631
|
const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
|
|
16632
16632
|
const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
|
|
16633
16633
|
props.push(
|
|
@@ -16637,7 +16637,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
16637
16637
|
`{ ${modifiers} }`,
|
|
16638
16638
|
false,
|
|
16639
16639
|
dir.loc,
|
|
16640
|
-
|
|
16640
|
+
2
|
|
16641
16641
|
)
|
|
16642
16642
|
)
|
|
16643
16643
|
);
|
|
@@ -16653,30 +16653,30 @@ const transformFilter = (node, context) => {
|
|
|
16653
16653
|
if (!isCompatEnabled("COMPILER_FILTER", context)) {
|
|
16654
16654
|
return;
|
|
16655
16655
|
}
|
|
16656
|
-
if (node.type ===
|
|
16656
|
+
if (node.type === 5) {
|
|
16657
16657
|
rewriteFilter(node.content, context);
|
|
16658
16658
|
}
|
|
16659
|
-
if (node.type ===
|
|
16659
|
+
if (node.type === 1) {
|
|
16660
16660
|
node.props.forEach((prop) => {
|
|
16661
|
-
if (prop.type ===
|
|
16661
|
+
if (prop.type === 7 && prop.name !== "for" && prop.exp) {
|
|
16662
16662
|
rewriteFilter(prop.exp, context);
|
|
16663
16663
|
}
|
|
16664
16664
|
});
|
|
16665
16665
|
}
|
|
16666
16666
|
};
|
|
16667
16667
|
function rewriteFilter(node, context) {
|
|
16668
|
-
if (node.type ===
|
|
16668
|
+
if (node.type === 4) {
|
|
16669
16669
|
parseFilter(node, context);
|
|
16670
16670
|
} else {
|
|
16671
16671
|
for (let i = 0; i < node.children.length; i++) {
|
|
16672
16672
|
const child = node.children[i];
|
|
16673
16673
|
if (typeof child !== "object")
|
|
16674
16674
|
continue;
|
|
16675
|
-
if (child.type ===
|
|
16675
|
+
if (child.type === 4) {
|
|
16676
16676
|
parseFilter(child, context);
|
|
16677
|
-
} else if (child.type ===
|
|
16677
|
+
} else if (child.type === 8) {
|
|
16678
16678
|
rewriteFilter(node, context);
|
|
16679
|
-
} else if (child.type ===
|
|
16679
|
+
} else if (child.type === 5) {
|
|
16680
16680
|
rewriteFilter(child.content, context);
|
|
16681
16681
|
}
|
|
16682
16682
|
}
|
|
@@ -16797,7 +16797,7 @@ function wrapFilter(exp, filter, context) {
|
|
|
16797
16797
|
|
|
16798
16798
|
const seen = /* @__PURE__ */ new WeakSet();
|
|
16799
16799
|
const transformMemo = (node, context) => {
|
|
16800
|
-
if (node.type ===
|
|
16800
|
+
if (node.type === 1) {
|
|
16801
16801
|
const dir = findDir(node, "memo");
|
|
16802
16802
|
if (!dir || seen.has(node)) {
|
|
16803
16803
|
return;
|
|
@@ -16805,8 +16805,8 @@ const transformMemo = (node, context) => {
|
|
|
16805
16805
|
seen.add(node);
|
|
16806
16806
|
return () => {
|
|
16807
16807
|
const codegenNode = node.codegenNode || context.currentNode.codegenNode;
|
|
16808
|
-
if (codegenNode && codegenNode.type ===
|
|
16809
|
-
if (node.tagType !==
|
|
16808
|
+
if (codegenNode && codegenNode.type === 13) {
|
|
16809
|
+
if (node.tagType !== 1) {
|
|
16810
16810
|
makeBlock(codegenNode, context);
|
|
16811
16811
|
}
|
|
16812
16812
|
node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
|
|
@@ -16846,17 +16846,17 @@ function baseCompile(template, options = {}) {
|
|
|
16846
16846
|
const isModuleMode = options.mode === "module";
|
|
16847
16847
|
{
|
|
16848
16848
|
if (options.prefixIdentifiers === true) {
|
|
16849
|
-
onError(createCompilerError(
|
|
16849
|
+
onError(createCompilerError(47));
|
|
16850
16850
|
} else if (isModuleMode) {
|
|
16851
|
-
onError(createCompilerError(
|
|
16851
|
+
onError(createCompilerError(48));
|
|
16852
16852
|
}
|
|
16853
16853
|
}
|
|
16854
16854
|
const prefixIdentifiers = false;
|
|
16855
16855
|
if (options.cacheHandlers) {
|
|
16856
|
-
onError(createCompilerError(
|
|
16856
|
+
onError(createCompilerError(49));
|
|
16857
16857
|
}
|
|
16858
16858
|
if (options.scopeId && !isModuleMode) {
|
|
16859
|
-
onError(createCompilerError(
|
|
16859
|
+
onError(createCompilerError(50));
|
|
16860
16860
|
}
|
|
16861
16861
|
const ast = isString(template) ? baseParse(template, options) : template;
|
|
16862
16862
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
|
|
@@ -16943,30 +16943,30 @@ const parserOptions = {
|
|
|
16943
16943
|
// https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
|
|
16944
16944
|
getNamespace(tag, parent) {
|
|
16945
16945
|
let ns = parent ? parent.ns : 0;
|
|
16946
|
-
if (parent && ns ===
|
|
16946
|
+
if (parent && ns === 2) {
|
|
16947
16947
|
if (parent.tag === "annotation-xml") {
|
|
16948
16948
|
if (tag === "svg") {
|
|
16949
|
-
return
|
|
16949
|
+
return 1;
|
|
16950
16950
|
}
|
|
16951
16951
|
if (parent.props.some(
|
|
16952
|
-
(a) => a.type ===
|
|
16952
|
+
(a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml")
|
|
16953
16953
|
)) {
|
|
16954
16954
|
ns = 0;
|
|
16955
16955
|
}
|
|
16956
16956
|
} else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") {
|
|
16957
16957
|
ns = 0;
|
|
16958
16958
|
}
|
|
16959
|
-
} else if (parent && ns ===
|
|
16959
|
+
} else if (parent && ns === 1) {
|
|
16960
16960
|
if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") {
|
|
16961
16961
|
ns = 0;
|
|
16962
16962
|
}
|
|
16963
16963
|
}
|
|
16964
16964
|
if (ns === 0) {
|
|
16965
16965
|
if (tag === "svg") {
|
|
16966
|
-
return
|
|
16966
|
+
return 1;
|
|
16967
16967
|
}
|
|
16968
16968
|
if (tag === "math") {
|
|
16969
|
-
return
|
|
16969
|
+
return 2;
|
|
16970
16970
|
}
|
|
16971
16971
|
}
|
|
16972
16972
|
return ns;
|
|
@@ -16975,22 +16975,22 @@ const parserOptions = {
|
|
|
16975
16975
|
getTextMode({ tag, ns }) {
|
|
16976
16976
|
if (ns === 0) {
|
|
16977
16977
|
if (tag === "textarea" || tag === "title") {
|
|
16978
|
-
return
|
|
16978
|
+
return 1;
|
|
16979
16979
|
}
|
|
16980
16980
|
if (isRawTextContainer(tag)) {
|
|
16981
|
-
return
|
|
16981
|
+
return 2;
|
|
16982
16982
|
}
|
|
16983
16983
|
}
|
|
16984
|
-
return
|
|
16984
|
+
return 0;
|
|
16985
16985
|
}
|
|
16986
16986
|
};
|
|
16987
16987
|
|
|
16988
16988
|
const transformStyle = (node) => {
|
|
16989
|
-
if (node.type ===
|
|
16989
|
+
if (node.type === 1) {
|
|
16990
16990
|
node.props.forEach((p, i) => {
|
|
16991
|
-
if (p.type ===
|
|
16991
|
+
if (p.type === 6 && p.name === "style" && p.value) {
|
|
16992
16992
|
node.props[i] = {
|
|
16993
|
-
type:
|
|
16993
|
+
type: 7,
|
|
16994
16994
|
name: `bind`,
|
|
16995
16995
|
arg: createSimpleExpression(`style`, true, p.loc),
|
|
16996
16996
|
exp: parseInlineCSS(p.value.content, p.loc),
|
|
@@ -17007,7 +17007,7 @@ const parseInlineCSS = (cssText, loc) => {
|
|
|
17007
17007
|
JSON.stringify(normalized),
|
|
17008
17008
|
false,
|
|
17009
17009
|
loc,
|
|
17010
|
-
|
|
17010
|
+
3
|
|
17011
17011
|
);
|
|
17012
17012
|
};
|
|
17013
17013
|
|
|
@@ -17020,16 +17020,16 @@ function createDOMCompilerError(code, loc) {
|
|
|
17020
17020
|
}
|
|
17021
17021
|
const DOMErrorMessages = {
|
|
17022
17022
|
[51]: `v-html is missing expression.`,
|
|
17023
|
-
[
|
|
17024
|
-
[
|
|
17025
|
-
[
|
|
17026
|
-
[
|
|
17027
|
-
[
|
|
17028
|
-
[
|
|
17029
|
-
[
|
|
17030
|
-
[
|
|
17031
|
-
[
|
|
17032
|
-
[
|
|
17023
|
+
[52]: `v-html will override element children.`,
|
|
17024
|
+
[53]: `v-text is missing expression.`,
|
|
17025
|
+
[54]: `v-text will override element children.`,
|
|
17026
|
+
[55]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
17027
|
+
[56]: `v-model argument is not supported on plain elements.`,
|
|
17028
|
+
[57]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
|
17029
|
+
[58]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
17030
|
+
[59]: `v-show is missing expression.`,
|
|
17031
|
+
[60]: `<Transition> expects exactly one child element or component.`,
|
|
17032
|
+
[61]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
17033
17033
|
};
|
|
17034
17034
|
|
|
17035
17035
|
const transformVHtml = (dir, node, context) => {
|
|
@@ -17041,7 +17041,7 @@ const transformVHtml = (dir, node, context) => {
|
|
|
17041
17041
|
}
|
|
17042
17042
|
if (node.children.length) {
|
|
17043
17043
|
context.onError(
|
|
17044
|
-
createDOMCompilerError(
|
|
17044
|
+
createDOMCompilerError(52, loc)
|
|
17045
17045
|
);
|
|
17046
17046
|
node.children.length = 0;
|
|
17047
17047
|
}
|
|
@@ -17059,12 +17059,12 @@ const transformVText = (dir, node, context) => {
|
|
|
17059
17059
|
const { exp, loc } = dir;
|
|
17060
17060
|
if (!exp) {
|
|
17061
17061
|
context.onError(
|
|
17062
|
-
createDOMCompilerError(
|
|
17062
|
+
createDOMCompilerError(53, loc)
|
|
17063
17063
|
);
|
|
17064
17064
|
}
|
|
17065
17065
|
if (node.children.length) {
|
|
17066
17066
|
context.onError(
|
|
17067
|
-
createDOMCompilerError(
|
|
17067
|
+
createDOMCompilerError(54, loc)
|
|
17068
17068
|
);
|
|
17069
17069
|
node.children.length = 0;
|
|
17070
17070
|
}
|
|
@@ -17084,13 +17084,13 @@ const transformVText = (dir, node, context) => {
|
|
|
17084
17084
|
|
|
17085
17085
|
const transformModel = (dir, node, context) => {
|
|
17086
17086
|
const baseResult = transformModel$1(dir, node, context);
|
|
17087
|
-
if (!baseResult.props.length || node.tagType ===
|
|
17087
|
+
if (!baseResult.props.length || node.tagType === 1) {
|
|
17088
17088
|
return baseResult;
|
|
17089
17089
|
}
|
|
17090
17090
|
if (dir.arg) {
|
|
17091
17091
|
context.onError(
|
|
17092
17092
|
createDOMCompilerError(
|
|
17093
|
-
|
|
17093
|
+
56,
|
|
17094
17094
|
dir.arg.loc
|
|
17095
17095
|
)
|
|
17096
17096
|
);
|
|
@@ -17100,7 +17100,7 @@ const transformModel = (dir, node, context) => {
|
|
|
17100
17100
|
if (value) {
|
|
17101
17101
|
context.onError(
|
|
17102
17102
|
createDOMCompilerError(
|
|
17103
|
-
|
|
17103
|
+
58,
|
|
17104
17104
|
value.loc
|
|
17105
17105
|
)
|
|
17106
17106
|
);
|
|
@@ -17114,7 +17114,7 @@ const transformModel = (dir, node, context) => {
|
|
|
17114
17114
|
if (tag === "input" || isCustomElement) {
|
|
17115
17115
|
const type = findProp(node, `type`);
|
|
17116
17116
|
if (type) {
|
|
17117
|
-
if (type.type ===
|
|
17117
|
+
if (type.type === 7) {
|
|
17118
17118
|
directiveToUse = V_MODEL_DYNAMIC;
|
|
17119
17119
|
} else if (type.value) {
|
|
17120
17120
|
switch (type.value.content) {
|
|
@@ -17128,7 +17128,7 @@ const transformModel = (dir, node, context) => {
|
|
|
17128
17128
|
isInvalidType = true;
|
|
17129
17129
|
context.onError(
|
|
17130
17130
|
createDOMCompilerError(
|
|
17131
|
-
|
|
17131
|
+
57,
|
|
17132
17132
|
dir.loc
|
|
17133
17133
|
)
|
|
17134
17134
|
);
|
|
@@ -17154,13 +17154,13 @@ const transformModel = (dir, node, context) => {
|
|
|
17154
17154
|
} else {
|
|
17155
17155
|
context.onError(
|
|
17156
17156
|
createDOMCompilerError(
|
|
17157
|
-
|
|
17157
|
+
55,
|
|
17158
17158
|
dir.loc
|
|
17159
17159
|
)
|
|
17160
17160
|
);
|
|
17161
17161
|
}
|
|
17162
17162
|
baseResult.props = baseResult.props.filter(
|
|
17163
|
-
(p) => !(p.key.type ===
|
|
17163
|
+
(p) => !(p.key.type === 4 && p.key.content === "modelValue")
|
|
17164
17164
|
);
|
|
17165
17165
|
return baseResult;
|
|
17166
17166
|
};
|
|
@@ -17218,7 +17218,7 @@ const resolveModifiers = (key, modifiers, context, loc) => {
|
|
|
17218
17218
|
};
|
|
17219
17219
|
const transformClick = (key, event) => {
|
|
17220
17220
|
const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === "onclick";
|
|
17221
|
-
return isStaticClick ? createSimpleExpression(event, true) : key.type !==
|
|
17221
|
+
return isStaticClick ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([
|
|
17222
17222
|
`(`,
|
|
17223
17223
|
key,
|
|
17224
17224
|
`) === "onClick" ? "${event}" : (`,
|
|
@@ -17266,7 +17266,7 @@ const transformShow = (dir, node, context) => {
|
|
|
17266
17266
|
const { exp, loc } = dir;
|
|
17267
17267
|
if (!exp) {
|
|
17268
17268
|
context.onError(
|
|
17269
|
-
createDOMCompilerError(
|
|
17269
|
+
createDOMCompilerError(59, loc)
|
|
17270
17270
|
);
|
|
17271
17271
|
}
|
|
17272
17272
|
return {
|
|
@@ -17276,7 +17276,7 @@ const transformShow = (dir, node, context) => {
|
|
|
17276
17276
|
};
|
|
17277
17277
|
|
|
17278
17278
|
const transformTransition = (node, context) => {
|
|
17279
|
-
if (node.type ===
|
|
17279
|
+
if (node.type === 1 && node.tagType === 1) {
|
|
17280
17280
|
const component = context.isBuiltInComponent(node.tag);
|
|
17281
17281
|
if (component === TRANSITION) {
|
|
17282
17282
|
return () => {
|
|
@@ -17286,7 +17286,7 @@ const transformTransition = (node, context) => {
|
|
|
17286
17286
|
if (hasMultipleChildren(node)) {
|
|
17287
17287
|
context.onError(
|
|
17288
17288
|
createDOMCompilerError(
|
|
17289
|
-
|
|
17289
|
+
60,
|
|
17290
17290
|
{
|
|
17291
17291
|
start: node.children[0].loc.start,
|
|
17292
17292
|
end: node.children[node.children.length - 1].loc.end,
|
|
@@ -17296,11 +17296,11 @@ const transformTransition = (node, context) => {
|
|
|
17296
17296
|
);
|
|
17297
17297
|
}
|
|
17298
17298
|
const child = node.children[0];
|
|
17299
|
-
if (child.type ===
|
|
17299
|
+
if (child.type === 1) {
|
|
17300
17300
|
for (const p of child.props) {
|
|
17301
|
-
if (p.type ===
|
|
17301
|
+
if (p.type === 7 && p.name === "show") {
|
|
17302
17302
|
node.props.push({
|
|
17303
|
-
type:
|
|
17303
|
+
type: 6,
|
|
17304
17304
|
name: "persisted",
|
|
17305
17305
|
value: void 0,
|
|
17306
17306
|
loc: node.loc
|
|
@@ -17314,16 +17314,16 @@ const transformTransition = (node, context) => {
|
|
|
17314
17314
|
};
|
|
17315
17315
|
function hasMultipleChildren(node) {
|
|
17316
17316
|
const children = node.children = node.children.filter(
|
|
17317
|
-
(c) => c.type !==
|
|
17317
|
+
(c) => c.type !== 3 && !(c.type === 2 && !c.content.trim())
|
|
17318
17318
|
);
|
|
17319
17319
|
const child = children[0];
|
|
17320
|
-
return children.length !== 1 || child.type ===
|
|
17320
|
+
return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren);
|
|
17321
17321
|
}
|
|
17322
17322
|
|
|
17323
17323
|
const ignoreSideEffectTags = (node, context) => {
|
|
17324
|
-
if (node.type ===
|
|
17324
|
+
if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
|
|
17325
17325
|
context.onError(
|
|
17326
|
-
createDOMCompilerError(
|
|
17326
|
+
createDOMCompilerError(61, node.loc)
|
|
17327
17327
|
);
|
|
17328
17328
|
context.removeNode();
|
|
17329
17329
|
}
|