@vue/compat 3.4.21 → 3.4.23

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.21
2
+ * @vue/compat v3.4.23
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"];
@@ -1779,11 +1780,17 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
1779
1780
  }
1780
1781
  return res;
1781
1782
  }
1782
- const values = [];
1783
- for (let i = 0; i < fn.length; i++) {
1784
- 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
+ );
1785
1793
  }
1786
- return values;
1787
1794
  }
1788
1795
  function handleError(err, instance, type, throwInDev = true) {
1789
1796
  const contextVNode = instance ? instance.vnode : null;
@@ -1804,12 +1811,14 @@ function handleError(err, instance, type, throwInDev = true) {
1804
1811
  }
1805
1812
  const appErrorHandler = instance.appContext.config.errorHandler;
1806
1813
  if (appErrorHandler) {
1814
+ pauseTracking();
1807
1815
  callWithErrorHandling(
1808
1816
  appErrorHandler,
1809
1817
  null,
1810
1818
  10,
1811
1819
  [err, exposedInstance, errorInfo]
1812
1820
  );
1821
+ resetTracking();
1813
1822
  return;
1814
1823
  }
1815
1824
  }
@@ -2187,6 +2196,8 @@ const devtoolsComponentRemoved = (component) => {
2187
2196
  _devtoolsComponentRemoved(component);
2188
2197
  }
2189
2198
  };
2199
+ /*! #__NO_SIDE_EFFECTS__ */
2200
+ // @__NO_SIDE_EFFECTS__
2190
2201
  function createDevtoolsComponentHook(hook) {
2191
2202
  return (component) => {
2192
2203
  emit$2(
@@ -4870,7 +4881,7 @@ const KeepAliveImpl = {
4870
4881
  return () => {
4871
4882
  pendingCacheKey = null;
4872
4883
  if (!slots.default) {
4873
- return null;
4884
+ return current = null;
4874
4885
  }
4875
4886
  const children = slots.default();
4876
4887
  const rawVNode = children[0];
@@ -5601,47 +5612,74 @@ function installCompatInstanceProperties(map) {
5601
5612
  $once: (i) => once.bind(null, i),
5602
5613
  $off: (i) => off.bind(null, i),
5603
5614
  $children: getCompatChildren,
5604
- $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
+ }
5605
5646
  });
5606
- if (isCompatEnabled$1("PRIVATE_APIS", null)) {
5607
- extend(map, {
5608
- // needed by many libs / render fns
5609
- $vnode: (i) => i.vnode,
5610
- // inject additional properties into $options for compat
5611
- // e.g. vuex needs this.$options.parent
5612
- $options: (i) => {
5613
- const res = extend({}, resolveMergedOptions(i));
5614
- res.parent = i.proxy.$parent;
5615
- res.propsData = i.vnode.props;
5616
- return res;
5617
- },
5618
- // some private properties that are likely accessed...
5619
- _self: (i) => i.proxy,
5620
- _uid: (i) => i.uid,
5621
- _data: (i) => i.data,
5622
- _isMounted: (i) => i.isMounted,
5623
- _isDestroyed: (i) => i.isUnmounted,
5624
- // v2 render helpers
5625
- $createElement: () => compatH,
5626
- _c: () => compatH,
5627
- _o: () => legacyMarkOnce,
5628
- _n: () => looseToNumber,
5629
- _s: () => toDisplayString,
5630
- _l: () => renderList,
5631
- _t: (i) => legacyRenderSlot.bind(null, i),
5632
- _q: () => looseEqual,
5633
- _i: () => looseIndexOf,
5634
- _m: (i) => legacyRenderStatic.bind(null, i),
5635
- _f: () => resolveFilter$1,
5636
- _k: (i) => legacyCheckKeyCodes.bind(null, i),
5637
- _b: () => legacyBindObjectProps,
5638
- _v: () => createTextVNode,
5639
- _e: () => createCommentVNode,
5640
- _u: () => legacyresolveScopedSlots,
5641
- _g: () => legacyBindObjectListeners,
5642
- _d: () => legacyBindDynamicKeys,
5643
- _p: () => legacyPrependModifier
5644
- });
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
+ };
5645
5683
  }
5646
5684
  }
5647
5685
 
@@ -5682,6 +5720,9 @@ const isReservedPrefix = (key) => key === "_" || key === "$";
5682
5720
  const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
5683
5721
  const PublicInstanceProxyHandlers = {
5684
5722
  get({ _: instance }, key) {
5723
+ if (key === "__v_skip") {
5724
+ return true;
5725
+ }
5685
5726
  const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
5686
5727
  if (!!(process.env.NODE_ENV !== "production") && key === "__isVue") {
5687
5728
  return true;
@@ -5724,7 +5765,7 @@ const PublicInstanceProxyHandlers = {
5724
5765
  let cssModule, globalProperties;
5725
5766
  if (publicGetter) {
5726
5767
  if (key === "$attrs") {
5727
- track(instance, "get", key);
5768
+ track(instance.attrs, "get", "");
5728
5769
  !!(process.env.NODE_ENV !== "production") && markAttrsAccessed();
5729
5770
  } else if (!!(process.env.NODE_ENV !== "production") && key === "$slots") {
5730
5771
  track(instance, "get", key);
@@ -6538,7 +6579,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6538
6579
  return vm;
6539
6580
  }
6540
6581
  }
6541
- Vue.version = `2.6.14-compat:${"3.4.21"}`;
6582
+ Vue.version = `2.6.14-compat:${"3.4.23"}`;
6542
6583
  Vue.config = singletonApp.config;
6543
6584
  Vue.use = (p, ...options) => {
6544
6585
  if (p && isFunction(p.install)) {
@@ -6733,15 +6774,14 @@ function applySingletonPrototype(app, Ctor) {
6733
6774
  app.config.globalProperties = Object.create(Ctor.prototype);
6734
6775
  }
6735
6776
  let hasPrototypeAugmentations = false;
6736
- const descriptors = Object.getOwnPropertyDescriptors(Ctor.prototype);
6737
- for (const key in descriptors) {
6777
+ for (const key of Object.getOwnPropertyNames(Ctor.prototype)) {
6738
6778
  if (key !== "constructor") {
6739
6779
  hasPrototypeAugmentations = true;
6740
6780
  if (enabled) {
6741
6781
  Object.defineProperty(
6742
6782
  app.config.globalProperties,
6743
6783
  key,
6744
- descriptors[key]
6784
+ Object.getOwnPropertyDescriptor(Ctor.prototype, key)
6745
6785
  );
6746
6786
  }
6747
6787
  }
@@ -7179,10 +7219,13 @@ function shouldSkipAttr(key, instance) {
7179
7219
  return false;
7180
7220
  }
7181
7221
 
7222
+ const internalObjectProto = /* @__PURE__ */ Object.create(null);
7223
+ const createInternalObject = () => Object.create(internalObjectProto);
7224
+ const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
7225
+
7182
7226
  function initProps(instance, rawProps, isStateful, isSSR = false) {
7183
7227
  const props = {};
7184
- const attrs = {};
7185
- def(attrs, InternalObjectKey, 1);
7228
+ const attrs = createInternalObject();
7186
7229
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
7187
7230
  setFullProps(instance, rawProps, props, attrs);
7188
7231
  for (const key in instance.propsOptions[0]) {
@@ -7304,7 +7347,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
7304
7347
  }
7305
7348
  }
7306
7349
  if (hasAttrsChanged) {
7307
- trigger(instance, "set", "$attrs");
7350
+ trigger(instance.attrs, "set", "");
7308
7351
  }
7309
7352
  if (!!(process.env.NODE_ENV !== "production")) {
7310
7353
  validateProps(rawProps || {}, props, instance);
@@ -7662,21 +7705,20 @@ const initSlots = (instance, children) => {
7662
7705
  const type = children._;
7663
7706
  if (type) {
7664
7707
  instance.slots = toRaw(children);
7665
- def(children, "_", type);
7708
+ def(instance.slots, "_", type);
7666
7709
  } else {
7667
7710
  normalizeObjectSlots(
7668
7711
  children,
7669
- instance.slots = {},
7712
+ instance.slots = createInternalObject(),
7670
7713
  instance
7671
7714
  );
7672
7715
  }
7673
7716
  } else {
7674
- instance.slots = {};
7717
+ instance.slots = createInternalObject();
7675
7718
  if (children) {
7676
7719
  normalizeVNodeSlots(instance, children);
7677
7720
  }
7678
7721
  }
7679
- def(instance.slots, InternalObjectKey, 1);
7680
7722
  };
7681
7723
  const updateSlots = (instance, children, optimized) => {
7682
7724
  const { vnode, slots } = instance;
@@ -7848,6 +7890,7 @@ function createHydrationFunctions(rendererInternals) {
7848
7890
  }
7849
7891
  };
7850
7892
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
7893
+ optimized = optimized || !!vnode.dynamicChildren;
7851
7894
  const isFragmentStart = isComment(node) && node.data === "[";
7852
7895
  const onMismatch = () => handleMismatch(
7853
7896
  node,
@@ -8093,9 +8136,9 @@ Server rendered element contains more child nodes than client vdom.`
8093
8136
  }
8094
8137
  }
8095
8138
  if (props) {
8096
- if (!!(process.env.NODE_ENV !== "production") || forcePatch || !optimized || patchFlag & (16 | 32)) {
8139
+ if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & (16 | 32)) {
8097
8140
  for (const key in props) {
8098
- if (!!(process.env.NODE_ENV !== "production") && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
8141
+ if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
8099
8142
  hasMismatch = true;
8100
8143
  }
8101
8144
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
@@ -10415,7 +10458,6 @@ const createVNodeWithArgsTransform = (...args) => {
10415
10458
  ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
10416
10459
  );
10417
10460
  };
10418
- const InternalObjectKey = `__vInternal`;
10419
10461
  const normalizeKey = ({ key }) => key != null ? key : null;
10420
10462
  const normalizeRef = ({
10421
10463
  ref,
@@ -10555,7 +10597,7 @@ Component that was made reactive: `,
10555
10597
  function guardReactiveProps(props) {
10556
10598
  if (!props)
10557
10599
  return null;
10558
- return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
10600
+ return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
10559
10601
  }
10560
10602
  function cloneVNode(vnode, extraProps, mergeRef = false) {
10561
10603
  const { props, ref, patchFlag, children } = vnode;
@@ -10663,7 +10705,7 @@ function normalizeChildren(vnode, children) {
10663
10705
  } else {
10664
10706
  type = 32;
10665
10707
  const slotFlag = children._;
10666
- if (!slotFlag && !(InternalObjectKey in children)) {
10708
+ if (!slotFlag && !isInternalObject(children)) {
10667
10709
  children._ctx = currentRenderingInstance;
10668
10710
  } else if (slotFlag === 3 && currentRenderingInstance) {
10669
10711
  if (currentRenderingInstance.slots._ === 1) {
@@ -10901,7 +10943,7 @@ function setupStatefulComponent(instance, isSSR) {
10901
10943
  }
10902
10944
  }
10903
10945
  instance.accessCache = /* @__PURE__ */ Object.create(null);
10904
- instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
10946
+ instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
10905
10947
  if (!!(process.env.NODE_ENV !== "production")) {
10906
10948
  exposePropsOnRenderContext(instance);
10907
10949
  }
@@ -11047,31 +11089,26 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
11047
11089
  }
11048
11090
  }
11049
11091
  }
11050
- function getAttrsProxy(instance) {
11051
- return instance.attrsProxy || (instance.attrsProxy = new Proxy(
11052
- instance.attrs,
11053
- !!(process.env.NODE_ENV !== "production") ? {
11054
- get(target, key) {
11055
- markAttrsAccessed();
11056
- track(instance, "get", "$attrs");
11057
- return target[key];
11058
- },
11059
- set() {
11060
- warn$1(`setupContext.attrs is readonly.`);
11061
- return false;
11062
- },
11063
- deleteProperty() {
11064
- warn$1(`setupContext.attrs is readonly.`);
11065
- return false;
11066
- }
11067
- } : {
11068
- get(target, key) {
11069
- track(instance, "get", "$attrs");
11070
- return target[key];
11071
- }
11072
- }
11073
- ));
11074
- }
11092
+ const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
11093
+ get(target, key) {
11094
+ markAttrsAccessed();
11095
+ track(target, "get", "");
11096
+ return target[key];
11097
+ },
11098
+ set() {
11099
+ warn$1(`setupContext.attrs is readonly.`);
11100
+ return false;
11101
+ },
11102
+ deleteProperty() {
11103
+ warn$1(`setupContext.attrs is readonly.`);
11104
+ return false;
11105
+ }
11106
+ } : {
11107
+ get(target, key) {
11108
+ track(target, "get", "");
11109
+ return target[key];
11110
+ }
11111
+ };
11075
11112
  function getSlotsProxy(instance) {
11076
11113
  return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
11077
11114
  get(target, key) {
@@ -11105,9 +11142,10 @@ function createSetupContext(instance) {
11105
11142
  instance.exposed = exposed || {};
11106
11143
  };
11107
11144
  if (!!(process.env.NODE_ENV !== "production")) {
11145
+ let attrsProxy;
11108
11146
  return Object.freeze({
11109
11147
  get attrs() {
11110
- return getAttrsProxy(instance);
11148
+ return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
11111
11149
  },
11112
11150
  get slots() {
11113
11151
  return getSlotsProxy(instance);
@@ -11119,9 +11157,7 @@ function createSetupContext(instance) {
11119
11157
  });
11120
11158
  } else {
11121
11159
  return {
11122
- get attrs() {
11123
- return getAttrsProxy(instance);
11124
- },
11160
+ attrs: new Proxy(instance.attrs, attrsProxyHandlers),
11125
11161
  slots: instance.slots,
11126
11162
  emit: instance.emit,
11127
11163
  expose
@@ -11461,7 +11497,7 @@ function isMemoSame(cached, memo) {
11461
11497
  return true;
11462
11498
  }
11463
11499
 
11464
- const version = "3.4.21";
11500
+ const version = "3.4.23";
11465
11501
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
11466
11502
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11467
11503
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -11946,8 +11982,8 @@ function useCssVars(getter) {
11946
11982
  setVarsOnVNode(instance.subTree, vars);
11947
11983
  updateTeleports(vars);
11948
11984
  };
11949
- watchPostEffect(setVars);
11950
11985
  onMounted(() => {
11986
+ watchPostEffect(setVars);
11951
11987
  const ob = new MutationObserver(setVars);
11952
11988
  ob.observe(instance.subTree.el.parentNode, { childList: true });
11953
11989
  onUnmounted(() => ob.disconnect());
@@ -12213,11 +12249,14 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
12213
12249
  const invokers = el[veiKey] || (el[veiKey] = {});
12214
12250
  const existingInvoker = invokers[rawName];
12215
12251
  if (nextValue && existingInvoker) {
12216
- existingInvoker.value = nextValue;
12252
+ existingInvoker.value = !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue;
12217
12253
  } else {
12218
12254
  const [name, options] = parseName(rawName);
12219
12255
  if (nextValue) {
12220
- const invoker = invokers[rawName] = createInvoker(nextValue, instance);
12256
+ const invoker = invokers[rawName] = createInvoker(
12257
+ !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue,
12258
+ instance
12259
+ );
12221
12260
  addEventListener(el, name, invoker, options);
12222
12261
  } else if (existingInvoker) {
12223
12262
  removeEventListener(el, name, existingInvoker, options);
@@ -12260,6 +12299,16 @@ function createInvoker(initialValue, instance) {
12260
12299
  invoker.attached = getNow();
12261
12300
  return invoker;
12262
12301
  }
12302
+ function sanitizeEventValue(value, propName) {
12303
+ if (isFunction(value) || isArray(value)) {
12304
+ return value;
12305
+ }
12306
+ warn(
12307
+ `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
12308
+ Expected function or array of functions, received type ${typeof value}.`
12309
+ );
12310
+ return NOOP;
12311
+ }
12263
12312
  function patchStopImmediatePropagation(e, value) {
12264
12313
  if (isArray(value)) {
12265
12314
  const originalStop = e.stopImmediatePropagation;
@@ -12267,7 +12316,9 @@ function patchStopImmediatePropagation(e, value) {
12267
12316
  originalStop.call(e);
12268
12317
  e._stopped = true;
12269
12318
  };
12270
- return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
12319
+ return value.map(
12320
+ (fn) => (e2) => !e2._stopped && fn && fn(e2)
12321
+ );
12271
12322
  } else {
12272
12323
  return value;
12273
12324
  }
@@ -12468,7 +12519,7 @@ class VueElement extends BaseClass {
12468
12519
  }
12469
12520
  }
12470
12521
  _setAttr(key) {
12471
- let value = this.getAttribute(key);
12522
+ let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0;
12472
12523
  const camelKey = camelize(key);
12473
12524
  if (this._numberProps && this._numberProps[camelKey]) {
12474
12525
  value = toNumber(value);
@@ -12640,7 +12691,28 @@ const TransitionGroupImpl = {
12640
12691
  )) {
12641
12692
  tag = "span";
12642
12693
  }
12643
- prevChildren = children;
12694
+ prevChildren = [];
12695
+ if (children) {
12696
+ for (let i = 0; i < children.length; i++) {
12697
+ const child = children[i];
12698
+ if (child.el && child.el instanceof Element) {
12699
+ prevChildren.push(child);
12700
+ setTransitionHooks(
12701
+ child,
12702
+ resolveTransitionHooks(
12703
+ child,
12704
+ cssTransitionProps,
12705
+ state,
12706
+ instance
12707
+ )
12708
+ );
12709
+ positionMap.set(
12710
+ child,
12711
+ child.el.getBoundingClientRect()
12712
+ );
12713
+ }
12714
+ }
12715
+ }
12644
12716
  children = slots.default ? getTransitionRawChildren(slots.default()) : [];
12645
12717
  for (let i = 0; i < children.length; i++) {
12646
12718
  const child = children[i];
@@ -12653,16 +12725,6 @@ const TransitionGroupImpl = {
12653
12725
  warn(`<TransitionGroup> children must be keyed.`);
12654
12726
  }
12655
12727
  }
12656
- if (prevChildren) {
12657
- for (let i = 0; i < prevChildren.length; i++) {
12658
- const child = prevChildren[i];
12659
- setTransitionHooks(
12660
- child,
12661
- resolveTransitionHooks(child, cssTransitionProps, state, instance)
12662
- );
12663
- positionMap.set(child, child.el.getBoundingClientRect());
12664
- }
12665
- }
12666
12728
  return createVNode(tag, null, children);
12667
12729
  };
12668
12730
  }
@@ -12764,7 +12826,7 @@ const vModelText = {
12764
12826
  el[assignKey] = getModelAssigner(vnode);
12765
12827
  if (el.composing)
12766
12828
  return;
12767
- const elValue = number || el.type === "number" ? looseToNumber(el.value) : el.value;
12829
+ const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
12768
12830
  const newValue = value == null ? "" : value;
12769
12831
  if (elValue === newValue) {
12770
12832
  return;
@@ -12867,14 +12929,14 @@ const vModelSelect = {
12867
12929
  // set value in mounted & updated because <select> relies on its children
12868
12930
  // <option>s.
12869
12931
  mounted(el, { value, modifiers: { number } }) {
12870
- setSelected(el, value, number);
12932
+ setSelected(el, value);
12871
12933
  },
12872
12934
  beforeUpdate(el, _binding, vnode) {
12873
12935
  el[assignKey] = getModelAssigner(vnode);
12874
12936
  },
12875
12937
  updated(el, { value, modifiers: { number } }) {
12876
12938
  if (!el._assigning) {
12877
- setSelected(el, value, number);
12939
+ setSelected(el, value);
12878
12940
  }
12879
12941
  }
12880
12942
  };
@@ -12894,9 +12956,7 @@ function setSelected(el, value, number) {
12894
12956
  if (isArrayValue) {
12895
12957
  const optionType = typeof optionValue;
12896
12958
  if (optionType === "string" || optionType === "number") {
12897
- option.selected = value.includes(
12898
- number ? looseToNumber(optionValue) : optionValue
12899
- );
12959
+ option.selected = value.some((v) => String(v) === String(optionValue));
12900
12960
  } else {
12901
12961
  option.selected = looseIndexOf(value, optionValue) > -1;
12902
12962
  }
@@ -15252,7 +15312,7 @@ function onCloseTag(el, end, isImplied = false) {
15252
15312
  if (isImplied) {
15253
15313
  setLocEnd(el.loc, backTrack(end, 60));
15254
15314
  } else {
15255
- setLocEnd(el.loc, end + 1);
15315
+ setLocEnd(el.loc, lookAhead(end, 62) + 1);
15256
15316
  }
15257
15317
  if (tokenizer.inSFCRoot) {
15258
15318
  if (el.children.length) {
@@ -15347,6 +15407,12 @@ function onCloseTag(el, end, isImplied = false) {
15347
15407
  }
15348
15408
  }
15349
15409
  }
15410
+ function lookAhead(index, c) {
15411
+ let i = index;
15412
+ while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1)
15413
+ i++;
15414
+ return i;
15415
+ }
15350
15416
  function backTrack(index, c) {
15351
15417
  let i = index;
15352
15418
  while (currentInput.charCodeAt(i) !== c && i >= 0)
@@ -17531,13 +17597,27 @@ const transformElement = (node, context) => {
17531
17597
  function resolveComponentType(node, context, ssr = false) {
17532
17598
  let { tag } = node;
17533
17599
  const isExplicitDynamic = isComponentTag(tag);
17534
- const isProp = findProp(node, "is");
17600
+ const isProp = findProp(
17601
+ node,
17602
+ "is",
17603
+ false,
17604
+ true
17605
+ /* allow empty */
17606
+ );
17535
17607
  if (isProp) {
17536
17608
  if (isExplicitDynamic || isCompatEnabled(
17537
17609
  "COMPILER_IS_ON_ELEMENT",
17538
17610
  context
17539
17611
  )) {
17540
- const exp = isProp.type === 6 ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp;
17612
+ let exp;
17613
+ if (isProp.type === 6) {
17614
+ exp = isProp.value && createSimpleExpression(isProp.value.content, true);
17615
+ } else {
17616
+ exp = isProp.exp;
17617
+ if (!exp) {
17618
+ exp = createSimpleExpression(`is`, false, isProp.loc);
17619
+ }
17620
+ }
17541
17621
  if (exp) {
17542
17622
  return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
17543
17623
  exp