@vue/compiler-core 3.5.13 → 3.5.15
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-core v3.5.
|
|
2
|
+
* @vue/compiler-core v3.5.15
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -1782,7 +1782,7 @@ function isReferenced(node, parent, grandparent) {
|
|
|
1782
1782
|
if (parent.key === node) {
|
|
1783
1783
|
return !!parent.computed;
|
|
1784
1784
|
}
|
|
1785
|
-
return
|
|
1785
|
+
return true;
|
|
1786
1786
|
// no: class { NODE = value; }
|
|
1787
1787
|
// yes: class { [NODE] = value; }
|
|
1788
1788
|
// yes: class { key = NODE; }
|
|
@@ -2473,7 +2473,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
2473
2473
|
"COMPILER_V_BIND_SYNC",
|
|
2474
2474
|
currentOptions,
|
|
2475
2475
|
currentProp.loc,
|
|
2476
|
-
currentProp.
|
|
2476
|
+
currentProp.arg.loc.source
|
|
2477
2477
|
)) {
|
|
2478
2478
|
currentProp.name = "model";
|
|
2479
2479
|
currentProp.modifiers.splice(syncIndex, 1);
|
|
@@ -3065,6 +3065,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
3065
3065
|
}
|
|
3066
3066
|
}
|
|
3067
3067
|
let cachedAsArray = false;
|
|
3068
|
+
const slotCacheKeys = [];
|
|
3068
3069
|
if (toCache.length === children.length && node.type === 1) {
|
|
3069
3070
|
if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && shared.isArray(node.codegenNode.children)) {
|
|
3070
3071
|
node.codegenNode.children = getCacheExpression(
|
|
@@ -3074,6 +3075,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
3074
3075
|
} else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !shared.isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
|
|
3075
3076
|
const slot = getSlotNode(node.codegenNode, "default");
|
|
3076
3077
|
if (slot) {
|
|
3078
|
+
slotCacheKeys.push(context.cached.length);
|
|
3077
3079
|
slot.returns = getCacheExpression(
|
|
3078
3080
|
createArrayExpression(slot.returns)
|
|
3079
3081
|
);
|
|
@@ -3083,6 +3085,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
3083
3085
|
const slotName = findDir(node, "slot", true);
|
|
3084
3086
|
const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
|
|
3085
3087
|
if (slot) {
|
|
3088
|
+
slotCacheKeys.push(context.cached.length);
|
|
3086
3089
|
slot.returns = getCacheExpression(
|
|
3087
3090
|
createArrayExpression(slot.returns)
|
|
3088
3091
|
);
|
|
@@ -3092,9 +3095,18 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
3092
3095
|
}
|
|
3093
3096
|
if (!cachedAsArray) {
|
|
3094
3097
|
for (const child of toCache) {
|
|
3098
|
+
slotCacheKeys.push(context.cached.length);
|
|
3095
3099
|
child.codegenNode = context.cache(child.codegenNode);
|
|
3096
3100
|
}
|
|
3097
3101
|
}
|
|
3102
|
+
if (slotCacheKeys.length && node.type === 1 && node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !shared.isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
|
|
3103
|
+
node.codegenNode.children.properties.push(
|
|
3104
|
+
createObjectProperty(
|
|
3105
|
+
`__`,
|
|
3106
|
+
createSimpleExpression(JSON.stringify(slotCacheKeys), false)
|
|
3107
|
+
)
|
|
3108
|
+
);
|
|
3109
|
+
}
|
|
3098
3110
|
function getCacheExpression(value) {
|
|
3099
3111
|
const exp = context.cache(value);
|
|
3100
3112
|
if (inFor && context.hmr) {
|
|
@@ -3653,7 +3665,9 @@ function createCodegenContext(ast, {
|
|
|
3653
3665
|
name = content;
|
|
3654
3666
|
}
|
|
3655
3667
|
}
|
|
3656
|
-
|
|
3668
|
+
if (node.loc.source) {
|
|
3669
|
+
addMapping(node.loc.start, name);
|
|
3670
|
+
}
|
|
3657
3671
|
}
|
|
3658
3672
|
if (newlineIndex === -3 /* Unknown */) {
|
|
3659
3673
|
advancePositionWithMutation(context, code);
|
|
@@ -3669,7 +3683,7 @@ function createCodegenContext(ast, {
|
|
|
3669
3683
|
context.column = code.length - newlineIndex;
|
|
3670
3684
|
}
|
|
3671
3685
|
}
|
|
3672
|
-
if (node && node.loc !== locStub) {
|
|
3686
|
+
if (node && node.loc !== locStub && node.loc.source) {
|
|
3673
3687
|
addMapping(node.loc.end);
|
|
3674
3688
|
}
|
|
3675
3689
|
}
|
|
@@ -5780,9 +5794,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5780
5794
|
hasDynamicKeys = true;
|
|
5781
5795
|
if (exp) {
|
|
5782
5796
|
if (isVBind) {
|
|
5783
|
-
pushRefVForMarker();
|
|
5784
|
-
pushMergeArg();
|
|
5785
5797
|
{
|
|
5798
|
+
pushMergeArg();
|
|
5786
5799
|
{
|
|
5787
5800
|
const hasOverridableKeys = mergeArgs.some((arg2) => {
|
|
5788
5801
|
if (arg2.type === 15) {
|
|
@@ -5812,6 +5825,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5812
5825
|
continue;
|
|
5813
5826
|
}
|
|
5814
5827
|
}
|
|
5828
|
+
pushRefVForMarker();
|
|
5829
|
+
pushMergeArg();
|
|
5815
5830
|
mergeArgs.push(exp);
|
|
5816
5831
|
} else {
|
|
5817
5832
|
pushMergeArg({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-core v3.5.
|
|
2
|
+
* @vue/compiler-core v3.5.15
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -1778,7 +1778,7 @@ function isReferenced(node, parent, grandparent) {
|
|
|
1778
1778
|
if (parent.key === node) {
|
|
1779
1779
|
return !!parent.computed;
|
|
1780
1780
|
}
|
|
1781
|
-
return
|
|
1781
|
+
return true;
|
|
1782
1782
|
// no: class { NODE = value; }
|
|
1783
1783
|
// yes: class { [NODE] = value; }
|
|
1784
1784
|
// yes: class { key = NODE; }
|
|
@@ -2469,7 +2469,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
2469
2469
|
"COMPILER_V_BIND_SYNC",
|
|
2470
2470
|
currentOptions,
|
|
2471
2471
|
currentProp.loc,
|
|
2472
|
-
currentProp.
|
|
2472
|
+
currentProp.arg.loc.source
|
|
2473
2473
|
)) {
|
|
2474
2474
|
currentProp.name = "model";
|
|
2475
2475
|
currentProp.modifiers.splice(syncIndex, 1);
|
|
@@ -3024,6 +3024,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
3024
3024
|
}
|
|
3025
3025
|
}
|
|
3026
3026
|
let cachedAsArray = false;
|
|
3027
|
+
const slotCacheKeys = [];
|
|
3027
3028
|
if (toCache.length === children.length && node.type === 1) {
|
|
3028
3029
|
if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && shared.isArray(node.codegenNode.children)) {
|
|
3029
3030
|
node.codegenNode.children = getCacheExpression(
|
|
@@ -3033,6 +3034,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
3033
3034
|
} else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !shared.isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
|
|
3034
3035
|
const slot = getSlotNode(node.codegenNode, "default");
|
|
3035
3036
|
if (slot) {
|
|
3037
|
+
slotCacheKeys.push(context.cached.length);
|
|
3036
3038
|
slot.returns = getCacheExpression(
|
|
3037
3039
|
createArrayExpression(slot.returns)
|
|
3038
3040
|
);
|
|
@@ -3042,6 +3044,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
3042
3044
|
const slotName = findDir(node, "slot", true);
|
|
3043
3045
|
const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
|
|
3044
3046
|
if (slot) {
|
|
3047
|
+
slotCacheKeys.push(context.cached.length);
|
|
3045
3048
|
slot.returns = getCacheExpression(
|
|
3046
3049
|
createArrayExpression(slot.returns)
|
|
3047
3050
|
);
|
|
@@ -3051,9 +3054,18 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
3051
3054
|
}
|
|
3052
3055
|
if (!cachedAsArray) {
|
|
3053
3056
|
for (const child of toCache) {
|
|
3057
|
+
slotCacheKeys.push(context.cached.length);
|
|
3054
3058
|
child.codegenNode = context.cache(child.codegenNode);
|
|
3055
3059
|
}
|
|
3056
3060
|
}
|
|
3061
|
+
if (slotCacheKeys.length && node.type === 1 && node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !shared.isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
|
|
3062
|
+
node.codegenNode.children.properties.push(
|
|
3063
|
+
createObjectProperty(
|
|
3064
|
+
`__`,
|
|
3065
|
+
createSimpleExpression(JSON.stringify(slotCacheKeys), false)
|
|
3066
|
+
)
|
|
3067
|
+
);
|
|
3068
|
+
}
|
|
3057
3069
|
function getCacheExpression(value) {
|
|
3058
3070
|
const exp = context.cache(value);
|
|
3059
3071
|
if (inFor && context.hmr) {
|
|
@@ -3595,7 +3607,9 @@ function createCodegenContext(ast, {
|
|
|
3595
3607
|
name = content;
|
|
3596
3608
|
}
|
|
3597
3609
|
}
|
|
3598
|
-
|
|
3610
|
+
if (node.loc.source) {
|
|
3611
|
+
addMapping(node.loc.start, name);
|
|
3612
|
+
}
|
|
3599
3613
|
}
|
|
3600
3614
|
if (newlineIndex === -3 /* Unknown */) {
|
|
3601
3615
|
advancePositionWithMutation(context, code);
|
|
@@ -3611,7 +3625,7 @@ function createCodegenContext(ast, {
|
|
|
3611
3625
|
context.column = code.length - newlineIndex;
|
|
3612
3626
|
}
|
|
3613
3627
|
}
|
|
3614
|
-
if (node && node.loc !== locStub) {
|
|
3628
|
+
if (node && node.loc !== locStub && node.loc.source) {
|
|
3615
3629
|
addMapping(node.loc.end);
|
|
3616
3630
|
}
|
|
3617
3631
|
}
|
|
@@ -5686,9 +5700,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5686
5700
|
hasDynamicKeys = true;
|
|
5687
5701
|
if (exp) {
|
|
5688
5702
|
if (isVBind) {
|
|
5689
|
-
pushRefVForMarker();
|
|
5690
|
-
pushMergeArg();
|
|
5691
5703
|
{
|
|
5704
|
+
pushMergeArg();
|
|
5692
5705
|
if (isCompatEnabled(
|
|
5693
5706
|
"COMPILER_V_BIND_OBJECT_ORDER",
|
|
5694
5707
|
context
|
|
@@ -5697,6 +5710,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
5697
5710
|
continue;
|
|
5698
5711
|
}
|
|
5699
5712
|
}
|
|
5713
|
+
pushRefVForMarker();
|
|
5714
|
+
pushMergeArg();
|
|
5700
5715
|
mergeArgs.push(exp);
|
|
5701
5716
|
} else {
|
|
5702
5717
|
pushMergeArg({
|
package/dist/compiler-core.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-core v3.5.
|
|
2
|
+
* @vue/compiler-core v3.5.15
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
|
-
import { isString, NOOP, isObject,
|
|
6
|
+
import { isString, NOOP, isObject, extend, NO, isSymbol, isArray, capitalize, camelize, EMPTY_OBJ, PatchFlagNames, slotFlagsText, isOn, isBuiltInDirective, isReservedProp, toHandlerKey } from '@vue/shared';
|
|
7
7
|
export { generateCodeFrame } from '@vue/shared';
|
|
8
8
|
|
|
9
9
|
const FRAGMENT = Symbol(!!(process.env.NODE_ENV !== "production") ? `Fragment` : ``);
|
|
@@ -1535,7 +1535,7 @@ function isForStatement(stmt) {
|
|
|
1535
1535
|
}
|
|
1536
1536
|
function walkForStatement(stmt, isVar, onIdent) {
|
|
1537
1537
|
const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
|
|
1538
|
-
if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar :
|
|
1538
|
+
if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : false)) {
|
|
1539
1539
|
for (const decl of variable.declarations) {
|
|
1540
1540
|
for (const id of extractIdentifiers(decl.id)) {
|
|
1541
1541
|
onIdent(id);
|
|
@@ -2153,7 +2153,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
2153
2153
|
"COMPILER_V_BIND_SYNC",
|
|
2154
2154
|
currentOptions,
|
|
2155
2155
|
currentProp.loc,
|
|
2156
|
-
currentProp.
|
|
2156
|
+
currentProp.arg.loc.source
|
|
2157
2157
|
)) {
|
|
2158
2158
|
currentProp.name = "model";
|
|
2159
2159
|
currentProp.modifiers.splice(syncIndex, 1);
|
|
@@ -2729,6 +2729,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
2729
2729
|
}
|
|
2730
2730
|
}
|
|
2731
2731
|
let cachedAsArray = false;
|
|
2732
|
+
const slotCacheKeys = [];
|
|
2732
2733
|
if (toCache.length === children.length && node.type === 1) {
|
|
2733
2734
|
if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
|
|
2734
2735
|
node.codegenNode.children = getCacheExpression(
|
|
@@ -2738,6 +2739,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
2738
2739
|
} else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
|
|
2739
2740
|
const slot = getSlotNode(node.codegenNode, "default");
|
|
2740
2741
|
if (slot) {
|
|
2742
|
+
slotCacheKeys.push(context.cached.length);
|
|
2741
2743
|
slot.returns = getCacheExpression(
|
|
2742
2744
|
createArrayExpression(slot.returns)
|
|
2743
2745
|
);
|
|
@@ -2747,6 +2749,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
2747
2749
|
const slotName = findDir(node, "slot", true);
|
|
2748
2750
|
const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
|
|
2749
2751
|
if (slot) {
|
|
2752
|
+
slotCacheKeys.push(context.cached.length);
|
|
2750
2753
|
slot.returns = getCacheExpression(
|
|
2751
2754
|
createArrayExpression(slot.returns)
|
|
2752
2755
|
);
|
|
@@ -2756,9 +2759,18 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
|
|
|
2756
2759
|
}
|
|
2757
2760
|
if (!cachedAsArray) {
|
|
2758
2761
|
for (const child of toCache) {
|
|
2762
|
+
slotCacheKeys.push(context.cached.length);
|
|
2759
2763
|
child.codegenNode = context.cache(child.codegenNode);
|
|
2760
2764
|
}
|
|
2761
2765
|
}
|
|
2766
|
+
if (slotCacheKeys.length && node.type === 1 && node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
|
|
2767
|
+
node.codegenNode.children.properties.push(
|
|
2768
|
+
createObjectProperty(
|
|
2769
|
+
`__`,
|
|
2770
|
+
createSimpleExpression(JSON.stringify(slotCacheKeys), false)
|
|
2771
|
+
)
|
|
2772
|
+
);
|
|
2773
|
+
}
|
|
2762
2774
|
function getCacheExpression(value) {
|
|
2763
2775
|
const exp = context.cache(value);
|
|
2764
2776
|
if (inFor && context.hmr) {
|
|
@@ -4950,9 +4962,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
4950
4962
|
hasDynamicKeys = true;
|
|
4951
4963
|
if (exp) {
|
|
4952
4964
|
if (isVBind) {
|
|
4953
|
-
pushRefVForMarker();
|
|
4954
|
-
pushMergeArg();
|
|
4955
4965
|
{
|
|
4966
|
+
pushMergeArg();
|
|
4956
4967
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
4957
4968
|
const hasOverridableKeys = mergeArgs.some((arg2) => {
|
|
4958
4969
|
if (arg2.type === 15) {
|
|
@@ -4982,6 +4993,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
4982
4993
|
continue;
|
|
4983
4994
|
}
|
|
4984
4995
|
}
|
|
4996
|
+
pushRefVForMarker();
|
|
4997
|
+
pushMergeArg();
|
|
4985
4998
|
mergeArgs.push(exp);
|
|
4986
4999
|
} else {
|
|
4987
5000
|
pushMergeArg({
|
|
@@ -5490,8 +5503,7 @@ const transformModel = (dir, node, context) => {
|
|
|
5490
5503
|
context.onError(createCompilerError(44, exp.loc));
|
|
5491
5504
|
return createTransformProps();
|
|
5492
5505
|
}
|
|
5493
|
-
|
|
5494
|
-
if (!expString.trim() || !isMemberExpression(exp) && !maybeRef) {
|
|
5506
|
+
if (!expString.trim() || !isMemberExpression(exp) && true) {
|
|
5495
5507
|
context.onError(
|
|
5496
5508
|
createCompilerError(42, exp.loc)
|
|
5497
5509
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-core",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.15",
|
|
4
4
|
"description": "@vue/compiler-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/compiler-core.esm-bundler.js",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@babel/parser": "^7.
|
|
49
|
+
"@babel/parser": "^7.27.2",
|
|
50
50
|
"entities": "^4.5.0",
|
|
51
51
|
"estree-walker": "^2.0.2",
|
|
52
|
-
"source-map-js": "^1.2.
|
|
53
|
-
"@vue/shared": "3.5.
|
|
52
|
+
"source-map-js": "^1.2.1",
|
|
53
|
+
"@vue/shared": "3.5.15"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@babel/types": "^7.
|
|
56
|
+
"@babel/types": "^7.27.1"
|
|
57
57
|
}
|
|
58
58
|
}
|