@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,5 +1,5 @@
|
|
|
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
|
**/
|
|
@@ -8,86 +8,86 @@
|
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
9
|
|
|
10
10
|
var shared = require('@vue/shared');
|
|
11
|
-
var
|
|
11
|
+
var decode = require('entities/decode');
|
|
12
12
|
var parser = require('@babel/parser');
|
|
13
13
|
var estreeWalker = require('estree-walker');
|
|
14
14
|
var sourceMapJs = require('source-map-js');
|
|
15
15
|
|
|
16
|
-
const FRAGMENT = Symbol(`Fragment` );
|
|
17
|
-
const TELEPORT = Symbol(`Teleport` );
|
|
18
|
-
const SUSPENSE = Symbol(`Suspense` );
|
|
19
|
-
const KEEP_ALIVE = Symbol(`KeepAlive` );
|
|
20
|
-
const BASE_TRANSITION = Symbol(
|
|
16
|
+
const FRAGMENT = /* @__PURE__ */ Symbol(`Fragment` );
|
|
17
|
+
const TELEPORT = /* @__PURE__ */ Symbol(`Teleport` );
|
|
18
|
+
const SUSPENSE = /* @__PURE__ */ Symbol(`Suspense` );
|
|
19
|
+
const KEEP_ALIVE = /* @__PURE__ */ Symbol(`KeepAlive` );
|
|
20
|
+
const BASE_TRANSITION = /* @__PURE__ */ Symbol(
|
|
21
21
|
`BaseTransition`
|
|
22
22
|
);
|
|
23
|
-
const OPEN_BLOCK = Symbol(`openBlock` );
|
|
24
|
-
const CREATE_BLOCK = Symbol(`createBlock` );
|
|
25
|
-
const CREATE_ELEMENT_BLOCK = Symbol(
|
|
23
|
+
const OPEN_BLOCK = /* @__PURE__ */ Symbol(`openBlock` );
|
|
24
|
+
const CREATE_BLOCK = /* @__PURE__ */ Symbol(`createBlock` );
|
|
25
|
+
const CREATE_ELEMENT_BLOCK = /* @__PURE__ */ Symbol(
|
|
26
26
|
`createElementBlock`
|
|
27
27
|
);
|
|
28
|
-
const CREATE_VNODE = Symbol(`createVNode` );
|
|
29
|
-
const CREATE_ELEMENT_VNODE = Symbol(
|
|
28
|
+
const CREATE_VNODE = /* @__PURE__ */ Symbol(`createVNode` );
|
|
29
|
+
const CREATE_ELEMENT_VNODE = /* @__PURE__ */ Symbol(
|
|
30
30
|
`createElementVNode`
|
|
31
31
|
);
|
|
32
|
-
const CREATE_COMMENT = Symbol(
|
|
32
|
+
const CREATE_COMMENT = /* @__PURE__ */ Symbol(
|
|
33
33
|
`createCommentVNode`
|
|
34
34
|
);
|
|
35
|
-
const CREATE_TEXT = Symbol(
|
|
35
|
+
const CREATE_TEXT = /* @__PURE__ */ Symbol(
|
|
36
36
|
`createTextVNode`
|
|
37
37
|
);
|
|
38
|
-
const CREATE_STATIC = Symbol(
|
|
38
|
+
const CREATE_STATIC = /* @__PURE__ */ Symbol(
|
|
39
39
|
`createStaticVNode`
|
|
40
40
|
);
|
|
41
|
-
const RESOLVE_COMPONENT = Symbol(
|
|
41
|
+
const RESOLVE_COMPONENT = /* @__PURE__ */ Symbol(
|
|
42
42
|
`resolveComponent`
|
|
43
43
|
);
|
|
44
|
-
const RESOLVE_DYNAMIC_COMPONENT = Symbol(
|
|
44
|
+
const RESOLVE_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol(
|
|
45
45
|
`resolveDynamicComponent`
|
|
46
46
|
);
|
|
47
|
-
const RESOLVE_DIRECTIVE = Symbol(
|
|
47
|
+
const RESOLVE_DIRECTIVE = /* @__PURE__ */ Symbol(
|
|
48
48
|
`resolveDirective`
|
|
49
49
|
);
|
|
50
|
-
const RESOLVE_FILTER = Symbol(
|
|
50
|
+
const RESOLVE_FILTER = /* @__PURE__ */ Symbol(
|
|
51
51
|
`resolveFilter`
|
|
52
52
|
);
|
|
53
|
-
const WITH_DIRECTIVES = Symbol(
|
|
53
|
+
const WITH_DIRECTIVES = /* @__PURE__ */ Symbol(
|
|
54
54
|
`withDirectives`
|
|
55
55
|
);
|
|
56
|
-
const RENDER_LIST = Symbol(`renderList` );
|
|
57
|
-
const RENDER_SLOT = Symbol(`renderSlot` );
|
|
58
|
-
const CREATE_SLOTS = Symbol(`createSlots` );
|
|
59
|
-
const TO_DISPLAY_STRING = Symbol(
|
|
56
|
+
const RENDER_LIST = /* @__PURE__ */ Symbol(`renderList` );
|
|
57
|
+
const RENDER_SLOT = /* @__PURE__ */ Symbol(`renderSlot` );
|
|
58
|
+
const CREATE_SLOTS = /* @__PURE__ */ Symbol(`createSlots` );
|
|
59
|
+
const TO_DISPLAY_STRING = /* @__PURE__ */ Symbol(
|
|
60
60
|
`toDisplayString`
|
|
61
61
|
);
|
|
62
|
-
const MERGE_PROPS = Symbol(`mergeProps` );
|
|
63
|
-
const NORMALIZE_CLASS = Symbol(
|
|
62
|
+
const MERGE_PROPS = /* @__PURE__ */ Symbol(`mergeProps` );
|
|
63
|
+
const NORMALIZE_CLASS = /* @__PURE__ */ Symbol(
|
|
64
64
|
`normalizeClass`
|
|
65
65
|
);
|
|
66
|
-
const NORMALIZE_STYLE = Symbol(
|
|
66
|
+
const NORMALIZE_STYLE = /* @__PURE__ */ Symbol(
|
|
67
67
|
`normalizeStyle`
|
|
68
68
|
);
|
|
69
|
-
const NORMALIZE_PROPS = Symbol(
|
|
69
|
+
const NORMALIZE_PROPS = /* @__PURE__ */ Symbol(
|
|
70
70
|
`normalizeProps`
|
|
71
71
|
);
|
|
72
|
-
const GUARD_REACTIVE_PROPS = Symbol(
|
|
72
|
+
const GUARD_REACTIVE_PROPS = /* @__PURE__ */ Symbol(
|
|
73
73
|
`guardReactiveProps`
|
|
74
74
|
);
|
|
75
|
-
const TO_HANDLERS = Symbol(`toHandlers` );
|
|
76
|
-
const CAMELIZE = Symbol(`camelize` );
|
|
77
|
-
const CAPITALIZE = Symbol(`capitalize` );
|
|
78
|
-
const TO_HANDLER_KEY = Symbol(
|
|
75
|
+
const TO_HANDLERS = /* @__PURE__ */ Symbol(`toHandlers` );
|
|
76
|
+
const CAMELIZE = /* @__PURE__ */ Symbol(`camelize` );
|
|
77
|
+
const CAPITALIZE = /* @__PURE__ */ Symbol(`capitalize` );
|
|
78
|
+
const TO_HANDLER_KEY = /* @__PURE__ */ Symbol(
|
|
79
79
|
`toHandlerKey`
|
|
80
80
|
);
|
|
81
|
-
const SET_BLOCK_TRACKING = Symbol(
|
|
81
|
+
const SET_BLOCK_TRACKING = /* @__PURE__ */ Symbol(
|
|
82
82
|
`setBlockTracking`
|
|
83
83
|
);
|
|
84
|
-
const PUSH_SCOPE_ID = Symbol(`pushScopeId` );
|
|
85
|
-
const POP_SCOPE_ID = Symbol(`popScopeId` );
|
|
86
|
-
const WITH_CTX = Symbol(`withCtx` );
|
|
87
|
-
const UNREF = Symbol(`unref` );
|
|
88
|
-
const IS_REF = Symbol(`isRef` );
|
|
89
|
-
const WITH_MEMO = Symbol(`withMemo` );
|
|
90
|
-
const IS_MEMO_SAME = Symbol(`isMemoSame` );
|
|
84
|
+
const PUSH_SCOPE_ID = /* @__PURE__ */ Symbol(`pushScopeId` );
|
|
85
|
+
const POP_SCOPE_ID = /* @__PURE__ */ Symbol(`popScopeId` );
|
|
86
|
+
const WITH_CTX = /* @__PURE__ */ Symbol(`withCtx` );
|
|
87
|
+
const UNREF = /* @__PURE__ */ Symbol(`unref` );
|
|
88
|
+
const IS_REF = /* @__PURE__ */ Symbol(`isRef` );
|
|
89
|
+
const WITH_MEMO = /* @__PURE__ */ Symbol(`withMemo` );
|
|
90
|
+
const IS_MEMO_SAME = /* @__PURE__ */ Symbol(`isMemoSame` );
|
|
91
91
|
const helperNameMap = {
|
|
92
92
|
[FRAGMENT]: `Fragment`,
|
|
93
93
|
[TELEPORT]: `Teleport`,
|
|
@@ -486,8 +486,8 @@ class Tokenizer {
|
|
|
486
486
|
this.currentSequence = void 0;
|
|
487
487
|
this.sequenceIndex = 0;
|
|
488
488
|
{
|
|
489
|
-
this.entityDecoder = new
|
|
490
|
-
|
|
489
|
+
this.entityDecoder = new decode.EntityDecoder(
|
|
490
|
+
decode.htmlDecodeTree,
|
|
491
491
|
(cp, consumed) => this.emitCodePoint(cp, consumed)
|
|
492
492
|
);
|
|
493
493
|
}
|
|
@@ -517,14 +517,28 @@ class Tokenizer {
|
|
|
517
517
|
getPos(index) {
|
|
518
518
|
let line = 1;
|
|
519
519
|
let column = index + 1;
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
520
|
+
const length = this.newlines.length;
|
|
521
|
+
let j = -1;
|
|
522
|
+
if (length > 100) {
|
|
523
|
+
let l = -1;
|
|
524
|
+
let r = length;
|
|
525
|
+
while (l + 1 < r) {
|
|
526
|
+
const m = l + r >>> 1;
|
|
527
|
+
this.newlines[m] < index ? l = m : r = m;
|
|
528
|
+
}
|
|
529
|
+
j = l;
|
|
530
|
+
} else {
|
|
531
|
+
for (let i = length - 1; i >= 0; i--) {
|
|
532
|
+
if (index > this.newlines[i]) {
|
|
533
|
+
j = i;
|
|
534
|
+
break;
|
|
535
|
+
}
|
|
526
536
|
}
|
|
527
537
|
}
|
|
538
|
+
if (j >= 0) {
|
|
539
|
+
line = j + 2;
|
|
540
|
+
column = index - this.newlines[j];
|
|
541
|
+
}
|
|
528
542
|
return {
|
|
529
543
|
column,
|
|
530
544
|
line,
|
|
@@ -1037,7 +1051,7 @@ class Tokenizer {
|
|
|
1037
1051
|
this.state = 33;
|
|
1038
1052
|
this.entityStart = this.index;
|
|
1039
1053
|
this.entityDecoder.startEntity(
|
|
1040
|
-
this.baseState === 1 || this.baseState === 32 ?
|
|
1054
|
+
this.baseState === 1 || this.baseState === 32 ? decode.DecodingMode.Legacy : decode.DecodingMode.Attribute
|
|
1041
1055
|
);
|
|
1042
1056
|
}
|
|
1043
1057
|
}
|
|
@@ -1256,7 +1270,7 @@ class Tokenizer {
|
|
|
1256
1270
|
this.sectionStart = this.entityStart + consumed;
|
|
1257
1271
|
this.index = this.sectionStart - 1;
|
|
1258
1272
|
this.cbs.onattribentity(
|
|
1259
|
-
|
|
1273
|
+
decode.fromCodePoint(cp),
|
|
1260
1274
|
this.entityStart,
|
|
1261
1275
|
this.sectionStart
|
|
1262
1276
|
);
|
|
@@ -1267,7 +1281,7 @@ class Tokenizer {
|
|
|
1267
1281
|
this.sectionStart = this.entityStart + consumed;
|
|
1268
1282
|
this.index = this.sectionStart - 1;
|
|
1269
1283
|
this.cbs.ontextentity(
|
|
1270
|
-
|
|
1284
|
+
decode.fromCodePoint(cp),
|
|
1271
1285
|
this.entityStart,
|
|
1272
1286
|
this.sectionStart
|
|
1273
1287
|
);
|
|
@@ -1457,24 +1471,26 @@ const ErrorCodes = {
|
|
|
1457
1471
|
"43": "X_V_MODEL_ON_SCOPE_VARIABLE",
|
|
1458
1472
|
"X_V_MODEL_ON_PROPS": 44,
|
|
1459
1473
|
"44": "X_V_MODEL_ON_PROPS",
|
|
1460
|
-
"
|
|
1461
|
-
"45": "
|
|
1462
|
-
"
|
|
1463
|
-
"46": "
|
|
1464
|
-
"
|
|
1465
|
-
"47": "
|
|
1466
|
-
"
|
|
1467
|
-
"48": "
|
|
1468
|
-
"
|
|
1469
|
-
"49": "
|
|
1470
|
-
"
|
|
1471
|
-
"50": "
|
|
1472
|
-
"
|
|
1473
|
-
"51": "
|
|
1474
|
-
"
|
|
1475
|
-
"52": "
|
|
1476
|
-
"
|
|
1477
|
-
"53": "
|
|
1474
|
+
"X_V_MODEL_ON_CONST": 45,
|
|
1475
|
+
"45": "X_V_MODEL_ON_CONST",
|
|
1476
|
+
"X_INVALID_EXPRESSION": 46,
|
|
1477
|
+
"46": "X_INVALID_EXPRESSION",
|
|
1478
|
+
"X_KEEP_ALIVE_INVALID_CHILDREN": 47,
|
|
1479
|
+
"47": "X_KEEP_ALIVE_INVALID_CHILDREN",
|
|
1480
|
+
"X_PREFIX_ID_NOT_SUPPORTED": 48,
|
|
1481
|
+
"48": "X_PREFIX_ID_NOT_SUPPORTED",
|
|
1482
|
+
"X_MODULE_MODE_NOT_SUPPORTED": 49,
|
|
1483
|
+
"49": "X_MODULE_MODE_NOT_SUPPORTED",
|
|
1484
|
+
"X_CACHE_HANDLER_NOT_SUPPORTED": 50,
|
|
1485
|
+
"50": "X_CACHE_HANDLER_NOT_SUPPORTED",
|
|
1486
|
+
"X_SCOPE_ID_NOT_SUPPORTED": 51,
|
|
1487
|
+
"51": "X_SCOPE_ID_NOT_SUPPORTED",
|
|
1488
|
+
"X_VNODE_HOOKS": 52,
|
|
1489
|
+
"52": "X_VNODE_HOOKS",
|
|
1490
|
+
"X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 53,
|
|
1491
|
+
"53": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT",
|
|
1492
|
+
"__EXTEND_POINT__": 54,
|
|
1493
|
+
"54": "__EXTEND_POINT__"
|
|
1478
1494
|
};
|
|
1479
1495
|
const errorMessages = {
|
|
1480
1496
|
// parse errors
|
|
@@ -1515,7 +1531,7 @@ const errorMessages = {
|
|
|
1515
1531
|
[32]: `v-for has invalid expression.`,
|
|
1516
1532
|
[33]: `<template v-for> key should be placed on the <template> tag.`,
|
|
1517
1533
|
[34]: `v-bind is missing expression.`,
|
|
1518
|
-
[
|
|
1534
|
+
[53]: `v-bind with same-name shorthand only allows static argument.`,
|
|
1519
1535
|
[35]: `v-on is missing expression.`,
|
|
1520
1536
|
[36]: `Unexpected custom directive on <slot> outlet.`,
|
|
1521
1537
|
[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.`,
|
|
@@ -1527,16 +1543,17 @@ const errorMessages = {
|
|
|
1527
1543
|
[43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
|
|
1528
1544
|
[44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
|
|
1529
1545
|
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
1530
|
-
[45]: `
|
|
1531
|
-
[46]:
|
|
1532
|
-
[
|
|
1546
|
+
[45]: `v-model cannot be used on a const binding because it is not writable.`,
|
|
1547
|
+
[46]: `Error parsing JavaScript expression: `,
|
|
1548
|
+
[47]: `<KeepAlive> expects exactly one child component.`,
|
|
1549
|
+
[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.`,
|
|
1533
1550
|
// generic errors
|
|
1534
|
-
[
|
|
1535
|
-
[
|
|
1536
|
-
[
|
|
1537
|
-
[
|
|
1551
|
+
[48]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
1552
|
+
[49]: `ES module mode is not supported in this build of compiler.`,
|
|
1553
|
+
[50]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
1554
|
+
[51]: `"scopeId" option is only supported in module mode.`,
|
|
1538
1555
|
// just to fulfill types
|
|
1539
|
-
[
|
|
1556
|
+
[54]: ``
|
|
1540
1557
|
};
|
|
1541
1558
|
|
|
1542
1559
|
function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {
|
|
@@ -2262,6 +2279,20 @@ function getMemoedVNodeCall(node) {
|
|
|
2262
2279
|
}
|
|
2263
2280
|
}
|
|
2264
2281
|
const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;
|
|
2282
|
+
function isAllWhitespace(str) {
|
|
2283
|
+
for (let i = 0; i < str.length; i++) {
|
|
2284
|
+
if (!isWhitespace(str.charCodeAt(i))) {
|
|
2285
|
+
return false;
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
return true;
|
|
2289
|
+
}
|
|
2290
|
+
function isWhitespaceText(node) {
|
|
2291
|
+
return node.type === 2 && isAllWhitespace(node.content) || node.type === 12 && isWhitespaceText(node.content);
|
|
2292
|
+
}
|
|
2293
|
+
function isCommentOrWhitespace(node) {
|
|
2294
|
+
return node.type === 3 || isWhitespaceText(node);
|
|
2295
|
+
}
|
|
2265
2296
|
|
|
2266
2297
|
const defaultParserOptions = {
|
|
2267
2298
|
parseMode: "base",
|
|
@@ -2312,7 +2343,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
2312
2343
|
let exp = getSlice(innerStart, innerEnd);
|
|
2313
2344
|
if (exp.includes("&")) {
|
|
2314
2345
|
{
|
|
2315
|
-
exp =
|
|
2346
|
+
exp = decode.decodeHTML(exp);
|
|
2316
2347
|
}
|
|
2317
2348
|
}
|
|
2318
2349
|
addNode({
|
|
@@ -2881,14 +2912,6 @@ function condenseWhitespace(nodes) {
|
|
|
2881
2912
|
}
|
|
2882
2913
|
return removedWhitespace ? nodes.filter(Boolean) : nodes;
|
|
2883
2914
|
}
|
|
2884
|
-
function isAllWhitespace(str) {
|
|
2885
|
-
for (let i = 0; i < str.length; i++) {
|
|
2886
|
-
if (!isWhitespace(str.charCodeAt(i))) {
|
|
2887
|
-
return false;
|
|
2888
|
-
}
|
|
2889
|
-
}
|
|
2890
|
-
return true;
|
|
2891
|
-
}
|
|
2892
2915
|
function hasNewlineChar(str) {
|
|
2893
2916
|
for (let i = 0; i < str.length; i++) {
|
|
2894
2917
|
const c = str.charCodeAt(i);
|
|
@@ -2981,7 +3004,7 @@ function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0
|
|
|
2981
3004
|
}
|
|
2982
3005
|
} catch (e) {
|
|
2983
3006
|
exp.ast = false;
|
|
2984
|
-
emitError(
|
|
3007
|
+
emitError(46, loc.start.offset, e.message);
|
|
2985
3008
|
}
|
|
2986
3009
|
}
|
|
2987
3010
|
return exp;
|
|
@@ -4554,7 +4577,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
|
|
|
4554
4577
|
} catch (e) {
|
|
4555
4578
|
context.onError(
|
|
4556
4579
|
createCompilerError(
|
|
4557
|
-
|
|
4580
|
+
46,
|
|
4558
4581
|
node.loc,
|
|
4559
4582
|
void 0,
|
|
4560
4583
|
e.message
|
|
@@ -4714,13 +4737,11 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
4714
4737
|
let i = siblings.indexOf(node);
|
|
4715
4738
|
while (i-- >= -1) {
|
|
4716
4739
|
const sibling = siblings[i];
|
|
4717
|
-
if (sibling && sibling
|
|
4718
|
-
context.removeNode(sibling);
|
|
4719
|
-
comments.unshift(sibling);
|
|
4720
|
-
continue;
|
|
4721
|
-
}
|
|
4722
|
-
if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
|
|
4740
|
+
if (sibling && isCommentOrWhitespace(sibling)) {
|
|
4723
4741
|
context.removeNode(sibling);
|
|
4742
|
+
if (sibling.type === 3) {
|
|
4743
|
+
comments.unshift(sibling);
|
|
4744
|
+
}
|
|
4724
4745
|
continue;
|
|
4725
4746
|
}
|
|
4726
4747
|
if (sibling && sibling.type === 9) {
|
|
@@ -5238,7 +5259,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
5238
5259
|
let prev;
|
|
5239
5260
|
while (j--) {
|
|
5240
5261
|
prev = children[j];
|
|
5241
|
-
if (
|
|
5262
|
+
if (!isCommentOrWhitespace(prev)) {
|
|
5242
5263
|
break;
|
|
5243
5264
|
}
|
|
5244
5265
|
}
|
|
@@ -5316,7 +5337,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
5316
5337
|
} else if (implicitDefaultChildren.length && // #3766
|
|
5317
5338
|
// with whitespace: 'preserve', whitespaces between slots will end up in
|
|
5318
5339
|
// implicitDefaultChildren. Ignore if all implicit children are whitespaces.
|
|
5319
|
-
implicitDefaultChildren.
|
|
5340
|
+
!implicitDefaultChildren.every(isWhitespaceText)) {
|
|
5320
5341
|
if (hasNamedDefaultSlot) {
|
|
5321
5342
|
context.onError(
|
|
5322
5343
|
createCompilerError(
|
|
@@ -5389,11 +5410,6 @@ function hasForwardedSlots(children) {
|
|
|
5389
5410
|
}
|
|
5390
5411
|
return false;
|
|
5391
5412
|
}
|
|
5392
|
-
function isNonWhitespaceContent(node) {
|
|
5393
|
-
if (node.type !== 2 && node.type !== 12)
|
|
5394
|
-
return true;
|
|
5395
|
-
return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content);
|
|
5396
|
-
}
|
|
5397
5413
|
|
|
5398
5414
|
const directiveImportMap = /* @__PURE__ */ new WeakMap();
|
|
5399
5415
|
const transformElement = (node, context) => {
|
|
@@ -5445,7 +5461,7 @@ const transformElement = (node, context) => {
|
|
|
5445
5461
|
patchFlag |= 1024;
|
|
5446
5462
|
if (node.children.length > 1) {
|
|
5447
5463
|
context.onError(
|
|
5448
|
-
createCompilerError(
|
|
5464
|
+
createCompilerError(47, {
|
|
5449
5465
|
start: node.children[0].loc.start,
|
|
5450
5466
|
end: node.children[node.children.length - 1].loc.end,
|
|
5451
5467
|
source: ""
|
|
@@ -6108,7 +6124,7 @@ const transformOn = (dir, node, context, augmentor) => {
|
|
|
6108
6124
|
if (arg.isStatic) {
|
|
6109
6125
|
let rawName = arg.content;
|
|
6110
6126
|
if (rawName.startsWith("vnode")) {
|
|
6111
|
-
context.onError(createCompilerError(
|
|
6127
|
+
context.onError(createCompilerError(52, arg.loc));
|
|
6112
6128
|
}
|
|
6113
6129
|
if (rawName.startsWith("vue:")) {
|
|
6114
6130
|
rawName = `vnode-${rawName.slice(4)}`;
|
|
@@ -6370,6 +6386,10 @@ const transformModel = (dir, node, context) => {
|
|
|
6370
6386
|
context.onError(createCompilerError(44, exp.loc));
|
|
6371
6387
|
return createTransformProps();
|
|
6372
6388
|
}
|
|
6389
|
+
if (bindingType === "literal-const" || bindingType === "setup-const") {
|
|
6390
|
+
context.onError(createCompilerError(45, exp.loc));
|
|
6391
|
+
return createTransformProps();
|
|
6392
|
+
}
|
|
6373
6393
|
const maybeRef = context.inline && (bindingType === "setup-let" || bindingType === "setup-ref" || bindingType === "setup-maybe-ref");
|
|
6374
6394
|
if (!expString.trim() || !isMemberExpression(exp, context) && !maybeRef) {
|
|
6375
6395
|
context.onError(
|
|
@@ -6623,7 +6643,7 @@ const transformVBindShorthand = (node, context) => {
|
|
|
6623
6643
|
if (arg.type !== 4 || !arg.isStatic) {
|
|
6624
6644
|
context.onError(
|
|
6625
6645
|
createCompilerError(
|
|
6626
|
-
|
|
6646
|
+
53,
|
|
6627
6647
|
arg.loc
|
|
6628
6648
|
)
|
|
6629
6649
|
);
|
|
@@ -6671,10 +6691,10 @@ function baseCompile(source, options = {}) {
|
|
|
6671
6691
|
const isModuleMode = options.mode === "module";
|
|
6672
6692
|
const prefixIdentifiers = options.prefixIdentifiers === true || isModuleMode;
|
|
6673
6693
|
if (!prefixIdentifiers && options.cacheHandlers) {
|
|
6674
|
-
onError(createCompilerError(
|
|
6694
|
+
onError(createCompilerError(50));
|
|
6675
6695
|
}
|
|
6676
6696
|
if (options.scopeId && !isModuleMode) {
|
|
6677
|
-
onError(createCompilerError(
|
|
6697
|
+
onError(createCompilerError(51));
|
|
6678
6698
|
}
|
|
6679
6699
|
const resolvedOptions = shared.extend({}, options, {
|
|
6680
6700
|
prefixIdentifiers
|
|
@@ -6816,6 +6836,8 @@ exports.hasDynamicKeyVBind = hasDynamicKeyVBind;
|
|
|
6816
6836
|
exports.hasScopeRef = hasScopeRef;
|
|
6817
6837
|
exports.helperNameMap = helperNameMap;
|
|
6818
6838
|
exports.injectProp = injectProp;
|
|
6839
|
+
exports.isAllWhitespace = isAllWhitespace;
|
|
6840
|
+
exports.isCommentOrWhitespace = isCommentOrWhitespace;
|
|
6819
6841
|
exports.isCoreComponent = isCoreComponent;
|
|
6820
6842
|
exports.isFnExpression = isFnExpression;
|
|
6821
6843
|
exports.isFnExpressionBrowser = isFnExpressionBrowser;
|
|
@@ -6837,6 +6859,7 @@ exports.isTemplateNode = isTemplateNode;
|
|
|
6837
6859
|
exports.isText = isText$1;
|
|
6838
6860
|
exports.isVPre = isVPre;
|
|
6839
6861
|
exports.isVSlot = isVSlot;
|
|
6862
|
+
exports.isWhitespaceText = isWhitespaceText;
|
|
6840
6863
|
exports.locStub = locStub;
|
|
6841
6864
|
exports.noopDirectiveTransform = noopDirectiveTransform;
|
|
6842
6865
|
exports.processExpression = processExpression;
|