@vue/compat 3.4.20 → 3.4.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,10 @@
1
1
  /**
2
- * @vue/compat v3.4.20
2
+ * @vue/compat v3.4.22
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
+ /*! #__NO_SIDE_EFFECTS__ */
7
+ // @__NO_SIDE_EFFECTS__
6
8
  function makeMap(str, expectsLowerCase) {
7
9
  const set = new Set(str.split(","));
8
10
  return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val);
@@ -354,7 +356,11 @@ const replacer = (_key, val) => {
354
356
  };
355
357
  const stringifySymbol = (v, i = "") => {
356
358
  var _a;
357
- return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
359
+ return (
360
+ // Symbol.description in es2019+ so we need to cast here to pass
361
+ // the lib: es2016 check
362
+ isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
363
+ );
358
364
  };
359
365
 
360
366
  function warn$2(msg, ...args) {
@@ -790,6 +796,8 @@ function createArrayInstrumentations() {
790
796
  return instrumentations;
791
797
  }
792
798
  function hasOwnProperty(key) {
799
+ if (!isSymbol(key))
800
+ key = String(key);
793
801
  const obj = toRaw(this);
794
802
  track(obj, "has", key);
795
803
  return obj.hasOwnProperty(key);
@@ -1142,23 +1150,16 @@ function createInstrumentations() {
1142
1150
  clear: createReadonlyMethod("clear"),
1143
1151
  forEach: createForEach(true, true)
1144
1152
  };
1145
- const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
1153
+ const iteratorMethods = [
1154
+ "keys",
1155
+ "values",
1156
+ "entries",
1157
+ Symbol.iterator
1158
+ ];
1146
1159
  iteratorMethods.forEach((method) => {
1147
- mutableInstrumentations2[method] = createIterableMethod(
1148
- method,
1149
- false,
1150
- false
1151
- );
1152
- readonlyInstrumentations2[method] = createIterableMethod(
1153
- method,
1154
- true,
1155
- false
1156
- );
1157
- shallowInstrumentations2[method] = createIterableMethod(
1158
- method,
1159
- false,
1160
- true
1161
- );
1160
+ mutableInstrumentations2[method] = createIterableMethod(method, false, false);
1161
+ readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
1162
+ shallowInstrumentations2[method] = createIterableMethod(method, false, true);
1162
1163
  shallowReadonlyInstrumentations2[method] = createIterableMethod(
1163
1164
  method,
1164
1165
  true,
@@ -1315,7 +1316,7 @@ function isShallow(value) {
1315
1316
  return !!(value && value["__v_isShallow"]);
1316
1317
  }
1317
1318
  function isProxy(value) {
1318
- return isReactive(value) || isReadonly(value);
1319
+ return value ? !!value["__v_raw"] : false;
1319
1320
  }
1320
1321
  function toRaw(observed) {
1321
1322
  const raw = observed && observed["__v_raw"];
@@ -1598,7 +1599,10 @@ function warn$1(msg, ...args) {
1598
1599
  instance,
1599
1600
  11,
1600
1601
  [
1601
- msg + args.join(""),
1602
+ msg + args.map((a) => {
1603
+ var _a, _b;
1604
+ return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
1605
+ }).join(""),
1602
1606
  instance && instance.proxy,
1603
1607
  trace.map(
1604
1608
  ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
@@ -1776,11 +1780,17 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
1776
1780
  }
1777
1781
  return res;
1778
1782
  }
1779
- const values = [];
1780
- for (let i = 0; i < fn.length; i++) {
1781
- values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
1783
+ if (isArray(fn)) {
1784
+ const values = [];
1785
+ for (let i = 0; i < fn.length; i++) {
1786
+ values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
1787
+ }
1788
+ return values;
1789
+ } else if (!!(process.env.NODE_ENV !== "production")) {
1790
+ warn$1(
1791
+ `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
1792
+ );
1782
1793
  }
1783
- return values;
1784
1794
  }
1785
1795
  function handleError(err, instance, type, throwInDev = true) {
1786
1796
  const contextVNode = instance ? instance.vnode : null;
@@ -1801,12 +1811,14 @@ function handleError(err, instance, type, throwInDev = true) {
1801
1811
  }
1802
1812
  const appErrorHandler = instance.appContext.config.errorHandler;
1803
1813
  if (appErrorHandler) {
1814
+ pauseTracking();
1804
1815
  callWithErrorHandling(
1805
1816
  appErrorHandler,
1806
1817
  null,
1807
1818
  10,
1808
1819
  [err, exposedInstance, errorInfo]
1809
1820
  );
1821
+ resetTracking();
1810
1822
  return;
1811
1823
  }
1812
1824
  }
@@ -2184,6 +2196,8 @@ const devtoolsComponentRemoved = (component) => {
2184
2196
  _devtoolsComponentRemoved(component);
2185
2197
  }
2186
2198
  };
2199
+ /*! #__NO_SIDE_EFFECTS__ */
2200
+ // @__NO_SIDE_EFFECTS__
2187
2201
  function createDevtoolsComponentHook(hook) {
2188
2202
  return (component) => {
2189
2203
  emit$2(
@@ -3293,7 +3307,7 @@ const SuspenseImpl = {
3293
3307
  rendererInternals
3294
3308
  );
3295
3309
  } else {
3296
- if (parentSuspense && parentSuspense.deps > 0) {
3310
+ if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
3297
3311
  n2.suspense = n1.suspense;
3298
3312
  n2.suspense.vnode = n2;
3299
3313
  n2.el = n1.el;
@@ -4867,7 +4881,7 @@ const KeepAliveImpl = {
4867
4881
  return () => {
4868
4882
  pendingCacheKey = null;
4869
4883
  if (!slots.default) {
4870
- return null;
4884
+ return current = null;
4871
4885
  }
4872
4886
  const children = slots.default();
4873
4887
  const rawVNode = children[0];
@@ -5598,47 +5612,74 @@ function installCompatInstanceProperties(map) {
5598
5612
  $once: (i) => once.bind(null, i),
5599
5613
  $off: (i) => off.bind(null, i),
5600
5614
  $children: getCompatChildren,
5601
- $listeners: getCompatListeners
5615
+ $listeners: getCompatListeners,
5616
+ // inject additional properties into $options for compat
5617
+ // e.g. vuex needs this.$options.parent
5618
+ $options: (i) => {
5619
+ if (!isCompatEnabled$1("PRIVATE_APIS", i)) {
5620
+ return resolveMergedOptions(i);
5621
+ }
5622
+ if (i.resolvedOptions) {
5623
+ return i.resolvedOptions;
5624
+ }
5625
+ const res = i.resolvedOptions = extend({}, resolveMergedOptions(i));
5626
+ Object.defineProperties(res, {
5627
+ parent: {
5628
+ get() {
5629
+ warnDeprecation$1("PRIVATE_APIS", i, "$options.parent");
5630
+ return i.proxy.$parent;
5631
+ }
5632
+ },
5633
+ propsData: {
5634
+ get() {
5635
+ warnDeprecation$1(
5636
+ "PRIVATE_APIS",
5637
+ i,
5638
+ "$options.propsData"
5639
+ );
5640
+ return i.vnode.props;
5641
+ }
5642
+ }
5643
+ });
5644
+ return res;
5645
+ }
5602
5646
  });
5603
- if (isCompatEnabled$1("PRIVATE_APIS", null)) {
5604
- extend(map, {
5605
- // needed by many libs / render fns
5606
- $vnode: (i) => i.vnode,
5607
- // inject additional properties into $options for compat
5608
- // e.g. vuex needs this.$options.parent
5609
- $options: (i) => {
5610
- const res = extend({}, resolveMergedOptions(i));
5611
- res.parent = i.proxy.$parent;
5612
- res.propsData = i.vnode.props;
5613
- return res;
5614
- },
5615
- // some private properties that are likely accessed...
5616
- _self: (i) => i.proxy,
5617
- _uid: (i) => i.uid,
5618
- _data: (i) => i.data,
5619
- _isMounted: (i) => i.isMounted,
5620
- _isDestroyed: (i) => i.isUnmounted,
5621
- // v2 render helpers
5622
- $createElement: () => compatH,
5623
- _c: () => compatH,
5624
- _o: () => legacyMarkOnce,
5625
- _n: () => looseToNumber,
5626
- _s: () => toDisplayString,
5627
- _l: () => renderList,
5628
- _t: (i) => legacyRenderSlot.bind(null, i),
5629
- _q: () => looseEqual,
5630
- _i: () => looseIndexOf,
5631
- _m: (i) => legacyRenderStatic.bind(null, i),
5632
- _f: () => resolveFilter$1,
5633
- _k: (i) => legacyCheckKeyCodes.bind(null, i),
5634
- _b: () => legacyBindObjectProps,
5635
- _v: () => createTextVNode,
5636
- _e: () => createCommentVNode,
5637
- _u: () => legacyresolveScopedSlots,
5638
- _g: () => legacyBindObjectListeners,
5639
- _d: () => legacyBindDynamicKeys,
5640
- _p: () => legacyPrependModifier
5641
- });
5647
+ const privateAPIs = {
5648
+ // needed by many libs / render fns
5649
+ $vnode: (i) => i.vnode,
5650
+ // some private properties that are likely accessed...
5651
+ _self: (i) => i.proxy,
5652
+ _uid: (i) => i.uid,
5653
+ _data: (i) => i.data,
5654
+ _isMounted: (i) => i.isMounted,
5655
+ _isDestroyed: (i) => i.isUnmounted,
5656
+ // v2 render helpers
5657
+ $createElement: () => compatH,
5658
+ _c: () => compatH,
5659
+ _o: () => legacyMarkOnce,
5660
+ _n: () => looseToNumber,
5661
+ _s: () => toDisplayString,
5662
+ _l: () => renderList,
5663
+ _t: (i) => legacyRenderSlot.bind(null, i),
5664
+ _q: () => looseEqual,
5665
+ _i: () => looseIndexOf,
5666
+ _m: (i) => legacyRenderStatic.bind(null, i),
5667
+ _f: () => resolveFilter$1,
5668
+ _k: (i) => legacyCheckKeyCodes.bind(null, i),
5669
+ _b: () => legacyBindObjectProps,
5670
+ _v: () => createTextVNode,
5671
+ _e: () => createCommentVNode,
5672
+ _u: () => legacyresolveScopedSlots,
5673
+ _g: () => legacyBindObjectListeners,
5674
+ _d: () => legacyBindDynamicKeys,
5675
+ _p: () => legacyPrependModifier
5676
+ };
5677
+ for (const key in privateAPIs) {
5678
+ map[key] = (i) => {
5679
+ if (isCompatEnabled$1("PRIVATE_APIS", i)) {
5680
+ return privateAPIs[key](i);
5681
+ }
5682
+ };
5642
5683
  }
5643
5684
  }
5644
5685
 
@@ -5679,6 +5720,9 @@ const isReservedPrefix = (key) => key === "_" || key === "$";
5679
5720
  const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
5680
5721
  const PublicInstanceProxyHandlers = {
5681
5722
  get({ _: instance }, key) {
5723
+ if (key === "__v_skip") {
5724
+ return true;
5725
+ }
5682
5726
  const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
5683
5727
  if (!!(process.env.NODE_ENV !== "production") && key === "__isVue") {
5684
5728
  return true;
@@ -6535,7 +6579,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6535
6579
  return vm;
6536
6580
  }
6537
6581
  }
6538
- Vue.version = `2.6.14-compat:${"3.4.20"}`;
6582
+ Vue.version = `2.6.14-compat:${"3.4.22"}`;
6539
6583
  Vue.config = singletonApp.config;
6540
6584
  Vue.use = (p, ...options) => {
6541
6585
  if (p && isFunction(p.install)) {
@@ -6730,15 +6774,14 @@ function applySingletonPrototype(app, Ctor) {
6730
6774
  app.config.globalProperties = Object.create(Ctor.prototype);
6731
6775
  }
6732
6776
  let hasPrototypeAugmentations = false;
6733
- const descriptors = Object.getOwnPropertyDescriptors(Ctor.prototype);
6734
- for (const key in descriptors) {
6777
+ for (const key of Object.getOwnPropertyNames(Ctor.prototype)) {
6735
6778
  if (key !== "constructor") {
6736
6779
  hasPrototypeAugmentations = true;
6737
6780
  if (enabled) {
6738
6781
  Object.defineProperty(
6739
6782
  app.config.globalProperties,
6740
6783
  key,
6741
- descriptors[key]
6784
+ Object.getOwnPropertyDescriptor(Ctor.prototype, key)
6742
6785
  );
6743
6786
  }
6744
6787
  }
@@ -7176,10 +7219,10 @@ function shouldSkipAttr(key, instance) {
7176
7219
  return false;
7177
7220
  }
7178
7221
 
7222
+ const attrsProto = {};
7179
7223
  function initProps(instance, rawProps, isStateful, isSSR = false) {
7180
7224
  const props = {};
7181
- const attrs = {};
7182
- def(attrs, InternalObjectKey, 1);
7225
+ const attrs = Object.create(attrsProto);
7183
7226
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
7184
7227
  setFullProps(instance, rawProps, props, attrs);
7185
7228
  for (const key in instance.propsOptions[0]) {
@@ -7301,7 +7344,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
7301
7344
  }
7302
7345
  }
7303
7346
  if (hasAttrsChanged) {
7304
- trigger(instance, "set", "$attrs");
7347
+ trigger(instance.attrs, "set", "");
7305
7348
  }
7306
7349
  if (!!(process.env.NODE_ENV !== "production")) {
7307
7350
  validateProps(rawProps || {}, props, instance);
@@ -7659,7 +7702,7 @@ const initSlots = (instance, children) => {
7659
7702
  const type = children._;
7660
7703
  if (type) {
7661
7704
  instance.slots = toRaw(children);
7662
- def(children, "_", type);
7705
+ def(instance.slots, "_", type);
7663
7706
  } else {
7664
7707
  normalizeObjectSlots(
7665
7708
  children,
@@ -7673,7 +7716,6 @@ const initSlots = (instance, children) => {
7673
7716
  normalizeVNodeSlots(instance, children);
7674
7717
  }
7675
7718
  }
7676
- def(instance.slots, InternalObjectKey, 1);
7677
7719
  };
7678
7720
  const updateSlots = (instance, children, optimized) => {
7679
7721
  const { vnode, slots } = instance;
@@ -7845,6 +7887,7 @@ function createHydrationFunctions(rendererInternals) {
7845
7887
  }
7846
7888
  };
7847
7889
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
7890
+ optimized = optimized || !!vnode.dynamicChildren;
7848
7891
  const isFragmentStart = isComment(node) && node.data === "[";
7849
7892
  const onMismatch = () => handleMismatch(
7850
7893
  node,
@@ -8090,9 +8133,9 @@ Server rendered element contains more child nodes than client vdom.`
8090
8133
  }
8091
8134
  }
8092
8135
  if (props) {
8093
- if (!!(process.env.NODE_ENV !== "production") || forcePatch || !optimized || patchFlag & (16 | 32)) {
8136
+ if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & (16 | 32)) {
8094
8137
  for (const key in props) {
8095
- if (!!(process.env.NODE_ENV !== "production") && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
8138
+ if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
8096
8139
  hasMismatch = true;
8097
8140
  }
8098
8141
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
@@ -10412,7 +10455,6 @@ const createVNodeWithArgsTransform = (...args) => {
10412
10455
  ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
10413
10456
  );
10414
10457
  };
10415
- const InternalObjectKey = `__vInternal`;
10416
10458
  const normalizeKey = ({ key }) => key != null ? key : null;
10417
10459
  const normalizeRef = ({
10418
10460
  ref,
@@ -10552,7 +10594,7 @@ Component that was made reactive: `,
10552
10594
  function guardReactiveProps(props) {
10553
10595
  if (!props)
10554
10596
  return null;
10555
- return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
10597
+ return isProxy(props) || Object.getPrototypeOf(props) === attrsProto ? extend({}, props) : props;
10556
10598
  }
10557
10599
  function cloneVNode(vnode, extraProps, mergeRef = false) {
10558
10600
  const { props, ref, patchFlag, children } = vnode;
@@ -10660,7 +10702,7 @@ function normalizeChildren(vnode, children) {
10660
10702
  } else {
10661
10703
  type = 32;
10662
10704
  const slotFlag = children._;
10663
- if (!slotFlag && !(InternalObjectKey in children)) {
10705
+ if (!slotFlag) {
10664
10706
  children._ctx = currentRenderingInstance;
10665
10707
  } else if (slotFlag === 3 && currentRenderingInstance) {
10666
10708
  if (currentRenderingInstance.slots._ === 1) {
@@ -10898,7 +10940,7 @@ function setupStatefulComponent(instance, isSSR) {
10898
10940
  }
10899
10941
  }
10900
10942
  instance.accessCache = /* @__PURE__ */ Object.create(null);
10901
- instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
10943
+ instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
10902
10944
  if (!!(process.env.NODE_ENV !== "production")) {
10903
10945
  exposePropsOnRenderContext(instance);
10904
10946
  }
@@ -11044,31 +11086,26 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
11044
11086
  }
11045
11087
  }
11046
11088
  }
11047
- function getAttrsProxy(instance) {
11048
- return instance.attrsProxy || (instance.attrsProxy = new Proxy(
11049
- instance.attrs,
11050
- !!(process.env.NODE_ENV !== "production") ? {
11051
- get(target, key) {
11052
- markAttrsAccessed();
11053
- track(instance, "get", "$attrs");
11054
- return target[key];
11055
- },
11056
- set() {
11057
- warn$1(`setupContext.attrs is readonly.`);
11058
- return false;
11059
- },
11060
- deleteProperty() {
11061
- warn$1(`setupContext.attrs is readonly.`);
11062
- return false;
11063
- }
11064
- } : {
11065
- get(target, key) {
11066
- track(instance, "get", "$attrs");
11067
- return target[key];
11068
- }
11069
- }
11070
- ));
11071
- }
11089
+ const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
11090
+ get(target, key) {
11091
+ markAttrsAccessed();
11092
+ track(target, "get", "");
11093
+ return target[key];
11094
+ },
11095
+ set() {
11096
+ warn$1(`setupContext.attrs is readonly.`);
11097
+ return false;
11098
+ },
11099
+ deleteProperty() {
11100
+ warn$1(`setupContext.attrs is readonly.`);
11101
+ return false;
11102
+ }
11103
+ } : {
11104
+ get(target, key) {
11105
+ track(target, "get", "");
11106
+ return target[key];
11107
+ }
11108
+ };
11072
11109
  function getSlotsProxy(instance) {
11073
11110
  return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
11074
11111
  get(target, key) {
@@ -11102,9 +11139,10 @@ function createSetupContext(instance) {
11102
11139
  instance.exposed = exposed || {};
11103
11140
  };
11104
11141
  if (!!(process.env.NODE_ENV !== "production")) {
11142
+ let attrsProxy;
11105
11143
  return Object.freeze({
11106
11144
  get attrs() {
11107
- return getAttrsProxy(instance);
11145
+ return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
11108
11146
  },
11109
11147
  get slots() {
11110
11148
  return getSlotsProxy(instance);
@@ -11116,9 +11154,7 @@ function createSetupContext(instance) {
11116
11154
  });
11117
11155
  } else {
11118
11156
  return {
11119
- get attrs() {
11120
- return getAttrsProxy(instance);
11121
- },
11157
+ attrs: new Proxy(instance.attrs, attrsProxyHandlers),
11122
11158
  slots: instance.slots,
11123
11159
  emit: instance.emit,
11124
11160
  expose
@@ -11458,7 +11494,7 @@ function isMemoSame(cached, memo) {
11458
11494
  return true;
11459
11495
  }
11460
11496
 
11461
- const version = "3.4.20";
11497
+ const version = "3.4.22";
11462
11498
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
11463
11499
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11464
11500
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -11943,8 +11979,8 @@ function useCssVars(getter) {
11943
11979
  setVarsOnVNode(instance.subTree, vars);
11944
11980
  updateTeleports(vars);
11945
11981
  };
11946
- watchPostEffect(setVars);
11947
11982
  onMounted(() => {
11983
+ watchPostEffect(setVars);
11948
11984
  const ob = new MutationObserver(setVars);
11949
11985
  ob.observe(instance.subTree.el.parentNode, { childList: true });
11950
11986
  onUnmounted(() => ob.disconnect());
@@ -12146,15 +12182,15 @@ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspe
12146
12182
  const tag = el.tagName;
12147
12183
  if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
12148
12184
  !tag.includes("-")) {
12149
- el._value = value;
12150
12185
  const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
12151
12186
  const newValue = value == null ? "" : value;
12152
- if (oldValue !== newValue) {
12187
+ if (oldValue !== newValue || !("_value" in el)) {
12153
12188
  el.value = newValue;
12154
12189
  }
12155
12190
  if (value == null) {
12156
12191
  el.removeAttribute(key);
12157
12192
  }
12193
+ el._value = value;
12158
12194
  return;
12159
12195
  }
12160
12196
  let needRemove = false;
@@ -12210,11 +12246,14 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
12210
12246
  const invokers = el[veiKey] || (el[veiKey] = {});
12211
12247
  const existingInvoker = invokers[rawName];
12212
12248
  if (nextValue && existingInvoker) {
12213
- existingInvoker.value = nextValue;
12249
+ existingInvoker.value = !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue;
12214
12250
  } else {
12215
12251
  const [name, options] = parseName(rawName);
12216
12252
  if (nextValue) {
12217
- const invoker = invokers[rawName] = createInvoker(nextValue, instance);
12253
+ const invoker = invokers[rawName] = createInvoker(
12254
+ !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue,
12255
+ instance
12256
+ );
12218
12257
  addEventListener(el, name, invoker, options);
12219
12258
  } else if (existingInvoker) {
12220
12259
  removeEventListener(el, name, existingInvoker, options);
@@ -12257,6 +12296,16 @@ function createInvoker(initialValue, instance) {
12257
12296
  invoker.attached = getNow();
12258
12297
  return invoker;
12259
12298
  }
12299
+ function sanitizeEventValue(value, propName) {
12300
+ if (isFunction(value) || isArray(value)) {
12301
+ return value;
12302
+ }
12303
+ warn(
12304
+ `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
12305
+ Expected function or array of functions, received type ${typeof value}.`
12306
+ );
12307
+ return NOOP;
12308
+ }
12260
12309
  function patchStopImmediatePropagation(e, value) {
12261
12310
  if (isArray(value)) {
12262
12311
  const originalStop = e.stopImmediatePropagation;
@@ -12264,7 +12313,9 @@ function patchStopImmediatePropagation(e, value) {
12264
12313
  originalStop.call(e);
12265
12314
  e._stopped = true;
12266
12315
  };
12267
- return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
12316
+ return value.map(
12317
+ (fn) => (e2) => !e2._stopped && fn && fn(e2)
12318
+ );
12268
12319
  } else {
12269
12320
  return value;
12270
12321
  }
@@ -12465,7 +12516,7 @@ class VueElement extends BaseClass {
12465
12516
  }
12466
12517
  }
12467
12518
  _setAttr(key) {
12468
- let value = this.getAttribute(key);
12519
+ let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0;
12469
12520
  const camelKey = camelize(key);
12470
12521
  if (this._numberProps && this._numberProps[camelKey]) {
12471
12522
  value = toNumber(value);
@@ -12637,7 +12688,28 @@ const TransitionGroupImpl = {
12637
12688
  )) {
12638
12689
  tag = "span";
12639
12690
  }
12640
- prevChildren = children;
12691
+ prevChildren = [];
12692
+ if (children) {
12693
+ for (let i = 0; i < children.length; i++) {
12694
+ const child = children[i];
12695
+ if (child.el && child.el instanceof Element) {
12696
+ prevChildren.push(child);
12697
+ setTransitionHooks(
12698
+ child,
12699
+ resolveTransitionHooks(
12700
+ child,
12701
+ cssTransitionProps,
12702
+ state,
12703
+ instance
12704
+ )
12705
+ );
12706
+ positionMap.set(
12707
+ child,
12708
+ child.el.getBoundingClientRect()
12709
+ );
12710
+ }
12711
+ }
12712
+ }
12641
12713
  children = slots.default ? getTransitionRawChildren(slots.default()) : [];
12642
12714
  for (let i = 0; i < children.length; i++) {
12643
12715
  const child = children[i];
@@ -12650,16 +12722,6 @@ const TransitionGroupImpl = {
12650
12722
  warn(`<TransitionGroup> children must be keyed.`);
12651
12723
  }
12652
12724
  }
12653
- if (prevChildren) {
12654
- for (let i = 0; i < prevChildren.length; i++) {
12655
- const child = prevChildren[i];
12656
- setTransitionHooks(
12657
- child,
12658
- resolveTransitionHooks(child, cssTransitionProps, state, instance)
12659
- );
12660
- positionMap.set(child, child.el.getBoundingClientRect());
12661
- }
12662
- }
12663
12725
  return createVNode(tag, null, children);
12664
12726
  };
12665
12727
  }
@@ -12761,7 +12823,7 @@ const vModelText = {
12761
12823
  el[assignKey] = getModelAssigner(vnode);
12762
12824
  if (el.composing)
12763
12825
  return;
12764
- const elValue = number || el.type === "number" ? looseToNumber(el.value) : el.value;
12826
+ const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
12765
12827
  const newValue = value == null ? "" : value;
12766
12828
  if (elValue === newValue) {
12767
12829
  return;
@@ -12864,14 +12926,14 @@ const vModelSelect = {
12864
12926
  // set value in mounted & updated because <select> relies on its children
12865
12927
  // <option>s.
12866
12928
  mounted(el, { value, modifiers: { number } }) {
12867
- setSelected(el, value, number);
12929
+ setSelected(el, value);
12868
12930
  },
12869
12931
  beforeUpdate(el, _binding, vnode) {
12870
12932
  el[assignKey] = getModelAssigner(vnode);
12871
12933
  },
12872
12934
  updated(el, { value, modifiers: { number } }) {
12873
12935
  if (!el._assigning) {
12874
- setSelected(el, value, number);
12936
+ setSelected(el, value);
12875
12937
  }
12876
12938
  }
12877
12939
  };
@@ -12891,9 +12953,7 @@ function setSelected(el, value, number) {
12891
12953
  if (isArrayValue) {
12892
12954
  const optionType = typeof optionValue;
12893
12955
  if (optionType === "string" || optionType === "number") {
12894
- option.selected = value.includes(
12895
- number ? looseToNumber(optionValue) : optionValue
12896
- );
12956
+ option.selected = value.some((v) => String(v) === String(optionValue));
12897
12957
  } else {
12898
12958
  option.selected = looseIndexOf(value, optionValue) > -1;
12899
12959
  }
@@ -15249,7 +15309,7 @@ function onCloseTag(el, end, isImplied = false) {
15249
15309
  if (isImplied) {
15250
15310
  setLocEnd(el.loc, backTrack(end, 60));
15251
15311
  } else {
15252
- setLocEnd(el.loc, end + 1);
15312
+ setLocEnd(el.loc, lookAhead(end, 62) + 1);
15253
15313
  }
15254
15314
  if (tokenizer.inSFCRoot) {
15255
15315
  if (el.children.length) {
@@ -15344,6 +15404,12 @@ function onCloseTag(el, end, isImplied = false) {
15344
15404
  }
15345
15405
  }
15346
15406
  }
15407
+ function lookAhead(index, c) {
15408
+ let i = index;
15409
+ while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1)
15410
+ i++;
15411
+ return i;
15412
+ }
15347
15413
  function backTrack(index, c) {
15348
15414
  let i = index;
15349
15415
  while (currentInput.charCodeAt(i) !== c && i >= 0)
@@ -17528,13 +17594,27 @@ const transformElement = (node, context) => {
17528
17594
  function resolveComponentType(node, context, ssr = false) {
17529
17595
  let { tag } = node;
17530
17596
  const isExplicitDynamic = isComponentTag(tag);
17531
- const isProp = findProp(node, "is");
17597
+ const isProp = findProp(
17598
+ node,
17599
+ "is",
17600
+ false,
17601
+ true
17602
+ /* allow empty */
17603
+ );
17532
17604
  if (isProp) {
17533
17605
  if (isExplicitDynamic || isCompatEnabled(
17534
17606
  "COMPILER_IS_ON_ELEMENT",
17535
17607
  context
17536
17608
  )) {
17537
- const exp = isProp.type === 6 ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp;
17609
+ let exp;
17610
+ if (isProp.type === 6) {
17611
+ exp = isProp.value && createSimpleExpression(isProp.value.content, true);
17612
+ } else {
17613
+ exp = isProp.exp;
17614
+ if (!exp) {
17615
+ exp = createSimpleExpression(`is`, false, isProp.loc);
17616
+ }
17617
+ }
17538
17618
  if (exp) {
17539
17619
  return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
17540
17620
  exp