@vue/compiler-core 3.5.24 → 3.5.26
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/compiler-core.cjs.js +131 -108
- package/dist/compiler-core.cjs.prod.js +126 -105
- package/dist/compiler-core.d.ts +13 -9
- package/dist/compiler-core.esm-bundler.js +123 -103
- package/package.json +3 -3
|
@@ -1,86 +1,86 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-core v3.5.
|
|
2
|
+
* @vue/compiler-core v3.5.26
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
6
|
import { isString, NOOP, isObject, extend, NO, isSymbol, PatchFlagNames, isArray, capitalize, camelize, EMPTY_OBJ, slotFlagsText, isOn, isBuiltInDirective, isReservedProp, toHandlerKey } from '@vue/shared';
|
|
7
7
|
export { generateCodeFrame } from '@vue/shared';
|
|
8
8
|
|
|
9
|
-
const FRAGMENT = Symbol(!!(process.env.NODE_ENV !== "production") ? `Fragment` : ``);
|
|
10
|
-
const TELEPORT = Symbol(!!(process.env.NODE_ENV !== "production") ? `Teleport` : ``);
|
|
11
|
-
const SUSPENSE = Symbol(!!(process.env.NODE_ENV !== "production") ? `Suspense` : ``);
|
|
12
|
-
const KEEP_ALIVE = Symbol(!!(process.env.NODE_ENV !== "production") ? `KeepAlive` : ``);
|
|
13
|
-
const BASE_TRANSITION = Symbol(
|
|
9
|
+
const FRAGMENT = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `Fragment` : ``);
|
|
10
|
+
const TELEPORT = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `Teleport` : ``);
|
|
11
|
+
const SUSPENSE = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `Suspense` : ``);
|
|
12
|
+
const KEEP_ALIVE = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `KeepAlive` : ``);
|
|
13
|
+
const BASE_TRANSITION = /* @__PURE__ */ Symbol(
|
|
14
14
|
!!(process.env.NODE_ENV !== "production") ? `BaseTransition` : ``
|
|
15
15
|
);
|
|
16
|
-
const OPEN_BLOCK = Symbol(!!(process.env.NODE_ENV !== "production") ? `openBlock` : ``);
|
|
17
|
-
const CREATE_BLOCK = Symbol(!!(process.env.NODE_ENV !== "production") ? `createBlock` : ``);
|
|
18
|
-
const CREATE_ELEMENT_BLOCK = Symbol(
|
|
16
|
+
const OPEN_BLOCK = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `openBlock` : ``);
|
|
17
|
+
const CREATE_BLOCK = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `createBlock` : ``);
|
|
18
|
+
const CREATE_ELEMENT_BLOCK = /* @__PURE__ */ Symbol(
|
|
19
19
|
!!(process.env.NODE_ENV !== "production") ? `createElementBlock` : ``
|
|
20
20
|
);
|
|
21
|
-
const CREATE_VNODE = Symbol(!!(process.env.NODE_ENV !== "production") ? `createVNode` : ``);
|
|
22
|
-
const CREATE_ELEMENT_VNODE = Symbol(
|
|
21
|
+
const CREATE_VNODE = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `createVNode` : ``);
|
|
22
|
+
const CREATE_ELEMENT_VNODE = /* @__PURE__ */ Symbol(
|
|
23
23
|
!!(process.env.NODE_ENV !== "production") ? `createElementVNode` : ``
|
|
24
24
|
);
|
|
25
|
-
const CREATE_COMMENT = Symbol(
|
|
25
|
+
const CREATE_COMMENT = /* @__PURE__ */ Symbol(
|
|
26
26
|
!!(process.env.NODE_ENV !== "production") ? `createCommentVNode` : ``
|
|
27
27
|
);
|
|
28
|
-
const CREATE_TEXT = Symbol(
|
|
28
|
+
const CREATE_TEXT = /* @__PURE__ */ Symbol(
|
|
29
29
|
!!(process.env.NODE_ENV !== "production") ? `createTextVNode` : ``
|
|
30
30
|
);
|
|
31
|
-
const CREATE_STATIC = Symbol(
|
|
31
|
+
const CREATE_STATIC = /* @__PURE__ */ Symbol(
|
|
32
32
|
!!(process.env.NODE_ENV !== "production") ? `createStaticVNode` : ``
|
|
33
33
|
);
|
|
34
|
-
const RESOLVE_COMPONENT = Symbol(
|
|
34
|
+
const RESOLVE_COMPONENT = /* @__PURE__ */ Symbol(
|
|
35
35
|
!!(process.env.NODE_ENV !== "production") ? `resolveComponent` : ``
|
|
36
36
|
);
|
|
37
|
-
const RESOLVE_DYNAMIC_COMPONENT = Symbol(
|
|
37
|
+
const RESOLVE_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol(
|
|
38
38
|
!!(process.env.NODE_ENV !== "production") ? `resolveDynamicComponent` : ``
|
|
39
39
|
);
|
|
40
|
-
const RESOLVE_DIRECTIVE = Symbol(
|
|
40
|
+
const RESOLVE_DIRECTIVE = /* @__PURE__ */ Symbol(
|
|
41
41
|
!!(process.env.NODE_ENV !== "production") ? `resolveDirective` : ``
|
|
42
42
|
);
|
|
43
|
-
const RESOLVE_FILTER = Symbol(
|
|
43
|
+
const RESOLVE_FILTER = /* @__PURE__ */ Symbol(
|
|
44
44
|
!!(process.env.NODE_ENV !== "production") ? `resolveFilter` : ``
|
|
45
45
|
);
|
|
46
|
-
const WITH_DIRECTIVES = Symbol(
|
|
46
|
+
const WITH_DIRECTIVES = /* @__PURE__ */ Symbol(
|
|
47
47
|
!!(process.env.NODE_ENV !== "production") ? `withDirectives` : ``
|
|
48
48
|
);
|
|
49
|
-
const RENDER_LIST = Symbol(!!(process.env.NODE_ENV !== "production") ? `renderList` : ``);
|
|
50
|
-
const RENDER_SLOT = Symbol(!!(process.env.NODE_ENV !== "production") ? `renderSlot` : ``);
|
|
51
|
-
const CREATE_SLOTS = Symbol(!!(process.env.NODE_ENV !== "production") ? `createSlots` : ``);
|
|
52
|
-
const TO_DISPLAY_STRING = Symbol(
|
|
49
|
+
const RENDER_LIST = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `renderList` : ``);
|
|
50
|
+
const RENDER_SLOT = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `renderSlot` : ``);
|
|
51
|
+
const CREATE_SLOTS = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `createSlots` : ``);
|
|
52
|
+
const TO_DISPLAY_STRING = /* @__PURE__ */ Symbol(
|
|
53
53
|
!!(process.env.NODE_ENV !== "production") ? `toDisplayString` : ``
|
|
54
54
|
);
|
|
55
|
-
const MERGE_PROPS = Symbol(!!(process.env.NODE_ENV !== "production") ? `mergeProps` : ``);
|
|
56
|
-
const NORMALIZE_CLASS = Symbol(
|
|
55
|
+
const MERGE_PROPS = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `mergeProps` : ``);
|
|
56
|
+
const NORMALIZE_CLASS = /* @__PURE__ */ Symbol(
|
|
57
57
|
!!(process.env.NODE_ENV !== "production") ? `normalizeClass` : ``
|
|
58
58
|
);
|
|
59
|
-
const NORMALIZE_STYLE = Symbol(
|
|
59
|
+
const NORMALIZE_STYLE = /* @__PURE__ */ Symbol(
|
|
60
60
|
!!(process.env.NODE_ENV !== "production") ? `normalizeStyle` : ``
|
|
61
61
|
);
|
|
62
|
-
const NORMALIZE_PROPS = Symbol(
|
|
62
|
+
const NORMALIZE_PROPS = /* @__PURE__ */ Symbol(
|
|
63
63
|
!!(process.env.NODE_ENV !== "production") ? `normalizeProps` : ``
|
|
64
64
|
);
|
|
65
|
-
const GUARD_REACTIVE_PROPS = Symbol(
|
|
65
|
+
const GUARD_REACTIVE_PROPS = /* @__PURE__ */ Symbol(
|
|
66
66
|
!!(process.env.NODE_ENV !== "production") ? `guardReactiveProps` : ``
|
|
67
67
|
);
|
|
68
|
-
const TO_HANDLERS = Symbol(!!(process.env.NODE_ENV !== "production") ? `toHandlers` : ``);
|
|
69
|
-
const CAMELIZE = Symbol(!!(process.env.NODE_ENV !== "production") ? `camelize` : ``);
|
|
70
|
-
const CAPITALIZE = Symbol(!!(process.env.NODE_ENV !== "production") ? `capitalize` : ``);
|
|
71
|
-
const TO_HANDLER_KEY = Symbol(
|
|
68
|
+
const TO_HANDLERS = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `toHandlers` : ``);
|
|
69
|
+
const CAMELIZE = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `camelize` : ``);
|
|
70
|
+
const CAPITALIZE = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `capitalize` : ``);
|
|
71
|
+
const TO_HANDLER_KEY = /* @__PURE__ */ Symbol(
|
|
72
72
|
!!(process.env.NODE_ENV !== "production") ? `toHandlerKey` : ``
|
|
73
73
|
);
|
|
74
|
-
const SET_BLOCK_TRACKING = Symbol(
|
|
74
|
+
const SET_BLOCK_TRACKING = /* @__PURE__ */ Symbol(
|
|
75
75
|
!!(process.env.NODE_ENV !== "production") ? `setBlockTracking` : ``
|
|
76
76
|
);
|
|
77
|
-
const PUSH_SCOPE_ID = Symbol(!!(process.env.NODE_ENV !== "production") ? `pushScopeId` : ``);
|
|
78
|
-
const POP_SCOPE_ID = Symbol(!!(process.env.NODE_ENV !== "production") ? `popScopeId` : ``);
|
|
79
|
-
const WITH_CTX = Symbol(!!(process.env.NODE_ENV !== "production") ? `withCtx` : ``);
|
|
80
|
-
const UNREF = Symbol(!!(process.env.NODE_ENV !== "production") ? `unref` : ``);
|
|
81
|
-
const IS_REF = Symbol(!!(process.env.NODE_ENV !== "production") ? `isRef` : ``);
|
|
82
|
-
const WITH_MEMO = Symbol(!!(process.env.NODE_ENV !== "production") ? `withMemo` : ``);
|
|
83
|
-
const IS_MEMO_SAME = Symbol(!!(process.env.NODE_ENV !== "production") ? `isMemoSame` : ``);
|
|
77
|
+
const PUSH_SCOPE_ID = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `pushScopeId` : ``);
|
|
78
|
+
const POP_SCOPE_ID = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `popScopeId` : ``);
|
|
79
|
+
const WITH_CTX = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `withCtx` : ``);
|
|
80
|
+
const UNREF = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `unref` : ``);
|
|
81
|
+
const IS_REF = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `isRef` : ``);
|
|
82
|
+
const WITH_MEMO = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `withMemo` : ``);
|
|
83
|
+
const IS_MEMO_SAME = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? `isMemoSame` : ``);
|
|
84
84
|
const helperNameMap = {
|
|
85
85
|
[FRAGMENT]: `Fragment`,
|
|
86
86
|
[TELEPORT]: `Teleport`,
|
|
@@ -504,14 +504,28 @@ class Tokenizer {
|
|
|
504
504
|
getPos(index) {
|
|
505
505
|
let line = 1;
|
|
506
506
|
let column = index + 1;
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
507
|
+
const length = this.newlines.length;
|
|
508
|
+
let j = -1;
|
|
509
|
+
if (length > 100) {
|
|
510
|
+
let l = -1;
|
|
511
|
+
let r = length;
|
|
512
|
+
while (l + 1 < r) {
|
|
513
|
+
const m = l + r >>> 1;
|
|
514
|
+
this.newlines[m] < index ? l = m : r = m;
|
|
515
|
+
}
|
|
516
|
+
j = l;
|
|
517
|
+
} else {
|
|
518
|
+
for (let i = length - 1; i >= 0; i--) {
|
|
519
|
+
if (index > this.newlines[i]) {
|
|
520
|
+
j = i;
|
|
521
|
+
break;
|
|
522
|
+
}
|
|
513
523
|
}
|
|
514
524
|
}
|
|
525
|
+
if (j >= 0) {
|
|
526
|
+
line = j + 2;
|
|
527
|
+
column = index - this.newlines[j];
|
|
528
|
+
}
|
|
515
529
|
return {
|
|
516
530
|
column,
|
|
517
531
|
line,
|
|
@@ -1388,24 +1402,26 @@ const ErrorCodes = {
|
|
|
1388
1402
|
"43": "X_V_MODEL_ON_SCOPE_VARIABLE",
|
|
1389
1403
|
"X_V_MODEL_ON_PROPS": 44,
|
|
1390
1404
|
"44": "X_V_MODEL_ON_PROPS",
|
|
1391
|
-
"
|
|
1392
|
-
"45": "
|
|
1393
|
-
"
|
|
1394
|
-
"46": "
|
|
1395
|
-
"
|
|
1396
|
-
"47": "
|
|
1397
|
-
"
|
|
1398
|
-
"48": "
|
|
1399
|
-
"
|
|
1400
|
-
"49": "
|
|
1401
|
-
"
|
|
1402
|
-
"50": "
|
|
1403
|
-
"
|
|
1404
|
-
"51": "
|
|
1405
|
-
"
|
|
1406
|
-
"52": "
|
|
1407
|
-
"
|
|
1408
|
-
"53": "
|
|
1405
|
+
"X_V_MODEL_ON_CONST": 45,
|
|
1406
|
+
"45": "X_V_MODEL_ON_CONST",
|
|
1407
|
+
"X_INVALID_EXPRESSION": 46,
|
|
1408
|
+
"46": "X_INVALID_EXPRESSION",
|
|
1409
|
+
"X_KEEP_ALIVE_INVALID_CHILDREN": 47,
|
|
1410
|
+
"47": "X_KEEP_ALIVE_INVALID_CHILDREN",
|
|
1411
|
+
"X_PREFIX_ID_NOT_SUPPORTED": 48,
|
|
1412
|
+
"48": "X_PREFIX_ID_NOT_SUPPORTED",
|
|
1413
|
+
"X_MODULE_MODE_NOT_SUPPORTED": 49,
|
|
1414
|
+
"49": "X_MODULE_MODE_NOT_SUPPORTED",
|
|
1415
|
+
"X_CACHE_HANDLER_NOT_SUPPORTED": 50,
|
|
1416
|
+
"50": "X_CACHE_HANDLER_NOT_SUPPORTED",
|
|
1417
|
+
"X_SCOPE_ID_NOT_SUPPORTED": 51,
|
|
1418
|
+
"51": "X_SCOPE_ID_NOT_SUPPORTED",
|
|
1419
|
+
"X_VNODE_HOOKS": 52,
|
|
1420
|
+
"52": "X_VNODE_HOOKS",
|
|
1421
|
+
"X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 53,
|
|
1422
|
+
"53": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT",
|
|
1423
|
+
"__EXTEND_POINT__": 54,
|
|
1424
|
+
"54": "__EXTEND_POINT__"
|
|
1409
1425
|
};
|
|
1410
1426
|
const errorMessages = {
|
|
1411
1427
|
// parse errors
|
|
@@ -1446,7 +1462,7 @@ const errorMessages = {
|
|
|
1446
1462
|
[32]: `v-for has invalid expression.`,
|
|
1447
1463
|
[33]: `<template v-for> key should be placed on the <template> tag.`,
|
|
1448
1464
|
[34]: `v-bind is missing expression.`,
|
|
1449
|
-
[
|
|
1465
|
+
[53]: `v-bind with same-name shorthand only allows static argument.`,
|
|
1450
1466
|
[35]: `v-on is missing expression.`,
|
|
1451
1467
|
[36]: `Unexpected custom directive on <slot> outlet.`,
|
|
1452
1468
|
[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.`,
|
|
@@ -1458,16 +1474,17 @@ const errorMessages = {
|
|
|
1458
1474
|
[43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
|
|
1459
1475
|
[44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
|
|
1460
1476
|
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
1461
|
-
[45]: `
|
|
1462
|
-
[46]:
|
|
1463
|
-
[
|
|
1477
|
+
[45]: `v-model cannot be used on a const binding because it is not writable.`,
|
|
1478
|
+
[46]: `Error parsing JavaScript expression: `,
|
|
1479
|
+
[47]: `<KeepAlive> expects exactly one child component.`,
|
|
1480
|
+
[52]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`,
|
|
1464
1481
|
// generic errors
|
|
1465
|
-
[
|
|
1466
|
-
[
|
|
1467
|
-
[
|
|
1468
|
-
[
|
|
1482
|
+
[48]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
1483
|
+
[49]: `ES module mode is not supported in this build of compiler.`,
|
|
1484
|
+
[50]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
1485
|
+
[51]: `"scopeId" option is only supported in module mode.`,
|
|
1469
1486
|
// just to fulfill types
|
|
1470
|
-
[
|
|
1487
|
+
[54]: ``
|
|
1471
1488
|
};
|
|
1472
1489
|
|
|
1473
1490
|
function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {
|
|
@@ -1923,6 +1940,20 @@ function getMemoedVNodeCall(node) {
|
|
|
1923
1940
|
}
|
|
1924
1941
|
}
|
|
1925
1942
|
const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;
|
|
1943
|
+
function isAllWhitespace(str) {
|
|
1944
|
+
for (let i = 0; i < str.length; i++) {
|
|
1945
|
+
if (!isWhitespace(str.charCodeAt(i))) {
|
|
1946
|
+
return false;
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
return true;
|
|
1950
|
+
}
|
|
1951
|
+
function isWhitespaceText(node) {
|
|
1952
|
+
return node.type === 2 && isAllWhitespace(node.content) || node.type === 12 && isWhitespaceText(node.content);
|
|
1953
|
+
}
|
|
1954
|
+
function isCommentOrWhitespace(node) {
|
|
1955
|
+
return node.type === 3 || isWhitespaceText(node);
|
|
1956
|
+
}
|
|
1926
1957
|
|
|
1927
1958
|
const defaultParserOptions = {
|
|
1928
1959
|
parseMode: "base",
|
|
@@ -2545,14 +2576,6 @@ function condenseWhitespace(nodes) {
|
|
|
2545
2576
|
}
|
|
2546
2577
|
return removedWhitespace ? nodes.filter(Boolean) : nodes;
|
|
2547
2578
|
}
|
|
2548
|
-
function isAllWhitespace(str) {
|
|
2549
|
-
for (let i = 0; i < str.length; i++) {
|
|
2550
|
-
if (!isWhitespace(str.charCodeAt(i))) {
|
|
2551
|
-
return false;
|
|
2552
|
-
}
|
|
2553
|
-
}
|
|
2554
|
-
return true;
|
|
2555
|
-
}
|
|
2556
2579
|
function hasNewlineChar(str) {
|
|
2557
2580
|
for (let i = 0; i < str.length; i++) {
|
|
2558
2581
|
const c = str.charCodeAt(i);
|
|
@@ -3868,7 +3891,7 @@ function validateBrowserExpression(node, context, asParams = false, asRawStateme
|
|
|
3868
3891
|
}
|
|
3869
3892
|
context.onError(
|
|
3870
3893
|
createCompilerError(
|
|
3871
|
-
|
|
3894
|
+
46,
|
|
3872
3895
|
node.loc,
|
|
3873
3896
|
void 0,
|
|
3874
3897
|
message
|
|
@@ -3984,13 +4007,11 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
3984
4007
|
let i = siblings.indexOf(node);
|
|
3985
4008
|
while (i-- >= -1) {
|
|
3986
4009
|
const sibling = siblings[i];
|
|
3987
|
-
if (sibling && sibling
|
|
3988
|
-
context.removeNode(sibling);
|
|
3989
|
-
!!(process.env.NODE_ENV !== "production") && comments.unshift(sibling);
|
|
3990
|
-
continue;
|
|
3991
|
-
}
|
|
3992
|
-
if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
|
|
4010
|
+
if (sibling && isCommentOrWhitespace(sibling)) {
|
|
3993
4011
|
context.removeNode(sibling);
|
|
4012
|
+
if (!!(process.env.NODE_ENV !== "production") && sibling.type === 3) {
|
|
4013
|
+
comments.unshift(sibling);
|
|
4014
|
+
}
|
|
3994
4015
|
continue;
|
|
3995
4016
|
}
|
|
3996
4017
|
if (sibling && sibling.type === 9) {
|
|
@@ -4462,7 +4483,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
4462
4483
|
let prev;
|
|
4463
4484
|
while (j--) {
|
|
4464
4485
|
prev = children[j];
|
|
4465
|
-
if (
|
|
4486
|
+
if (!isCommentOrWhitespace(prev)) {
|
|
4466
4487
|
break;
|
|
4467
4488
|
}
|
|
4468
4489
|
}
|
|
@@ -4540,7 +4561,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
4540
4561
|
} else if (implicitDefaultChildren.length && // #3766
|
|
4541
4562
|
// with whitespace: 'preserve', whitespaces between slots will end up in
|
|
4542
4563
|
// implicitDefaultChildren. Ignore if all implicit children are whitespaces.
|
|
4543
|
-
implicitDefaultChildren.
|
|
4564
|
+
!implicitDefaultChildren.every(isWhitespaceText)) {
|
|
4544
4565
|
if (hasNamedDefaultSlot) {
|
|
4545
4566
|
context.onError(
|
|
4546
4567
|
createCompilerError(
|
|
@@ -4613,11 +4634,6 @@ function hasForwardedSlots(children) {
|
|
|
4613
4634
|
}
|
|
4614
4635
|
return false;
|
|
4615
4636
|
}
|
|
4616
|
-
function isNonWhitespaceContent(node) {
|
|
4617
|
-
if (node.type !== 2 && node.type !== 12)
|
|
4618
|
-
return true;
|
|
4619
|
-
return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content);
|
|
4620
|
-
}
|
|
4621
4637
|
|
|
4622
4638
|
const directiveImportMap = /* @__PURE__ */ new WeakMap();
|
|
4623
4639
|
const transformElement = (node, context) => {
|
|
@@ -4669,7 +4685,7 @@ const transformElement = (node, context) => {
|
|
|
4669
4685
|
patchFlag |= 1024;
|
|
4670
4686
|
if (!!(process.env.NODE_ENV !== "production") && node.children.length > 1) {
|
|
4671
4687
|
context.onError(
|
|
4672
|
-
createCompilerError(
|
|
4688
|
+
createCompilerError(47, {
|
|
4673
4689
|
start: node.children[0].loc.start,
|
|
4674
4690
|
end: node.children[node.children.length - 1].loc.end,
|
|
4675
4691
|
source: ""
|
|
@@ -5256,7 +5272,7 @@ const transformOn = (dir, node, context, augmentor) => {
|
|
|
5256
5272
|
if (arg.isStatic) {
|
|
5257
5273
|
let rawName = arg.content;
|
|
5258
5274
|
if (!!(process.env.NODE_ENV !== "production") && rawName.startsWith("vnode")) {
|
|
5259
|
-
context.onError(createCompilerError(
|
|
5275
|
+
context.onError(createCompilerError(52, arg.loc));
|
|
5260
5276
|
}
|
|
5261
5277
|
if (rawName.startsWith("vue:")) {
|
|
5262
5278
|
rawName = `vnode-${rawName.slice(4)}`;
|
|
@@ -5489,6 +5505,10 @@ const transformModel = (dir, node, context) => {
|
|
|
5489
5505
|
context.onError(createCompilerError(44, exp.loc));
|
|
5490
5506
|
return createTransformProps();
|
|
5491
5507
|
}
|
|
5508
|
+
if (bindingType === "literal-const" || bindingType === "setup-const") {
|
|
5509
|
+
context.onError(createCompilerError(45, exp.loc));
|
|
5510
|
+
return createTransformProps();
|
|
5511
|
+
}
|
|
5492
5512
|
if (!expString.trim() || !isMemberExpression(exp) && true) {
|
|
5493
5513
|
context.onError(
|
|
5494
5514
|
createCompilerError(42, exp.loc)
|
|
@@ -5717,7 +5737,7 @@ const transformVBindShorthand = (node, context) => {
|
|
|
5717
5737
|
if (arg.type !== 4 || !arg.isStatic) {
|
|
5718
5738
|
context.onError(
|
|
5719
5739
|
createCompilerError(
|
|
5720
|
-
|
|
5740
|
+
53,
|
|
5721
5741
|
arg.loc
|
|
5722
5742
|
)
|
|
5723
5743
|
);
|
|
@@ -5761,17 +5781,17 @@ function baseCompile(source, options = {}) {
|
|
|
5761
5781
|
const isModuleMode = options.mode === "module";
|
|
5762
5782
|
{
|
|
5763
5783
|
if (options.prefixIdentifiers === true) {
|
|
5764
|
-
onError(createCompilerError(47));
|
|
5765
|
-
} else if (isModuleMode) {
|
|
5766
5784
|
onError(createCompilerError(48));
|
|
5785
|
+
} else if (isModuleMode) {
|
|
5786
|
+
onError(createCompilerError(49));
|
|
5767
5787
|
}
|
|
5768
5788
|
}
|
|
5769
5789
|
const prefixIdentifiers = false;
|
|
5770
5790
|
if (options.cacheHandlers) {
|
|
5771
|
-
onError(createCompilerError(
|
|
5791
|
+
onError(createCompilerError(50));
|
|
5772
5792
|
}
|
|
5773
5793
|
if (options.scopeId && !isModuleMode) {
|
|
5774
|
-
onError(createCompilerError(
|
|
5794
|
+
onError(createCompilerError(51));
|
|
5775
5795
|
}
|
|
5776
5796
|
const resolvedOptions = extend({}, options, {
|
|
5777
5797
|
prefixIdentifiers
|
|
@@ -5812,4 +5832,4 @@ const BindingTypes = {
|
|
|
5812
5832
|
|
|
5813
5833
|
const noopDirectiveTransform = () => ({ props: [] });
|
|
5814
5834
|
|
|
5815
|
-
export { BASE_TRANSITION, BindingTypes, CAMELIZE, CAPITALIZE, CREATE_BLOCK, CREATE_COMMENT, CREATE_ELEMENT_BLOCK, CREATE_ELEMENT_VNODE, CREATE_SLOTS, CREATE_STATIC, CREATE_TEXT, CREATE_VNODE, CompilerDeprecationTypes, ConstantTypes, ElementTypes, ErrorCodes, FRAGMENT, GUARD_REACTIVE_PROPS, IS_MEMO_SAME, IS_REF, KEEP_ALIVE, MERGE_PROPS, NORMALIZE_CLASS, NORMALIZE_PROPS, NORMALIZE_STYLE, Namespaces, NodeTypes, OPEN_BLOCK, POP_SCOPE_ID, PUSH_SCOPE_ID, RENDER_LIST, RENDER_SLOT, RESOLVE_COMPONENT, RESOLVE_DIRECTIVE, RESOLVE_DYNAMIC_COMPONENT, RESOLVE_FILTER, SET_BLOCK_TRACKING, SUSPENSE, TELEPORT, TO_DISPLAY_STRING, TO_HANDLERS, TO_HANDLER_KEY, TS_NODE_TYPES, UNREF, WITH_CTX, WITH_DIRECTIVES, WITH_MEMO, advancePositionWithClone, advancePositionWithMutation, assert, baseCompile, baseParse, buildDirectiveArgs, buildProps, buildSlots, checkCompatEnabled, convertToBlock, createArrayExpression, createAssignmentExpression, createBlockStatement, createCacheExpression, createCallExpression, createCompilerError, createCompoundExpression, createConditionalExpression, createForLoopParams, createFunctionExpression, createIfStatement, createInterpolation, createObjectExpression, createObjectProperty, createReturnStatement, createRoot, createSequenceExpression, createSimpleExpression, createStructuralDirectiveTransform, createTemplateLiteral, createTransformContext, createVNodeCall, errorMessages, extractIdentifiers, findDir, findProp, forAliasRE, generate, getBaseTransformPreset, getConstantType, getMemoedVNodeCall, getVNodeBlockHelper, getVNodeHelper, hasDynamicKeyVBind, hasScopeRef, helperNameMap, injectProp, isCoreComponent, isFnExpression, isFnExpressionBrowser, isFnExpressionNode, isFunctionType, isInDestructureAssignment, isInNewExpression, isMemberExpression, isMemberExpressionBrowser, isMemberExpressionNode, isReferencedIdentifier, isSimpleIdentifier, isSlotOutlet, isStaticArgOf, isStaticExp, isStaticProperty, isStaticPropertyKey, isTemplateNode, isText$1 as isText, isVPre, isVSlot, locStub, noopDirectiveTransform, processExpression, processFor, processIf, processSlotOutlet, registerRuntimeHelpers, resolveComponentType, stringifyExpression, toValidAssetId, trackSlotScopes, trackVForSlotScopes, transform, transformBind, transformElement, transformExpression, transformModel, transformOn, transformVBindShorthand, traverseNode, unwrapTSNode, validFirstIdentCharRE, walkBlockDeclarations, walkFunctionParams, walkIdentifiers, warnDeprecation };
|
|
5835
|
+
export { BASE_TRANSITION, BindingTypes, CAMELIZE, CAPITALIZE, CREATE_BLOCK, CREATE_COMMENT, CREATE_ELEMENT_BLOCK, CREATE_ELEMENT_VNODE, CREATE_SLOTS, CREATE_STATIC, CREATE_TEXT, CREATE_VNODE, CompilerDeprecationTypes, ConstantTypes, ElementTypes, ErrorCodes, FRAGMENT, GUARD_REACTIVE_PROPS, IS_MEMO_SAME, IS_REF, KEEP_ALIVE, MERGE_PROPS, NORMALIZE_CLASS, NORMALIZE_PROPS, NORMALIZE_STYLE, Namespaces, NodeTypes, OPEN_BLOCK, POP_SCOPE_ID, PUSH_SCOPE_ID, RENDER_LIST, RENDER_SLOT, RESOLVE_COMPONENT, RESOLVE_DIRECTIVE, RESOLVE_DYNAMIC_COMPONENT, RESOLVE_FILTER, SET_BLOCK_TRACKING, SUSPENSE, TELEPORT, TO_DISPLAY_STRING, TO_HANDLERS, TO_HANDLER_KEY, TS_NODE_TYPES, UNREF, WITH_CTX, WITH_DIRECTIVES, WITH_MEMO, advancePositionWithClone, advancePositionWithMutation, assert, baseCompile, baseParse, buildDirectiveArgs, buildProps, buildSlots, checkCompatEnabled, convertToBlock, createArrayExpression, createAssignmentExpression, createBlockStatement, createCacheExpression, createCallExpression, createCompilerError, createCompoundExpression, createConditionalExpression, createForLoopParams, createFunctionExpression, createIfStatement, createInterpolation, createObjectExpression, createObjectProperty, createReturnStatement, createRoot, createSequenceExpression, createSimpleExpression, createStructuralDirectiveTransform, createTemplateLiteral, createTransformContext, createVNodeCall, errorMessages, extractIdentifiers, findDir, findProp, forAliasRE, generate, getBaseTransformPreset, getConstantType, getMemoedVNodeCall, getVNodeBlockHelper, getVNodeHelper, hasDynamicKeyVBind, hasScopeRef, helperNameMap, injectProp, isAllWhitespace, isCommentOrWhitespace, isCoreComponent, isFnExpression, isFnExpressionBrowser, isFnExpressionNode, isFunctionType, isInDestructureAssignment, isInNewExpression, isMemberExpression, isMemberExpressionBrowser, isMemberExpressionNode, isReferencedIdentifier, isSimpleIdentifier, isSlotOutlet, isStaticArgOf, isStaticExp, isStaticProperty, isStaticPropertyKey, isTemplateNode, isText$1 as isText, isVPre, isVSlot, isWhitespaceText, locStub, noopDirectiveTransform, processExpression, processFor, processIf, processSlotOutlet, registerRuntimeHelpers, resolveComponentType, stringifyExpression, toValidAssetId, trackSlotScopes, trackVForSlotScopes, transform, transformBind, transformElement, transformExpression, transformModel, transformOn, transformVBindShorthand, traverseNode, unwrapTSNode, validFirstIdentCharRE, walkBlockDeclarations, walkFunctionParams, walkIdentifiers, warnDeprecation };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-core",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.26",
|
|
4
4
|
"description": "@vue/compiler-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/compiler-core.esm-bundler.js",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@babel/parser": "^7.28.5",
|
|
50
|
-
"entities": "^
|
|
50
|
+
"entities": "^7.0.0",
|
|
51
51
|
"estree-walker": "^2.0.2",
|
|
52
52
|
"source-map-js": "^1.2.1",
|
|
53
|
-
"@vue/shared": "3.5.
|
|
53
|
+
"@vue/shared": "3.5.26"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@babel/types": "^7.28.5"
|