@vue/compiler-dom 3.4.0-alpha.3 → 3.4.0-beta.1
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-dom.cjs.js +28 -1
- package/dist/compiler-dom.cjs.prod.js +28 -1
- package/dist/compiler-dom.d.ts +1 -1
- package/dist/compiler-dom.esm-browser.js +415 -147
- package/dist/compiler-dom.esm-browser.prod.js +1 -1
- package/dist/compiler-dom.esm-bundler.js +29 -3
- package/dist/compiler-dom.global.js +423 -146
- package/dist/compiler-dom.global.prod.js +1 -1
- package/package.json +3 -3
|
@@ -7,8 +7,8 @@ const EMPTY_OBJ = Object.freeze({}) ;
|
|
|
7
7
|
const NOOP = () => {
|
|
8
8
|
};
|
|
9
9
|
const NO = () => false;
|
|
10
|
-
const
|
|
11
|
-
|
|
10
|
+
const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
|
|
11
|
+
(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
|
|
12
12
|
const extend = Object.assign;
|
|
13
13
|
const isArray = Array.isArray;
|
|
14
14
|
const isString = (val) => typeof val === "string";
|
|
@@ -119,9 +119,11 @@ function parseStringStyle(cssText) {
|
|
|
119
119
|
|
|
120
120
|
const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
|
|
121
121
|
const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
|
|
122
|
+
const MATH_TAGS = "math,maction,annotation,annotation-xml,menclose,merror,mfenced,mfrac,mi,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,semantics,mspace,msqrt,mstyle,msub,msup,msubsup,mtable,mtd,mtext,mtr,munder,munderover";
|
|
122
123
|
const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
|
|
123
124
|
const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
|
|
124
125
|
const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
|
|
126
|
+
const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
|
|
125
127
|
const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
|
|
126
128
|
|
|
127
129
|
const FRAGMENT = Symbol(`Fragment` );
|
|
@@ -212,6 +214,90 @@ function registerRuntimeHelpers(helpers) {
|
|
|
212
214
|
});
|
|
213
215
|
}
|
|
214
216
|
|
|
217
|
+
const Namespaces = {
|
|
218
|
+
"HTML": 0,
|
|
219
|
+
"0": "HTML",
|
|
220
|
+
"SVG": 1,
|
|
221
|
+
"1": "SVG",
|
|
222
|
+
"MATH_ML": 2,
|
|
223
|
+
"2": "MATH_ML"
|
|
224
|
+
};
|
|
225
|
+
const NodeTypes = {
|
|
226
|
+
"ROOT": 0,
|
|
227
|
+
"0": "ROOT",
|
|
228
|
+
"ELEMENT": 1,
|
|
229
|
+
"1": "ELEMENT",
|
|
230
|
+
"TEXT": 2,
|
|
231
|
+
"2": "TEXT",
|
|
232
|
+
"COMMENT": 3,
|
|
233
|
+
"3": "COMMENT",
|
|
234
|
+
"SIMPLE_EXPRESSION": 4,
|
|
235
|
+
"4": "SIMPLE_EXPRESSION",
|
|
236
|
+
"INTERPOLATION": 5,
|
|
237
|
+
"5": "INTERPOLATION",
|
|
238
|
+
"ATTRIBUTE": 6,
|
|
239
|
+
"6": "ATTRIBUTE",
|
|
240
|
+
"DIRECTIVE": 7,
|
|
241
|
+
"7": "DIRECTIVE",
|
|
242
|
+
"COMPOUND_EXPRESSION": 8,
|
|
243
|
+
"8": "COMPOUND_EXPRESSION",
|
|
244
|
+
"IF": 9,
|
|
245
|
+
"9": "IF",
|
|
246
|
+
"IF_BRANCH": 10,
|
|
247
|
+
"10": "IF_BRANCH",
|
|
248
|
+
"FOR": 11,
|
|
249
|
+
"11": "FOR",
|
|
250
|
+
"TEXT_CALL": 12,
|
|
251
|
+
"12": "TEXT_CALL",
|
|
252
|
+
"VNODE_CALL": 13,
|
|
253
|
+
"13": "VNODE_CALL",
|
|
254
|
+
"JS_CALL_EXPRESSION": 14,
|
|
255
|
+
"14": "JS_CALL_EXPRESSION",
|
|
256
|
+
"JS_OBJECT_EXPRESSION": 15,
|
|
257
|
+
"15": "JS_OBJECT_EXPRESSION",
|
|
258
|
+
"JS_PROPERTY": 16,
|
|
259
|
+
"16": "JS_PROPERTY",
|
|
260
|
+
"JS_ARRAY_EXPRESSION": 17,
|
|
261
|
+
"17": "JS_ARRAY_EXPRESSION",
|
|
262
|
+
"JS_FUNCTION_EXPRESSION": 18,
|
|
263
|
+
"18": "JS_FUNCTION_EXPRESSION",
|
|
264
|
+
"JS_CONDITIONAL_EXPRESSION": 19,
|
|
265
|
+
"19": "JS_CONDITIONAL_EXPRESSION",
|
|
266
|
+
"JS_CACHE_EXPRESSION": 20,
|
|
267
|
+
"20": "JS_CACHE_EXPRESSION",
|
|
268
|
+
"JS_BLOCK_STATEMENT": 21,
|
|
269
|
+
"21": "JS_BLOCK_STATEMENT",
|
|
270
|
+
"JS_TEMPLATE_LITERAL": 22,
|
|
271
|
+
"22": "JS_TEMPLATE_LITERAL",
|
|
272
|
+
"JS_IF_STATEMENT": 23,
|
|
273
|
+
"23": "JS_IF_STATEMENT",
|
|
274
|
+
"JS_ASSIGNMENT_EXPRESSION": 24,
|
|
275
|
+
"24": "JS_ASSIGNMENT_EXPRESSION",
|
|
276
|
+
"JS_SEQUENCE_EXPRESSION": 25,
|
|
277
|
+
"25": "JS_SEQUENCE_EXPRESSION",
|
|
278
|
+
"JS_RETURN_STATEMENT": 26,
|
|
279
|
+
"26": "JS_RETURN_STATEMENT"
|
|
280
|
+
};
|
|
281
|
+
const ElementTypes = {
|
|
282
|
+
"ELEMENT": 0,
|
|
283
|
+
"0": "ELEMENT",
|
|
284
|
+
"COMPONENT": 1,
|
|
285
|
+
"1": "COMPONENT",
|
|
286
|
+
"SLOT": 2,
|
|
287
|
+
"2": "SLOT",
|
|
288
|
+
"TEMPLATE": 3,
|
|
289
|
+
"3": "TEMPLATE"
|
|
290
|
+
};
|
|
291
|
+
const ConstantTypes = {
|
|
292
|
+
"NOT_CONSTANT": 0,
|
|
293
|
+
"0": "NOT_CONSTANT",
|
|
294
|
+
"CAN_SKIP_PATCH": 1,
|
|
295
|
+
"1": "CAN_SKIP_PATCH",
|
|
296
|
+
"CAN_HOIST": 2,
|
|
297
|
+
"2": "CAN_HOIST",
|
|
298
|
+
"CAN_STRINGIFY": 3,
|
|
299
|
+
"3": "CAN_STRINGIFY"
|
|
300
|
+
};
|
|
215
301
|
const locStub = {
|
|
216
302
|
start: { line: 1, column: 1, offset: 0 },
|
|
217
303
|
end: { line: 1, column: 1, offset: 0 },
|
|
@@ -466,7 +552,9 @@ class Tokenizer {
|
|
|
466
552
|
this.inRCDATA = false;
|
|
467
553
|
/** For disabling RCDATA tags handling */
|
|
468
554
|
this.inXML = false;
|
|
469
|
-
/**
|
|
555
|
+
/** For disabling interpolation parsing in v-pre */
|
|
556
|
+
this.inVPre = false;
|
|
557
|
+
/** Record newline positions for fast line / column calculation */
|
|
470
558
|
this.newlines = [];
|
|
471
559
|
this.mode = 0;
|
|
472
560
|
this.delimiterOpen = defaultDelimitersOpen;
|
|
@@ -485,6 +573,7 @@ class Tokenizer {
|
|
|
485
573
|
this.sectionStart = 0;
|
|
486
574
|
this.index = 0;
|
|
487
575
|
this.baseState = 1;
|
|
576
|
+
this.inRCDATA = false;
|
|
488
577
|
this.currentSequence = void 0;
|
|
489
578
|
this.newlines.length = 0;
|
|
490
579
|
this.delimiterOpen = defaultDelimitersOpen;
|
|
@@ -523,7 +612,7 @@ class Tokenizer {
|
|
|
523
612
|
}
|
|
524
613
|
this.state = 5;
|
|
525
614
|
this.sectionStart = this.index;
|
|
526
|
-
} else if (c === this.delimiterOpen[0]) {
|
|
615
|
+
} else if (!this.inVPre && c === this.delimiterOpen[0]) {
|
|
527
616
|
this.state = 2;
|
|
528
617
|
this.delimiterIndex = 0;
|
|
529
618
|
this.stateInterpolationOpen(c);
|
|
@@ -1205,6 +1294,16 @@ class Tokenizer {
|
|
|
1205
1294
|
}
|
|
1206
1295
|
}
|
|
1207
1296
|
|
|
1297
|
+
const CompilerDeprecationTypes = {
|
|
1298
|
+
"COMPILER_IS_ON_ELEMENT": "COMPILER_IS_ON_ELEMENT",
|
|
1299
|
+
"COMPILER_V_BIND_SYNC": "COMPILER_V_BIND_SYNC",
|
|
1300
|
+
"COMPILER_V_BIND_OBJECT_ORDER": "COMPILER_V_BIND_OBJECT_ORDER",
|
|
1301
|
+
"COMPILER_V_ON_NATIVE": "COMPILER_V_ON_NATIVE",
|
|
1302
|
+
"COMPILER_V_IF_V_FOR_PRECEDENCE": "COMPILER_V_IF_V_FOR_PRECEDENCE",
|
|
1303
|
+
"COMPILER_NATIVE_TEMPLATE": "COMPILER_NATIVE_TEMPLATE",
|
|
1304
|
+
"COMPILER_INLINE_TEMPLATE": "COMPILER_INLINE_TEMPLATE",
|
|
1305
|
+
"COMPILER_FILTERS": "COMPILER_FILTER"
|
|
1306
|
+
};
|
|
1208
1307
|
const deprecationData = {
|
|
1209
1308
|
["COMPILER_IS_ON_ELEMENT"]: {
|
|
1210
1309
|
message: `Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".`,
|
|
@@ -1286,6 +1385,114 @@ function createCompilerError(code, loc, messages, additionalMessage) {
|
|
|
1286
1385
|
error.loc = loc;
|
|
1287
1386
|
return error;
|
|
1288
1387
|
}
|
|
1388
|
+
const ErrorCodes = {
|
|
1389
|
+
"ABRUPT_CLOSING_OF_EMPTY_COMMENT": 0,
|
|
1390
|
+
"0": "ABRUPT_CLOSING_OF_EMPTY_COMMENT",
|
|
1391
|
+
"CDATA_IN_HTML_CONTENT": 1,
|
|
1392
|
+
"1": "CDATA_IN_HTML_CONTENT",
|
|
1393
|
+
"DUPLICATE_ATTRIBUTE": 2,
|
|
1394
|
+
"2": "DUPLICATE_ATTRIBUTE",
|
|
1395
|
+
"END_TAG_WITH_ATTRIBUTES": 3,
|
|
1396
|
+
"3": "END_TAG_WITH_ATTRIBUTES",
|
|
1397
|
+
"END_TAG_WITH_TRAILING_SOLIDUS": 4,
|
|
1398
|
+
"4": "END_TAG_WITH_TRAILING_SOLIDUS",
|
|
1399
|
+
"EOF_BEFORE_TAG_NAME": 5,
|
|
1400
|
+
"5": "EOF_BEFORE_TAG_NAME",
|
|
1401
|
+
"EOF_IN_CDATA": 6,
|
|
1402
|
+
"6": "EOF_IN_CDATA",
|
|
1403
|
+
"EOF_IN_COMMENT": 7,
|
|
1404
|
+
"7": "EOF_IN_COMMENT",
|
|
1405
|
+
"EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT": 8,
|
|
1406
|
+
"8": "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT",
|
|
1407
|
+
"EOF_IN_TAG": 9,
|
|
1408
|
+
"9": "EOF_IN_TAG",
|
|
1409
|
+
"INCORRECTLY_CLOSED_COMMENT": 10,
|
|
1410
|
+
"10": "INCORRECTLY_CLOSED_COMMENT",
|
|
1411
|
+
"INCORRECTLY_OPENED_COMMENT": 11,
|
|
1412
|
+
"11": "INCORRECTLY_OPENED_COMMENT",
|
|
1413
|
+
"INVALID_FIRST_CHARACTER_OF_TAG_NAME": 12,
|
|
1414
|
+
"12": "INVALID_FIRST_CHARACTER_OF_TAG_NAME",
|
|
1415
|
+
"MISSING_ATTRIBUTE_VALUE": 13,
|
|
1416
|
+
"13": "MISSING_ATTRIBUTE_VALUE",
|
|
1417
|
+
"MISSING_END_TAG_NAME": 14,
|
|
1418
|
+
"14": "MISSING_END_TAG_NAME",
|
|
1419
|
+
"MISSING_WHITESPACE_BETWEEN_ATTRIBUTES": 15,
|
|
1420
|
+
"15": "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES",
|
|
1421
|
+
"NESTED_COMMENT": 16,
|
|
1422
|
+
"16": "NESTED_COMMENT",
|
|
1423
|
+
"UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME": 17,
|
|
1424
|
+
"17": "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME",
|
|
1425
|
+
"UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE": 18,
|
|
1426
|
+
"18": "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE",
|
|
1427
|
+
"UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME": 19,
|
|
1428
|
+
"19": "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME",
|
|
1429
|
+
"UNEXPECTED_NULL_CHARACTER": 20,
|
|
1430
|
+
"20": "UNEXPECTED_NULL_CHARACTER",
|
|
1431
|
+
"UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME": 21,
|
|
1432
|
+
"21": "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME",
|
|
1433
|
+
"UNEXPECTED_SOLIDUS_IN_TAG": 22,
|
|
1434
|
+
"22": "UNEXPECTED_SOLIDUS_IN_TAG",
|
|
1435
|
+
"X_INVALID_END_TAG": 23,
|
|
1436
|
+
"23": "X_INVALID_END_TAG",
|
|
1437
|
+
"X_MISSING_END_TAG": 24,
|
|
1438
|
+
"24": "X_MISSING_END_TAG",
|
|
1439
|
+
"X_MISSING_INTERPOLATION_END": 25,
|
|
1440
|
+
"25": "X_MISSING_INTERPOLATION_END",
|
|
1441
|
+
"X_MISSING_DIRECTIVE_NAME": 26,
|
|
1442
|
+
"26": "X_MISSING_DIRECTIVE_NAME",
|
|
1443
|
+
"X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END": 27,
|
|
1444
|
+
"27": "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END",
|
|
1445
|
+
"X_V_IF_NO_EXPRESSION": 28,
|
|
1446
|
+
"28": "X_V_IF_NO_EXPRESSION",
|
|
1447
|
+
"X_V_IF_SAME_KEY": 29,
|
|
1448
|
+
"29": "X_V_IF_SAME_KEY",
|
|
1449
|
+
"X_V_ELSE_NO_ADJACENT_IF": 30,
|
|
1450
|
+
"30": "X_V_ELSE_NO_ADJACENT_IF",
|
|
1451
|
+
"X_V_FOR_NO_EXPRESSION": 31,
|
|
1452
|
+
"31": "X_V_FOR_NO_EXPRESSION",
|
|
1453
|
+
"X_V_FOR_MALFORMED_EXPRESSION": 32,
|
|
1454
|
+
"32": "X_V_FOR_MALFORMED_EXPRESSION",
|
|
1455
|
+
"X_V_FOR_TEMPLATE_KEY_PLACEMENT": 33,
|
|
1456
|
+
"33": "X_V_FOR_TEMPLATE_KEY_PLACEMENT",
|
|
1457
|
+
"X_V_BIND_NO_EXPRESSION": 34,
|
|
1458
|
+
"34": "X_V_BIND_NO_EXPRESSION",
|
|
1459
|
+
"X_V_ON_NO_EXPRESSION": 35,
|
|
1460
|
+
"35": "X_V_ON_NO_EXPRESSION",
|
|
1461
|
+
"X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET": 36,
|
|
1462
|
+
"36": "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET",
|
|
1463
|
+
"X_V_SLOT_MIXED_SLOT_USAGE": 37,
|
|
1464
|
+
"37": "X_V_SLOT_MIXED_SLOT_USAGE",
|
|
1465
|
+
"X_V_SLOT_DUPLICATE_SLOT_NAMES": 38,
|
|
1466
|
+
"38": "X_V_SLOT_DUPLICATE_SLOT_NAMES",
|
|
1467
|
+
"X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN": 39,
|
|
1468
|
+
"39": "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN",
|
|
1469
|
+
"X_V_SLOT_MISPLACED": 40,
|
|
1470
|
+
"40": "X_V_SLOT_MISPLACED",
|
|
1471
|
+
"X_V_MODEL_NO_EXPRESSION": 41,
|
|
1472
|
+
"41": "X_V_MODEL_NO_EXPRESSION",
|
|
1473
|
+
"X_V_MODEL_MALFORMED_EXPRESSION": 42,
|
|
1474
|
+
"42": "X_V_MODEL_MALFORMED_EXPRESSION",
|
|
1475
|
+
"X_V_MODEL_ON_SCOPE_VARIABLE": 43,
|
|
1476
|
+
"43": "X_V_MODEL_ON_SCOPE_VARIABLE",
|
|
1477
|
+
"X_V_MODEL_ON_PROPS": 44,
|
|
1478
|
+
"44": "X_V_MODEL_ON_PROPS",
|
|
1479
|
+
"X_INVALID_EXPRESSION": 45,
|
|
1480
|
+
"45": "X_INVALID_EXPRESSION",
|
|
1481
|
+
"X_KEEP_ALIVE_INVALID_CHILDREN": 46,
|
|
1482
|
+
"46": "X_KEEP_ALIVE_INVALID_CHILDREN",
|
|
1483
|
+
"X_PREFIX_ID_NOT_SUPPORTED": 47,
|
|
1484
|
+
"47": "X_PREFIX_ID_NOT_SUPPORTED",
|
|
1485
|
+
"X_MODULE_MODE_NOT_SUPPORTED": 48,
|
|
1486
|
+
"48": "X_MODULE_MODE_NOT_SUPPORTED",
|
|
1487
|
+
"X_CACHE_HANDLER_NOT_SUPPORTED": 49,
|
|
1488
|
+
"49": "X_CACHE_HANDLER_NOT_SUPPORTED",
|
|
1489
|
+
"X_SCOPE_ID_NOT_SUPPORTED": 50,
|
|
1490
|
+
"50": "X_SCOPE_ID_NOT_SUPPORTED",
|
|
1491
|
+
"X_VNODE_HOOKS": 51,
|
|
1492
|
+
"51": "X_VNODE_HOOKS",
|
|
1493
|
+
"__EXTEND_POINT__": 52,
|
|
1494
|
+
"52": "__EXTEND_POINT__"
|
|
1495
|
+
};
|
|
1289
1496
|
const errorMessages = {
|
|
1290
1497
|
// parse errors
|
|
1291
1498
|
[0]: "Illegal comment.",
|
|
@@ -1338,18 +1545,134 @@ const errorMessages = {
|
|
|
1338
1545
|
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
1339
1546
|
[45]: `Error parsing JavaScript expression: `,
|
|
1340
1547
|
[46]: `<KeepAlive> expects exactly one child component.`,
|
|
1548
|
+
[51]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
|
|
1341
1549
|
// generic errors
|
|
1342
1550
|
[47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
1343
1551
|
[48]: `ES module mode is not supported in this build of compiler.`,
|
|
1344
1552
|
[49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
1345
1553
|
[50]: `"scopeId" option is only supported in module mode.`,
|
|
1346
|
-
// deprecations
|
|
1347
|
-
[51]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
|
|
1348
|
-
[52]: `v-is="component-name" has been deprecated. Use is="vue:component-name" instead. v-is support will be removed in 3.4.`,
|
|
1349
1554
|
// just to fulfill types
|
|
1350
|
-
[
|
|
1555
|
+
[52]: ``
|
|
1351
1556
|
};
|
|
1352
1557
|
|
|
1558
|
+
function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {
|
|
1559
|
+
{
|
|
1560
|
+
return;
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
function isReferencedIdentifier(id, parent, parentStack) {
|
|
1564
|
+
{
|
|
1565
|
+
return false;
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
function isInDestructureAssignment(parent, parentStack) {
|
|
1569
|
+
if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) {
|
|
1570
|
+
let i = parentStack.length;
|
|
1571
|
+
while (i--) {
|
|
1572
|
+
const p = parentStack[i];
|
|
1573
|
+
if (p.type === "AssignmentExpression") {
|
|
1574
|
+
return true;
|
|
1575
|
+
} else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) {
|
|
1576
|
+
break;
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
return false;
|
|
1581
|
+
}
|
|
1582
|
+
function walkFunctionParams(node, onIdent) {
|
|
1583
|
+
for (const p of node.params) {
|
|
1584
|
+
for (const id of extractIdentifiers(p)) {
|
|
1585
|
+
onIdent(id);
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
function walkBlockDeclarations(block, onIdent) {
|
|
1590
|
+
for (const stmt of block.body) {
|
|
1591
|
+
if (stmt.type === "VariableDeclaration") {
|
|
1592
|
+
if (stmt.declare)
|
|
1593
|
+
continue;
|
|
1594
|
+
for (const decl of stmt.declarations) {
|
|
1595
|
+
for (const id of extractIdentifiers(decl.id)) {
|
|
1596
|
+
onIdent(id);
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
} else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") {
|
|
1600
|
+
if (stmt.declare || !stmt.id)
|
|
1601
|
+
continue;
|
|
1602
|
+
onIdent(stmt.id);
|
|
1603
|
+
} else if (stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement") {
|
|
1604
|
+
const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
|
|
1605
|
+
if (variable && variable.type === "VariableDeclaration") {
|
|
1606
|
+
for (const decl of variable.declarations) {
|
|
1607
|
+
for (const id of extractIdentifiers(decl.id)) {
|
|
1608
|
+
onIdent(id);
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
function extractIdentifiers(param, nodes = []) {
|
|
1616
|
+
switch (param.type) {
|
|
1617
|
+
case "Identifier":
|
|
1618
|
+
nodes.push(param);
|
|
1619
|
+
break;
|
|
1620
|
+
case "MemberExpression":
|
|
1621
|
+
let object = param;
|
|
1622
|
+
while (object.type === "MemberExpression") {
|
|
1623
|
+
object = object.object;
|
|
1624
|
+
}
|
|
1625
|
+
nodes.push(object);
|
|
1626
|
+
break;
|
|
1627
|
+
case "ObjectPattern":
|
|
1628
|
+
for (const prop of param.properties) {
|
|
1629
|
+
if (prop.type === "RestElement") {
|
|
1630
|
+
extractIdentifiers(prop.argument, nodes);
|
|
1631
|
+
} else {
|
|
1632
|
+
extractIdentifiers(prop.value, nodes);
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
break;
|
|
1636
|
+
case "ArrayPattern":
|
|
1637
|
+
param.elements.forEach((element) => {
|
|
1638
|
+
if (element)
|
|
1639
|
+
extractIdentifiers(element, nodes);
|
|
1640
|
+
});
|
|
1641
|
+
break;
|
|
1642
|
+
case "RestElement":
|
|
1643
|
+
extractIdentifiers(param.argument, nodes);
|
|
1644
|
+
break;
|
|
1645
|
+
case "AssignmentPattern":
|
|
1646
|
+
extractIdentifiers(param.left, nodes);
|
|
1647
|
+
break;
|
|
1648
|
+
}
|
|
1649
|
+
return nodes;
|
|
1650
|
+
}
|
|
1651
|
+
const isFunctionType = (node) => {
|
|
1652
|
+
return /Function(?:Expression|Declaration)$|Method$/.test(node.type);
|
|
1653
|
+
};
|
|
1654
|
+
const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed;
|
|
1655
|
+
const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;
|
|
1656
|
+
const TS_NODE_TYPES = [
|
|
1657
|
+
"TSAsExpression",
|
|
1658
|
+
// foo as number
|
|
1659
|
+
"TSTypeAssertion",
|
|
1660
|
+
// (<number>foo)
|
|
1661
|
+
"TSNonNullExpression",
|
|
1662
|
+
// foo!
|
|
1663
|
+
"TSInstantiationExpression",
|
|
1664
|
+
// foo<string>
|
|
1665
|
+
"TSSatisfiesExpression"
|
|
1666
|
+
// foo satisfies T
|
|
1667
|
+
];
|
|
1668
|
+
function unwrapTSNode(node) {
|
|
1669
|
+
if (TS_NODE_TYPES.includes(node.type)) {
|
|
1670
|
+
return unwrapTSNode(node.expression);
|
|
1671
|
+
} else {
|
|
1672
|
+
return node;
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1353
1676
|
const isStaticExp = (p) => p.type === 4 && p.isStatic;
|
|
1354
1677
|
function isCoreComponent(tag) {
|
|
1355
1678
|
switch (tag) {
|
|
@@ -1655,7 +1978,8 @@ const defaultParserOptions = {
|
|
|
1655
1978
|
isCustomElement: NO,
|
|
1656
1979
|
onError: defaultOnError,
|
|
1657
1980
|
onWarn: defaultOnWarn,
|
|
1658
|
-
comments: true
|
|
1981
|
+
comments: true,
|
|
1982
|
+
prefixIdentifiers: false
|
|
1659
1983
|
};
|
|
1660
1984
|
let currentOptions = defaultParserOptions;
|
|
1661
1985
|
let currentRoot = null;
|
|
@@ -1697,7 +2021,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
1697
2021
|
}
|
|
1698
2022
|
addNode({
|
|
1699
2023
|
type: 5,
|
|
1700
|
-
content:
|
|
2024
|
+
content: createExp(exp, false, getLoc(innerStart, innerEnd)),
|
|
1701
2025
|
loc: getLoc(start, end)
|
|
1702
2026
|
});
|
|
1703
2027
|
},
|
|
@@ -1790,7 +2114,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
1790
2114
|
loc: getLoc(start)
|
|
1791
2115
|
};
|
|
1792
2116
|
if (name === "pre") {
|
|
1793
|
-
inVPre = true;
|
|
2117
|
+
inVPre = tokenizer.inVPre = true;
|
|
1794
2118
|
currentVPreBoundary = currentOpenTag;
|
|
1795
2119
|
const props = currentOpenTag.props;
|
|
1796
2120
|
for (let i = 0; i < props.length; i++) {
|
|
@@ -1810,7 +2134,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
1810
2134
|
setLocEnd(currentProp.nameLoc, end);
|
|
1811
2135
|
} else {
|
|
1812
2136
|
const isStatic = arg[0] !== `[`;
|
|
1813
|
-
currentProp.arg =
|
|
2137
|
+
currentProp.arg = createExp(
|
|
1814
2138
|
isStatic ? arg : arg.slice(1, -1),
|
|
1815
2139
|
isStatic,
|
|
1816
2140
|
getLoc(start, end),
|
|
@@ -1883,10 +2207,13 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
1883
2207
|
tokenizer.enterRCDATA(toCharCodes(`</template`), 0);
|
|
1884
2208
|
}
|
|
1885
2209
|
} else {
|
|
1886
|
-
|
|
2210
|
+
let expParseMode = 0 /* Normal */;
|
|
2211
|
+
currentProp.exp = createExp(
|
|
1887
2212
|
currentAttrValue,
|
|
1888
2213
|
false,
|
|
1889
|
-
getLoc(currentAttrStartIndex, currentAttrEndIndex)
|
|
2214
|
+
getLoc(currentAttrStartIndex, currentAttrEndIndex),
|
|
2215
|
+
0,
|
|
2216
|
+
expParseMode
|
|
1890
2217
|
);
|
|
1891
2218
|
if (currentProp.name === "for") {
|
|
1892
2219
|
currentProp.forParseResult = parseForExpression(currentProp.exp);
|
|
@@ -1989,10 +2316,16 @@ function parseForExpression(input) {
|
|
|
1989
2316
|
if (!inMatch)
|
|
1990
2317
|
return;
|
|
1991
2318
|
const [, LHS, RHS] = inMatch;
|
|
1992
|
-
const createAliasExpression = (content, offset) => {
|
|
2319
|
+
const createAliasExpression = (content, offset, asParam = false) => {
|
|
1993
2320
|
const start = loc.start.offset + offset;
|
|
1994
2321
|
const end = start + content.length;
|
|
1995
|
-
return
|
|
2322
|
+
return createExp(
|
|
2323
|
+
content,
|
|
2324
|
+
false,
|
|
2325
|
+
getLoc(start, end),
|
|
2326
|
+
0,
|
|
2327
|
+
asParam ? 1 /* Params */ : 0 /* Normal */
|
|
2328
|
+
);
|
|
1996
2329
|
};
|
|
1997
2330
|
const result = {
|
|
1998
2331
|
source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)),
|
|
@@ -2010,7 +2343,7 @@ function parseForExpression(input) {
|
|
|
2010
2343
|
let keyOffset;
|
|
2011
2344
|
if (keyContent) {
|
|
2012
2345
|
keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
|
|
2013
|
-
result.key = createAliasExpression(keyContent, keyOffset);
|
|
2346
|
+
result.key = createAliasExpression(keyContent, keyOffset, true);
|
|
2014
2347
|
}
|
|
2015
2348
|
if (iteratorMatch[2]) {
|
|
2016
2349
|
const indexContent = iteratorMatch[2].trim();
|
|
@@ -2020,13 +2353,14 @@ function parseForExpression(input) {
|
|
|
2020
2353
|
exp.indexOf(
|
|
2021
2354
|
indexContent,
|
|
2022
2355
|
result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length
|
|
2023
|
-
)
|
|
2356
|
+
),
|
|
2357
|
+
true
|
|
2024
2358
|
);
|
|
2025
2359
|
}
|
|
2026
2360
|
}
|
|
2027
2361
|
}
|
|
2028
2362
|
if (valueContent) {
|
|
2029
|
-
result.value = createAliasExpression(valueContent, trimmedOffset);
|
|
2363
|
+
result.value = createAliasExpression(valueContent, trimmedOffset, true);
|
|
2030
2364
|
}
|
|
2031
2365
|
return result;
|
|
2032
2366
|
}
|
|
@@ -2104,7 +2438,7 @@ function onCloseTag(el, end, isImplied = false) {
|
|
|
2104
2438
|
inPre--;
|
|
2105
2439
|
}
|
|
2106
2440
|
if (currentVPreBoundary === el) {
|
|
2107
|
-
inVPre = false;
|
|
2441
|
+
inVPre = tokenizer.inVPre = false;
|
|
2108
2442
|
currentVPreBoundary = null;
|
|
2109
2443
|
}
|
|
2110
2444
|
if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) {
|
|
@@ -2339,8 +2673,14 @@ function dirToAttr(dir) {
|
|
|
2339
2673
|
}
|
|
2340
2674
|
return attr;
|
|
2341
2675
|
}
|
|
2342
|
-
function
|
|
2343
|
-
|
|
2676
|
+
function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) {
|
|
2677
|
+
const exp = createSimpleExpression(content, isStatic, loc, constType);
|
|
2678
|
+
return exp;
|
|
2679
|
+
}
|
|
2680
|
+
function emitError(code, index, message) {
|
|
2681
|
+
currentOptions.onError(
|
|
2682
|
+
createCompilerError(code, getLoc(index, index), void 0, message)
|
|
2683
|
+
);
|
|
2344
2684
|
}
|
|
2345
2685
|
function reset() {
|
|
2346
2686
|
tokenizer.reset();
|
|
@@ -2371,6 +2711,7 @@ function baseParse(input, options) {
|
|
|
2371
2711
|
}
|
|
2372
2712
|
}
|
|
2373
2713
|
tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0;
|
|
2714
|
+
tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2;
|
|
2374
2715
|
const delimiters = options == null ? void 0 : options.delimiters;
|
|
2375
2716
|
if (delimiters) {
|
|
2376
2717
|
tokenizer.delimiterOpen = toCharCodes(delimiters[0]);
|
|
@@ -2655,6 +2996,7 @@ function createTransformContext(root, {
|
|
|
2655
2996
|
const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/);
|
|
2656
2997
|
const context = {
|
|
2657
2998
|
// options
|
|
2999
|
+
filename,
|
|
2658
3000
|
selfName: nameMatch && capitalize(camelize(nameMatch[1])),
|
|
2659
3001
|
prefixIdentifiers,
|
|
2660
3002
|
hoistStatic: hoistStatic2,
|
|
@@ -3487,117 +3829,6 @@ function genCacheExpression(node, context) {
|
|
|
3487
3829
|
push(`)`);
|
|
3488
3830
|
}
|
|
3489
3831
|
|
|
3490
|
-
function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {
|
|
3491
|
-
{
|
|
3492
|
-
return;
|
|
3493
|
-
}
|
|
3494
|
-
}
|
|
3495
|
-
function isReferencedIdentifier(id, parent, parentStack) {
|
|
3496
|
-
{
|
|
3497
|
-
return false;
|
|
3498
|
-
}
|
|
3499
|
-
}
|
|
3500
|
-
function isInDestructureAssignment(parent, parentStack) {
|
|
3501
|
-
if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) {
|
|
3502
|
-
let i = parentStack.length;
|
|
3503
|
-
while (i--) {
|
|
3504
|
-
const p = parentStack[i];
|
|
3505
|
-
if (p.type === "AssignmentExpression") {
|
|
3506
|
-
return true;
|
|
3507
|
-
} else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) {
|
|
3508
|
-
break;
|
|
3509
|
-
}
|
|
3510
|
-
}
|
|
3511
|
-
}
|
|
3512
|
-
return false;
|
|
3513
|
-
}
|
|
3514
|
-
function walkFunctionParams(node, onIdent) {
|
|
3515
|
-
for (const p of node.params) {
|
|
3516
|
-
for (const id of extractIdentifiers(p)) {
|
|
3517
|
-
onIdent(id);
|
|
3518
|
-
}
|
|
3519
|
-
}
|
|
3520
|
-
}
|
|
3521
|
-
function walkBlockDeclarations(block, onIdent) {
|
|
3522
|
-
for (const stmt of block.body) {
|
|
3523
|
-
if (stmt.type === "VariableDeclaration") {
|
|
3524
|
-
if (stmt.declare)
|
|
3525
|
-
continue;
|
|
3526
|
-
for (const decl of stmt.declarations) {
|
|
3527
|
-
for (const id of extractIdentifiers(decl.id)) {
|
|
3528
|
-
onIdent(id);
|
|
3529
|
-
}
|
|
3530
|
-
}
|
|
3531
|
-
} else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") {
|
|
3532
|
-
if (stmt.declare || !stmt.id)
|
|
3533
|
-
continue;
|
|
3534
|
-
onIdent(stmt.id);
|
|
3535
|
-
} else if (stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement") {
|
|
3536
|
-
const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
|
|
3537
|
-
if (variable && variable.type === "VariableDeclaration") {
|
|
3538
|
-
for (const decl of variable.declarations) {
|
|
3539
|
-
for (const id of extractIdentifiers(decl.id)) {
|
|
3540
|
-
onIdent(id);
|
|
3541
|
-
}
|
|
3542
|
-
}
|
|
3543
|
-
}
|
|
3544
|
-
}
|
|
3545
|
-
}
|
|
3546
|
-
}
|
|
3547
|
-
function extractIdentifiers(param, nodes = []) {
|
|
3548
|
-
switch (param.type) {
|
|
3549
|
-
case "Identifier":
|
|
3550
|
-
nodes.push(param);
|
|
3551
|
-
break;
|
|
3552
|
-
case "MemberExpression":
|
|
3553
|
-
let object = param;
|
|
3554
|
-
while (object.type === "MemberExpression") {
|
|
3555
|
-
object = object.object;
|
|
3556
|
-
}
|
|
3557
|
-
nodes.push(object);
|
|
3558
|
-
break;
|
|
3559
|
-
case "ObjectPattern":
|
|
3560
|
-
for (const prop of param.properties) {
|
|
3561
|
-
if (prop.type === "RestElement") {
|
|
3562
|
-
extractIdentifiers(prop.argument, nodes);
|
|
3563
|
-
} else {
|
|
3564
|
-
extractIdentifiers(prop.value, nodes);
|
|
3565
|
-
}
|
|
3566
|
-
}
|
|
3567
|
-
break;
|
|
3568
|
-
case "ArrayPattern":
|
|
3569
|
-
param.elements.forEach((element) => {
|
|
3570
|
-
if (element)
|
|
3571
|
-
extractIdentifiers(element, nodes);
|
|
3572
|
-
});
|
|
3573
|
-
break;
|
|
3574
|
-
case "RestElement":
|
|
3575
|
-
extractIdentifiers(param.argument, nodes);
|
|
3576
|
-
break;
|
|
3577
|
-
case "AssignmentPattern":
|
|
3578
|
-
extractIdentifiers(param.left, nodes);
|
|
3579
|
-
break;
|
|
3580
|
-
}
|
|
3581
|
-
return nodes;
|
|
3582
|
-
}
|
|
3583
|
-
const isFunctionType = (node) => {
|
|
3584
|
-
return /Function(?:Expression|Declaration)$|Method$/.test(node.type);
|
|
3585
|
-
};
|
|
3586
|
-
const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed;
|
|
3587
|
-
const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;
|
|
3588
|
-
const TS_NODE_TYPES = [
|
|
3589
|
-
"TSAsExpression",
|
|
3590
|
-
// foo as number
|
|
3591
|
-
"TSTypeAssertion",
|
|
3592
|
-
// (<number>foo)
|
|
3593
|
-
"TSNonNullExpression",
|
|
3594
|
-
// foo!
|
|
3595
|
-
"TSInstantiationExpression",
|
|
3596
|
-
// foo<string>
|
|
3597
|
-
"TSSatisfiesExpression"
|
|
3598
|
-
// foo satisfies T
|
|
3599
|
-
];
|
|
3600
|
-
|
|
3601
3832
|
const prohibitedKeywordRE = new RegExp(
|
|
3602
3833
|
"\\b" + "arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b") + "\\b"
|
|
3603
3834
|
);
|
|
@@ -4556,6 +4787,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
4556
4787
|
if (isEventHandler && isReservedProp(name)) {
|
|
4557
4788
|
hasVnodeHook = true;
|
|
4558
4789
|
}
|
|
4790
|
+
if (isEventHandler && value.type === 14) {
|
|
4791
|
+
value = value.arguments[0];
|
|
4792
|
+
}
|
|
4559
4793
|
if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
|
|
4560
4794
|
return;
|
|
4561
4795
|
}
|
|
@@ -5008,9 +5242,7 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
5008
5242
|
if (arg.isStatic) {
|
|
5009
5243
|
let rawName = arg.content;
|
|
5010
5244
|
if (rawName.startsWith("vnode")) {
|
|
5011
|
-
context.
|
|
5012
|
-
createCompilerError(51, arg.loc)
|
|
5013
|
-
);
|
|
5245
|
+
context.onError(createCompilerError(51, arg.loc));
|
|
5014
5246
|
}
|
|
5015
5247
|
if (rawName.startsWith("vue:")) {
|
|
5016
5248
|
rawName = `vnode-${rawName.slice(4)}`;
|
|
@@ -5503,12 +5735,14 @@ function baseCompile(source, options = {}) {
|
|
|
5503
5735
|
if (options.scopeId && !isModuleMode) {
|
|
5504
5736
|
onError(createCompilerError(50));
|
|
5505
5737
|
}
|
|
5506
|
-
const
|
|
5738
|
+
const resolvedOptions = extend({}, options, {
|
|
5739
|
+
prefixIdentifiers
|
|
5740
|
+
});
|
|
5741
|
+
const ast = isString(source) ? baseParse(source, resolvedOptions) : source;
|
|
5507
5742
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
|
|
5508
5743
|
transform(
|
|
5509
5744
|
ast,
|
|
5510
|
-
extend({},
|
|
5511
|
-
prefixIdentifiers,
|
|
5745
|
+
extend({}, resolvedOptions, {
|
|
5512
5746
|
nodeTransforms: [
|
|
5513
5747
|
...nodeTransforms,
|
|
5514
5748
|
...options.nodeTransforms || []
|
|
@@ -5522,14 +5756,22 @@ function baseCompile(source, options = {}) {
|
|
|
5522
5756
|
)
|
|
5523
5757
|
})
|
|
5524
5758
|
);
|
|
5525
|
-
return generate(
|
|
5526
|
-
ast,
|
|
5527
|
-
extend({}, options, {
|
|
5528
|
-
prefixIdentifiers
|
|
5529
|
-
})
|
|
5530
|
-
);
|
|
5759
|
+
return generate(ast, resolvedOptions);
|
|
5531
5760
|
}
|
|
5532
5761
|
|
|
5762
|
+
const BindingTypes = {
|
|
5763
|
+
"DATA": "data",
|
|
5764
|
+
"PROPS": "props",
|
|
5765
|
+
"PROPS_ALIASED": "props-aliased",
|
|
5766
|
+
"SETUP_LET": "setup-let",
|
|
5767
|
+
"SETUP_CONST": "setup-const",
|
|
5768
|
+
"SETUP_REACTIVE_CONST": "setup-reactive-const",
|
|
5769
|
+
"SETUP_MAYBE_REF": "setup-maybe-ref",
|
|
5770
|
+
"SETUP_REF": "setup-ref",
|
|
5771
|
+
"OPTIONS": "options",
|
|
5772
|
+
"LITERAL_CONST": "literal-const"
|
|
5773
|
+
};
|
|
5774
|
+
|
|
5533
5775
|
const noopDirectiveTransform = () => ({ props: [] });
|
|
5534
5776
|
|
|
5535
5777
|
const V_MODEL_RADIO = Symbol(`vModelRadio` );
|
|
@@ -5572,7 +5814,7 @@ function decodeHtmlBrowser(raw, asAttr = false) {
|
|
|
5572
5814
|
const parserOptions = {
|
|
5573
5815
|
parseMode: "html",
|
|
5574
5816
|
isVoidTag,
|
|
5575
|
-
isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag),
|
|
5817
|
+
isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
|
|
5576
5818
|
isPreTag: (tag) => tag === "pre",
|
|
5577
5819
|
decodeEntities: decodeHtmlBrowser ,
|
|
5578
5820
|
isBuiltInComponent: (tag) => {
|
|
@@ -5648,6 +5890,32 @@ function createDOMCompilerError(code, loc) {
|
|
|
5648
5890
|
DOMErrorMessages
|
|
5649
5891
|
);
|
|
5650
5892
|
}
|
|
5893
|
+
const DOMErrorCodes = {
|
|
5894
|
+
"X_V_HTML_NO_EXPRESSION": 53,
|
|
5895
|
+
"53": "X_V_HTML_NO_EXPRESSION",
|
|
5896
|
+
"X_V_HTML_WITH_CHILDREN": 54,
|
|
5897
|
+
"54": "X_V_HTML_WITH_CHILDREN",
|
|
5898
|
+
"X_V_TEXT_NO_EXPRESSION": 55,
|
|
5899
|
+
"55": "X_V_TEXT_NO_EXPRESSION",
|
|
5900
|
+
"X_V_TEXT_WITH_CHILDREN": 56,
|
|
5901
|
+
"56": "X_V_TEXT_WITH_CHILDREN",
|
|
5902
|
+
"X_V_MODEL_ON_INVALID_ELEMENT": 57,
|
|
5903
|
+
"57": "X_V_MODEL_ON_INVALID_ELEMENT",
|
|
5904
|
+
"X_V_MODEL_ARG_ON_ELEMENT": 58,
|
|
5905
|
+
"58": "X_V_MODEL_ARG_ON_ELEMENT",
|
|
5906
|
+
"X_V_MODEL_ON_FILE_INPUT_ELEMENT": 59,
|
|
5907
|
+
"59": "X_V_MODEL_ON_FILE_INPUT_ELEMENT",
|
|
5908
|
+
"X_V_MODEL_UNNECESSARY_VALUE": 60,
|
|
5909
|
+
"60": "X_V_MODEL_UNNECESSARY_VALUE",
|
|
5910
|
+
"X_V_SHOW_NO_EXPRESSION": 61,
|
|
5911
|
+
"61": "X_V_SHOW_NO_EXPRESSION",
|
|
5912
|
+
"X_TRANSITION_INVALID_CHILDREN": 62,
|
|
5913
|
+
"62": "X_TRANSITION_INVALID_CHILDREN",
|
|
5914
|
+
"X_IGNORED_SIDE_EFFECT_TAG": 63,
|
|
5915
|
+
"63": "X_IGNORED_SIDE_EFFECT_TAG",
|
|
5916
|
+
"__EXTEND_POINT__": 64,
|
|
5917
|
+
"64": "__EXTEND_POINT__"
|
|
5918
|
+
};
|
|
5651
5919
|
const DOMErrorMessages = {
|
|
5652
5920
|
[53]: `v-html is missing expression.`,
|
|
5653
5921
|
[54]: `v-html will override element children.`,
|
|
@@ -6002,4 +6270,4 @@ function parse(template, options = {}) {
|
|
|
6002
6270
|
return baseParse(template, extend({}, parserOptions, options));
|
|
6003
6271
|
}
|
|
6004
6272
|
|
|
6005
|
-
export { BASE_TRANSITION, CAMELIZE, CAPITALIZE, CREATE_BLOCK, CREATE_COMMENT, CREATE_ELEMENT_BLOCK, CREATE_ELEMENT_VNODE, CREATE_SLOTS, CREATE_STATIC, CREATE_TEXT, CREATE_VNODE, DOMDirectiveTransforms, DOMErrorMessages, DOMNodeTransforms, FRAGMENT, GUARD_REACTIVE_PROPS, IS_MEMO_SAME, IS_REF, KEEP_ALIVE, MERGE_PROPS, NORMALIZE_CLASS, NORMALIZE_PROPS, NORMALIZE_STYLE, 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, TRANSITION, TRANSITION_GROUP, TS_NODE_TYPES, UNREF, V_MODEL_CHECKBOX, V_MODEL_DYNAMIC, V_MODEL_RADIO, V_MODEL_SELECT, V_MODEL_TEXT, V_ON_WITH_KEYS, V_ON_WITH_MODIFIERS, V_SHOW, WITH_CTX, WITH_DIRECTIVES, WITH_MEMO, advancePositionWithClone, advancePositionWithMutation, assert, baseCompile, baseParse, buildDirectiveArgs, buildProps, buildSlots, checkCompatEnabled, compile, convertToBlock, createArrayExpression, createAssignmentExpression, createBlockStatement, createCacheExpression, createCallExpression, createCompilerError, createCompoundExpression, createConditionalExpression, createDOMCompilerError, createForLoopParams, createFunctionExpression, createIfStatement, createInterpolation, createObjectExpression, createObjectProperty, createReturnStatement, createRoot, createSequenceExpression, createSimpleExpression, createStructuralDirectiveTransform, createTemplateLiteral, createTransformContext, createVNodeCall, errorMessages, extractIdentifiers, findDir, findProp, forAliasRE, generate, generateCodeFrame, getBaseTransformPreset, getConstantType, getMemoedVNodeCall, getVNodeBlockHelper, getVNodeHelper, hasDynamicKeyVBind, hasScopeRef, helperNameMap, injectProp, isCoreComponent, isFunctionType, isInDestructureAssignment, isMemberExpression, isMemberExpressionBrowser, isMemberExpressionNode, isReferencedIdentifier, isSimpleIdentifier, isSlotOutlet, isStaticArgOf, isStaticExp, isStaticProperty, isStaticPropertyKey, isTemplateNode, isText$1 as isText, isVSlot, locStub, noopDirectiveTransform, parse, parserOptions, processExpression, processFor, processIf, processSlotOutlet, registerRuntimeHelpers, resolveComponentType, stringifyExpression, toValidAssetId, trackSlotScopes, trackVForSlotScopes, transform, transformBind, transformElement, transformExpression, transformModel$1 as transformModel, transformOn$1 as transformOn, transformStyle, traverseNode, walkBlockDeclarations, walkFunctionParams, walkIdentifiers, warnDeprecation };
|
|
6273
|
+
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, DOMDirectiveTransforms, DOMErrorCodes, DOMErrorMessages, DOMNodeTransforms, 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, TRANSITION, TRANSITION_GROUP, TS_NODE_TYPES, UNREF, V_MODEL_CHECKBOX, V_MODEL_DYNAMIC, V_MODEL_RADIO, V_MODEL_SELECT, V_MODEL_TEXT, V_ON_WITH_KEYS, V_ON_WITH_MODIFIERS, V_SHOW, WITH_CTX, WITH_DIRECTIVES, WITH_MEMO, advancePositionWithClone, advancePositionWithMutation, assert, baseCompile, baseParse, buildDirectiveArgs, buildProps, buildSlots, checkCompatEnabled, compile, convertToBlock, createArrayExpression, createAssignmentExpression, createBlockStatement, createCacheExpression, createCallExpression, createCompilerError, createCompoundExpression, createConditionalExpression, createDOMCompilerError, createForLoopParams, createFunctionExpression, createIfStatement, createInterpolation, createObjectExpression, createObjectProperty, createReturnStatement, createRoot, createSequenceExpression, createSimpleExpression, createStructuralDirectiveTransform, createTemplateLiteral, createTransformContext, createVNodeCall, errorMessages, extractIdentifiers, findDir, findProp, forAliasRE, generate, generateCodeFrame, getBaseTransformPreset, getConstantType, getMemoedVNodeCall, getVNodeBlockHelper, getVNodeHelper, hasDynamicKeyVBind, hasScopeRef, helperNameMap, injectProp, isCoreComponent, isFunctionType, isInDestructureAssignment, isMemberExpression, isMemberExpressionBrowser, isMemberExpressionNode, isReferencedIdentifier, isSimpleIdentifier, isSlotOutlet, isStaticArgOf, isStaticExp, isStaticProperty, isStaticPropertyKey, isTemplateNode, isText$1 as isText, isVSlot, locStub, noopDirectiveTransform, parse, parserOptions, processExpression, processFor, processIf, processSlotOutlet, registerRuntimeHelpers, resolveComponentType, stringifyExpression, toValidAssetId, trackSlotScopes, trackVForSlotScopes, transform, transformBind, transformElement, transformExpression, transformModel$1 as transformModel, transformOn$1 as transformOn, transformStyle, traverseNode, unwrapTSNode, walkBlockDeclarations, walkFunctionParams, walkIdentifiers, warnDeprecation };
|