@vue/compat 3.4.0-alpha.3 → 3.4.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,8 +8,8 @@ const EMPTY_ARR = Object.freeze([]) ;
8
8
  const NOOP = () => {
9
9
  };
10
10
  const NO = () => false;
11
- const onRE = /^on[^a-z]/;
12
- const isOn = (key) => onRE.test(key);
11
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
12
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
13
13
  const isModelListener = (key) => key.startsWith("onUpdate:");
14
14
  const extend = Object.assign;
15
15
  const remove = (arr, el) => {
@@ -117,7 +117,7 @@ const slotFlagsText = {
117
117
  [3]: "FORWARDED"
118
118
  };
119
119
 
120
- const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
120
+ const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error";
121
121
  const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
122
122
 
123
123
  const range = 2;
@@ -1498,6 +1498,18 @@ function propertyToRef(source, key, defaultValue) {
1498
1498
  return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1499
1499
  }
1500
1500
 
1501
+ const TrackOpTypes = {
1502
+ "GET": "get",
1503
+ "HAS": "has",
1504
+ "ITERATE": "iterate"
1505
+ };
1506
+ const TriggerOpTypes = {
1507
+ "SET": "set",
1508
+ "ADD": "add",
1509
+ "DELETE": "delete",
1510
+ "CLEAR": "clear"
1511
+ };
1512
+
1501
1513
  const stack$1 = [];
1502
1514
  function pushWarningContext(vnode) {
1503
1515
  stack$1.push(vnode);
@@ -1612,6 +1624,38 @@ function assertNumber(val, type) {
1612
1624
  }
1613
1625
  }
1614
1626
 
1627
+ const ErrorCodes = {
1628
+ "SETUP_FUNCTION": 0,
1629
+ "0": "SETUP_FUNCTION",
1630
+ "RENDER_FUNCTION": 1,
1631
+ "1": "RENDER_FUNCTION",
1632
+ "WATCH_GETTER": 2,
1633
+ "2": "WATCH_GETTER",
1634
+ "WATCH_CALLBACK": 3,
1635
+ "3": "WATCH_CALLBACK",
1636
+ "WATCH_CLEANUP": 4,
1637
+ "4": "WATCH_CLEANUP",
1638
+ "NATIVE_EVENT_HANDLER": 5,
1639
+ "5": "NATIVE_EVENT_HANDLER",
1640
+ "COMPONENT_EVENT_HANDLER": 6,
1641
+ "6": "COMPONENT_EVENT_HANDLER",
1642
+ "VNODE_HOOK": 7,
1643
+ "7": "VNODE_HOOK",
1644
+ "DIRECTIVE_HOOK": 8,
1645
+ "8": "DIRECTIVE_HOOK",
1646
+ "TRANSITION_HOOK": 9,
1647
+ "9": "TRANSITION_HOOK",
1648
+ "APP_ERROR_HANDLER": 10,
1649
+ "10": "APP_ERROR_HANDLER",
1650
+ "APP_WARN_HANDLER": 11,
1651
+ "11": "APP_WARN_HANDLER",
1652
+ "FUNCTION_REF": 12,
1653
+ "12": "FUNCTION_REF",
1654
+ "ASYNC_COMPONENT_LOADER": 13,
1655
+ "13": "ASYNC_COMPONENT_LOADER",
1656
+ "SCHEDULER": 14,
1657
+ "14": "SCHEDULER"
1658
+ };
1615
1659
  const ErrorTypeStrings$1 = {
1616
1660
  ["sp"]: "serverPrefetch hook",
1617
1661
  ["bc"]: "beforeCreate hook",
@@ -2094,6 +2138,50 @@ function devtoolsComponentEmit(component, event, params) {
2094
2138
  );
2095
2139
  }
2096
2140
 
2141
+ const DeprecationTypes$1 = {
2142
+ "GLOBAL_MOUNT": "GLOBAL_MOUNT",
2143
+ "GLOBAL_MOUNT_CONTAINER": "GLOBAL_MOUNT_CONTAINER",
2144
+ "GLOBAL_EXTEND": "GLOBAL_EXTEND",
2145
+ "GLOBAL_PROTOTYPE": "GLOBAL_PROTOTYPE",
2146
+ "GLOBAL_SET": "GLOBAL_SET",
2147
+ "GLOBAL_DELETE": "GLOBAL_DELETE",
2148
+ "GLOBAL_OBSERVABLE": "GLOBAL_OBSERVABLE",
2149
+ "GLOBAL_PRIVATE_UTIL": "GLOBAL_PRIVATE_UTIL",
2150
+ "CONFIG_SILENT": "CONFIG_SILENT",
2151
+ "CONFIG_DEVTOOLS": "CONFIG_DEVTOOLS",
2152
+ "CONFIG_KEY_CODES": "CONFIG_KEY_CODES",
2153
+ "CONFIG_PRODUCTION_TIP": "CONFIG_PRODUCTION_TIP",
2154
+ "CONFIG_IGNORED_ELEMENTS": "CONFIG_IGNORED_ELEMENTS",
2155
+ "CONFIG_WHITESPACE": "CONFIG_WHITESPACE",
2156
+ "CONFIG_OPTION_MERGE_STRATS": "CONFIG_OPTION_MERGE_STRATS",
2157
+ "INSTANCE_SET": "INSTANCE_SET",
2158
+ "INSTANCE_DELETE": "INSTANCE_DELETE",
2159
+ "INSTANCE_DESTROY": "INSTANCE_DESTROY",
2160
+ "INSTANCE_EVENT_EMITTER": "INSTANCE_EVENT_EMITTER",
2161
+ "INSTANCE_EVENT_HOOKS": "INSTANCE_EVENT_HOOKS",
2162
+ "INSTANCE_CHILDREN": "INSTANCE_CHILDREN",
2163
+ "INSTANCE_LISTENERS": "INSTANCE_LISTENERS",
2164
+ "INSTANCE_SCOPED_SLOTS": "INSTANCE_SCOPED_SLOTS",
2165
+ "INSTANCE_ATTRS_CLASS_STYLE": "INSTANCE_ATTRS_CLASS_STYLE",
2166
+ "OPTIONS_DATA_FN": "OPTIONS_DATA_FN",
2167
+ "OPTIONS_DATA_MERGE": "OPTIONS_DATA_MERGE",
2168
+ "OPTIONS_BEFORE_DESTROY": "OPTIONS_BEFORE_DESTROY",
2169
+ "OPTIONS_DESTROYED": "OPTIONS_DESTROYED",
2170
+ "WATCH_ARRAY": "WATCH_ARRAY",
2171
+ "PROPS_DEFAULT_THIS": "PROPS_DEFAULT_THIS",
2172
+ "V_ON_KEYCODE_MODIFIER": "V_ON_KEYCODE_MODIFIER",
2173
+ "CUSTOM_DIR": "CUSTOM_DIR",
2174
+ "ATTR_FALSE_VALUE": "ATTR_FALSE_VALUE",
2175
+ "ATTR_ENUMERATED_COERCION": "ATTR_ENUMERATED_COERCION",
2176
+ "TRANSITION_CLASSES": "TRANSITION_CLASSES",
2177
+ "TRANSITION_GROUP_ROOT": "TRANSITION_GROUP_ROOT",
2178
+ "COMPONENT_ASYNC": "COMPONENT_ASYNC",
2179
+ "COMPONENT_FUNCTIONAL": "COMPONENT_FUNCTIONAL",
2180
+ "COMPONENT_V_MODEL": "COMPONENT_V_MODEL",
2181
+ "RENDER_FUNCTION": "RENDER_FUNCTION",
2182
+ "FILTERS": "FILTERS",
2183
+ "PRIVATE_APIS": "PRIVATE_APIS"
2184
+ };
2097
2185
  const deprecationData$1 = {
2098
2186
  ["GLOBAL_MOUNT"]: {
2099
2187
  message: `The global app bootstrapping API has changed: vm.$mount() and the "el" option have been removed. Use createApp(RootComponent).mount() instead.`,
@@ -3408,7 +3496,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3408
3496
  if (delayEnter) {
3409
3497
  activeBranch.transition.afterLeave = () => {
3410
3498
  if (pendingId === suspense.pendingId) {
3411
- move(pendingBranch, container2, anchor2, 0);
3499
+ move(
3500
+ pendingBranch,
3501
+ container2,
3502
+ next(activeBranch),
3503
+ 0
3504
+ );
3412
3505
  queuePostFlushCb(effects);
3413
3506
  }
3414
3507
  };
@@ -3455,7 +3548,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3455
3548
  }
3456
3549
  const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
3457
3550
  triggerEvent(vnode2, "onFallback");
3458
- const anchor2 = next(activeBranch);
3459
3551
  const mountFallback = () => {
3460
3552
  if (!suspense.isInFallback) {
3461
3553
  return;
@@ -3464,7 +3556,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3464
3556
  null,
3465
3557
  fallbackVNode,
3466
3558
  container2,
3467
- anchor2,
3559
+ next(activeBranch),
3468
3560
  parentComponent2,
3469
3561
  null,
3470
3562
  // fallback tree will not have suspense context
@@ -6322,7 +6414,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6322
6414
  return vm;
6323
6415
  }
6324
6416
  }
6325
- Vue.version = `2.6.14-compat:${"3.4.0-alpha.3"}`;
6417
+ Vue.version = `2.6.14-compat:${"3.4.0-alpha.4"}`;
6326
6418
  Vue.config = singletonApp.config;
6327
6419
  Vue.use = (p, ...options) => {
6328
6420
  if (p && isFunction(p.install)) {
@@ -6723,18 +6815,6 @@ function createAppAPI(render, hydrate) {
6723
6815
  rootProps = null;
6724
6816
  }
6725
6817
  const context = createAppContext();
6726
- {
6727
- Object.defineProperty(context.config, "unwrapInjectedRef", {
6728
- get() {
6729
- return true;
6730
- },
6731
- set() {
6732
- warn(
6733
- `app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.`
6734
- );
6735
- }
6736
- });
6737
- }
6738
6818
  const installedPlugins = /* @__PURE__ */ new WeakSet();
6739
6819
  let isMounted = false;
6740
6820
  const app = context.app = {
@@ -10725,9 +10805,9 @@ function initCustomFormatter() {
10725
10805
  return;
10726
10806
  }
10727
10807
  const vueStyle = { style: "color:#3ba776" };
10728
- const numberStyle = { style: "color:#0b1bc9" };
10729
- const stringStyle = { style: "color:#b62e24" };
10730
- const keywordStyle = { style: "color:#9d288c" };
10808
+ const numberStyle = { style: "color:#1677ff" };
10809
+ const stringStyle = { style: "color:#f5222d" };
10810
+ const keywordStyle = { style: "color:#eb2f96" };
10731
10811
  const formatter = {
10732
10812
  header(obj) {
10733
10813
  if (!isObject(obj)) {
@@ -10921,7 +11001,7 @@ function isMemoSame(cached, memo) {
10921
11001
  return true;
10922
11002
  }
10923
11003
 
10924
- const version = "3.4.0-alpha.3";
11004
+ const version = "3.4.0-alpha.4";
10925
11005
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10926
11006
  const ssrUtils = null;
10927
11007
  const resolveFilter = resolveFilter$1 ;
@@ -10933,6 +11013,7 @@ const _compatUtils = {
10933
11013
  softAssertCompatEnabled
10934
11014
  };
10935
11015
  const compatUtils = _compatUtils ;
11016
+ const DeprecationTypes = DeprecationTypes$1 ;
10936
11017
 
10937
11018
  const svgNS = "http://www.w3.org/2000/svg";
10938
11019
  const doc = typeof document !== "undefined" ? document : null;
@@ -11621,7 +11702,8 @@ function patchStopImmediatePropagation(e, value) {
11621
11702
  }
11622
11703
  }
11623
11704
 
11624
- const nativeOnRE = /^on[a-z]/;
11705
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11706
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
11625
11707
  const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11626
11708
  if (key === "class") {
11627
11709
  patchClass(el, nextValue, isSVG);
@@ -11655,7 +11737,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
11655
11737
  if (key === "innerHTML" || key === "textContent") {
11656
11738
  return true;
11657
11739
  }
11658
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
11740
+ if (key in el && isNativeOn(key) && isFunction(value)) {
11659
11741
  return true;
11660
11742
  }
11661
11743
  return false;
@@ -11672,7 +11754,11 @@ function shouldSetAsProp(el, key, value, isSVG) {
11672
11754
  if (key === "type" && el.tagName === "TEXTAREA") {
11673
11755
  return false;
11674
11756
  }
11675
- if (nativeOnRE.test(key) && isString(value)) {
11757
+ if (key === "width" || key === "height") {
11758
+ const tag = el.tagName;
11759
+ return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE");
11760
+ }
11761
+ if (isNativeOn(key) && isString(value)) {
11676
11762
  return false;
11677
11763
  }
11678
11764
  return key in el;
@@ -12362,14 +12448,14 @@ const modifierGuards = {
12362
12448
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
12363
12449
  };
12364
12450
  const withModifiers = (fn, modifiers) => {
12365
- return (event, ...args) => {
12451
+ return fn._withMods || (fn._withMods = (event, ...args) => {
12366
12452
  for (let i = 0; i < modifiers.length; i++) {
12367
12453
  const guard = modifierGuards[modifiers[i]];
12368
12454
  if (guard && guard(event, modifiers))
12369
12455
  return;
12370
12456
  }
12371
12457
  return fn(event, ...args);
12372
- };
12458
+ });
12373
12459
  };
12374
12460
  const keyNames = {
12375
12461
  esc: "escape",
@@ -12397,7 +12483,7 @@ const withKeys = (fn, modifiers) => {
12397
12483
  );
12398
12484
  }
12399
12485
  }
12400
- return (event) => {
12486
+ return fn._withKeys || (fn._withKeys = (event) => {
12401
12487
  if (!("key" in event)) {
12402
12488
  return;
12403
12489
  }
@@ -12425,7 +12511,7 @@ const withKeys = (fn, modifiers) => {
12425
12511
  }
12426
12512
  }
12427
12513
  }
12428
- };
12514
+ });
12429
12515
  };
12430
12516
 
12431
12517
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -12556,7 +12642,9 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
12556
12642
  BaseTransition: BaseTransition,
12557
12643
  BaseTransitionPropsValidators: BaseTransitionPropsValidators,
12558
12644
  Comment: Comment,
12645
+ DeprecationTypes: DeprecationTypes,
12559
12646
  EffectScope: EffectScope,
12647
+ ErrorCodes: ErrorCodes,
12560
12648
  ErrorTypeStrings: ErrorTypeStrings,
12561
12649
  Fragment: Fragment,
12562
12650
  KeepAlive: KeepAlive,
@@ -12565,8 +12653,10 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
12565
12653
  Suspense: Suspense,
12566
12654
  Teleport: Teleport,
12567
12655
  Text: Text,
12656
+ TrackOpTypes: TrackOpTypes,
12568
12657
  Transition: Transition,
12569
12658
  TransitionGroup: TransitionGroup,
12659
+ TriggerOpTypes: TriggerOpTypes,
12570
12660
  VueElement: VueElement,
12571
12661
  assertNumber: assertNumber,
12572
12662
  callWithAsyncErrorHandling: callWithAsyncErrorHandling,
@@ -13038,7 +13128,9 @@ class Tokenizer {
13038
13128
  this.inRCDATA = false;
13039
13129
  /** For disabling RCDATA tags handling */
13040
13130
  this.inXML = false;
13041
- /** Reocrd newline positions for fast line / column calculation */
13131
+ /** For disabling interpolation parsing in v-pre */
13132
+ this.inVPre = false;
13133
+ /** Record newline positions for fast line / column calculation */
13042
13134
  this.newlines = [];
13043
13135
  this.mode = 0;
13044
13136
  this.delimiterOpen = defaultDelimitersOpen;
@@ -13057,6 +13149,7 @@ class Tokenizer {
13057
13149
  this.sectionStart = 0;
13058
13150
  this.index = 0;
13059
13151
  this.baseState = 1;
13152
+ this.inRCDATA = false;
13060
13153
  this.currentSequence = void 0;
13061
13154
  this.newlines.length = 0;
13062
13155
  this.delimiterOpen = defaultDelimitersOpen;
@@ -13095,7 +13188,7 @@ class Tokenizer {
13095
13188
  }
13096
13189
  this.state = 5;
13097
13190
  this.sectionStart = this.index;
13098
- } else if (c === this.delimiterOpen[0]) {
13191
+ } else if (!this.inVPre && c === this.delimiterOpen[0]) {
13099
13192
  this.state = 2;
13100
13193
  this.delimiterIndex = 0;
13101
13194
  this.stateInterpolationOpen(c);
@@ -13910,16 +14003,14 @@ const errorMessages = {
13910
14003
  Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
13911
14004
  [45]: `Error parsing JavaScript expression: `,
13912
14005
  [46]: `<KeepAlive> expects exactly one child component.`,
14006
+ [47]: `@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.`,
13913
14007
  // generic errors
13914
- [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
13915
- [48]: `ES module mode is not supported in this build of compiler.`,
13916
- [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
13917
- [50]: `"scopeId" option is only supported in module mode.`,
13918
- // deprecations
13919
- [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.`,
13920
- [52]: `v-is="component-name" has been deprecated. Use is="vue:component-name" instead. v-is support will be removed in 3.4.`,
14008
+ [48]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
14009
+ [49]: `ES module mode is not supported in this build of compiler.`,
14010
+ [50]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
14011
+ [51]: `"scopeId" option is only supported in module mode.`,
13921
14012
  // just to fulfill types
13922
- [53]: ``
14013
+ [52]: ``
13923
14014
  };
13924
14015
 
13925
14016
  const isStaticExp = (p) => p.type === 4 && p.isStatic;
@@ -14162,7 +14253,8 @@ const defaultParserOptions = {
14162
14253
  isCustomElement: NO,
14163
14254
  onError: defaultOnError,
14164
14255
  onWarn: defaultOnWarn,
14165
- comments: true
14256
+ comments: true,
14257
+ prefixIdentifiers: false
14166
14258
  };
14167
14259
  let currentOptions = defaultParserOptions;
14168
14260
  let currentRoot = null;
@@ -14204,7 +14296,7 @@ const tokenizer = new Tokenizer(stack, {
14204
14296
  }
14205
14297
  addNode({
14206
14298
  type: 5,
14207
- content: createSimpleExpression(exp, false, getLoc(innerStart, innerEnd)),
14299
+ content: createExp(exp, false, getLoc(innerStart, innerEnd)),
14208
14300
  loc: getLoc(start, end)
14209
14301
  });
14210
14302
  },
@@ -14297,7 +14389,7 @@ const tokenizer = new Tokenizer(stack, {
14297
14389
  loc: getLoc(start)
14298
14390
  };
14299
14391
  if (name === "pre") {
14300
- inVPre = true;
14392
+ inVPre = tokenizer.inVPre = true;
14301
14393
  currentVPreBoundary = currentOpenTag;
14302
14394
  const props = currentOpenTag.props;
14303
14395
  for (let i = 0; i < props.length; i++) {
@@ -14317,7 +14409,7 @@ const tokenizer = new Tokenizer(stack, {
14317
14409
  setLocEnd(currentProp.nameLoc, end);
14318
14410
  } else {
14319
14411
  const isStatic = arg[0] !== `[`;
14320
- currentProp.arg = createSimpleExpression(
14412
+ currentProp.arg = createExp(
14321
14413
  isStatic ? arg : arg.slice(1, -1),
14322
14414
  isStatic,
14323
14415
  getLoc(start, end),
@@ -14390,10 +14482,13 @@ const tokenizer = new Tokenizer(stack, {
14390
14482
  tokenizer.enterRCDATA(toCharCodes(`</template`), 0);
14391
14483
  }
14392
14484
  } else {
14393
- currentProp.exp = createSimpleExpression(
14485
+ let expParseMode = 0 /* Normal */;
14486
+ currentProp.exp = createExp(
14394
14487
  currentAttrValue,
14395
14488
  false,
14396
- getLoc(currentAttrStartIndex, currentAttrEndIndex)
14489
+ getLoc(currentAttrStartIndex, currentAttrEndIndex),
14490
+ 0,
14491
+ expParseMode
14397
14492
  );
14398
14493
  if (currentProp.name === "for") {
14399
14494
  currentProp.forParseResult = parseForExpression(currentProp.exp);
@@ -14496,10 +14591,16 @@ function parseForExpression(input) {
14496
14591
  if (!inMatch)
14497
14592
  return;
14498
14593
  const [, LHS, RHS] = inMatch;
14499
- const createAliasExpression = (content, offset) => {
14594
+ const createAliasExpression = (content, offset, asParam = false) => {
14500
14595
  const start = loc.start.offset + offset;
14501
14596
  const end = start + content.length;
14502
- return createSimpleExpression(content, false, getLoc(start, end));
14597
+ return createExp(
14598
+ content,
14599
+ false,
14600
+ getLoc(start, end),
14601
+ 0,
14602
+ asParam ? 1 /* Params */ : 0 /* Normal */
14603
+ );
14503
14604
  };
14504
14605
  const result = {
14505
14606
  source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)),
@@ -14517,7 +14618,7 @@ function parseForExpression(input) {
14517
14618
  let keyOffset;
14518
14619
  if (keyContent) {
14519
14620
  keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
14520
- result.key = createAliasExpression(keyContent, keyOffset);
14621
+ result.key = createAliasExpression(keyContent, keyOffset, true);
14521
14622
  }
14522
14623
  if (iteratorMatch[2]) {
14523
14624
  const indexContent = iteratorMatch[2].trim();
@@ -14527,13 +14628,14 @@ function parseForExpression(input) {
14527
14628
  exp.indexOf(
14528
14629
  indexContent,
14529
14630
  result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length
14530
- )
14631
+ ),
14632
+ true
14531
14633
  );
14532
14634
  }
14533
14635
  }
14534
14636
  }
14535
14637
  if (valueContent) {
14536
- result.value = createAliasExpression(valueContent, trimmedOffset);
14638
+ result.value = createAliasExpression(valueContent, trimmedOffset, true);
14537
14639
  }
14538
14640
  return result;
14539
14641
  }
@@ -14611,7 +14713,7 @@ function onCloseTag(el, end, isImplied = false) {
14611
14713
  inPre--;
14612
14714
  }
14613
14715
  if (currentVPreBoundary === el) {
14614
- inVPre = false;
14716
+ inVPre = tokenizer.inVPre = false;
14615
14717
  currentVPreBoundary = null;
14616
14718
  }
14617
14719
  if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) {
@@ -14846,8 +14948,14 @@ function dirToAttr(dir) {
14846
14948
  }
14847
14949
  return attr;
14848
14950
  }
14849
- function emitError(code, index) {
14850
- currentOptions.onError(createCompilerError(code, getLoc(index, index)));
14951
+ function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) {
14952
+ const exp = createSimpleExpression(content, isStatic, loc, constType);
14953
+ return exp;
14954
+ }
14955
+ function emitError(code, index, message) {
14956
+ currentOptions.onError(
14957
+ createCompilerError(code, getLoc(index, index), void 0, message)
14958
+ );
14851
14959
  }
14852
14960
  function reset() {
14853
14961
  tokenizer.reset();
@@ -14878,6 +14986,7 @@ function baseParse(input, options) {
14878
14986
  }
14879
14987
  }
14880
14988
  tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0;
14989
+ tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2;
14881
14990
  const delimiters = options == null ? void 0 : options.delimiters;
14882
14991
  if (delimiters) {
14883
14992
  tokenizer.delimiterOpen = toCharCodes(delimiters[0]);
@@ -16924,6 +17033,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
16924
17033
  if (isEventHandler && isReservedProp(name)) {
16925
17034
  hasVnodeHook = true;
16926
17035
  }
17036
+ if (isEventHandler && value.type === 14) {
17037
+ value = value.arguments[0];
17038
+ }
16927
17039
  if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
16928
17040
  return;
16929
17041
  }
@@ -17376,9 +17488,7 @@ const transformOn$1 = (dir, node, context, augmentor) => {
17376
17488
  if (arg.isStatic) {
17377
17489
  let rawName = arg.content;
17378
17490
  if (rawName.startsWith("vnode")) {
17379
- context.onWarn(
17380
- createCompilerError(51, arg.loc)
17381
- );
17491
+ context.onError(createCompilerError(47, arg.loc));
17382
17492
  }
17383
17493
  if (rawName.startsWith("vue:")) {
17384
17494
  rawName = `vnode-${rawName.slice(4)}`;
@@ -17859,17 +17969,17 @@ function baseCompile(source, options = {}) {
17859
17969
  const isModuleMode = options.mode === "module";
17860
17970
  {
17861
17971
  if (options.prefixIdentifiers === true) {
17862
- onError(createCompilerError(47));
17863
- } else if (isModuleMode) {
17864
17972
  onError(createCompilerError(48));
17973
+ } else if (isModuleMode) {
17974
+ onError(createCompilerError(49));
17865
17975
  }
17866
17976
  }
17867
17977
  const prefixIdentifiers = false;
17868
17978
  if (options.cacheHandlers) {
17869
- onError(createCompilerError(49));
17979
+ onError(createCompilerError(50));
17870
17980
  }
17871
17981
  if (options.scopeId && !isModuleMode) {
17872
- onError(createCompilerError(50));
17982
+ onError(createCompilerError(51));
17873
17983
  }
17874
17984
  const ast = isString(source) ? baseParse(source, options) : source;
17875
17985
  const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
@@ -18425,4 +18535,4 @@ var Vue$1 = Vue;
18425
18535
 
18426
18536
  const { configureCompat } = Vue$1;
18427
18537
 
18428
- export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
18538
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };