@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.cjs.prod.js
CHANGED
|
@@ -1451,7 +1451,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
1451
1451
|
callWithErrorHandling(
|
|
1452
1452
|
appErrorHandler,
|
|
1453
1453
|
null,
|
|
1454
|
-
|
|
1454
|
+
10,
|
|
1455
1455
|
[err, exposedInstance, errorInfo]
|
|
1456
1456
|
);
|
|
1457
1457
|
return;
|
|
@@ -1573,7 +1573,7 @@ function flushJobs(seen) {
|
|
|
1573
1573
|
const job = queue[flushIndex];
|
|
1574
1574
|
if (job && job.active !== false) {
|
|
1575
1575
|
if (false) ;
|
|
1576
|
-
callWithErrorHandling(job, null,
|
|
1576
|
+
callWithErrorHandling(job, null, 14);
|
|
1577
1577
|
}
|
|
1578
1578
|
}
|
|
1579
1579
|
} finally {
|
|
@@ -1728,7 +1728,7 @@ function emit$1(instance, event, args) {
|
|
|
1728
1728
|
callWithAsyncErrorHandling(
|
|
1729
1729
|
cbs.map((cb) => cb.bind(instance.proxy)),
|
|
1730
1730
|
instance,
|
|
1731
|
-
|
|
1731
|
+
6,
|
|
1732
1732
|
args
|
|
1733
1733
|
);
|
|
1734
1734
|
}
|
|
@@ -1783,7 +1783,7 @@ function compatModelEmit(instance, event, args) {
|
|
|
1783
1783
|
callWithErrorHandling(
|
|
1784
1784
|
modelHandler,
|
|
1785
1785
|
instance,
|
|
1786
|
-
|
|
1786
|
+
6,
|
|
1787
1787
|
args
|
|
1788
1788
|
);
|
|
1789
1789
|
}
|
|
@@ -1816,7 +1816,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
1816
1816
|
callWithAsyncErrorHandling(
|
|
1817
1817
|
handler,
|
|
1818
1818
|
instance,
|
|
1819
|
-
|
|
1819
|
+
6,
|
|
1820
1820
|
args
|
|
1821
1821
|
);
|
|
1822
1822
|
}
|
|
@@ -1831,7 +1831,7 @@ function emit(instance, event, ...rawArgs) {
|
|
|
1831
1831
|
callWithAsyncErrorHandling(
|
|
1832
1832
|
onceHandler,
|
|
1833
1833
|
instance,
|
|
1834
|
-
|
|
1834
|
+
6,
|
|
1835
1835
|
args
|
|
1836
1836
|
);
|
|
1837
1837
|
}
|
|
@@ -2005,7 +2005,7 @@ function renderComponentRoot(instance) {
|
|
|
2005
2005
|
}
|
|
2006
2006
|
} catch (err) {
|
|
2007
2007
|
blockStack.length = 0;
|
|
2008
|
-
handleError(err, instance,
|
|
2008
|
+
handleError(err, instance, 1);
|
|
2009
2009
|
result = createVNode(Comment);
|
|
2010
2010
|
}
|
|
2011
2011
|
let root = result;
|
|
@@ -2436,7 +2436,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
2436
2436
|
if (delayEnter) {
|
|
2437
2437
|
activeBranch.transition.afterLeave = () => {
|
|
2438
2438
|
if (pendingId === suspense.pendingId) {
|
|
2439
|
-
move(pendingBranch, container2, anchor2,
|
|
2439
|
+
move(pendingBranch, container2, anchor2, 0);
|
|
2440
2440
|
}
|
|
2441
2441
|
};
|
|
2442
2442
|
}
|
|
@@ -2446,7 +2446,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
2446
2446
|
unmount(activeBranch, parentComponent2, suspense, true);
|
|
2447
2447
|
}
|
|
2448
2448
|
if (!delayEnter) {
|
|
2449
|
-
move(pendingBranch, container2, anchor2,
|
|
2449
|
+
move(pendingBranch, container2, anchor2, 0);
|
|
2450
2450
|
}
|
|
2451
2451
|
}
|
|
2452
2452
|
setActiveBranch(suspense, pendingBranch);
|
|
@@ -2524,7 +2524,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
2524
2524
|
}
|
|
2525
2525
|
const hydratedEl = instance.vnode.el;
|
|
2526
2526
|
instance.asyncDep.catch((err) => {
|
|
2527
|
-
handleError(err, instance,
|
|
2527
|
+
handleError(err, instance, 0);
|
|
2528
2528
|
}).then((asyncSetupResult) => {
|
|
2529
2529
|
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
|
|
2530
2530
|
return;
|
|
@@ -2727,12 +2727,12 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
2727
2727
|
} else if (isReactive(s)) {
|
|
2728
2728
|
return traverse(s);
|
|
2729
2729
|
} else if (isFunction(s)) {
|
|
2730
|
-
return callWithErrorHandling(s, instance,
|
|
2730
|
+
return callWithErrorHandling(s, instance, 2);
|
|
2731
2731
|
} else ;
|
|
2732
2732
|
});
|
|
2733
2733
|
} else if (isFunction(source)) {
|
|
2734
2734
|
if (cb) {
|
|
2735
|
-
getter = () => callWithErrorHandling(source, instance,
|
|
2735
|
+
getter = () => callWithErrorHandling(source, instance, 2);
|
|
2736
2736
|
} else {
|
|
2737
2737
|
getter = () => {
|
|
2738
2738
|
if (instance && instance.isUnmounted) {
|
|
@@ -2744,7 +2744,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
2744
2744
|
return callWithAsyncErrorHandling(
|
|
2745
2745
|
source,
|
|
2746
2746
|
instance,
|
|
2747
|
-
|
|
2747
|
+
3,
|
|
2748
2748
|
[onCleanup]
|
|
2749
2749
|
);
|
|
2750
2750
|
};
|
|
@@ -2769,7 +2769,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
2769
2769
|
let cleanup;
|
|
2770
2770
|
let onCleanup = (fn) => {
|
|
2771
2771
|
cleanup = effect.onStop = () => {
|
|
2772
|
-
callWithErrorHandling(fn, instance,
|
|
2772
|
+
callWithErrorHandling(fn, instance, 4);
|
|
2773
2773
|
};
|
|
2774
2774
|
};
|
|
2775
2775
|
let ssrCleanup;
|
|
@@ -2778,7 +2778,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
2778
2778
|
if (!cb) {
|
|
2779
2779
|
getter();
|
|
2780
2780
|
} else if (immediate) {
|
|
2781
|
-
callWithAsyncErrorHandling(cb, instance,
|
|
2781
|
+
callWithAsyncErrorHandling(cb, instance, 3, [
|
|
2782
2782
|
getter(),
|
|
2783
2783
|
isMultiSource ? [] : void 0,
|
|
2784
2784
|
onCleanup
|
|
@@ -2804,7 +2804,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
2804
2804
|
if (cleanup) {
|
|
2805
2805
|
cleanup();
|
|
2806
2806
|
}
|
|
2807
|
-
callWithAsyncErrorHandling(cb, instance,
|
|
2807
|
+
callWithAsyncErrorHandling(cb, instance, 3, [
|
|
2808
2808
|
newValue,
|
|
2809
2809
|
// pass undefined as the old value when it's changed for the first time
|
|
2810
2810
|
oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
|
|
@@ -3070,7 +3070,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
|
|
|
3070
3070
|
hook && callWithAsyncErrorHandling(
|
|
3071
3071
|
hook,
|
|
3072
3072
|
instance,
|
|
3073
|
-
|
|
3073
|
+
9,
|
|
3074
3074
|
args
|
|
3075
3075
|
);
|
|
3076
3076
|
};
|
|
@@ -3294,7 +3294,7 @@ function defineAsyncComponent(source) {
|
|
|
3294
3294
|
handleError(
|
|
3295
3295
|
err,
|
|
3296
3296
|
instance,
|
|
3297
|
-
|
|
3297
|
+
13,
|
|
3298
3298
|
!errorComponent
|
|
3299
3299
|
/* do not throw in dev if user provided error component */
|
|
3300
3300
|
);
|
|
@@ -3396,7 +3396,7 @@ const KeepAliveImpl = {
|
|
|
3396
3396
|
const storageContainer = createElement("div");
|
|
3397
3397
|
sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
|
|
3398
3398
|
const instance2 = vnode.component;
|
|
3399
|
-
move(vnode, container, anchor,
|
|
3399
|
+
move(vnode, container, anchor, 0, parentSuspense);
|
|
3400
3400
|
patch(
|
|
3401
3401
|
instance2.vnode,
|
|
3402
3402
|
vnode,
|
|
@@ -3421,7 +3421,7 @@ const KeepAliveImpl = {
|
|
|
3421
3421
|
};
|
|
3422
3422
|
sharedContext.deactivate = (vnode) => {
|
|
3423
3423
|
const instance2 = vnode.component;
|
|
3424
|
-
move(vnode, storageContainer, null,
|
|
3424
|
+
move(vnode, storageContainer, null, 1, parentSuspense);
|
|
3425
3425
|
queuePostRenderEffect(() => {
|
|
3426
3426
|
if (instance2.da) {
|
|
3427
3427
|
invokeArrayFns(instance2.da);
|
|
@@ -3762,7 +3762,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
3762
3762
|
}
|
|
3763
3763
|
if (hook) {
|
|
3764
3764
|
pauseTracking();
|
|
3765
|
-
callWithAsyncErrorHandling(hook, instance,
|
|
3765
|
+
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
3766
3766
|
vnode.el,
|
|
3767
3767
|
binding,
|
|
3768
3768
|
vnode,
|
|
@@ -5372,7 +5372,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
5372
5372
|
return vm;
|
|
5373
5373
|
}
|
|
5374
5374
|
}
|
|
5375
|
-
Vue.version = `2.6.14-compat:${"3.3.0-alpha.
|
|
5375
|
+
Vue.version = `2.6.14-compat:${"3.3.0-alpha.4"}`;
|
|
5376
5376
|
Vue.config = singletonApp.config;
|
|
5377
5377
|
Vue.use = (p, ...options) => {
|
|
5378
5378
|
if (p && isFunction(p.install)) {
|
|
@@ -5850,7 +5850,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
5850
5850
|
}
|
|
5851
5851
|
}
|
|
5852
5852
|
if (isFunction(ref)) {
|
|
5853
|
-
callWithErrorHandling(ref, owner,
|
|
5853
|
+
callWithErrorHandling(ref, owner, 12, [value, refs]);
|
|
5854
5854
|
} else {
|
|
5855
5855
|
const _isString = isString(ref);
|
|
5856
5856
|
const _isRef = isRef(ref);
|
|
@@ -7305,7 +7305,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7305
7305
|
);
|
|
7306
7306
|
} else if (moved) {
|
|
7307
7307
|
if (j < 0 || i !== increasingNewIndexSequence[j]) {
|
|
7308
|
-
move(nextChild, container, anchor,
|
|
7308
|
+
move(nextChild, container, anchor, 2);
|
|
7309
7309
|
} else {
|
|
7310
7310
|
j--;
|
|
7311
7311
|
}
|
|
@@ -7339,9 +7339,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7339
7339
|
moveStaticNode(vnode, container, anchor);
|
|
7340
7340
|
return;
|
|
7341
7341
|
}
|
|
7342
|
-
const needTransition = moveType !==
|
|
7342
|
+
const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
|
|
7343
7343
|
if (needTransition) {
|
|
7344
|
-
if (moveType ===
|
|
7344
|
+
if (moveType === 0) {
|
|
7345
7345
|
transition.beforeEnter(el);
|
|
7346
7346
|
hostInsert(el, container, anchor);
|
|
7347
7347
|
queuePostRenderEffect(() => transition.enter(el), parentSuspense);
|
|
@@ -7714,7 +7714,7 @@ const TeleportImpl = {
|
|
|
7714
7714
|
container,
|
|
7715
7715
|
mainAnchor,
|
|
7716
7716
|
internals,
|
|
7717
|
-
|
|
7717
|
+
1
|
|
7718
7718
|
);
|
|
7719
7719
|
}
|
|
7720
7720
|
} else {
|
|
@@ -7729,7 +7729,7 @@ const TeleportImpl = {
|
|
|
7729
7729
|
nextTarget,
|
|
7730
7730
|
null,
|
|
7731
7731
|
internals,
|
|
7732
|
-
|
|
7732
|
+
0
|
|
7733
7733
|
);
|
|
7734
7734
|
}
|
|
7735
7735
|
} else if (wasDisabled) {
|
|
@@ -7738,7 +7738,7 @@ const TeleportImpl = {
|
|
|
7738
7738
|
target,
|
|
7739
7739
|
targetAnchor,
|
|
7740
7740
|
internals,
|
|
7741
|
-
|
|
7741
|
+
1
|
|
7742
7742
|
);
|
|
7743
7743
|
}
|
|
7744
7744
|
}
|
|
@@ -7769,12 +7769,12 @@ const TeleportImpl = {
|
|
|
7769
7769
|
move: moveTeleport,
|
|
7770
7770
|
hydrate: hydrateTeleport
|
|
7771
7771
|
};
|
|
7772
|
-
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType =
|
|
7773
|
-
if (moveType ===
|
|
7772
|
+
function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
|
|
7773
|
+
if (moveType === 0) {
|
|
7774
7774
|
insert(vnode.targetAnchor, container, parentAnchor);
|
|
7775
7775
|
}
|
|
7776
7776
|
const { el, anchor, shapeFlag, children, props } = vnode;
|
|
7777
|
-
const isReorder = moveType ===
|
|
7777
|
+
const isReorder = moveType === 2;
|
|
7778
7778
|
if (isReorder) {
|
|
7779
7779
|
insert(el, container, parentAnchor);
|
|
7780
7780
|
}
|
|
@@ -7785,7 +7785,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
7785
7785
|
children[i],
|
|
7786
7786
|
container,
|
|
7787
7787
|
parentAnchor,
|
|
7788
|
-
|
|
7788
|
+
2
|
|
7789
7789
|
);
|
|
7790
7790
|
}
|
|
7791
7791
|
}
|
|
@@ -8240,7 +8240,7 @@ function mergeProps(...args) {
|
|
|
8240
8240
|
return ret;
|
|
8241
8241
|
}
|
|
8242
8242
|
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
8243
|
-
callWithAsyncErrorHandling(hook, instance,
|
|
8243
|
+
callWithAsyncErrorHandling(hook, instance, 7, [
|
|
8244
8244
|
vnode,
|
|
8245
8245
|
prevVNode
|
|
8246
8246
|
]);
|
|
@@ -8371,7 +8371,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
8371
8371
|
const setupResult = callWithErrorHandling(
|
|
8372
8372
|
setup,
|
|
8373
8373
|
instance,
|
|
8374
|
-
|
|
8374
|
+
0,
|
|
8375
8375
|
[instance.props, setupContext]
|
|
8376
8376
|
);
|
|
8377
8377
|
resetTracking();
|
|
@@ -8382,7 +8382,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
8382
8382
|
return setupResult.then((resolvedResult) => {
|
|
8383
8383
|
handleSetupResult(instance, resolvedResult, isSSR);
|
|
8384
8384
|
}).catch((e) => {
|
|
8385
|
-
handleError(e, instance,
|
|
8385
|
+
handleError(e, instance, 0);
|
|
8386
8386
|
});
|
|
8387
8387
|
} else {
|
|
8388
8388
|
instance.asyncDep = setupResult;
|
|
@@ -8639,7 +8639,7 @@ function isMemoSame(cached, memo) {
|
|
|
8639
8639
|
return true;
|
|
8640
8640
|
}
|
|
8641
8641
|
|
|
8642
|
-
const version = "3.3.0-alpha.
|
|
8642
|
+
const version = "3.3.0-alpha.4";
|
|
8643
8643
|
const _ssrUtils = {
|
|
8644
8644
|
createComponentInstance,
|
|
8645
8645
|
setupComponent,
|
|
@@ -8960,7 +8960,7 @@ function createInvoker(initialValue, instance) {
|
|
|
8960
8960
|
callWithAsyncErrorHandling(
|
|
8961
8961
|
patchStopImmediatePropagation(e, invoker.value),
|
|
8962
8962
|
instance,
|
|
8963
|
-
|
|
8963
|
+
5,
|
|
8964
8964
|
[e]
|
|
8965
8965
|
);
|
|
8966
8966
|
};
|
|
@@ -10314,63 +10314,63 @@ function createCompilerError(code, loc, messages, additionalMessage) {
|
|
|
10314
10314
|
}
|
|
10315
10315
|
const errorMessages = {
|
|
10316
10316
|
// parse errors
|
|
10317
|
-
[
|
|
10318
|
-
[
|
|
10319
|
-
[
|
|
10320
|
-
[
|
|
10321
|
-
[
|
|
10322
|
-
[
|
|
10323
|
-
[
|
|
10324
|
-
[
|
|
10325
|
-
[
|
|
10326
|
-
[
|
|
10327
|
-
[
|
|
10328
|
-
[
|
|
10329
|
-
[
|
|
10330
|
-
[
|
|
10331
|
-
[
|
|
10332
|
-
[
|
|
10333
|
-
[
|
|
10334
|
-
[
|
|
10335
|
-
[
|
|
10336
|
-
[
|
|
10337
|
-
[
|
|
10338
|
-
[
|
|
10339
|
-
[
|
|
10317
|
+
[0]: "Illegal comment.",
|
|
10318
|
+
[1]: "CDATA section is allowed only in XML context.",
|
|
10319
|
+
[2]: "Duplicate attribute.",
|
|
10320
|
+
[3]: "End tag cannot have attributes.",
|
|
10321
|
+
[4]: "Illegal '/' in tags.",
|
|
10322
|
+
[5]: "Unexpected EOF in tag.",
|
|
10323
|
+
[6]: "Unexpected EOF in CDATA section.",
|
|
10324
|
+
[7]: "Unexpected EOF in comment.",
|
|
10325
|
+
[8]: "Unexpected EOF in script.",
|
|
10326
|
+
[9]: "Unexpected EOF in tag.",
|
|
10327
|
+
[10]: "Incorrectly closed comment.",
|
|
10328
|
+
[11]: "Incorrectly opened comment.",
|
|
10329
|
+
[12]: "Illegal tag name. Use '<' to print '<'.",
|
|
10330
|
+
[13]: "Attribute value was expected.",
|
|
10331
|
+
[14]: "End tag name was expected.",
|
|
10332
|
+
[15]: "Whitespace was expected.",
|
|
10333
|
+
[16]: "Unexpected '<!--' in comment.",
|
|
10334
|
+
[17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
|
|
10335
|
+
[18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
|
|
10336
|
+
[19]: "Attribute name cannot start with '='.",
|
|
10337
|
+
[21]: "'<?' is allowed only in XML context.",
|
|
10338
|
+
[20]: `Unexpected null character.`,
|
|
10339
|
+
[22]: "Illegal '/' in tags.",
|
|
10340
10340
|
// Vue-specific parse errors
|
|
10341
|
-
[
|
|
10342
|
-
[
|
|
10343
|
-
[
|
|
10344
|
-
[
|
|
10345
|
-
[
|
|
10341
|
+
[23]: "Invalid end tag.",
|
|
10342
|
+
[24]: "Element is missing end tag.",
|
|
10343
|
+
[25]: "Interpolation end sign was not found.",
|
|
10344
|
+
[27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
|
|
10345
|
+
[26]: "Legal directive name was expected.",
|
|
10346
10346
|
// transform errors
|
|
10347
|
-
[
|
|
10348
|
-
[
|
|
10349
|
-
[
|
|
10350
|
-
[
|
|
10351
|
-
[
|
|
10352
|
-
[
|
|
10353
|
-
[
|
|
10354
|
-
[
|
|
10355
|
-
[
|
|
10356
|
-
[
|
|
10357
|
-
[
|
|
10358
|
-
[
|
|
10359
|
-
[
|
|
10360
|
-
[
|
|
10361
|
-
[
|
|
10362
|
-
[
|
|
10363
|
-
[
|
|
10347
|
+
[28]: `v-if/v-else-if is missing expression.`,
|
|
10348
|
+
[29]: `v-if/else branches must use unique keys.`,
|
|
10349
|
+
[30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,
|
|
10350
|
+
[31]: `v-for is missing expression.`,
|
|
10351
|
+
[32]: `v-for has invalid expression.`,
|
|
10352
|
+
[33]: `<template v-for> key should be placed on the <template> tag.`,
|
|
10353
|
+
[34]: `v-bind is missing expression.`,
|
|
10354
|
+
[35]: `v-on is missing expression.`,
|
|
10355
|
+
[36]: `Unexpected custom directive on <slot> outlet.`,
|
|
10356
|
+
[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.`,
|
|
10357
|
+
[38]: `Duplicate slot names found. `,
|
|
10358
|
+
[39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`,
|
|
10359
|
+
[40]: `v-slot can only be used on components or <template> tags.`,
|
|
10360
|
+
[41]: `v-model is missing expression.`,
|
|
10361
|
+
[42]: `v-model value must be a valid JavaScript member expression.`,
|
|
10362
|
+
[43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
|
|
10363
|
+
[44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
|
|
10364
10364
|
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
10365
|
-
[
|
|
10366
|
-
[
|
|
10365
|
+
[45]: `Error parsing JavaScript expression: `,
|
|
10366
|
+
[46]: `<KeepAlive> expects exactly one child component.`,
|
|
10367
10367
|
// generic errors
|
|
10368
|
-
[
|
|
10369
|
-
[
|
|
10370
|
-
[
|
|
10371
|
-
[
|
|
10368
|
+
[47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
10369
|
+
[48]: `ES module mode is not supported in this build of compiler.`,
|
|
10370
|
+
[49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
10371
|
+
[50]: `"scopeId" option is only supported in module mode.`,
|
|
10372
10372
|
// just to fulfill types
|
|
10373
|
-
[
|
|
10373
|
+
[51]: ``
|
|
10374
10374
|
};
|
|
10375
10375
|
|
|
10376
10376
|
const FRAGMENT = Symbol(``);
|
|
@@ -10468,7 +10468,7 @@ const locStub = {
|
|
|
10468
10468
|
};
|
|
10469
10469
|
function createRoot(children, loc = locStub) {
|
|
10470
10470
|
return {
|
|
10471
|
-
type:
|
|
10471
|
+
type: 0,
|
|
10472
10472
|
children,
|
|
10473
10473
|
helpers: /* @__PURE__ */ new Set(),
|
|
10474
10474
|
components: [],
|
|
@@ -10494,7 +10494,7 @@ function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps,
|
|
|
10494
10494
|
}
|
|
10495
10495
|
}
|
|
10496
10496
|
return {
|
|
10497
|
-
type:
|
|
10497
|
+
type: 13,
|
|
10498
10498
|
tag,
|
|
10499
10499
|
props,
|
|
10500
10500
|
children,
|
|
@@ -10509,21 +10509,21 @@ function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps,
|
|
|
10509
10509
|
}
|
|
10510
10510
|
function createArrayExpression(elements, loc = locStub) {
|
|
10511
10511
|
return {
|
|
10512
|
-
type:
|
|
10512
|
+
type: 17,
|
|
10513
10513
|
loc,
|
|
10514
10514
|
elements
|
|
10515
10515
|
};
|
|
10516
10516
|
}
|
|
10517
10517
|
function createObjectExpression(properties, loc = locStub) {
|
|
10518
10518
|
return {
|
|
10519
|
-
type:
|
|
10519
|
+
type: 15,
|
|
10520
10520
|
loc,
|
|
10521
10521
|
properties
|
|
10522
10522
|
};
|
|
10523
10523
|
}
|
|
10524
10524
|
function createObjectProperty(key, value) {
|
|
10525
10525
|
return {
|
|
10526
|
-
type:
|
|
10526
|
+
type: 16,
|
|
10527
10527
|
loc: locStub,
|
|
10528
10528
|
key: isString(key) ? createSimpleExpression(key, true) : key,
|
|
10529
10529
|
value
|
|
@@ -10531,23 +10531,23 @@ function createObjectProperty(key, value) {
|
|
|
10531
10531
|
}
|
|
10532
10532
|
function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) {
|
|
10533
10533
|
return {
|
|
10534
|
-
type:
|
|
10534
|
+
type: 4,
|
|
10535
10535
|
loc,
|
|
10536
10536
|
content,
|
|
10537
10537
|
isStatic,
|
|
10538
|
-
constType: isStatic ?
|
|
10538
|
+
constType: isStatic ? 3 : constType
|
|
10539
10539
|
};
|
|
10540
10540
|
}
|
|
10541
10541
|
function createCompoundExpression(children, loc = locStub) {
|
|
10542
10542
|
return {
|
|
10543
|
-
type:
|
|
10543
|
+
type: 8,
|
|
10544
10544
|
loc,
|
|
10545
10545
|
children
|
|
10546
10546
|
};
|
|
10547
10547
|
}
|
|
10548
10548
|
function createCallExpression(callee, args = [], loc = locStub) {
|
|
10549
10549
|
return {
|
|
10550
|
-
type:
|
|
10550
|
+
type: 14,
|
|
10551
10551
|
loc,
|
|
10552
10552
|
callee,
|
|
10553
10553
|
arguments: args
|
|
@@ -10555,7 +10555,7 @@ function createCallExpression(callee, args = [], loc = locStub) {
|
|
|
10555
10555
|
}
|
|
10556
10556
|
function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) {
|
|
10557
10557
|
return {
|
|
10558
|
-
type:
|
|
10558
|
+
type: 18,
|
|
10559
10559
|
params,
|
|
10560
10560
|
returns,
|
|
10561
10561
|
newline,
|
|
@@ -10565,7 +10565,7 @@ function createFunctionExpression(params, returns = void 0, newline = false, isS
|
|
|
10565
10565
|
}
|
|
10566
10566
|
function createConditionalExpression(test, consequent, alternate, newline = true) {
|
|
10567
10567
|
return {
|
|
10568
|
-
type:
|
|
10568
|
+
type: 19,
|
|
10569
10569
|
test,
|
|
10570
10570
|
consequent,
|
|
10571
10571
|
alternate,
|
|
@@ -10575,7 +10575,7 @@ function createConditionalExpression(test, consequent, alternate, newline = true
|
|
|
10575
10575
|
}
|
|
10576
10576
|
function createCacheExpression(index, value, isVNode = false) {
|
|
10577
10577
|
return {
|
|
10578
|
-
type:
|
|
10578
|
+
type: 20,
|
|
10579
10579
|
index,
|
|
10580
10580
|
value,
|
|
10581
10581
|
isVNode,
|
|
@@ -10584,13 +10584,13 @@ function createCacheExpression(index, value, isVNode = false) {
|
|
|
10584
10584
|
}
|
|
10585
10585
|
function createBlockStatement(body) {
|
|
10586
10586
|
return {
|
|
10587
|
-
type:
|
|
10587
|
+
type: 21,
|
|
10588
10588
|
body,
|
|
10589
10589
|
loc: locStub
|
|
10590
10590
|
};
|
|
10591
10591
|
}
|
|
10592
10592
|
|
|
10593
|
-
const isStaticExp = (p) => p.type ===
|
|
10593
|
+
const isStaticExp = (p) => p.type === 4 && p.isStatic;
|
|
10594
10594
|
const isBuiltInType = (tag, expected) => tag === expected || tag === hyphenate(expected);
|
|
10595
10595
|
function isCoreComponent(tag) {
|
|
10596
10596
|
if (isBuiltInType(tag, "Teleport")) {
|
|
@@ -10659,7 +10659,7 @@ function advancePositionWithMutation(pos, source, numberOfCharacters = source.le
|
|
|
10659
10659
|
function findDir(node, name, allowEmpty = false) {
|
|
10660
10660
|
for (let i = 0; i < node.props.length; i++) {
|
|
10661
10661
|
const p = node.props[i];
|
|
10662
|
-
if (p.type ===
|
|
10662
|
+
if (p.type === 7 && (allowEmpty || p.exp) && (isString(name) ? p.name === name : name.test(p.name))) {
|
|
10663
10663
|
return p;
|
|
10664
10664
|
}
|
|
10665
10665
|
}
|
|
@@ -10667,7 +10667,7 @@ function findDir(node, name, allowEmpty = false) {
|
|
|
10667
10667
|
function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
|
|
10668
10668
|
for (let i = 0; i < node.props.length; i++) {
|
|
10669
10669
|
const p = node.props[i];
|
|
10670
|
-
if (p.type ===
|
|
10670
|
+
if (p.type === 6) {
|
|
10671
10671
|
if (dynamicOnly)
|
|
10672
10672
|
continue;
|
|
10673
10673
|
if (p.name === name && (p.value || allowEmpty)) {
|
|
@@ -10683,23 +10683,23 @@ function isStaticArgOf(arg, name) {
|
|
|
10683
10683
|
}
|
|
10684
10684
|
function hasDynamicKeyVBind(node) {
|
|
10685
10685
|
return node.props.some(
|
|
10686
|
-
(p) => p.type ===
|
|
10687
|
-
p.arg.type !==
|
|
10686
|
+
(p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj"
|
|
10687
|
+
p.arg.type !== 4 || // v-bind:[_ctx.foo]
|
|
10688
10688
|
!p.arg.isStatic)
|
|
10689
10689
|
// v-bind:[foo]
|
|
10690
10690
|
);
|
|
10691
10691
|
}
|
|
10692
10692
|
function isText$1(node) {
|
|
10693
|
-
return node.type ===
|
|
10693
|
+
return node.type === 5 || node.type === 2;
|
|
10694
10694
|
}
|
|
10695
10695
|
function isVSlot(p) {
|
|
10696
|
-
return p.type ===
|
|
10696
|
+
return p.type === 7 && p.name === "slot";
|
|
10697
10697
|
}
|
|
10698
10698
|
function isTemplateNode(node) {
|
|
10699
|
-
return node.type ===
|
|
10699
|
+
return node.type === 1 && node.tagType === 3;
|
|
10700
10700
|
}
|
|
10701
10701
|
function isSlotOutlet(node) {
|
|
10702
|
-
return node.type ===
|
|
10702
|
+
return node.type === 1 && node.tagType === 2;
|
|
10703
10703
|
}
|
|
10704
10704
|
function getVNodeHelper(ssr, isComponent) {
|
|
10705
10705
|
return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
|
|
@@ -10709,7 +10709,7 @@ function getVNodeBlockHelper(ssr, isComponent) {
|
|
|
10709
10709
|
}
|
|
10710
10710
|
const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
|
|
10711
10711
|
function getUnnormalizedProps(props, callPath = []) {
|
|
10712
|
-
if (props && !isString(props) && props.type ===
|
|
10712
|
+
if (props && !isString(props) && props.type === 14) {
|
|
10713
10713
|
const callee = props.callee;
|
|
10714
10714
|
if (!isString(callee) && propsHelperSet.has(callee)) {
|
|
10715
10715
|
return getUnnormalizedProps(
|
|
@@ -10722,10 +10722,10 @@ function getUnnormalizedProps(props, callPath = []) {
|
|
|
10722
10722
|
}
|
|
10723
10723
|
function injectProp(node, prop, context) {
|
|
10724
10724
|
let propsWithInjection;
|
|
10725
|
-
let props = node.type ===
|
|
10725
|
+
let props = node.type === 13 ? node.props : node.arguments[2];
|
|
10726
10726
|
let callPath = [];
|
|
10727
10727
|
let parentCall;
|
|
10728
|
-
if (props && !isString(props) && props.type ===
|
|
10728
|
+
if (props && !isString(props) && props.type === 14) {
|
|
10729
10729
|
const ret = getUnnormalizedProps(props);
|
|
10730
10730
|
props = ret[0];
|
|
10731
10731
|
callPath = ret[1];
|
|
@@ -10733,9 +10733,9 @@ function injectProp(node, prop, context) {
|
|
|
10733
10733
|
}
|
|
10734
10734
|
if (props == null || isString(props)) {
|
|
10735
10735
|
propsWithInjection = createObjectExpression([prop]);
|
|
10736
|
-
} else if (props.type ===
|
|
10736
|
+
} else if (props.type === 14) {
|
|
10737
10737
|
const first = props.arguments[0];
|
|
10738
|
-
if (!isString(first) && first.type ===
|
|
10738
|
+
if (!isString(first) && first.type === 15) {
|
|
10739
10739
|
if (!hasProp(prop, first)) {
|
|
10740
10740
|
first.properties.unshift(prop);
|
|
10741
10741
|
}
|
|
@@ -10750,7 +10750,7 @@ function injectProp(node, prop, context) {
|
|
|
10750
10750
|
}
|
|
10751
10751
|
}
|
|
10752
10752
|
!propsWithInjection && (propsWithInjection = props);
|
|
10753
|
-
} else if (props.type ===
|
|
10753
|
+
} else if (props.type === 15) {
|
|
10754
10754
|
if (!hasProp(prop, props)) {
|
|
10755
10755
|
props.properties.unshift(prop);
|
|
10756
10756
|
}
|
|
@@ -10764,7 +10764,7 @@ function injectProp(node, prop, context) {
|
|
|
10764
10764
|
parentCall = callPath[callPath.length - 2];
|
|
10765
10765
|
}
|
|
10766
10766
|
}
|
|
10767
|
-
if (node.type ===
|
|
10767
|
+
if (node.type === 13) {
|
|
10768
10768
|
if (parentCall) {
|
|
10769
10769
|
parentCall.arguments[0] = propsWithInjection;
|
|
10770
10770
|
} else {
|
|
@@ -10780,10 +10780,10 @@ function injectProp(node, prop, context) {
|
|
|
10780
10780
|
}
|
|
10781
10781
|
function hasProp(prop, props) {
|
|
10782
10782
|
let result = false;
|
|
10783
|
-
if (prop.key.type ===
|
|
10783
|
+
if (prop.key.type === 4) {
|
|
10784
10784
|
const propKeyName = prop.key.content;
|
|
10785
10785
|
result = props.properties.some(
|
|
10786
|
-
(p) => p.key.type ===
|
|
10786
|
+
(p) => p.key.type === 4 && p.key.content === propKeyName
|
|
10787
10787
|
);
|
|
10788
10788
|
}
|
|
10789
10789
|
return result;
|
|
@@ -10798,42 +10798,42 @@ function hasScopeRef(node, ids) {
|
|
|
10798
10798
|
return false;
|
|
10799
10799
|
}
|
|
10800
10800
|
switch (node.type) {
|
|
10801
|
-
case
|
|
10801
|
+
case 1:
|
|
10802
10802
|
for (let i = 0; i < node.props.length; i++) {
|
|
10803
10803
|
const p = node.props[i];
|
|
10804
|
-
if (p.type ===
|
|
10804
|
+
if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) {
|
|
10805
10805
|
return true;
|
|
10806
10806
|
}
|
|
10807
10807
|
}
|
|
10808
10808
|
return node.children.some((c) => hasScopeRef(c, ids));
|
|
10809
|
-
case
|
|
10809
|
+
case 11:
|
|
10810
10810
|
if (hasScopeRef(node.source, ids)) {
|
|
10811
10811
|
return true;
|
|
10812
10812
|
}
|
|
10813
10813
|
return node.children.some((c) => hasScopeRef(c, ids));
|
|
10814
|
-
case
|
|
10814
|
+
case 9:
|
|
10815
10815
|
return node.branches.some((b) => hasScopeRef(b, ids));
|
|
10816
|
-
case
|
|
10816
|
+
case 10:
|
|
10817
10817
|
if (hasScopeRef(node.condition, ids)) {
|
|
10818
10818
|
return true;
|
|
10819
10819
|
}
|
|
10820
10820
|
return node.children.some((c) => hasScopeRef(c, ids));
|
|
10821
|
-
case
|
|
10821
|
+
case 4:
|
|
10822
10822
|
return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content];
|
|
10823
|
-
case
|
|
10823
|
+
case 8:
|
|
10824
10824
|
return node.children.some((c) => isObject(c) && hasScopeRef(c, ids));
|
|
10825
|
-
case
|
|
10826
|
-
case
|
|
10825
|
+
case 5:
|
|
10826
|
+
case 12:
|
|
10827
10827
|
return hasScopeRef(node.content, ids);
|
|
10828
|
-
case
|
|
10829
|
-
case
|
|
10828
|
+
case 2:
|
|
10829
|
+
case 3:
|
|
10830
10830
|
return false;
|
|
10831
10831
|
default:
|
|
10832
10832
|
return false;
|
|
10833
10833
|
}
|
|
10834
10834
|
}
|
|
10835
10835
|
function getMemoedVNodeCall(node) {
|
|
10836
|
-
if (node.type ===
|
|
10836
|
+
if (node.type === 14 && node.callee === WITH_MEMO) {
|
|
10837
10837
|
return node.arguments[1].returns;
|
|
10838
10838
|
} else {
|
|
10839
10839
|
return node;
|
|
@@ -10877,8 +10877,8 @@ const decodeMap = {
|
|
|
10877
10877
|
};
|
|
10878
10878
|
const defaultParserOptions = {
|
|
10879
10879
|
delimiters: [`{{`, `}}`],
|
|
10880
|
-
getNamespace: () =>
|
|
10881
|
-
getTextMode: () =>
|
|
10880
|
+
getNamespace: () => 0,
|
|
10881
|
+
getTextMode: () => 0,
|
|
10882
10882
|
isVoidTag: NO,
|
|
10883
10883
|
isPreTag: NO,
|
|
10884
10884
|
isCustomElement: NO,
|
|
@@ -10891,7 +10891,7 @@ function baseParse(content, options = {}) {
|
|
|
10891
10891
|
const context = createParserContext(content, options);
|
|
10892
10892
|
const start = getCursor(context);
|
|
10893
10893
|
return createRoot(
|
|
10894
|
-
parseChildren(context,
|
|
10894
|
+
parseChildren(context, 0, []),
|
|
10895
10895
|
getSelection(context, start)
|
|
10896
10896
|
);
|
|
10897
10897
|
}
|
|
@@ -10915,48 +10915,48 @@ function createParserContext(content, rawOptions) {
|
|
|
10915
10915
|
}
|
|
10916
10916
|
function parseChildren(context, mode, ancestors) {
|
|
10917
10917
|
const parent = last(ancestors);
|
|
10918
|
-
const ns = parent ? parent.ns :
|
|
10918
|
+
const ns = parent ? parent.ns : 0;
|
|
10919
10919
|
const nodes = [];
|
|
10920
10920
|
while (!isEnd(context, mode, ancestors)) {
|
|
10921
10921
|
const s = context.source;
|
|
10922
10922
|
let node = void 0;
|
|
10923
|
-
if (mode ===
|
|
10923
|
+
if (mode === 0 || mode === 1) {
|
|
10924
10924
|
if (!context.inVPre && startsWith(s, context.options.delimiters[0])) {
|
|
10925
10925
|
node = parseInterpolation(context, mode);
|
|
10926
|
-
} else if (mode ===
|
|
10926
|
+
} else if (mode === 0 && s[0] === "<") {
|
|
10927
10927
|
if (s.length === 1) {
|
|
10928
|
-
emitError(context,
|
|
10928
|
+
emitError(context, 5, 1);
|
|
10929
10929
|
} else if (s[1] === "!") {
|
|
10930
10930
|
if (startsWith(s, "<!--")) {
|
|
10931
10931
|
node = parseComment(context);
|
|
10932
10932
|
} else if (startsWith(s, "<!DOCTYPE")) {
|
|
10933
10933
|
node = parseBogusComment(context);
|
|
10934
10934
|
} else if (startsWith(s, "<![CDATA[")) {
|
|
10935
|
-
if (ns !==
|
|
10935
|
+
if (ns !== 0) {
|
|
10936
10936
|
node = parseCDATA(context, ancestors);
|
|
10937
10937
|
} else {
|
|
10938
|
-
emitError(context,
|
|
10938
|
+
emitError(context, 1);
|
|
10939
10939
|
node = parseBogusComment(context);
|
|
10940
10940
|
}
|
|
10941
10941
|
} else {
|
|
10942
|
-
emitError(context,
|
|
10942
|
+
emitError(context, 11);
|
|
10943
10943
|
node = parseBogusComment(context);
|
|
10944
10944
|
}
|
|
10945
10945
|
} else if (s[1] === "/") {
|
|
10946
10946
|
if (s.length === 2) {
|
|
10947
|
-
emitError(context,
|
|
10947
|
+
emitError(context, 5, 2);
|
|
10948
10948
|
} else if (s[2] === ">") {
|
|
10949
|
-
emitError(context,
|
|
10949
|
+
emitError(context, 14, 2);
|
|
10950
10950
|
advanceBy(context, 3);
|
|
10951
10951
|
continue;
|
|
10952
10952
|
} else if (/[a-z]/i.test(s[2])) {
|
|
10953
|
-
emitError(context,
|
|
10953
|
+
emitError(context, 23);
|
|
10954
10954
|
parseTag(context, TagType.End, parent);
|
|
10955
10955
|
continue;
|
|
10956
10956
|
} else {
|
|
10957
10957
|
emitError(
|
|
10958
10958
|
context,
|
|
10959
|
-
|
|
10959
|
+
12,
|
|
10960
10960
|
2
|
|
10961
10961
|
);
|
|
10962
10962
|
node = parseBogusComment(context);
|
|
@@ -10967,19 +10967,19 @@ function parseChildren(context, mode, ancestors) {
|
|
|
10967
10967
|
"COMPILER_NATIVE_TEMPLATE",
|
|
10968
10968
|
context
|
|
10969
10969
|
) && node && node.tag === "template" && !node.props.some(
|
|
10970
|
-
(p) => p.type ===
|
|
10970
|
+
(p) => p.type === 7 && isSpecialTemplateDirective(p.name)
|
|
10971
10971
|
)) {
|
|
10972
10972
|
node = node.children;
|
|
10973
10973
|
}
|
|
10974
10974
|
} else if (s[1] === "?") {
|
|
10975
10975
|
emitError(
|
|
10976
10976
|
context,
|
|
10977
|
-
|
|
10977
|
+
21,
|
|
10978
10978
|
1
|
|
10979
10979
|
);
|
|
10980
10980
|
node = parseBogusComment(context);
|
|
10981
10981
|
} else {
|
|
10982
|
-
emitError(context,
|
|
10982
|
+
emitError(context, 12, 1);
|
|
10983
10983
|
}
|
|
10984
10984
|
}
|
|
10985
10985
|
}
|
|
@@ -10995,16 +10995,16 @@ function parseChildren(context, mode, ancestors) {
|
|
|
10995
10995
|
}
|
|
10996
10996
|
}
|
|
10997
10997
|
let removedWhitespace = false;
|
|
10998
|
-
if (mode !==
|
|
10998
|
+
if (mode !== 2 && mode !== 1) {
|
|
10999
10999
|
const shouldCondense = context.options.whitespace !== "preserve";
|
|
11000
11000
|
for (let i = 0; i < nodes.length; i++) {
|
|
11001
11001
|
const node = nodes[i];
|
|
11002
|
-
if (node.type ===
|
|
11002
|
+
if (node.type === 2) {
|
|
11003
11003
|
if (!context.inPre) {
|
|
11004
11004
|
if (!/[^\t\r\n\f ]/.test(node.content)) {
|
|
11005
11005
|
const prev = nodes[i - 1];
|
|
11006
11006
|
const next = nodes[i + 1];
|
|
11007
|
-
if (!prev || !next || shouldCondense && (prev.type ===
|
|
11007
|
+
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))) {
|
|
11008
11008
|
removedWhitespace = true;
|
|
11009
11009
|
nodes[i] = null;
|
|
11010
11010
|
} else {
|
|
@@ -11016,14 +11016,14 @@ function parseChildren(context, mode, ancestors) {
|
|
|
11016
11016
|
} else {
|
|
11017
11017
|
node.content = node.content.replace(/\r\n/g, "\n");
|
|
11018
11018
|
}
|
|
11019
|
-
} else if (node.type ===
|
|
11019
|
+
} else if (node.type === 3 && !context.options.comments) {
|
|
11020
11020
|
removedWhitespace = true;
|
|
11021
11021
|
nodes[i] = null;
|
|
11022
11022
|
}
|
|
11023
11023
|
}
|
|
11024
11024
|
if (context.inPre && parent && context.options.isPreTag(parent.tag)) {
|
|
11025
11025
|
const first = nodes[0];
|
|
11026
|
-
if (first && first.type ===
|
|
11026
|
+
if (first && first.type === 2) {
|
|
11027
11027
|
first.content = first.content.replace(/^\r?\n/, "");
|
|
11028
11028
|
}
|
|
11029
11029
|
}
|
|
@@ -11031,9 +11031,9 @@ function parseChildren(context, mode, ancestors) {
|
|
|
11031
11031
|
return removedWhitespace ? nodes.filter(Boolean) : nodes;
|
|
11032
11032
|
}
|
|
11033
11033
|
function pushNode(nodes, node) {
|
|
11034
|
-
if (node.type ===
|
|
11034
|
+
if (node.type === 2) {
|
|
11035
11035
|
const prev = last(nodes);
|
|
11036
|
-
if (prev && prev.type ===
|
|
11036
|
+
if (prev && prev.type === 2 && prev.loc.end.offset === node.loc.start.offset) {
|
|
11037
11037
|
prev.content += node.content;
|
|
11038
11038
|
prev.loc.end = node.loc.end;
|
|
11039
11039
|
prev.loc.source += node.loc.source;
|
|
@@ -11044,9 +11044,9 @@ function pushNode(nodes, node) {
|
|
|
11044
11044
|
}
|
|
11045
11045
|
function parseCDATA(context, ancestors) {
|
|
11046
11046
|
advanceBy(context, 9);
|
|
11047
|
-
const nodes = parseChildren(context,
|
|
11047
|
+
const nodes = parseChildren(context, 3, ancestors);
|
|
11048
11048
|
if (context.source.length === 0) {
|
|
11049
|
-
emitError(context,
|
|
11049
|
+
emitError(context, 6);
|
|
11050
11050
|
} else {
|
|
11051
11051
|
advanceBy(context, 3);
|
|
11052
11052
|
}
|
|
@@ -11059,13 +11059,13 @@ function parseComment(context) {
|
|
|
11059
11059
|
if (!match) {
|
|
11060
11060
|
content = context.source.slice(4);
|
|
11061
11061
|
advanceBy(context, context.source.length);
|
|
11062
|
-
emitError(context,
|
|
11062
|
+
emitError(context, 7);
|
|
11063
11063
|
} else {
|
|
11064
11064
|
if (match.index <= 3) {
|
|
11065
|
-
emitError(context,
|
|
11065
|
+
emitError(context, 0);
|
|
11066
11066
|
}
|
|
11067
11067
|
if (match[1]) {
|
|
11068
|
-
emitError(context,
|
|
11068
|
+
emitError(context, 10);
|
|
11069
11069
|
}
|
|
11070
11070
|
content = context.source.slice(4, match.index);
|
|
11071
11071
|
const s = context.source.slice(0, match.index);
|
|
@@ -11073,14 +11073,14 @@ function parseComment(context) {
|
|
|
11073
11073
|
while ((nestedIndex = s.indexOf("<!--", prevIndex)) !== -1) {
|
|
11074
11074
|
advanceBy(context, nestedIndex - prevIndex + 1);
|
|
11075
11075
|
if (nestedIndex + 4 < s.length) {
|
|
11076
|
-
emitError(context,
|
|
11076
|
+
emitError(context, 16);
|
|
11077
11077
|
}
|
|
11078
11078
|
prevIndex = nestedIndex + 1;
|
|
11079
11079
|
}
|
|
11080
11080
|
advanceBy(context, match.index + match[0].length - prevIndex + 1);
|
|
11081
11081
|
}
|
|
11082
11082
|
return {
|
|
11083
|
-
type:
|
|
11083
|
+
type: 3,
|
|
11084
11084
|
content,
|
|
11085
11085
|
loc: getSelection(context, start)
|
|
11086
11086
|
};
|
|
@@ -11098,7 +11098,7 @@ function parseBogusComment(context) {
|
|
|
11098
11098
|
advanceBy(context, closeIndex + 1);
|
|
11099
11099
|
}
|
|
11100
11100
|
return {
|
|
11101
|
-
type:
|
|
11101
|
+
type: 3,
|
|
11102
11102
|
content,
|
|
11103
11103
|
loc: getSelection(context, start)
|
|
11104
11104
|
};
|
|
@@ -11125,7 +11125,7 @@ function parseElement(context, ancestors) {
|
|
|
11125
11125
|
ancestors.pop();
|
|
11126
11126
|
{
|
|
11127
11127
|
const inlineTemplateProp = element.props.find(
|
|
11128
|
-
(p) => p.type ===
|
|
11128
|
+
(p) => p.type === 6 && p.name === "inline-template"
|
|
11129
11129
|
);
|
|
11130
11130
|
if (inlineTemplateProp && checkCompatEnabled(
|
|
11131
11131
|
"COMPILER_INLINE_TEMPLATE",
|
|
@@ -11134,7 +11134,7 @@ function parseElement(context, ancestors) {
|
|
|
11134
11134
|
)) {
|
|
11135
11135
|
const loc = getSelection(context, element.loc.end);
|
|
11136
11136
|
inlineTemplateProp.value = {
|
|
11137
|
-
type:
|
|
11137
|
+
type: 2,
|
|
11138
11138
|
content: loc.source,
|
|
11139
11139
|
loc
|
|
11140
11140
|
};
|
|
@@ -11144,11 +11144,11 @@ function parseElement(context, ancestors) {
|
|
|
11144
11144
|
if (startsWithEndTagOpen(context.source, element.tag)) {
|
|
11145
11145
|
parseTag(context, TagType.End, parent);
|
|
11146
11146
|
} else {
|
|
11147
|
-
emitError(context,
|
|
11147
|
+
emitError(context, 24, 0, element.loc.start);
|
|
11148
11148
|
if (context.source.length === 0 && element.tag.toLowerCase() === "script") {
|
|
11149
11149
|
const first = children[0];
|
|
11150
11150
|
if (first && startsWith(first.loc.source, "<!--")) {
|
|
11151
|
-
emitError(context,
|
|
11151
|
+
emitError(context, 8);
|
|
11152
11152
|
}
|
|
11153
11153
|
}
|
|
11154
11154
|
}
|
|
@@ -11182,7 +11182,7 @@ function parseTag(context, type, parent) {
|
|
|
11182
11182
|
context.inPre = true;
|
|
11183
11183
|
}
|
|
11184
11184
|
let props = parseAttributes(context, type);
|
|
11185
|
-
if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type ===
|
|
11185
|
+
if (type === 0 /* Start */ && !context.inVPre && props.some((p) => p.type === 7 && p.name === "pre")) {
|
|
11186
11186
|
context.inVPre = true;
|
|
11187
11187
|
extend(context, cursor);
|
|
11188
11188
|
context.source = currentSource;
|
|
@@ -11190,33 +11190,33 @@ function parseTag(context, type, parent) {
|
|
|
11190
11190
|
}
|
|
11191
11191
|
let isSelfClosing = false;
|
|
11192
11192
|
if (context.source.length === 0) {
|
|
11193
|
-
emitError(context,
|
|
11193
|
+
emitError(context, 9);
|
|
11194
11194
|
} else {
|
|
11195
11195
|
isSelfClosing = startsWith(context.source, "/>");
|
|
11196
11196
|
if (type === 1 /* End */ && isSelfClosing) {
|
|
11197
|
-
emitError(context,
|
|
11197
|
+
emitError(context, 4);
|
|
11198
11198
|
}
|
|
11199
11199
|
advanceBy(context, isSelfClosing ? 2 : 1);
|
|
11200
11200
|
}
|
|
11201
11201
|
if (type === 1 /* End */) {
|
|
11202
11202
|
return;
|
|
11203
11203
|
}
|
|
11204
|
-
let tagType =
|
|
11204
|
+
let tagType = 0;
|
|
11205
11205
|
if (!context.inVPre) {
|
|
11206
11206
|
if (tag === "slot") {
|
|
11207
|
-
tagType =
|
|
11207
|
+
tagType = 2;
|
|
11208
11208
|
} else if (tag === "template") {
|
|
11209
11209
|
if (props.some(
|
|
11210
|
-
(p) => p.type ===
|
|
11210
|
+
(p) => p.type === 7 && isSpecialTemplateDirective(p.name)
|
|
11211
11211
|
)) {
|
|
11212
|
-
tagType =
|
|
11212
|
+
tagType = 3;
|
|
11213
11213
|
}
|
|
11214
11214
|
} else if (isComponent(tag, props, context)) {
|
|
11215
|
-
tagType =
|
|
11215
|
+
tagType = 1;
|
|
11216
11216
|
}
|
|
11217
11217
|
}
|
|
11218
11218
|
return {
|
|
11219
|
-
type:
|
|
11219
|
+
type: 1,
|
|
11220
11220
|
ns,
|
|
11221
11221
|
tag,
|
|
11222
11222
|
tagType,
|
|
@@ -11238,7 +11238,7 @@ function isComponent(tag, props, context) {
|
|
|
11238
11238
|
}
|
|
11239
11239
|
for (let i = 0; i < props.length; i++) {
|
|
11240
11240
|
const p = props[i];
|
|
11241
|
-
if (p.type ===
|
|
11241
|
+
if (p.type === 6) {
|
|
11242
11242
|
if (p.name === "is" && p.value) {
|
|
11243
11243
|
if (p.value.content.startsWith("vue:")) {
|
|
11244
11244
|
return true;
|
|
@@ -11271,23 +11271,23 @@ function parseAttributes(context, type) {
|
|
|
11271
11271
|
const attributeNames = /* @__PURE__ */ new Set();
|
|
11272
11272
|
while (context.source.length > 0 && !startsWith(context.source, ">") && !startsWith(context.source, "/>")) {
|
|
11273
11273
|
if (startsWith(context.source, "/")) {
|
|
11274
|
-
emitError(context,
|
|
11274
|
+
emitError(context, 22);
|
|
11275
11275
|
advanceBy(context, 1);
|
|
11276
11276
|
advanceSpaces(context);
|
|
11277
11277
|
continue;
|
|
11278
11278
|
}
|
|
11279
11279
|
if (type === 1 /* End */) {
|
|
11280
|
-
emitError(context,
|
|
11280
|
+
emitError(context, 3);
|
|
11281
11281
|
}
|
|
11282
11282
|
const attr = parseAttribute(context, attributeNames);
|
|
11283
|
-
if (attr.type ===
|
|
11283
|
+
if (attr.type === 6 && attr.value && attr.name === "class") {
|
|
11284
11284
|
attr.value.content = attr.value.content.replace(/\s+/g, " ").trim();
|
|
11285
11285
|
}
|
|
11286
11286
|
if (type === 0 /* Start */) {
|
|
11287
11287
|
props.push(attr);
|
|
11288
11288
|
}
|
|
11289
11289
|
if (/^[^\t\r\n\f />]/.test(context.source)) {
|
|
11290
|
-
emitError(context,
|
|
11290
|
+
emitError(context, 15);
|
|
11291
11291
|
}
|
|
11292
11292
|
advanceSpaces(context);
|
|
11293
11293
|
}
|
|
@@ -11298,11 +11298,11 @@ function parseAttribute(context, nameSet) {
|
|
|
11298
11298
|
const match = /^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(context.source);
|
|
11299
11299
|
const name = match[0];
|
|
11300
11300
|
if (nameSet.has(name)) {
|
|
11301
|
-
emitError(context,
|
|
11301
|
+
emitError(context, 2);
|
|
11302
11302
|
}
|
|
11303
11303
|
nameSet.add(name);
|
|
11304
11304
|
if (name[0] === "=") {
|
|
11305
|
-
emitError(context,
|
|
11305
|
+
emitError(context, 19);
|
|
11306
11306
|
}
|
|
11307
11307
|
{
|
|
11308
11308
|
const pattern = /["'<]/g;
|
|
@@ -11310,7 +11310,7 @@ function parseAttribute(context, nameSet) {
|
|
|
11310
11310
|
while (m = pattern.exec(name)) {
|
|
11311
11311
|
emitError(
|
|
11312
11312
|
context,
|
|
11313
|
-
|
|
11313
|
+
17,
|
|
11314
11314
|
m.index
|
|
11315
11315
|
);
|
|
11316
11316
|
}
|
|
@@ -11323,7 +11323,7 @@ function parseAttribute(context, nameSet) {
|
|
|
11323
11323
|
advanceSpaces(context);
|
|
11324
11324
|
value = parseAttributeValue(context);
|
|
11325
11325
|
if (!value) {
|
|
11326
|
-
emitError(context,
|
|
11326
|
+
emitError(context, 13);
|
|
11327
11327
|
}
|
|
11328
11328
|
}
|
|
11329
11329
|
const loc = getSelection(context, start);
|
|
@@ -11353,7 +11353,7 @@ function parseAttribute(context, nameSet) {
|
|
|
11353
11353
|
if (!content.endsWith("]")) {
|
|
11354
11354
|
emitError(
|
|
11355
11355
|
context,
|
|
11356
|
-
|
|
11356
|
+
27
|
|
11357
11357
|
);
|
|
11358
11358
|
content = content.slice(1);
|
|
11359
11359
|
} else {
|
|
@@ -11363,10 +11363,10 @@ function parseAttribute(context, nameSet) {
|
|
|
11363
11363
|
content += match2[3] || "";
|
|
11364
11364
|
}
|
|
11365
11365
|
arg = {
|
|
11366
|
-
type:
|
|
11366
|
+
type: 4,
|
|
11367
11367
|
content,
|
|
11368
11368
|
isStatic,
|
|
11369
|
-
constType: isStatic ?
|
|
11369
|
+
constType: isStatic ? 3 : 0,
|
|
11370
11370
|
loc: loc2
|
|
11371
11371
|
};
|
|
11372
11372
|
}
|
|
@@ -11392,10 +11392,10 @@ function parseAttribute(context, nameSet) {
|
|
|
11392
11392
|
}
|
|
11393
11393
|
}
|
|
11394
11394
|
return {
|
|
11395
|
-
type:
|
|
11395
|
+
type: 7,
|
|
11396
11396
|
name: dirName,
|
|
11397
11397
|
exp: value && {
|
|
11398
|
-
type:
|
|
11398
|
+
type: 4,
|
|
11399
11399
|
content: value.content,
|
|
11400
11400
|
isStatic: false,
|
|
11401
11401
|
// Treat as non-constant by default. This can be potentially set to
|
|
@@ -11409,13 +11409,13 @@ function parseAttribute(context, nameSet) {
|
|
|
11409
11409
|
};
|
|
11410
11410
|
}
|
|
11411
11411
|
if (!context.inVPre && startsWith(name, "v-")) {
|
|
11412
|
-
emitError(context,
|
|
11412
|
+
emitError(context, 26);
|
|
11413
11413
|
}
|
|
11414
11414
|
return {
|
|
11415
|
-
type:
|
|
11415
|
+
type: 6,
|
|
11416
11416
|
name,
|
|
11417
11417
|
value: value && {
|
|
11418
|
-
type:
|
|
11418
|
+
type: 2,
|
|
11419
11419
|
content: value.content,
|
|
11420
11420
|
loc: value.loc
|
|
11421
11421
|
},
|
|
@@ -11434,10 +11434,10 @@ function parseAttributeValue(context) {
|
|
|
11434
11434
|
content = parseTextData(
|
|
11435
11435
|
context,
|
|
11436
11436
|
context.source.length,
|
|
11437
|
-
|
|
11437
|
+
4
|
|
11438
11438
|
);
|
|
11439
11439
|
} else {
|
|
11440
|
-
content = parseTextData(context, endIndex,
|
|
11440
|
+
content = parseTextData(context, endIndex, 4);
|
|
11441
11441
|
advanceBy(context, 1);
|
|
11442
11442
|
}
|
|
11443
11443
|
} else {
|
|
@@ -11450,11 +11450,11 @@ function parseAttributeValue(context) {
|
|
|
11450
11450
|
while (m = unexpectedChars.exec(match[0])) {
|
|
11451
11451
|
emitError(
|
|
11452
11452
|
context,
|
|
11453
|
-
|
|
11453
|
+
18,
|
|
11454
11454
|
m.index
|
|
11455
11455
|
);
|
|
11456
11456
|
}
|
|
11457
|
-
content = parseTextData(context, match[0].length,
|
|
11457
|
+
content = parseTextData(context, match[0].length, 4);
|
|
11458
11458
|
}
|
|
11459
11459
|
return { content, isQuoted, loc: getSelection(context, start) };
|
|
11460
11460
|
}
|
|
@@ -11462,7 +11462,7 @@ function parseInterpolation(context, mode) {
|
|
|
11462
11462
|
const [open, close] = context.options.delimiters;
|
|
11463
11463
|
const closeIndex = context.source.indexOf(close, open.length);
|
|
11464
11464
|
if (closeIndex === -1) {
|
|
11465
|
-
emitError(context,
|
|
11465
|
+
emitError(context, 25);
|
|
11466
11466
|
return void 0;
|
|
11467
11467
|
}
|
|
11468
11468
|
const start = getCursor(context);
|
|
@@ -11481,9 +11481,9 @@ function parseInterpolation(context, mode) {
|
|
|
11481
11481
|
advancePositionWithMutation(innerEnd, rawContent, endOffset);
|
|
11482
11482
|
advanceBy(context, close.length);
|
|
11483
11483
|
return {
|
|
11484
|
-
type:
|
|
11484
|
+
type: 5,
|
|
11485
11485
|
content: {
|
|
11486
|
-
type:
|
|
11486
|
+
type: 4,
|
|
11487
11487
|
isStatic: false,
|
|
11488
11488
|
// Set `isConstant` to false by default and will decide in transformExpression
|
|
11489
11489
|
constType: 0,
|
|
@@ -11494,7 +11494,7 @@ function parseInterpolation(context, mode) {
|
|
|
11494
11494
|
};
|
|
11495
11495
|
}
|
|
11496
11496
|
function parseText(context, mode) {
|
|
11497
|
-
const endTokens = mode ===
|
|
11497
|
+
const endTokens = mode === 3 ? ["]]>"] : ["<", context.options.delimiters[0]];
|
|
11498
11498
|
let endIndex = context.source.length;
|
|
11499
11499
|
for (let i = 0; i < endTokens.length; i++) {
|
|
11500
11500
|
const index = context.source.indexOf(endTokens[i], 1);
|
|
@@ -11505,7 +11505,7 @@ function parseText(context, mode) {
|
|
|
11505
11505
|
const start = getCursor(context);
|
|
11506
11506
|
const content = parseTextData(context, endIndex, mode);
|
|
11507
11507
|
return {
|
|
11508
|
-
type:
|
|
11508
|
+
type: 2,
|
|
11509
11509
|
content,
|
|
11510
11510
|
loc: getSelection(context, start)
|
|
11511
11511
|
};
|
|
@@ -11513,12 +11513,12 @@ function parseText(context, mode) {
|
|
|
11513
11513
|
function parseTextData(context, length, mode) {
|
|
11514
11514
|
const rawText = context.source.slice(0, length);
|
|
11515
11515
|
advanceBy(context, length);
|
|
11516
|
-
if (mode ===
|
|
11516
|
+
if (mode === 2 || mode === 3 || !rawText.includes("&")) {
|
|
11517
11517
|
return rawText;
|
|
11518
11518
|
} else {
|
|
11519
11519
|
return context.options.decodeEntities(
|
|
11520
11520
|
rawText,
|
|
11521
|
-
mode ===
|
|
11521
|
+
mode === 4
|
|
11522
11522
|
);
|
|
11523
11523
|
}
|
|
11524
11524
|
}
|
|
@@ -11574,7 +11574,7 @@ function emitError(context, code, offset, loc = getCursor(context)) {
|
|
|
11574
11574
|
function isEnd(context, mode, ancestors) {
|
|
11575
11575
|
const s = context.source;
|
|
11576
11576
|
switch (mode) {
|
|
11577
|
-
case
|
|
11577
|
+
case 0:
|
|
11578
11578
|
if (startsWith(s, "</")) {
|
|
11579
11579
|
for (let i = ancestors.length - 1; i >= 0; --i) {
|
|
11580
11580
|
if (startsWithEndTagOpen(s, ancestors[i].tag)) {
|
|
@@ -11583,15 +11583,15 @@ function isEnd(context, mode, ancestors) {
|
|
|
11583
11583
|
}
|
|
11584
11584
|
}
|
|
11585
11585
|
break;
|
|
11586
|
-
case
|
|
11587
|
-
case
|
|
11586
|
+
case 1:
|
|
11587
|
+
case 2: {
|
|
11588
11588
|
const parent = last(ancestors);
|
|
11589
11589
|
if (parent && startsWithEndTagOpen(s, parent.tag)) {
|
|
11590
11590
|
return true;
|
|
11591
11591
|
}
|
|
11592
11592
|
break;
|
|
11593
11593
|
}
|
|
11594
|
-
case
|
|
11594
|
+
case 3:
|
|
11595
11595
|
if (startsWith(s, "]]>")) {
|
|
11596
11596
|
return true;
|
|
11597
11597
|
}
|
|
@@ -11614,7 +11614,7 @@ function hoistStatic(root, context) {
|
|
|
11614
11614
|
}
|
|
11615
11615
|
function isSingleElementRoot(root, child) {
|
|
11616
11616
|
const { children } = root;
|
|
11617
|
-
return children.length === 1 && child.type ===
|
|
11617
|
+
return children.length === 1 && child.type === 1 && !isSlotOutlet(child);
|
|
11618
11618
|
}
|
|
11619
11619
|
function walk(node, context, doNotHoistNode = false) {
|
|
11620
11620
|
const { children } = node;
|
|
@@ -11622,10 +11622,10 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
11622
11622
|
let hoistedCount = 0;
|
|
11623
11623
|
for (let i = 0; i < children.length; i++) {
|
|
11624
11624
|
const child = children[i];
|
|
11625
|
-
if (child.type ===
|
|
11625
|
+
if (child.type === 1 && child.tagType === 0) {
|
|
11626
11626
|
const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
|
|
11627
11627
|
if (constantType > 0) {
|
|
11628
|
-
if (constantType >=
|
|
11628
|
+
if (constantType >= 2) {
|
|
11629
11629
|
child.codegenNode.patchFlag = -1 + (``);
|
|
11630
11630
|
child.codegenNode = context.hoist(child.codegenNode);
|
|
11631
11631
|
hoistedCount++;
|
|
@@ -11633,9 +11633,9 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
11633
11633
|
}
|
|
11634
11634
|
} else {
|
|
11635
11635
|
const codegenNode = child.codegenNode;
|
|
11636
|
-
if (codegenNode.type ===
|
|
11636
|
+
if (codegenNode.type === 13) {
|
|
11637
11637
|
const flag = getPatchFlag(codegenNode);
|
|
11638
|
-
if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >=
|
|
11638
|
+
if ((!flag || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) {
|
|
11639
11639
|
const props = getNodeProps(child);
|
|
11640
11640
|
if (props) {
|
|
11641
11641
|
codegenNode.props = context.hoist(props);
|
|
@@ -11647,8 +11647,8 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
11647
11647
|
}
|
|
11648
11648
|
}
|
|
11649
11649
|
}
|
|
11650
|
-
if (child.type ===
|
|
11651
|
-
const isComponent = child.tagType ===
|
|
11650
|
+
if (child.type === 1) {
|
|
11651
|
+
const isComponent = child.tagType === 1;
|
|
11652
11652
|
if (isComponent) {
|
|
11653
11653
|
context.scopes.vSlot++;
|
|
11654
11654
|
}
|
|
@@ -11656,9 +11656,9 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
11656
11656
|
if (isComponent) {
|
|
11657
11657
|
context.scopes.vSlot--;
|
|
11658
11658
|
}
|
|
11659
|
-
} else if (child.type ===
|
|
11659
|
+
} else if (child.type === 11) {
|
|
11660
11660
|
walk(child, context, child.children.length === 1);
|
|
11661
|
-
} else if (child.type ===
|
|
11661
|
+
} else if (child.type === 9) {
|
|
11662
11662
|
for (let i2 = 0; i2 < child.branches.length; i2++) {
|
|
11663
11663
|
walk(
|
|
11664
11664
|
child.branches[i2],
|
|
@@ -11671,7 +11671,7 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
11671
11671
|
if (hoistedCount && context.transformHoist) {
|
|
11672
11672
|
context.transformHoist(children, context, node);
|
|
11673
11673
|
}
|
|
11674
|
-
if (hoistedCount && hoistedCount === originalCount && node.type ===
|
|
11674
|
+
if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
|
|
11675
11675
|
node.codegenNode.children = context.hoist(
|
|
11676
11676
|
createArrayExpression(node.codegenNode.children)
|
|
11677
11677
|
);
|
|
@@ -11680,8 +11680,8 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
11680
11680
|
function getConstantType(node, context) {
|
|
11681
11681
|
const { constantCache } = context;
|
|
11682
11682
|
switch (node.type) {
|
|
11683
|
-
case
|
|
11684
|
-
if (node.tagType !==
|
|
11683
|
+
case 1:
|
|
11684
|
+
if (node.tagType !== 0) {
|
|
11685
11685
|
return 0;
|
|
11686
11686
|
}
|
|
11687
11687
|
const cached = constantCache.get(node);
|
|
@@ -11689,7 +11689,7 @@ function getConstantType(node, context) {
|
|
|
11689
11689
|
return cached;
|
|
11690
11690
|
}
|
|
11691
11691
|
const codegenNode = node.codegenNode;
|
|
11692
|
-
if (codegenNode.type !==
|
|
11692
|
+
if (codegenNode.type !== 13) {
|
|
11693
11693
|
return 0;
|
|
11694
11694
|
}
|
|
11695
11695
|
if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject") {
|
|
@@ -11697,7 +11697,7 @@ function getConstantType(node, context) {
|
|
|
11697
11697
|
}
|
|
11698
11698
|
const flag = getPatchFlag(codegenNode);
|
|
11699
11699
|
if (!flag) {
|
|
11700
|
-
let returnType2 =
|
|
11700
|
+
let returnType2 = 3;
|
|
11701
11701
|
const generatedPropsType = getGeneratedPropsConstantType(node, context);
|
|
11702
11702
|
if (generatedPropsType === 0) {
|
|
11703
11703
|
constantCache.set(node, 0);
|
|
@@ -11716,10 +11716,10 @@ function getConstantType(node, context) {
|
|
|
11716
11716
|
returnType2 = childType;
|
|
11717
11717
|
}
|
|
11718
11718
|
}
|
|
11719
|
-
if (returnType2 >
|
|
11719
|
+
if (returnType2 > 1) {
|
|
11720
11720
|
for (let i = 0; i < node.props.length; i++) {
|
|
11721
11721
|
const p = node.props[i];
|
|
11722
|
-
if (p.type ===
|
|
11722
|
+
if (p.type === 7 && p.name === "bind" && p.exp) {
|
|
11723
11723
|
const expType = getConstantType(p.exp, context);
|
|
11724
11724
|
if (expType === 0) {
|
|
11725
11725
|
constantCache.set(node, 0);
|
|
@@ -11734,7 +11734,7 @@ function getConstantType(node, context) {
|
|
|
11734
11734
|
if (codegenNode.isBlock) {
|
|
11735
11735
|
for (let i = 0; i < node.props.length; i++) {
|
|
11736
11736
|
const p = node.props[i];
|
|
11737
|
-
if (p.type ===
|
|
11737
|
+
if (p.type === 7) {
|
|
11738
11738
|
constantCache.set(node, 0);
|
|
11739
11739
|
return 0;
|
|
11740
11740
|
}
|
|
@@ -11752,20 +11752,20 @@ function getConstantType(node, context) {
|
|
|
11752
11752
|
constantCache.set(node, 0);
|
|
11753
11753
|
return 0;
|
|
11754
11754
|
}
|
|
11755
|
-
case
|
|
11756
|
-
case
|
|
11757
|
-
return
|
|
11758
|
-
case
|
|
11759
|
-
case
|
|
11760
|
-
case
|
|
11755
|
+
case 2:
|
|
11756
|
+
case 3:
|
|
11757
|
+
return 3;
|
|
11758
|
+
case 9:
|
|
11759
|
+
case 11:
|
|
11760
|
+
case 10:
|
|
11761
11761
|
return 0;
|
|
11762
|
-
case
|
|
11763
|
-
case
|
|
11762
|
+
case 5:
|
|
11763
|
+
case 12:
|
|
11764
11764
|
return getConstantType(node.content, context);
|
|
11765
|
-
case
|
|
11765
|
+
case 4:
|
|
11766
11766
|
return node.constType;
|
|
11767
|
-
case
|
|
11768
|
-
let returnType =
|
|
11767
|
+
case 8:
|
|
11768
|
+
let returnType = 3;
|
|
11769
11769
|
for (let i = 0; i < node.children.length; i++) {
|
|
11770
11770
|
const child = node.children[i];
|
|
11771
11771
|
if (isString(child) || isSymbol(child)) {
|
|
@@ -11790,20 +11790,20 @@ const allowHoistedHelperSet = /* @__PURE__ */ new Set([
|
|
|
11790
11790
|
GUARD_REACTIVE_PROPS
|
|
11791
11791
|
]);
|
|
11792
11792
|
function getConstantTypeOfHelperCall(value, context) {
|
|
11793
|
-
if (value.type ===
|
|
11793
|
+
if (value.type === 14 && !isString(value.callee) && allowHoistedHelperSet.has(value.callee)) {
|
|
11794
11794
|
const arg = value.arguments[0];
|
|
11795
|
-
if (arg.type ===
|
|
11795
|
+
if (arg.type === 4) {
|
|
11796
11796
|
return getConstantType(arg, context);
|
|
11797
|
-
} else if (arg.type ===
|
|
11797
|
+
} else if (arg.type === 14) {
|
|
11798
11798
|
return getConstantTypeOfHelperCall(arg, context);
|
|
11799
11799
|
}
|
|
11800
11800
|
}
|
|
11801
11801
|
return 0;
|
|
11802
11802
|
}
|
|
11803
11803
|
function getGeneratedPropsConstantType(node, context) {
|
|
11804
|
-
let returnType =
|
|
11804
|
+
let returnType = 3;
|
|
11805
11805
|
const props = getNodeProps(node);
|
|
11806
|
-
if (props && props.type ===
|
|
11806
|
+
if (props && props.type === 15) {
|
|
11807
11807
|
const { properties } = props;
|
|
11808
11808
|
for (let i = 0; i < properties.length; i++) {
|
|
11809
11809
|
const { key, value } = properties[i];
|
|
@@ -11815,9 +11815,9 @@ function getGeneratedPropsConstantType(node, context) {
|
|
|
11815
11815
|
returnType = keyType;
|
|
11816
11816
|
}
|
|
11817
11817
|
let valueType;
|
|
11818
|
-
if (value.type ===
|
|
11818
|
+
if (value.type === 4) {
|
|
11819
11819
|
valueType = getConstantType(value, context);
|
|
11820
|
-
} else if (value.type ===
|
|
11820
|
+
} else if (value.type === 14) {
|
|
11821
11821
|
valueType = getConstantTypeOfHelperCall(value, context);
|
|
11822
11822
|
} else {
|
|
11823
11823
|
valueType = 0;
|
|
@@ -11834,7 +11834,7 @@ function getGeneratedPropsConstantType(node, context) {
|
|
|
11834
11834
|
}
|
|
11835
11835
|
function getNodeProps(node) {
|
|
11836
11836
|
const codegenNode = node.codegenNode;
|
|
11837
|
-
if (codegenNode.type ===
|
|
11837
|
+
if (codegenNode.type === 13) {
|
|
11838
11838
|
return codegenNode.props;
|
|
11839
11839
|
}
|
|
11840
11840
|
}
|
|
@@ -11956,7 +11956,7 @@ function createTransformContext(root, {
|
|
|
11956
11956
|
addId(exp);
|
|
11957
11957
|
} else if (exp.identifiers) {
|
|
11958
11958
|
exp.identifiers.forEach(addId);
|
|
11959
|
-
} else if (exp.type ===
|
|
11959
|
+
} else if (exp.type === 4) {
|
|
11960
11960
|
addId(exp.content);
|
|
11961
11961
|
}
|
|
11962
11962
|
}
|
|
@@ -11967,7 +11967,7 @@ function createTransformContext(root, {
|
|
|
11967
11967
|
removeId(exp);
|
|
11968
11968
|
} else if (exp.identifiers) {
|
|
11969
11969
|
exp.identifiers.forEach(removeId);
|
|
11970
|
-
} else if (exp.type ===
|
|
11970
|
+
} else if (exp.type === 4) {
|
|
11971
11971
|
removeId(exp.content);
|
|
11972
11972
|
}
|
|
11973
11973
|
}
|
|
@@ -11980,7 +11980,7 @@ function createTransformContext(root, {
|
|
|
11980
11980
|
`_hoisted_${context.hoists.length}`,
|
|
11981
11981
|
false,
|
|
11982
11982
|
exp.loc,
|
|
11983
|
-
|
|
11983
|
+
2
|
|
11984
11984
|
);
|
|
11985
11985
|
identifier.hoisted = exp;
|
|
11986
11986
|
return identifier;
|
|
@@ -12031,7 +12031,7 @@ function createRootCodegen(root, context) {
|
|
|
12031
12031
|
const child = children[0];
|
|
12032
12032
|
if (isSingleElementRoot(root, child) && child.codegenNode) {
|
|
12033
12033
|
const codegenNode = child.codegenNode;
|
|
12034
|
-
if (codegenNode.type ===
|
|
12034
|
+
if (codegenNode.type === 13) {
|
|
12035
12035
|
makeBlock(codegenNode, context);
|
|
12036
12036
|
}
|
|
12037
12037
|
root.codegenNode = codegenNode;
|
|
@@ -12091,25 +12091,25 @@ function traverseNode(node, context) {
|
|
|
12091
12091
|
}
|
|
12092
12092
|
}
|
|
12093
12093
|
switch (node.type) {
|
|
12094
|
-
case
|
|
12094
|
+
case 3:
|
|
12095
12095
|
if (!context.ssr) {
|
|
12096
12096
|
context.helper(CREATE_COMMENT);
|
|
12097
12097
|
}
|
|
12098
12098
|
break;
|
|
12099
|
-
case
|
|
12099
|
+
case 5:
|
|
12100
12100
|
if (!context.ssr) {
|
|
12101
12101
|
context.helper(TO_DISPLAY_STRING);
|
|
12102
12102
|
}
|
|
12103
12103
|
break;
|
|
12104
|
-
case
|
|
12104
|
+
case 9:
|
|
12105
12105
|
for (let i2 = 0; i2 < node.branches.length; i2++) {
|
|
12106
12106
|
traverseNode(node.branches[i2], context);
|
|
12107
12107
|
}
|
|
12108
12108
|
break;
|
|
12109
|
-
case
|
|
12110
|
-
case
|
|
12111
|
-
case
|
|
12112
|
-
case
|
|
12109
|
+
case 10:
|
|
12110
|
+
case 11:
|
|
12111
|
+
case 1:
|
|
12112
|
+
case 0:
|
|
12113
12113
|
traverseChildren(node, context);
|
|
12114
12114
|
break;
|
|
12115
12115
|
}
|
|
@@ -12122,15 +12122,15 @@ function traverseNode(node, context) {
|
|
|
12122
12122
|
function createStructuralDirectiveTransform(name, fn) {
|
|
12123
12123
|
const matches = isString(name) ? (n) => n === name : (n) => name.test(n);
|
|
12124
12124
|
return (node, context) => {
|
|
12125
|
-
if (node.type ===
|
|
12125
|
+
if (node.type === 1) {
|
|
12126
12126
|
const { props } = node;
|
|
12127
|
-
if (node.tagType ===
|
|
12127
|
+
if (node.tagType === 3 && props.some(isVSlot)) {
|
|
12128
12128
|
return;
|
|
12129
12129
|
}
|
|
12130
12130
|
const exitFns = [];
|
|
12131
12131
|
for (let i = 0; i < props.length; i++) {
|
|
12132
12132
|
const prop = props[i];
|
|
12133
|
-
if (prop.type ===
|
|
12133
|
+
if (prop.type === 7 && matches(prop.name)) {
|
|
12134
12134
|
props.splice(i, 1);
|
|
12135
12135
|
i--;
|
|
12136
12136
|
const onExit = fn(node, prop, context);
|
|
@@ -12188,7 +12188,7 @@ function createCodegenContext(ast, {
|
|
|
12188
12188
|
if (context.map) {
|
|
12189
12189
|
if (node) {
|
|
12190
12190
|
let name;
|
|
12191
|
-
if (node.type ===
|
|
12191
|
+
if (node.type === 4 && !node.isStatic) {
|
|
12192
12192
|
const content = node.content.replace(/^_ctx\./, "");
|
|
12193
12193
|
if (content !== node.content && isSimpleIdentifier(content)) {
|
|
12194
12194
|
name = content;
|
|
@@ -12464,7 +12464,7 @@ function genHoists(hoists, context) {
|
|
|
12464
12464
|
for (let i = 0; i < hoists.length; i++) {
|
|
12465
12465
|
const exp = hoists[i];
|
|
12466
12466
|
if (exp) {
|
|
12467
|
-
const needScopeIdWrapper = genScopeId && exp.type ===
|
|
12467
|
+
const needScopeIdWrapper = genScopeId && exp.type === 13;
|
|
12468
12468
|
push(
|
|
12469
12469
|
`const _hoisted_${i + 1} = ${needScopeIdWrapper ? `${PURE_ANNOTATION} _withScopeId(() => ` : ``}`
|
|
12470
12470
|
);
|
|
@@ -12489,7 +12489,7 @@ function genImports(importsOptions, context) {
|
|
|
12489
12489
|
});
|
|
12490
12490
|
}
|
|
12491
12491
|
function isText(n) {
|
|
12492
|
-
return isString(n) || n.type ===
|
|
12492
|
+
return isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8;
|
|
12493
12493
|
}
|
|
12494
12494
|
function genNodeListAsArray(nodes, context) {
|
|
12495
12495
|
const multilines = nodes.length > 3 || nodes.some((n) => isArray(n) || !isText(n));
|
|
@@ -12530,66 +12530,66 @@ function genNode(node, context) {
|
|
|
12530
12530
|
return;
|
|
12531
12531
|
}
|
|
12532
12532
|
switch (node.type) {
|
|
12533
|
-
case
|
|
12534
|
-
case
|
|
12535
|
-
case
|
|
12533
|
+
case 1:
|
|
12534
|
+
case 9:
|
|
12535
|
+
case 11:
|
|
12536
12536
|
genNode(node.codegenNode, context);
|
|
12537
12537
|
break;
|
|
12538
|
-
case
|
|
12538
|
+
case 2:
|
|
12539
12539
|
genText(node, context);
|
|
12540
12540
|
break;
|
|
12541
|
-
case
|
|
12541
|
+
case 4:
|
|
12542
12542
|
genExpression(node, context);
|
|
12543
12543
|
break;
|
|
12544
|
-
case
|
|
12544
|
+
case 5:
|
|
12545
12545
|
genInterpolation(node, context);
|
|
12546
12546
|
break;
|
|
12547
|
-
case
|
|
12547
|
+
case 12:
|
|
12548
12548
|
genNode(node.codegenNode, context);
|
|
12549
12549
|
break;
|
|
12550
|
-
case
|
|
12550
|
+
case 8:
|
|
12551
12551
|
genCompoundExpression(node, context);
|
|
12552
12552
|
break;
|
|
12553
|
-
case
|
|
12553
|
+
case 3:
|
|
12554
12554
|
genComment(node, context);
|
|
12555
12555
|
break;
|
|
12556
|
-
case
|
|
12556
|
+
case 13:
|
|
12557
12557
|
genVNodeCall(node, context);
|
|
12558
12558
|
break;
|
|
12559
|
-
case
|
|
12559
|
+
case 14:
|
|
12560
12560
|
genCallExpression(node, context);
|
|
12561
12561
|
break;
|
|
12562
|
-
case
|
|
12562
|
+
case 15:
|
|
12563
12563
|
genObjectExpression(node, context);
|
|
12564
12564
|
break;
|
|
12565
|
-
case
|
|
12565
|
+
case 17:
|
|
12566
12566
|
genArrayExpression(node, context);
|
|
12567
12567
|
break;
|
|
12568
|
-
case
|
|
12568
|
+
case 18:
|
|
12569
12569
|
genFunctionExpression(node, context);
|
|
12570
12570
|
break;
|
|
12571
|
-
case
|
|
12571
|
+
case 19:
|
|
12572
12572
|
genConditionalExpression(node, context);
|
|
12573
12573
|
break;
|
|
12574
|
-
case
|
|
12574
|
+
case 20:
|
|
12575
12575
|
genCacheExpression(node, context);
|
|
12576
12576
|
break;
|
|
12577
|
-
case
|
|
12577
|
+
case 21:
|
|
12578
12578
|
genNodeList(node.body, context, true, false);
|
|
12579
12579
|
break;
|
|
12580
|
-
case
|
|
12580
|
+
case 22:
|
|
12581
12581
|
genTemplateLiteral(node, context);
|
|
12582
12582
|
break;
|
|
12583
|
-
case
|
|
12583
|
+
case 23:
|
|
12584
12584
|
genIfStatement(node, context);
|
|
12585
12585
|
break;
|
|
12586
|
-
case
|
|
12586
|
+
case 24:
|
|
12587
12587
|
genAssignmentExpression(node, context);
|
|
12588
12588
|
break;
|
|
12589
|
-
case
|
|
12589
|
+
case 25:
|
|
12590
12590
|
genSequenceExpression(node, context);
|
|
12591
12591
|
break;
|
|
12592
|
-
case
|
|
12592
|
+
case 26:
|
|
12593
12593
|
genReturnStatement(node, context);
|
|
12594
12594
|
break;
|
|
12595
12595
|
}
|
|
@@ -12621,7 +12621,7 @@ function genCompoundExpression(node, context) {
|
|
|
12621
12621
|
}
|
|
12622
12622
|
function genExpressionAsPropertyKey(node, context) {
|
|
12623
12623
|
const { push } = context;
|
|
12624
|
-
if (node.type ===
|
|
12624
|
+
if (node.type === 8) {
|
|
12625
12625
|
push(`[`);
|
|
12626
12626
|
genCompoundExpression(node, context);
|
|
12627
12627
|
push(`]`);
|
|
@@ -12702,7 +12702,7 @@ function genObjectExpression(node, context) {
|
|
|
12702
12702
|
push(`{}`, node);
|
|
12703
12703
|
return;
|
|
12704
12704
|
}
|
|
12705
|
-
const multilines = properties.length > 1 || properties.some((p) => p.value.type !==
|
|
12705
|
+
const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4);
|
|
12706
12706
|
push(multilines ? `{` : `{ `);
|
|
12707
12707
|
multilines && indent();
|
|
12708
12708
|
for (let i = 0; i < properties.length; i++) {
|
|
@@ -12764,7 +12764,7 @@ function genFunctionExpression(node, context) {
|
|
|
12764
12764
|
function genConditionalExpression(node, context) {
|
|
12765
12765
|
const { test, consequent, alternate, newline: needNewline } = node;
|
|
12766
12766
|
const { push, indent, deindent, newline } = context;
|
|
12767
|
-
if (test.type ===
|
|
12767
|
+
if (test.type === 4) {
|
|
12768
12768
|
const needsParens = !isSimpleIdentifier(test.content);
|
|
12769
12769
|
needsParens && push(`(`);
|
|
12770
12770
|
genExpression(test, context);
|
|
@@ -12783,7 +12783,7 @@ function genConditionalExpression(node, context) {
|
|
|
12783
12783
|
needNewline && newline();
|
|
12784
12784
|
needNewline || push(` `);
|
|
12785
12785
|
push(`: `);
|
|
12786
|
-
const isNested = alternate.type ===
|
|
12786
|
+
const isNested = alternate.type === 19;
|
|
12787
12787
|
if (!isNested) {
|
|
12788
12788
|
context.indentLevel++;
|
|
12789
12789
|
}
|
|
@@ -12849,7 +12849,7 @@ function genIfStatement(node, context) {
|
|
|
12849
12849
|
push(`}`);
|
|
12850
12850
|
if (alternate) {
|
|
12851
12851
|
push(` else `);
|
|
12852
|
-
if (alternate.type ===
|
|
12852
|
+
if (alternate.type === 23) {
|
|
12853
12853
|
genIfStatement(alternate, context);
|
|
12854
12854
|
} else {
|
|
12855
12855
|
push(`{`);
|
|
@@ -13118,18 +13118,18 @@ function isReferenced(node, parent, grandparent) {
|
|
|
13118
13118
|
|
|
13119
13119
|
const isLiteralWhitelisted = /* @__PURE__ */ makeMap("true,false,null,this");
|
|
13120
13120
|
const transformExpression = (node, context) => {
|
|
13121
|
-
if (node.type ===
|
|
13121
|
+
if (node.type === 5) {
|
|
13122
13122
|
node.content = processExpression(
|
|
13123
13123
|
node.content,
|
|
13124
13124
|
context
|
|
13125
13125
|
);
|
|
13126
|
-
} else if (node.type ===
|
|
13126
|
+
} else if (node.type === 1) {
|
|
13127
13127
|
for (let i = 0; i < node.props.length; i++) {
|
|
13128
13128
|
const dir = node.props[i];
|
|
13129
|
-
if (dir.type ===
|
|
13129
|
+
if (dir.type === 7 && dir.name !== "for") {
|
|
13130
13130
|
const exp = dir.exp;
|
|
13131
13131
|
const arg = dir.arg;
|
|
13132
|
-
if (exp && exp.type ===
|
|
13132
|
+
if (exp && exp.type === 4 && !(dir.name === "on" && arg)) {
|
|
13133
13133
|
dir.exp = processExpression(
|
|
13134
13134
|
exp,
|
|
13135
13135
|
context,
|
|
@@ -13137,7 +13137,7 @@ const transformExpression = (node, context) => {
|
|
|
13137
13137
|
dir.name === "slot"
|
|
13138
13138
|
);
|
|
13139
13139
|
}
|
|
13140
|
-
if (arg && arg.type ===
|
|
13140
|
+
if (arg && arg.type === 4 && !arg.isStatic) {
|
|
13141
13141
|
dir.arg = processExpression(arg, context);
|
|
13142
13142
|
}
|
|
13143
13143
|
}
|
|
@@ -13213,14 +13213,14 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
13213
13213
|
const isLiteral = isLiteralWhitelisted(rawExp);
|
|
13214
13214
|
if (!asParams && !isScopeVarReference && !isAllowedGlobal && !isLiteral) {
|
|
13215
13215
|
if (bindingMetadata[node.content] === "setup-const") {
|
|
13216
|
-
node.constType =
|
|
13216
|
+
node.constType = 1;
|
|
13217
13217
|
}
|
|
13218
13218
|
node.content = rewriteIdentifier(rawExp);
|
|
13219
13219
|
} else if (!isScopeVarReference) {
|
|
13220
13220
|
if (isLiteral) {
|
|
13221
|
-
node.constType =
|
|
13221
|
+
node.constType = 3;
|
|
13222
13222
|
} else {
|
|
13223
|
-
node.constType =
|
|
13223
|
+
node.constType = 2;
|
|
13224
13224
|
}
|
|
13225
13225
|
}
|
|
13226
13226
|
return node;
|
|
@@ -13234,7 +13234,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
13234
13234
|
} catch (e) {
|
|
13235
13235
|
context.onError(
|
|
13236
13236
|
createCompilerError(
|
|
13237
|
-
|
|
13237
|
+
45,
|
|
13238
13238
|
node.loc,
|
|
13239
13239
|
void 0,
|
|
13240
13240
|
e.message
|
|
@@ -13293,7 +13293,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
13293
13293
|
start: advancePositionWithClone(node.loc.start, source2, start),
|
|
13294
13294
|
end: advancePositionWithClone(node.loc.start, source2, end)
|
|
13295
13295
|
},
|
|
13296
|
-
id.isConstant ?
|
|
13296
|
+
id.isConstant ? 3 : 0
|
|
13297
13297
|
)
|
|
13298
13298
|
);
|
|
13299
13299
|
if (i === ids.length - 1 && end < rawExp.length) {
|
|
@@ -13305,7 +13305,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
13305
13305
|
ret = createCompoundExpression(children, node.loc);
|
|
13306
13306
|
} else {
|
|
13307
13307
|
ret = node;
|
|
13308
|
-
ret.constType = bailConstant ? 0 :
|
|
13308
|
+
ret.constType = bailConstant ? 0 : 3;
|
|
13309
13309
|
}
|
|
13310
13310
|
ret.identifiers = Object.keys(knownIds);
|
|
13311
13311
|
return ret;
|
|
@@ -13322,7 +13322,7 @@ function canPrefix(id) {
|
|
|
13322
13322
|
function stringifyExpression(exp) {
|
|
13323
13323
|
if (isString(exp)) {
|
|
13324
13324
|
return exp;
|
|
13325
|
-
} else if (exp.type ===
|
|
13325
|
+
} else if (exp.type === 4) {
|
|
13326
13326
|
return exp.content;
|
|
13327
13327
|
} else {
|
|
13328
13328
|
return exp.children.map(stringifyExpression).join("");
|
|
@@ -13338,7 +13338,7 @@ const transformIf = createStructuralDirectiveTransform(
|
|
|
13338
13338
|
let key = 0;
|
|
13339
13339
|
while (i-- >= 0) {
|
|
13340
13340
|
const sibling = siblings[i];
|
|
13341
|
-
if (sibling && sibling.type ===
|
|
13341
|
+
if (sibling && sibling.type === 9) {
|
|
13342
13342
|
key += sibling.branches.length;
|
|
13343
13343
|
}
|
|
13344
13344
|
}
|
|
@@ -13365,7 +13365,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
13365
13365
|
if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) {
|
|
13366
13366
|
const loc = dir.exp ? dir.exp.loc : node.loc;
|
|
13367
13367
|
context.onError(
|
|
13368
|
-
createCompilerError(
|
|
13368
|
+
createCompilerError(28, dir.loc)
|
|
13369
13369
|
);
|
|
13370
13370
|
dir.exp = createSimpleExpression(`true`, false, loc);
|
|
13371
13371
|
}
|
|
@@ -13375,7 +13375,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
13375
13375
|
if (dir.name === "if") {
|
|
13376
13376
|
const branch = createIfBranch(node, dir);
|
|
13377
13377
|
const ifNode = {
|
|
13378
|
-
type:
|
|
13378
|
+
type: 9,
|
|
13379
13379
|
loc: node.loc,
|
|
13380
13380
|
branches: [branch]
|
|
13381
13381
|
};
|
|
@@ -13388,18 +13388,18 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
13388
13388
|
let i = siblings.indexOf(node);
|
|
13389
13389
|
while (i-- >= -1) {
|
|
13390
13390
|
const sibling = siblings[i];
|
|
13391
|
-
if (sibling && sibling.type ===
|
|
13391
|
+
if (sibling && sibling.type === 3) {
|
|
13392
13392
|
context.removeNode(sibling);
|
|
13393
13393
|
continue;
|
|
13394
13394
|
}
|
|
13395
|
-
if (sibling && sibling.type ===
|
|
13395
|
+
if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
|
|
13396
13396
|
context.removeNode(sibling);
|
|
13397
13397
|
continue;
|
|
13398
13398
|
}
|
|
13399
|
-
if (sibling && sibling.type ===
|
|
13399
|
+
if (sibling && sibling.type === 9) {
|
|
13400
13400
|
if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) {
|
|
13401
13401
|
context.onError(
|
|
13402
|
-
createCompilerError(
|
|
13402
|
+
createCompilerError(30, node.loc)
|
|
13403
13403
|
);
|
|
13404
13404
|
}
|
|
13405
13405
|
context.removeNode();
|
|
@@ -13411,7 +13411,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
13411
13411
|
if (isSameKey(userKey, key)) {
|
|
13412
13412
|
context.onError(
|
|
13413
13413
|
createCompilerError(
|
|
13414
|
-
|
|
13414
|
+
29,
|
|
13415
13415
|
branch.userKey.loc
|
|
13416
13416
|
)
|
|
13417
13417
|
);
|
|
@@ -13427,7 +13427,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
13427
13427
|
context.currentNode = null;
|
|
13428
13428
|
} else {
|
|
13429
13429
|
context.onError(
|
|
13430
|
-
createCompilerError(
|
|
13430
|
+
createCompilerError(30, node.loc)
|
|
13431
13431
|
);
|
|
13432
13432
|
}
|
|
13433
13433
|
break;
|
|
@@ -13435,9 +13435,9 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
13435
13435
|
}
|
|
13436
13436
|
}
|
|
13437
13437
|
function createIfBranch(node, dir) {
|
|
13438
|
-
const isTemplateIf = node.tagType ===
|
|
13438
|
+
const isTemplateIf = node.tagType === 3;
|
|
13439
13439
|
return {
|
|
13440
|
-
type:
|
|
13440
|
+
type: 10,
|
|
13441
13441
|
loc: node.loc,
|
|
13442
13442
|
condition: dir.name === "else" ? void 0 : dir.exp,
|
|
13443
13443
|
children: isTemplateIf && !findDir(node, "for") ? node.children : [node],
|
|
@@ -13469,14 +13469,14 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
|
|
|
13469
13469
|
`${keyIndex}`,
|
|
13470
13470
|
false,
|
|
13471
13471
|
locStub,
|
|
13472
|
-
|
|
13472
|
+
2
|
|
13473
13473
|
)
|
|
13474
13474
|
);
|
|
13475
13475
|
const { children } = branch;
|
|
13476
13476
|
const firstChild = children[0];
|
|
13477
|
-
const needFragmentWrapper = children.length !== 1 || firstChild.type !==
|
|
13477
|
+
const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1;
|
|
13478
13478
|
if (needFragmentWrapper) {
|
|
13479
|
-
if (children.length === 1 && firstChild.type ===
|
|
13479
|
+
if (children.length === 1 && firstChild.type === 11) {
|
|
13480
13480
|
const vnodeCall = firstChild.codegenNode;
|
|
13481
13481
|
injectProp(vnodeCall, keyProperty, context);
|
|
13482
13482
|
return vnodeCall;
|
|
@@ -13499,7 +13499,7 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
|
|
|
13499
13499
|
} else {
|
|
13500
13500
|
const ret = firstChild.codegenNode;
|
|
13501
13501
|
const vnodeCall = getMemoedVNodeCall(ret);
|
|
13502
|
-
if (vnodeCall.type ===
|
|
13502
|
+
if (vnodeCall.type === 13) {
|
|
13503
13503
|
makeBlock(vnodeCall, context);
|
|
13504
13504
|
}
|
|
13505
13505
|
injectProp(vnodeCall, keyProperty, context);
|
|
@@ -13510,7 +13510,7 @@ function isSameKey(a, b) {
|
|
|
13510
13510
|
if (!a || a.type !== b.type) {
|
|
13511
13511
|
return false;
|
|
13512
13512
|
}
|
|
13513
|
-
if (a.type ===
|
|
13513
|
+
if (a.type === 6) {
|
|
13514
13514
|
if (a.value.content !== b.value.content) {
|
|
13515
13515
|
return false;
|
|
13516
13516
|
}
|
|
@@ -13520,7 +13520,7 @@ function isSameKey(a, b) {
|
|
|
13520
13520
|
if (exp.type !== branchExp.type) {
|
|
13521
13521
|
return false;
|
|
13522
13522
|
}
|
|
13523
|
-
if (exp.type !==
|
|
13523
|
+
if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) {
|
|
13524
13524
|
return false;
|
|
13525
13525
|
}
|
|
13526
13526
|
}
|
|
@@ -13528,13 +13528,13 @@ function isSameKey(a, b) {
|
|
|
13528
13528
|
}
|
|
13529
13529
|
function getParentCondition(node) {
|
|
13530
13530
|
while (true) {
|
|
13531
|
-
if (node.type ===
|
|
13532
|
-
if (node.alternate.type ===
|
|
13531
|
+
if (node.type === 19) {
|
|
13532
|
+
if (node.alternate.type === 19) {
|
|
13533
13533
|
node = node.alternate;
|
|
13534
13534
|
} else {
|
|
13535
13535
|
return node;
|
|
13536
13536
|
}
|
|
13537
|
-
} else if (node.type ===
|
|
13537
|
+
} else if (node.type === 20) {
|
|
13538
13538
|
node = node.value;
|
|
13539
13539
|
}
|
|
13540
13540
|
}
|
|
@@ -13551,7 +13551,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
13551
13551
|
const isTemplate = isTemplateNode(node);
|
|
13552
13552
|
const memo = findDir(node, "memo");
|
|
13553
13553
|
const keyProp = findProp(node, `key`);
|
|
13554
|
-
const keyExp = keyProp && (keyProp.type ===
|
|
13554
|
+
const keyExp = keyProp && (keyProp.type === 6 ? createSimpleExpression(keyProp.value.content, true) : keyProp.exp);
|
|
13555
13555
|
const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
|
|
13556
13556
|
if (isTemplate) {
|
|
13557
13557
|
if (memo) {
|
|
@@ -13560,14 +13560,14 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
13560
13560
|
context
|
|
13561
13561
|
);
|
|
13562
13562
|
}
|
|
13563
|
-
if (keyProperty && keyProp.type !==
|
|
13563
|
+
if (keyProperty && keyProp.type !== 6) {
|
|
13564
13564
|
keyProperty.value = processExpression(
|
|
13565
13565
|
keyProperty.value,
|
|
13566
13566
|
context
|
|
13567
13567
|
);
|
|
13568
13568
|
}
|
|
13569
13569
|
}
|
|
13570
|
-
const isStableFragment = forNode.source.type ===
|
|
13570
|
+
const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
|
|
13571
13571
|
const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
|
|
13572
13572
|
forNode.codegenNode = createVNodeCall(
|
|
13573
13573
|
context,
|
|
@@ -13587,12 +13587,12 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
13587
13587
|
const { children } = forNode;
|
|
13588
13588
|
if (isTemplate) {
|
|
13589
13589
|
node.children.some((c) => {
|
|
13590
|
-
if (c.type ===
|
|
13590
|
+
if (c.type === 1) {
|
|
13591
13591
|
const key = findProp(c, "key");
|
|
13592
13592
|
if (key) {
|
|
13593
13593
|
context.onError(
|
|
13594
13594
|
createCompilerError(
|
|
13595
|
-
|
|
13595
|
+
33,
|
|
13596
13596
|
key.loc
|
|
13597
13597
|
)
|
|
13598
13598
|
);
|
|
@@ -13601,7 +13601,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
13601
13601
|
}
|
|
13602
13602
|
});
|
|
13603
13603
|
}
|
|
13604
|
-
const needFragmentWrapper = children.length !== 1 || children[0].type !==
|
|
13604
|
+
const needFragmentWrapper = children.length !== 1 || children[0].type !== 1;
|
|
13605
13605
|
const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null;
|
|
13606
13606
|
if (slotOutlet) {
|
|
13607
13607
|
childBlock = slotOutlet.codegenNode;
|
|
@@ -13688,7 +13688,7 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
13688
13688
|
function processFor(node, dir, context, processCodegen) {
|
|
13689
13689
|
if (!dir.exp) {
|
|
13690
13690
|
context.onError(
|
|
13691
|
-
createCompilerError(
|
|
13691
|
+
createCompilerError(31, dir.loc)
|
|
13692
13692
|
);
|
|
13693
13693
|
return;
|
|
13694
13694
|
}
|
|
@@ -13700,14 +13700,14 @@ function processFor(node, dir, context, processCodegen) {
|
|
|
13700
13700
|
);
|
|
13701
13701
|
if (!parseResult) {
|
|
13702
13702
|
context.onError(
|
|
13703
|
-
createCompilerError(
|
|
13703
|
+
createCompilerError(32, dir.loc)
|
|
13704
13704
|
);
|
|
13705
13705
|
return;
|
|
13706
13706
|
}
|
|
13707
13707
|
const { addIdentifiers, removeIdentifiers, scopes } = context;
|
|
13708
13708
|
const { source, value, key, index } = parseResult;
|
|
13709
13709
|
const forNode = {
|
|
13710
|
-
type:
|
|
13710
|
+
type: 11,
|
|
13711
13711
|
loc: dir.loc,
|
|
13712
13712
|
source,
|
|
13713
13713
|
valueAlias: value,
|
|
@@ -13821,7 +13821,7 @@ function createParamsList(args) {
|
|
|
13821
13821
|
|
|
13822
13822
|
const defaultFallback = createSimpleExpression(`undefined`, false);
|
|
13823
13823
|
const trackSlotScopes = (node, context) => {
|
|
13824
|
-
if (node.type ===
|
|
13824
|
+
if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) {
|
|
13825
13825
|
const vSlot = findDir(node, "slot");
|
|
13826
13826
|
if (vSlot) {
|
|
13827
13827
|
const slotProps = vSlot.exp;
|
|
@@ -13897,14 +13897,14 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
13897
13897
|
const slotElement = children[i];
|
|
13898
13898
|
let slotDir;
|
|
13899
13899
|
if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) {
|
|
13900
|
-
if (slotElement.type !==
|
|
13900
|
+
if (slotElement.type !== 3) {
|
|
13901
13901
|
implicitDefaultChildren.push(slotElement);
|
|
13902
13902
|
}
|
|
13903
13903
|
continue;
|
|
13904
13904
|
}
|
|
13905
13905
|
if (onComponentSlot) {
|
|
13906
13906
|
context.onError(
|
|
13907
|
-
createCompilerError(
|
|
13907
|
+
createCompilerError(37, slotDir.loc)
|
|
13908
13908
|
);
|
|
13909
13909
|
break;
|
|
13910
13910
|
}
|
|
@@ -13944,7 +13944,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
13944
13944
|
let prev;
|
|
13945
13945
|
while (j--) {
|
|
13946
13946
|
prev = children[j];
|
|
13947
|
-
if (prev.type !==
|
|
13947
|
+
if (prev.type !== 3) {
|
|
13948
13948
|
break;
|
|
13949
13949
|
}
|
|
13950
13950
|
}
|
|
@@ -13952,7 +13952,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
13952
13952
|
children.splice(i, 1);
|
|
13953
13953
|
i--;
|
|
13954
13954
|
let conditional = dynamicSlots[dynamicSlots.length - 1];
|
|
13955
|
-
while (conditional.alternate.type ===
|
|
13955
|
+
while (conditional.alternate.type === 19) {
|
|
13956
13956
|
conditional = conditional.alternate;
|
|
13957
13957
|
}
|
|
13958
13958
|
conditional.alternate = vElse.exp ? createConditionalExpression(
|
|
@@ -13966,7 +13966,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
13966
13966
|
) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++);
|
|
13967
13967
|
} else {
|
|
13968
13968
|
context.onError(
|
|
13969
|
-
createCompilerError(
|
|
13969
|
+
createCompilerError(30, vElse.loc)
|
|
13970
13970
|
);
|
|
13971
13971
|
}
|
|
13972
13972
|
} else if (vFor = findDir(slotElement, "for")) {
|
|
@@ -13986,7 +13986,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
13986
13986
|
);
|
|
13987
13987
|
} else {
|
|
13988
13988
|
context.onError(
|
|
13989
|
-
createCompilerError(
|
|
13989
|
+
createCompilerError(32, vFor.loc)
|
|
13990
13990
|
);
|
|
13991
13991
|
}
|
|
13992
13992
|
} else {
|
|
@@ -13994,7 +13994,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
13994
13994
|
if (seenSlotNames.has(staticSlotName)) {
|
|
13995
13995
|
context.onError(
|
|
13996
13996
|
createCompilerError(
|
|
13997
|
-
|
|
13997
|
+
38,
|
|
13998
13998
|
dirLoc
|
|
13999
13999
|
)
|
|
14000
14000
|
);
|
|
@@ -14025,7 +14025,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
14025
14025
|
if (hasNamedDefaultSlot) {
|
|
14026
14026
|
context.onError(
|
|
14027
14027
|
createCompilerError(
|
|
14028
|
-
|
|
14028
|
+
39,
|
|
14029
14029
|
implicitDefaultChildren[0].loc
|
|
14030
14030
|
)
|
|
14031
14031
|
);
|
|
@@ -14078,17 +14078,17 @@ function hasForwardedSlots(children) {
|
|
|
14078
14078
|
for (let i = 0; i < children.length; i++) {
|
|
14079
14079
|
const child = children[i];
|
|
14080
14080
|
switch (child.type) {
|
|
14081
|
-
case
|
|
14082
|
-
if (child.tagType ===
|
|
14081
|
+
case 1:
|
|
14082
|
+
if (child.tagType === 2 || hasForwardedSlots(child.children)) {
|
|
14083
14083
|
return true;
|
|
14084
14084
|
}
|
|
14085
14085
|
break;
|
|
14086
|
-
case
|
|
14086
|
+
case 9:
|
|
14087
14087
|
if (hasForwardedSlots(child.branches))
|
|
14088
14088
|
return true;
|
|
14089
14089
|
break;
|
|
14090
|
-
case
|
|
14091
|
-
case
|
|
14090
|
+
case 10:
|
|
14091
|
+
case 11:
|
|
14092
14092
|
if (hasForwardedSlots(child.children))
|
|
14093
14093
|
return true;
|
|
14094
14094
|
break;
|
|
@@ -14097,20 +14097,20 @@ function hasForwardedSlots(children) {
|
|
|
14097
14097
|
return false;
|
|
14098
14098
|
}
|
|
14099
14099
|
function isNonWhitespaceContent(node) {
|
|
14100
|
-
if (node.type !==
|
|
14100
|
+
if (node.type !== 2 && node.type !== 12)
|
|
14101
14101
|
return true;
|
|
14102
|
-
return node.type ===
|
|
14102
|
+
return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content);
|
|
14103
14103
|
}
|
|
14104
14104
|
|
|
14105
14105
|
const directiveImportMap = /* @__PURE__ */ new WeakMap();
|
|
14106
14106
|
const transformElement = (node, context) => {
|
|
14107
14107
|
return function postTransformElement() {
|
|
14108
14108
|
node = context.currentNode;
|
|
14109
|
-
if (!(node.type ===
|
|
14109
|
+
if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) {
|
|
14110
14110
|
return;
|
|
14111
14111
|
}
|
|
14112
14112
|
const { tag, props } = node;
|
|
14113
|
-
const isComponent = node.tagType ===
|
|
14113
|
+
const isComponent = node.tagType === 1;
|
|
14114
14114
|
let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`;
|
|
14115
14115
|
const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
|
|
14116
14116
|
let vnodeProps;
|
|
@@ -14164,11 +14164,11 @@ const transformElement = (node, context) => {
|
|
|
14164
14164
|
} else if (node.children.length === 1 && vnodeTag !== TELEPORT) {
|
|
14165
14165
|
const child = node.children[0];
|
|
14166
14166
|
const type = child.type;
|
|
14167
|
-
const hasDynamicTextChild = type ===
|
|
14167
|
+
const hasDynamicTextChild = type === 5 || type === 8;
|
|
14168
14168
|
if (hasDynamicTextChild && getConstantType(child, context) === 0) {
|
|
14169
14169
|
patchFlag |= 1;
|
|
14170
14170
|
}
|
|
14171
|
-
if (hasDynamicTextChild || type ===
|
|
14171
|
+
if (hasDynamicTextChild || type === 2) {
|
|
14172
14172
|
vnodeChildren = child;
|
|
14173
14173
|
} else {
|
|
14174
14174
|
vnodeChildren = node.children;
|
|
@@ -14209,13 +14209,13 @@ function resolveComponentType(node, context, ssr = false) {
|
|
|
14209
14209
|
"COMPILER_IS_ON_ELEMENT",
|
|
14210
14210
|
context
|
|
14211
14211
|
)) {
|
|
14212
|
-
const exp = isProp.type ===
|
|
14212
|
+
const exp = isProp.type === 6 ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp;
|
|
14213
14213
|
if (exp) {
|
|
14214
14214
|
return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
|
|
14215
14215
|
exp
|
|
14216
14216
|
]);
|
|
14217
14217
|
}
|
|
14218
|
-
} else if (isProp.type ===
|
|
14218
|
+
} else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) {
|
|
14219
14219
|
tag = isProp.value.content.slice(4);
|
|
14220
14220
|
}
|
|
14221
14221
|
}
|
|
@@ -14325,7 +14325,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14325
14325
|
if (isEventHandler && isReservedProp(name)) {
|
|
14326
14326
|
hasVnodeHook = true;
|
|
14327
14327
|
}
|
|
14328
|
-
if (value.type ===
|
|
14328
|
+
if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
|
|
14329
14329
|
return;
|
|
14330
14330
|
}
|
|
14331
14331
|
if (name === "ref") {
|
|
@@ -14346,7 +14346,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14346
14346
|
};
|
|
14347
14347
|
for (let i = 0; i < props.length; i++) {
|
|
14348
14348
|
const prop = props[i];
|
|
14349
|
-
if (prop.type ===
|
|
14349
|
+
if (prop.type === 6) {
|
|
14350
14350
|
const { loc, name, value } = prop;
|
|
14351
14351
|
let isStatic = true;
|
|
14352
14352
|
if (name === "ref") {
|
|
@@ -14399,7 +14399,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14399
14399
|
if (name === "slot") {
|
|
14400
14400
|
if (!isComponent) {
|
|
14401
14401
|
context.onError(
|
|
14402
|
-
createCompilerError(
|
|
14402
|
+
createCompilerError(40, loc)
|
|
14403
14403
|
);
|
|
14404
14404
|
}
|
|
14405
14405
|
continue;
|
|
@@ -14449,7 +14449,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14449
14449
|
mergeArgs.push(exp);
|
|
14450
14450
|
} else {
|
|
14451
14451
|
pushMergeArg({
|
|
14452
|
-
type:
|
|
14452
|
+
type: 14,
|
|
14453
14453
|
loc,
|
|
14454
14454
|
callee: context.helper(TO_HANDLERS),
|
|
14455
14455
|
arguments: isComponent ? [exp] : [exp, `true`]
|
|
@@ -14458,7 +14458,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14458
14458
|
} else {
|
|
14459
14459
|
context.onError(
|
|
14460
14460
|
createCompilerError(
|
|
14461
|
-
isVBind ?
|
|
14461
|
+
isVBind ? 34 : 35,
|
|
14462
14462
|
loc
|
|
14463
14463
|
)
|
|
14464
14464
|
);
|
|
@@ -14527,7 +14527,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14527
14527
|
}
|
|
14528
14528
|
if (!context.inSSR && propsExpression) {
|
|
14529
14529
|
switch (propsExpression.type) {
|
|
14530
|
-
case
|
|
14530
|
+
case 15:
|
|
14531
14531
|
let classKeyIndex = -1;
|
|
14532
14532
|
let styleKeyIndex = -1;
|
|
14533
14533
|
let hasDynamicKey = false;
|
|
@@ -14554,9 +14554,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14554
14554
|
}
|
|
14555
14555
|
if (styleProp && // the static style is compiled into an object,
|
|
14556
14556
|
// so use `hasStyleBinding` to ensure that it is a dynamic style binding
|
|
14557
|
-
(hasStyleBinding || styleProp.value.type ===
|
|
14557
|
+
(hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist,
|
|
14558
14558
|
// v-bind:style with static literal object
|
|
14559
|
-
styleProp.value.type ===
|
|
14559
|
+
styleProp.value.type === 17)) {
|
|
14560
14560
|
styleProp.value = createCallExpression(
|
|
14561
14561
|
context.helper(NORMALIZE_STYLE),
|
|
14562
14562
|
[styleProp.value]
|
|
@@ -14569,7 +14569,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14569
14569
|
);
|
|
14570
14570
|
}
|
|
14571
14571
|
break;
|
|
14572
|
-
case
|
|
14572
|
+
case 14:
|
|
14573
14573
|
break;
|
|
14574
14574
|
default:
|
|
14575
14575
|
propsExpression = createCallExpression(
|
|
@@ -14596,7 +14596,7 @@ function dedupeProperties(properties) {
|
|
|
14596
14596
|
const deduped = [];
|
|
14597
14597
|
for (let i = 0; i < properties.length; i++) {
|
|
14598
14598
|
const prop = properties[i];
|
|
14599
|
-
if (prop.key.type ===
|
|
14599
|
+
if (prop.key.type === 8 || !prop.key.isStatic) {
|
|
14600
14600
|
deduped.push(prop);
|
|
14601
14601
|
continue;
|
|
14602
14602
|
}
|
|
@@ -14614,7 +14614,7 @@ function dedupeProperties(properties) {
|
|
|
14614
14614
|
return deduped;
|
|
14615
14615
|
}
|
|
14616
14616
|
function mergeAsArray(existing, incoming) {
|
|
14617
|
-
if (existing.value.type ===
|
|
14617
|
+
if (existing.value.type === 17) {
|
|
14618
14618
|
existing.value.elements.push(incoming.value);
|
|
14619
14619
|
} else {
|
|
14620
14620
|
existing.value = createArrayExpression(
|
|
@@ -14716,7 +14716,7 @@ function processSlotOutlet(node, context) {
|
|
|
14716
14716
|
const nonNameProps = [];
|
|
14717
14717
|
for (let i = 0; i < node.props.length; i++) {
|
|
14718
14718
|
const p = node.props[i];
|
|
14719
|
-
if (p.type ===
|
|
14719
|
+
if (p.type === 6) {
|
|
14720
14720
|
if (p.value) {
|
|
14721
14721
|
if (p.name === "name") {
|
|
14722
14722
|
slotName = JSON.stringify(p.value.content);
|
|
@@ -14749,7 +14749,7 @@ function processSlotOutlet(node, context) {
|
|
|
14749
14749
|
if (directives.length) {
|
|
14750
14750
|
context.onError(
|
|
14751
14751
|
createCompilerError(
|
|
14752
|
-
|
|
14752
|
+
36,
|
|
14753
14753
|
directives[0].loc
|
|
14754
14754
|
)
|
|
14755
14755
|
);
|
|
@@ -14765,16 +14765,16 @@ const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+
|
|
|
14765
14765
|
const transformOn$1 = (dir, node, context, augmentor) => {
|
|
14766
14766
|
const { loc, modifiers, arg } = dir;
|
|
14767
14767
|
if (!dir.exp && !modifiers.length) {
|
|
14768
|
-
context.onError(createCompilerError(
|
|
14768
|
+
context.onError(createCompilerError(35, loc));
|
|
14769
14769
|
}
|
|
14770
14770
|
let eventName;
|
|
14771
|
-
if (arg.type ===
|
|
14771
|
+
if (arg.type === 4) {
|
|
14772
14772
|
if (arg.isStatic) {
|
|
14773
14773
|
let rawName = arg.content;
|
|
14774
14774
|
if (rawName.startsWith("vue:")) {
|
|
14775
14775
|
rawName = `vnode-${rawName.slice(4)}`;
|
|
14776
14776
|
}
|
|
14777
|
-
const eventString = node.tagType !==
|
|
14777
|
+
const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? (
|
|
14778
14778
|
// for non-element and vnode lifecycle event listeners, auto convert
|
|
14779
14779
|
// it to camelCase. See issue #2249
|
|
14780
14780
|
toHandlerKey(camelize(rawName))
|
|
@@ -14817,16 +14817,16 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
14817
14817
|
shouldCache = context.cacheHandlers && // unnecessary to cache inside v-once
|
|
14818
14818
|
!context.inVOnce && // runtime constants don't need to be cached
|
|
14819
14819
|
// (this is analyzed by compileScript in SFC <script setup>)
|
|
14820
|
-
!(exp.type ===
|
|
14820
|
+
!(exp.type === 4 && exp.constType > 0) && // #1541 bail if this is a member exp handler passed to a component -
|
|
14821
14821
|
// we need to use the original function to preserve arity,
|
|
14822
14822
|
// e.g. <transition> relies on checking cb.length to determine
|
|
14823
14823
|
// transition end handling. Inline function is ok since its arity
|
|
14824
14824
|
// is preserved even when cached.
|
|
14825
|
-
!(isMemberExp && node.tagType ===
|
|
14825
|
+
!(isMemberExp && node.tagType === 1) && // bail if the function references closure variables (v-for, v-slot)
|
|
14826
14826
|
// it must be passed fresh to avoid stale values.
|
|
14827
14827
|
!hasScopeRef(exp, context.identifiers);
|
|
14828
14828
|
if (shouldCache && isMemberExp) {
|
|
14829
|
-
if (exp.type ===
|
|
14829
|
+
if (exp.type === 4) {
|
|
14830
14830
|
exp.content = `${exp.content} && ${exp.content}(...args)`;
|
|
14831
14831
|
} else {
|
|
14832
14832
|
exp.children = [...exp.children, ` && `, ...exp.children, `(...args)`];
|
|
@@ -14864,14 +14864,14 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
14864
14864
|
const transformBind = (dir, _node, context) => {
|
|
14865
14865
|
const { exp, modifiers, loc } = dir;
|
|
14866
14866
|
const arg = dir.arg;
|
|
14867
|
-
if (arg.type !==
|
|
14867
|
+
if (arg.type !== 4) {
|
|
14868
14868
|
arg.children.unshift(`(`);
|
|
14869
14869
|
arg.children.push(`) || ""`);
|
|
14870
14870
|
} else if (!arg.isStatic) {
|
|
14871
14871
|
arg.content = `${arg.content} || ""`;
|
|
14872
14872
|
}
|
|
14873
14873
|
if (modifiers.includes("camel")) {
|
|
14874
|
-
if (arg.type ===
|
|
14874
|
+
if (arg.type === 4) {
|
|
14875
14875
|
if (arg.isStatic) {
|
|
14876
14876
|
arg.content = camelize(arg.content);
|
|
14877
14877
|
} else {
|
|
@@ -14890,8 +14890,8 @@ const transformBind = (dir, _node, context) => {
|
|
|
14890
14890
|
injectPrefix(arg, "^");
|
|
14891
14891
|
}
|
|
14892
14892
|
}
|
|
14893
|
-
if (!exp || exp.type ===
|
|
14894
|
-
context.onError(createCompilerError(
|
|
14893
|
+
if (!exp || exp.type === 4 && !exp.content.trim()) {
|
|
14894
|
+
context.onError(createCompilerError(34, loc));
|
|
14895
14895
|
return {
|
|
14896
14896
|
props: [createObjectProperty(arg, createSimpleExpression("", true, loc))]
|
|
14897
14897
|
};
|
|
@@ -14901,7 +14901,7 @@ const transformBind = (dir, _node, context) => {
|
|
|
14901
14901
|
};
|
|
14902
14902
|
};
|
|
14903
14903
|
const injectPrefix = (arg, prefix) => {
|
|
14904
|
-
if (arg.type ===
|
|
14904
|
+
if (arg.type === 4) {
|
|
14905
14905
|
if (arg.isStatic) {
|
|
14906
14906
|
arg.content = prefix + arg.content;
|
|
14907
14907
|
} else {
|
|
@@ -14914,7 +14914,7 @@ const injectPrefix = (arg, prefix) => {
|
|
|
14914
14914
|
};
|
|
14915
14915
|
|
|
14916
14916
|
const transformText = (node, context) => {
|
|
14917
|
-
if (node.type ===
|
|
14917
|
+
if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) {
|
|
14918
14918
|
return () => {
|
|
14919
14919
|
const children = node.children;
|
|
14920
14920
|
let currentContainer = void 0;
|
|
@@ -14946,13 +14946,13 @@ const transformText = (node, context) => {
|
|
|
14946
14946
|
// as-is since the runtime has dedicated fast path for this by directly
|
|
14947
14947
|
// setting textContent of the element.
|
|
14948
14948
|
// for component root it's always normalized anyway.
|
|
14949
|
-
children.length === 1 && (node.type ===
|
|
14949
|
+
children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756
|
|
14950
14950
|
// custom directives can potentially add DOM elements arbitrarily,
|
|
14951
14951
|
// we need to avoid setting textContent of the element at runtime
|
|
14952
14952
|
// to avoid accidentally overwriting the DOM elements added
|
|
14953
14953
|
// by the user through custom directives.
|
|
14954
14954
|
!node.props.find(
|
|
14955
|
-
(p) => p.type ===
|
|
14955
|
+
(p) => p.type === 7 && !context.directiveTransforms[p.name]
|
|
14956
14956
|
) && // in compat mode, <template> tags with no special directives
|
|
14957
14957
|
// will be rendered as a fragment so its children must be
|
|
14958
14958
|
// converted into vnodes.
|
|
@@ -14961,9 +14961,9 @@ const transformText = (node, context) => {
|
|
|
14961
14961
|
}
|
|
14962
14962
|
for (let i = 0; i < children.length; i++) {
|
|
14963
14963
|
const child = children[i];
|
|
14964
|
-
if (isText$1(child) || child.type ===
|
|
14964
|
+
if (isText$1(child) || child.type === 8) {
|
|
14965
14965
|
const callArgs = [];
|
|
14966
|
-
if (child.type !==
|
|
14966
|
+
if (child.type !== 2 || child.content !== " ") {
|
|
14967
14967
|
callArgs.push(child);
|
|
14968
14968
|
}
|
|
14969
14969
|
if (!context.ssr && getConstantType(child, context) === 0) {
|
|
@@ -14972,7 +14972,7 @@ const transformText = (node, context) => {
|
|
|
14972
14972
|
);
|
|
14973
14973
|
}
|
|
14974
14974
|
children[i] = {
|
|
14975
|
-
type:
|
|
14975
|
+
type: 12,
|
|
14976
14976
|
content: child,
|
|
14977
14977
|
loc: child.loc,
|
|
14978
14978
|
codegenNode: createCallExpression(
|
|
@@ -14988,7 +14988,7 @@ const transformText = (node, context) => {
|
|
|
14988
14988
|
|
|
14989
14989
|
const seen$1 = /* @__PURE__ */ new WeakSet();
|
|
14990
14990
|
const transformOnce = (node, context) => {
|
|
14991
|
-
if (node.type ===
|
|
14991
|
+
if (node.type === 1 && findDir(node, "once", true)) {
|
|
14992
14992
|
if (seen$1.has(node) || context.inVOnce) {
|
|
14993
14993
|
return;
|
|
14994
14994
|
}
|
|
@@ -15013,27 +15013,27 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
15013
15013
|
const { exp, arg } = dir;
|
|
15014
15014
|
if (!exp) {
|
|
15015
15015
|
context.onError(
|
|
15016
|
-
createCompilerError(
|
|
15016
|
+
createCompilerError(41, dir.loc)
|
|
15017
15017
|
);
|
|
15018
15018
|
return createTransformProps();
|
|
15019
15019
|
}
|
|
15020
15020
|
const rawExp = exp.loc.source;
|
|
15021
|
-
const expString = exp.type ===
|
|
15021
|
+
const expString = exp.type === 4 ? exp.content : rawExp;
|
|
15022
15022
|
const bindingType = context.bindingMetadata[rawExp];
|
|
15023
15023
|
if (bindingType === "props" || bindingType === "props-aliased") {
|
|
15024
|
-
context.onError(createCompilerError(
|
|
15024
|
+
context.onError(createCompilerError(44, exp.loc));
|
|
15025
15025
|
return createTransformProps();
|
|
15026
15026
|
}
|
|
15027
15027
|
const maybeRef = context.inline && (bindingType === "setup-let" || bindingType === "setup-ref" || bindingType === "setup-maybe-ref");
|
|
15028
15028
|
if (!expString.trim() || !isMemberExpression(expString, context) && !maybeRef) {
|
|
15029
15029
|
context.onError(
|
|
15030
|
-
createCompilerError(
|
|
15030
|
+
createCompilerError(42, exp.loc)
|
|
15031
15031
|
);
|
|
15032
15032
|
return createTransformProps();
|
|
15033
15033
|
}
|
|
15034
15034
|
if (context.prefixIdentifiers && isSimpleIdentifier(expString) && context.identifiers[expString]) {
|
|
15035
15035
|
context.onError(
|
|
15036
|
-
createCompilerError(
|
|
15036
|
+
createCompilerError(43, exp.loc)
|
|
15037
15037
|
);
|
|
15038
15038
|
return createTransformProps();
|
|
15039
15039
|
}
|
|
@@ -15072,7 +15072,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
15072
15072
|
if (context.prefixIdentifiers && !context.inVOnce && context.cacheHandlers && !hasScopeRef(exp, context.identifiers)) {
|
|
15073
15073
|
props[1].value = context.cache(props[1].value);
|
|
15074
15074
|
}
|
|
15075
|
-
if (dir.modifiers.length && node.tagType ===
|
|
15075
|
+
if (dir.modifiers.length && node.tagType === 1) {
|
|
15076
15076
|
const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
|
|
15077
15077
|
const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
|
|
15078
15078
|
props.push(
|
|
@@ -15082,7 +15082,7 @@ const transformModel$1 = (dir, node, context) => {
|
|
|
15082
15082
|
`{ ${modifiers} }`,
|
|
15083
15083
|
false,
|
|
15084
15084
|
dir.loc,
|
|
15085
|
-
|
|
15085
|
+
2
|
|
15086
15086
|
)
|
|
15087
15087
|
)
|
|
15088
15088
|
);
|
|
@@ -15098,30 +15098,30 @@ const transformFilter = (node, context) => {
|
|
|
15098
15098
|
if (!isCompatEnabled("COMPILER_FILTER", context)) {
|
|
15099
15099
|
return;
|
|
15100
15100
|
}
|
|
15101
|
-
if (node.type ===
|
|
15101
|
+
if (node.type === 5) {
|
|
15102
15102
|
rewriteFilter(node.content, context);
|
|
15103
15103
|
}
|
|
15104
|
-
if (node.type ===
|
|
15104
|
+
if (node.type === 1) {
|
|
15105
15105
|
node.props.forEach((prop) => {
|
|
15106
|
-
if (prop.type ===
|
|
15106
|
+
if (prop.type === 7 && prop.name !== "for" && prop.exp) {
|
|
15107
15107
|
rewriteFilter(prop.exp, context);
|
|
15108
15108
|
}
|
|
15109
15109
|
});
|
|
15110
15110
|
}
|
|
15111
15111
|
};
|
|
15112
15112
|
function rewriteFilter(node, context) {
|
|
15113
|
-
if (node.type ===
|
|
15113
|
+
if (node.type === 4) {
|
|
15114
15114
|
parseFilter(node, context);
|
|
15115
15115
|
} else {
|
|
15116
15116
|
for (let i = 0; i < node.children.length; i++) {
|
|
15117
15117
|
const child = node.children[i];
|
|
15118
15118
|
if (typeof child !== "object")
|
|
15119
15119
|
continue;
|
|
15120
|
-
if (child.type ===
|
|
15120
|
+
if (child.type === 4) {
|
|
15121
15121
|
parseFilter(child, context);
|
|
15122
|
-
} else if (child.type ===
|
|
15122
|
+
} else if (child.type === 8) {
|
|
15123
15123
|
rewriteFilter(node, context);
|
|
15124
|
-
} else if (child.type ===
|
|
15124
|
+
} else if (child.type === 5) {
|
|
15125
15125
|
rewriteFilter(child.content, context);
|
|
15126
15126
|
}
|
|
15127
15127
|
}
|
|
@@ -15237,7 +15237,7 @@ function wrapFilter(exp, filter, context) {
|
|
|
15237
15237
|
|
|
15238
15238
|
const seen = /* @__PURE__ */ new WeakSet();
|
|
15239
15239
|
const transformMemo = (node, context) => {
|
|
15240
|
-
if (node.type ===
|
|
15240
|
+
if (node.type === 1) {
|
|
15241
15241
|
const dir = findDir(node, "memo");
|
|
15242
15242
|
if (!dir || seen.has(node)) {
|
|
15243
15243
|
return;
|
|
@@ -15245,8 +15245,8 @@ const transformMemo = (node, context) => {
|
|
|
15245
15245
|
seen.add(node);
|
|
15246
15246
|
return () => {
|
|
15247
15247
|
const codegenNode = node.codegenNode || context.currentNode.codegenNode;
|
|
15248
|
-
if (codegenNode && codegenNode.type ===
|
|
15249
|
-
if (node.tagType !==
|
|
15248
|
+
if (codegenNode && codegenNode.type === 13) {
|
|
15249
|
+
if (node.tagType !== 1) {
|
|
15250
15250
|
makeBlock(codegenNode, context);
|
|
15251
15251
|
}
|
|
15252
15252
|
node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
|
|
@@ -15290,10 +15290,10 @@ function baseCompile(template, options = {}) {
|
|
|
15290
15290
|
const isModuleMode = options.mode === "module";
|
|
15291
15291
|
const prefixIdentifiers = options.prefixIdentifiers === true || isModuleMode;
|
|
15292
15292
|
if (!prefixIdentifiers && options.cacheHandlers) {
|
|
15293
|
-
onError(createCompilerError(
|
|
15293
|
+
onError(createCompilerError(49));
|
|
15294
15294
|
}
|
|
15295
15295
|
if (options.scopeId && !isModuleMode) {
|
|
15296
|
-
onError(createCompilerError(
|
|
15296
|
+
onError(createCompilerError(50));
|
|
15297
15297
|
}
|
|
15298
15298
|
const ast = isString(template) ? baseParse(template, options) : template;
|
|
15299
15299
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(prefixIdentifiers);
|
|
@@ -17711,30 +17711,30 @@ const parserOptions = {
|
|
|
17711
17711
|
// https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
|
|
17712
17712
|
getNamespace(tag, parent) {
|
|
17713
17713
|
let ns = parent ? parent.ns : 0;
|
|
17714
|
-
if (parent && ns ===
|
|
17714
|
+
if (parent && ns === 2) {
|
|
17715
17715
|
if (parent.tag === "annotation-xml") {
|
|
17716
17716
|
if (tag === "svg") {
|
|
17717
|
-
return
|
|
17717
|
+
return 1;
|
|
17718
17718
|
}
|
|
17719
17719
|
if (parent.props.some(
|
|
17720
|
-
(a) => a.type ===
|
|
17720
|
+
(a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml")
|
|
17721
17721
|
)) {
|
|
17722
17722
|
ns = 0;
|
|
17723
17723
|
}
|
|
17724
17724
|
} else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") {
|
|
17725
17725
|
ns = 0;
|
|
17726
17726
|
}
|
|
17727
|
-
} else if (parent && ns ===
|
|
17727
|
+
} else if (parent && ns === 1) {
|
|
17728
17728
|
if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") {
|
|
17729
17729
|
ns = 0;
|
|
17730
17730
|
}
|
|
17731
17731
|
}
|
|
17732
17732
|
if (ns === 0) {
|
|
17733
17733
|
if (tag === "svg") {
|
|
17734
|
-
return
|
|
17734
|
+
return 1;
|
|
17735
17735
|
}
|
|
17736
17736
|
if (tag === "math") {
|
|
17737
|
-
return
|
|
17737
|
+
return 2;
|
|
17738
17738
|
}
|
|
17739
17739
|
}
|
|
17740
17740
|
return ns;
|
|
@@ -17743,22 +17743,22 @@ const parserOptions = {
|
|
|
17743
17743
|
getTextMode({ tag, ns }) {
|
|
17744
17744
|
if (ns === 0) {
|
|
17745
17745
|
if (tag === "textarea" || tag === "title") {
|
|
17746
|
-
return
|
|
17746
|
+
return 1;
|
|
17747
17747
|
}
|
|
17748
17748
|
if (isRawTextContainer(tag)) {
|
|
17749
|
-
return
|
|
17749
|
+
return 2;
|
|
17750
17750
|
}
|
|
17751
17751
|
}
|
|
17752
|
-
return
|
|
17752
|
+
return 0;
|
|
17753
17753
|
}
|
|
17754
17754
|
};
|
|
17755
17755
|
|
|
17756
17756
|
const transformStyle = (node) => {
|
|
17757
|
-
if (node.type ===
|
|
17757
|
+
if (node.type === 1) {
|
|
17758
17758
|
node.props.forEach((p, i) => {
|
|
17759
|
-
if (p.type ===
|
|
17759
|
+
if (p.type === 6 && p.name === "style" && p.value) {
|
|
17760
17760
|
node.props[i] = {
|
|
17761
|
-
type:
|
|
17761
|
+
type: 7,
|
|
17762
17762
|
name: `bind`,
|
|
17763
17763
|
arg: createSimpleExpression(`style`, true, p.loc),
|
|
17764
17764
|
exp: parseInlineCSS(p.value.content, p.loc),
|
|
@@ -17775,7 +17775,7 @@ const parseInlineCSS = (cssText, loc) => {
|
|
|
17775
17775
|
JSON.stringify(normalized),
|
|
17776
17776
|
false,
|
|
17777
17777
|
loc,
|
|
17778
|
-
|
|
17778
|
+
3
|
|
17779
17779
|
);
|
|
17780
17780
|
};
|
|
17781
17781
|
|
|
@@ -17788,16 +17788,16 @@ function createDOMCompilerError(code, loc) {
|
|
|
17788
17788
|
}
|
|
17789
17789
|
const DOMErrorMessages = {
|
|
17790
17790
|
[51]: `v-html is missing expression.`,
|
|
17791
|
-
[
|
|
17792
|
-
[
|
|
17793
|
-
[
|
|
17794
|
-
[
|
|
17795
|
-
[
|
|
17796
|
-
[
|
|
17797
|
-
[
|
|
17798
|
-
[
|
|
17799
|
-
[
|
|
17800
|
-
[
|
|
17791
|
+
[52]: `v-html will override element children.`,
|
|
17792
|
+
[53]: `v-text is missing expression.`,
|
|
17793
|
+
[54]: `v-text will override element children.`,
|
|
17794
|
+
[55]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
|
17795
|
+
[56]: `v-model argument is not supported on plain elements.`,
|
|
17796
|
+
[57]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
|
17797
|
+
[58]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
|
17798
|
+
[59]: `v-show is missing expression.`,
|
|
17799
|
+
[60]: `<Transition> expects exactly one child element or component.`,
|
|
17800
|
+
[61]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
|
17801
17801
|
};
|
|
17802
17802
|
|
|
17803
17803
|
const transformVHtml = (dir, node, context) => {
|
|
@@ -17809,7 +17809,7 @@ const transformVHtml = (dir, node, context) => {
|
|
|
17809
17809
|
}
|
|
17810
17810
|
if (node.children.length) {
|
|
17811
17811
|
context.onError(
|
|
17812
|
-
createDOMCompilerError(
|
|
17812
|
+
createDOMCompilerError(52, loc)
|
|
17813
17813
|
);
|
|
17814
17814
|
node.children.length = 0;
|
|
17815
17815
|
}
|
|
@@ -17827,12 +17827,12 @@ const transformVText = (dir, node, context) => {
|
|
|
17827
17827
|
const { exp, loc } = dir;
|
|
17828
17828
|
if (!exp) {
|
|
17829
17829
|
context.onError(
|
|
17830
|
-
createDOMCompilerError(
|
|
17830
|
+
createDOMCompilerError(53, loc)
|
|
17831
17831
|
);
|
|
17832
17832
|
}
|
|
17833
17833
|
if (node.children.length) {
|
|
17834
17834
|
context.onError(
|
|
17835
|
-
createDOMCompilerError(
|
|
17835
|
+
createDOMCompilerError(54, loc)
|
|
17836
17836
|
);
|
|
17837
17837
|
node.children.length = 0;
|
|
17838
17838
|
}
|
|
@@ -17852,13 +17852,13 @@ const transformVText = (dir, node, context) => {
|
|
|
17852
17852
|
|
|
17853
17853
|
const transformModel = (dir, node, context) => {
|
|
17854
17854
|
const baseResult = transformModel$1(dir, node, context);
|
|
17855
|
-
if (!baseResult.props.length || node.tagType ===
|
|
17855
|
+
if (!baseResult.props.length || node.tagType === 1) {
|
|
17856
17856
|
return baseResult;
|
|
17857
17857
|
}
|
|
17858
17858
|
if (dir.arg) {
|
|
17859
17859
|
context.onError(
|
|
17860
17860
|
createDOMCompilerError(
|
|
17861
|
-
|
|
17861
|
+
56,
|
|
17862
17862
|
dir.arg.loc
|
|
17863
17863
|
)
|
|
17864
17864
|
);
|
|
@@ -17871,7 +17871,7 @@ const transformModel = (dir, node, context) => {
|
|
|
17871
17871
|
if (tag === "input" || isCustomElement) {
|
|
17872
17872
|
const type = findProp(node, `type`);
|
|
17873
17873
|
if (type) {
|
|
17874
|
-
if (type.type ===
|
|
17874
|
+
if (type.type === 7) {
|
|
17875
17875
|
directiveToUse = V_MODEL_DYNAMIC;
|
|
17876
17876
|
} else if (type.value) {
|
|
17877
17877
|
switch (type.value.content) {
|
|
@@ -17885,7 +17885,7 @@ const transformModel = (dir, node, context) => {
|
|
|
17885
17885
|
isInvalidType = true;
|
|
17886
17886
|
context.onError(
|
|
17887
17887
|
createDOMCompilerError(
|
|
17888
|
-
|
|
17888
|
+
57,
|
|
17889
17889
|
dir.loc
|
|
17890
17890
|
)
|
|
17891
17891
|
);
|
|
@@ -17904,13 +17904,13 @@ const transformModel = (dir, node, context) => {
|
|
|
17904
17904
|
} else {
|
|
17905
17905
|
context.onError(
|
|
17906
17906
|
createDOMCompilerError(
|
|
17907
|
-
|
|
17907
|
+
55,
|
|
17908
17908
|
dir.loc
|
|
17909
17909
|
)
|
|
17910
17910
|
);
|
|
17911
17911
|
}
|
|
17912
17912
|
baseResult.props = baseResult.props.filter(
|
|
17913
|
-
(p) => !(p.key.type ===
|
|
17913
|
+
(p) => !(p.key.type === 4 && p.key.content === "modelValue")
|
|
17914
17914
|
);
|
|
17915
17915
|
return baseResult;
|
|
17916
17916
|
};
|
|
@@ -17966,7 +17966,7 @@ const resolveModifiers = (key, modifiers, context, loc) => {
|
|
|
17966
17966
|
};
|
|
17967
17967
|
const transformClick = (key, event) => {
|
|
17968
17968
|
const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === "onclick";
|
|
17969
|
-
return isStaticClick ? createSimpleExpression(event, true) : key.type !==
|
|
17969
|
+
return isStaticClick ? createSimpleExpression(event, true) : key.type !== 4 ? createCompoundExpression([
|
|
17970
17970
|
`(`,
|
|
17971
17971
|
key,
|
|
17972
17972
|
`) === "onClick" ? "${event}" : (`,
|
|
@@ -18014,7 +18014,7 @@ const transformShow = (dir, node, context) => {
|
|
|
18014
18014
|
const { exp, loc } = dir;
|
|
18015
18015
|
if (!exp) {
|
|
18016
18016
|
context.onError(
|
|
18017
|
-
createDOMCompilerError(
|
|
18017
|
+
createDOMCompilerError(59, loc)
|
|
18018
18018
|
);
|
|
18019
18019
|
}
|
|
18020
18020
|
return {
|
|
@@ -18074,10 +18074,10 @@ const stringifyStatic = (children, context, parent) => {
|
|
|
18074
18074
|
}
|
|
18075
18075
|
stringifyCurrentChunk(i);
|
|
18076
18076
|
};
|
|
18077
|
-
const getHoistedNode = (node) => (node.type ===
|
|
18077
|
+
const getHoistedNode = (node) => (node.type === 1 && node.tagType === 0 || node.type == 12) && node.codegenNode && node.codegenNode.type === 4 && node.codegenNode.hoisted;
|
|
18078
18078
|
const dataAriaRE = /^(data|aria)-/;
|
|
18079
18079
|
const isStringifiableAttr = (name, ns) => {
|
|
18080
|
-
return (ns === 0 ? isKnownHtmlAttr(name) : ns ===
|
|
18080
|
+
return (ns === 0 ? isKnownHtmlAttr(name) : ns === 1 ? isKnownSvgAttr(name) : false) || dataAriaRE.test(name);
|
|
18081
18081
|
};
|
|
18082
18082
|
const replaceHoist = (node, replacement, context) => {
|
|
18083
18083
|
const hoistToReplace = node.codegenNode.hoisted;
|
|
@@ -18087,10 +18087,10 @@ const isNonStringifiable = /* @__PURE__ */ makeMap(
|
|
|
18087
18087
|
`caption,thead,tr,th,tbody,td,tfoot,colgroup,col`
|
|
18088
18088
|
);
|
|
18089
18089
|
function analyzeNode(node) {
|
|
18090
|
-
if (node.type ===
|
|
18090
|
+
if (node.type === 1 && isNonStringifiable(node.tag)) {
|
|
18091
18091
|
return false;
|
|
18092
18092
|
}
|
|
18093
|
-
if (node.type ===
|
|
18093
|
+
if (node.type === 12) {
|
|
18094
18094
|
return [1, 0];
|
|
18095
18095
|
}
|
|
18096
18096
|
let nc = 1;
|
|
@@ -18103,14 +18103,14 @@ function analyzeNode(node) {
|
|
|
18103
18103
|
function walk(node2) {
|
|
18104
18104
|
for (let i = 0; i < node2.props.length; i++) {
|
|
18105
18105
|
const p = node2.props[i];
|
|
18106
|
-
if (p.type ===
|
|
18106
|
+
if (p.type === 6 && !isStringifiableAttr(p.name, node2.ns)) {
|
|
18107
18107
|
return bail();
|
|
18108
18108
|
}
|
|
18109
|
-
if (p.type ===
|
|
18110
|
-
if (p.arg && (p.arg.type ===
|
|
18109
|
+
if (p.type === 7 && p.name === "bind") {
|
|
18110
|
+
if (p.arg && (p.arg.type === 8 || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node2.ns))) {
|
|
18111
18111
|
return bail();
|
|
18112
18112
|
}
|
|
18113
|
-
if (p.exp && (p.exp.type ===
|
|
18113
|
+
if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) {
|
|
18114
18114
|
return bail();
|
|
18115
18115
|
}
|
|
18116
18116
|
}
|
|
@@ -18118,7 +18118,7 @@ function analyzeNode(node) {
|
|
|
18118
18118
|
for (let i = 0; i < node2.children.length; i++) {
|
|
18119
18119
|
nc++;
|
|
18120
18120
|
const child = node2.children[i];
|
|
18121
|
-
if (child.type ===
|
|
18121
|
+
if (child.type === 1) {
|
|
18122
18122
|
if (child.props.length > 0) {
|
|
18123
18123
|
ec++;
|
|
18124
18124
|
}
|
|
@@ -18140,17 +18140,17 @@ function stringifyNode(node, context) {
|
|
|
18140
18140
|
return ``;
|
|
18141
18141
|
}
|
|
18142
18142
|
switch (node.type) {
|
|
18143
|
-
case
|
|
18143
|
+
case 1:
|
|
18144
18144
|
return stringifyElement(node, context);
|
|
18145
|
-
case
|
|
18145
|
+
case 2:
|
|
18146
18146
|
return escapeHtml(node.content);
|
|
18147
|
-
case
|
|
18147
|
+
case 3:
|
|
18148
18148
|
return `<!--${escapeHtml(node.content)}-->`;
|
|
18149
|
-
case
|
|
18149
|
+
case 5:
|
|
18150
18150
|
return escapeHtml(toDisplayString(evaluateConstant(node.content)));
|
|
18151
|
-
case
|
|
18151
|
+
case 8:
|
|
18152
18152
|
return escapeHtml(evaluateConstant(node));
|
|
18153
|
-
case
|
|
18153
|
+
case 12:
|
|
18154
18154
|
return stringifyNode(node.content, context);
|
|
18155
18155
|
default:
|
|
18156
18156
|
return "";
|
|
@@ -18161,12 +18161,12 @@ function stringifyElement(node, context) {
|
|
|
18161
18161
|
let innerHTML = "";
|
|
18162
18162
|
for (let i = 0; i < node.props.length; i++) {
|
|
18163
18163
|
const p = node.props[i];
|
|
18164
|
-
if (p.type ===
|
|
18164
|
+
if (p.type === 6) {
|
|
18165
18165
|
res += ` ${p.name}`;
|
|
18166
18166
|
if (p.value) {
|
|
18167
18167
|
res += `="${escapeHtml(p.value.content)}"`;
|
|
18168
18168
|
}
|
|
18169
|
-
} else if (p.type ===
|
|
18169
|
+
} else if (p.type === 7) {
|
|
18170
18170
|
if (p.name === "bind") {
|
|
18171
18171
|
const exp = p.exp;
|
|
18172
18172
|
if (exp.content[0] === "_") {
|
|
@@ -18214,7 +18214,7 @@ function stringifyElement(node, context) {
|
|
|
18214
18214
|
return res;
|
|
18215
18215
|
}
|
|
18216
18216
|
function evaluateConstant(exp) {
|
|
18217
|
-
if (exp.type ===
|
|
18217
|
+
if (exp.type === 4) {
|
|
18218
18218
|
return new Function(`return ${exp.content}`)();
|
|
18219
18219
|
} else {
|
|
18220
18220
|
let res = ``;
|
|
@@ -18222,9 +18222,9 @@ function evaluateConstant(exp) {
|
|
|
18222
18222
|
if (isString(c) || isSymbol(c)) {
|
|
18223
18223
|
return;
|
|
18224
18224
|
}
|
|
18225
|
-
if (c.type ===
|
|
18225
|
+
if (c.type === 2) {
|
|
18226
18226
|
res += c.content;
|
|
18227
|
-
} else if (c.type ===
|
|
18227
|
+
} else if (c.type === 5) {
|
|
18228
18228
|
res += toDisplayString(evaluateConstant(c.content));
|
|
18229
18229
|
} else {
|
|
18230
18230
|
res += evaluateConstant(c);
|
|
@@ -18235,9 +18235,9 @@ function evaluateConstant(exp) {
|
|
|
18235
18235
|
}
|
|
18236
18236
|
|
|
18237
18237
|
const ignoreSideEffectTags = (node, context) => {
|
|
18238
|
-
if (node.type ===
|
|
18238
|
+
if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
|
|
18239
18239
|
context.onError(
|
|
18240
|
-
createDOMCompilerError(
|
|
18240
|
+
createDOMCompilerError(61, node.loc)
|
|
18241
18241
|
);
|
|
18242
18242
|
context.removeNode();
|
|
18243
18243
|
}
|