@vue/compat 3.4.21 → 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.21
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"];
@@ -1777,11 +1778,17 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
1777
1778
  }
1778
1779
  return res;
1779
1780
  }
1780
- const values = [];
1781
- for (let i = 0; i < fn.length; i++) {
1782
- values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
1781
+ if (isArray(fn)) {
1782
+ const values = [];
1783
+ for (let i = 0; i < fn.length; i++) {
1784
+ values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
1785
+ }
1786
+ return values;
1787
+ } else {
1788
+ warn$1(
1789
+ `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
1790
+ );
1783
1791
  }
1784
- return values;
1785
1792
  }
1786
1793
  function handleError(err, instance, type, throwInDev = true) {
1787
1794
  const contextVNode = instance ? instance.vnode : null;
@@ -1802,12 +1809,14 @@ function handleError(err, instance, type, throwInDev = true) {
1802
1809
  }
1803
1810
  const appErrorHandler = instance.appContext.config.errorHandler;
1804
1811
  if (appErrorHandler) {
1812
+ pauseTracking();
1805
1813
  callWithErrorHandling(
1806
1814
  appErrorHandler,
1807
1815
  null,
1808
1816
  10,
1809
1817
  [err, exposedInstance, errorInfo]
1810
1818
  );
1819
+ resetTracking();
1811
1820
  return;
1812
1821
  }
1813
1822
  }
@@ -2183,6 +2192,8 @@ const devtoolsComponentRemoved = (component) => {
2183
2192
  _devtoolsComponentRemoved(component);
2184
2193
  }
2185
2194
  };
2195
+ /*! #__NO_SIDE_EFFECTS__ */
2196
+ // @__NO_SIDE_EFFECTS__
2186
2197
  function createDevtoolsComponentHook(hook) {
2187
2198
  return (component) => {
2188
2199
  emit$2(
@@ -4834,7 +4845,7 @@ const KeepAliveImpl = {
4834
4845
  return () => {
4835
4846
  pendingCacheKey = null;
4836
4847
  if (!slots.default) {
4837
- return null;
4848
+ return current = null;
4838
4849
  }
4839
4850
  const children = slots.default();
4840
4851
  const rawVNode = children[0];
@@ -5565,47 +5576,74 @@ function installCompatInstanceProperties(map) {
5565
5576
  $once: (i) => once.bind(null, i),
5566
5577
  $off: (i) => off.bind(null, i),
5567
5578
  $children: getCompatChildren,
5568
- $listeners: getCompatListeners
5579
+ $listeners: getCompatListeners,
5580
+ // inject additional properties into $options for compat
5581
+ // e.g. vuex needs this.$options.parent
5582
+ $options: (i) => {
5583
+ if (!isCompatEnabled$1("PRIVATE_APIS", i)) {
5584
+ return resolveMergedOptions(i);
5585
+ }
5586
+ if (i.resolvedOptions) {
5587
+ return i.resolvedOptions;
5588
+ }
5589
+ const res = i.resolvedOptions = extend({}, resolveMergedOptions(i));
5590
+ Object.defineProperties(res, {
5591
+ parent: {
5592
+ get() {
5593
+ warnDeprecation$1("PRIVATE_APIS", i, "$options.parent");
5594
+ return i.proxy.$parent;
5595
+ }
5596
+ },
5597
+ propsData: {
5598
+ get() {
5599
+ warnDeprecation$1(
5600
+ "PRIVATE_APIS",
5601
+ i,
5602
+ "$options.propsData"
5603
+ );
5604
+ return i.vnode.props;
5605
+ }
5606
+ }
5607
+ });
5608
+ return res;
5609
+ }
5569
5610
  });
5570
- if (isCompatEnabled$1("PRIVATE_APIS", null)) {
5571
- extend(map, {
5572
- // needed by many libs / render fns
5573
- $vnode: (i) => i.vnode,
5574
- // inject additional properties into $options for compat
5575
- // e.g. vuex needs this.$options.parent
5576
- $options: (i) => {
5577
- const res = extend({}, resolveMergedOptions(i));
5578
- res.parent = i.proxy.$parent;
5579
- res.propsData = i.vnode.props;
5580
- return res;
5581
- },
5582
- // some private properties that are likely accessed...
5583
- _self: (i) => i.proxy,
5584
- _uid: (i) => i.uid,
5585
- _data: (i) => i.data,
5586
- _isMounted: (i) => i.isMounted,
5587
- _isDestroyed: (i) => i.isUnmounted,
5588
- // v2 render helpers
5589
- $createElement: () => compatH,
5590
- _c: () => compatH,
5591
- _o: () => legacyMarkOnce,
5592
- _n: () => looseToNumber,
5593
- _s: () => toDisplayString,
5594
- _l: () => renderList,
5595
- _t: (i) => legacyRenderSlot.bind(null, i),
5596
- _q: () => looseEqual,
5597
- _i: () => looseIndexOf,
5598
- _m: (i) => legacyRenderStatic.bind(null, i),
5599
- _f: () => resolveFilter$1,
5600
- _k: (i) => legacyCheckKeyCodes.bind(null, i),
5601
- _b: () => legacyBindObjectProps,
5602
- _v: () => createTextVNode,
5603
- _e: () => createCommentVNode,
5604
- _u: () => legacyresolveScopedSlots,
5605
- _g: () => legacyBindObjectListeners,
5606
- _d: () => legacyBindDynamicKeys,
5607
- _p: () => legacyPrependModifier
5608
- });
5611
+ const privateAPIs = {
5612
+ // needed by many libs / render fns
5613
+ $vnode: (i) => i.vnode,
5614
+ // some private properties that are likely accessed...
5615
+ _self: (i) => i.proxy,
5616
+ _uid: (i) => i.uid,
5617
+ _data: (i) => i.data,
5618
+ _isMounted: (i) => i.isMounted,
5619
+ _isDestroyed: (i) => i.isUnmounted,
5620
+ // v2 render helpers
5621
+ $createElement: () => compatH,
5622
+ _c: () => compatH,
5623
+ _o: () => legacyMarkOnce,
5624
+ _n: () => looseToNumber,
5625
+ _s: () => toDisplayString,
5626
+ _l: () => renderList,
5627
+ _t: (i) => legacyRenderSlot.bind(null, i),
5628
+ _q: () => looseEqual,
5629
+ _i: () => looseIndexOf,
5630
+ _m: (i) => legacyRenderStatic.bind(null, i),
5631
+ _f: () => resolveFilter$1,
5632
+ _k: (i) => legacyCheckKeyCodes.bind(null, i),
5633
+ _b: () => legacyBindObjectProps,
5634
+ _v: () => createTextVNode,
5635
+ _e: () => createCommentVNode,
5636
+ _u: () => legacyresolveScopedSlots,
5637
+ _g: () => legacyBindObjectListeners,
5638
+ _d: () => legacyBindDynamicKeys,
5639
+ _p: () => legacyPrependModifier
5640
+ };
5641
+ for (const key in privateAPIs) {
5642
+ map[key] = (i) => {
5643
+ if (isCompatEnabled$1("PRIVATE_APIS", i)) {
5644
+ return privateAPIs[key](i);
5645
+ }
5646
+ };
5609
5647
  }
5610
5648
  }
5611
5649
 
@@ -5646,6 +5684,9 @@ const isReservedPrefix = (key) => key === "_" || key === "$";
5646
5684
  const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
5647
5685
  const PublicInstanceProxyHandlers = {
5648
5686
  get({ _: instance }, key) {
5687
+ if (key === "__v_skip") {
5688
+ return true;
5689
+ }
5649
5690
  const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
5650
5691
  if (key === "__isVue") {
5651
5692
  return true;
@@ -6500,7 +6541,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6500
6541
  return vm;
6501
6542
  }
6502
6543
  }
6503
- Vue.version = `2.6.14-compat:${"3.4.21"}`;
6544
+ Vue.version = `2.6.14-compat:${"3.4.22"}`;
6504
6545
  Vue.config = singletonApp.config;
6505
6546
  Vue.use = (p, ...options) => {
6506
6547
  if (p && isFunction(p.install)) {
@@ -6694,15 +6735,14 @@ function applySingletonPrototype(app, Ctor) {
6694
6735
  app.config.globalProperties = Object.create(Ctor.prototype);
6695
6736
  }
6696
6737
  let hasPrototypeAugmentations = false;
6697
- const descriptors = Object.getOwnPropertyDescriptors(Ctor.prototype);
6698
- for (const key in descriptors) {
6738
+ for (const key of Object.getOwnPropertyNames(Ctor.prototype)) {
6699
6739
  if (key !== "constructor") {
6700
6740
  hasPrototypeAugmentations = true;
6701
6741
  if (enabled) {
6702
6742
  Object.defineProperty(
6703
6743
  app.config.globalProperties,
6704
6744
  key,
6705
- descriptors[key]
6745
+ Object.getOwnPropertyDescriptor(Ctor.prototype, key)
6706
6746
  );
6707
6747
  }
6708
6748
  }
@@ -7138,10 +7178,10 @@ function shouldSkipAttr(key, instance) {
7138
7178
  return false;
7139
7179
  }
7140
7180
 
7181
+ const attrsProto = {};
7141
7182
  function initProps(instance, rawProps, isStateful, isSSR = false) {
7142
7183
  const props = {};
7143
- const attrs = {};
7144
- def(attrs, InternalObjectKey, 1);
7184
+ const attrs = Object.create(attrsProto);
7145
7185
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
7146
7186
  setFullProps(instance, rawProps, props, attrs);
7147
7187
  for (const key in instance.propsOptions[0]) {
@@ -7263,7 +7303,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
7263
7303
  }
7264
7304
  }
7265
7305
  if (hasAttrsChanged) {
7266
- trigger(instance, "set", "$attrs");
7306
+ trigger(instance.attrs, "set", "");
7267
7307
  }
7268
7308
  {
7269
7309
  validateProps(rawProps || {}, props, instance);
@@ -7621,7 +7661,7 @@ const initSlots = (instance, children) => {
7621
7661
  const type = children._;
7622
7662
  if (type) {
7623
7663
  instance.slots = toRaw(children);
7624
- def(children, "_", type);
7664
+ def(instance.slots, "_", type);
7625
7665
  } else {
7626
7666
  normalizeObjectSlots(
7627
7667
  children,
@@ -7635,7 +7675,6 @@ const initSlots = (instance, children) => {
7635
7675
  normalizeVNodeSlots(instance, children);
7636
7676
  }
7637
7677
  }
7638
- def(instance.slots, InternalObjectKey, 1);
7639
7678
  };
7640
7679
  const updateSlots = (instance, children, optimized) => {
7641
7680
  const { vnode, slots } = instance;
@@ -7807,6 +7846,7 @@ function createHydrationFunctions(rendererInternals) {
7807
7846
  }
7808
7847
  };
7809
7848
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
7849
+ optimized = optimized || !!vnode.dynamicChildren;
7810
7850
  const isFragmentStart = isComment(node) && node.data === "[";
7811
7851
  const onMismatch = () => handleMismatch(
7812
7852
  node,
@@ -10326,7 +10366,6 @@ const createVNodeWithArgsTransform = (...args) => {
10326
10366
  ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
10327
10367
  );
10328
10368
  };
10329
- const InternalObjectKey = `__vInternal`;
10330
10369
  const normalizeKey = ({ key }) => key != null ? key : null;
10331
10370
  const normalizeRef = ({
10332
10371
  ref,
@@ -10466,7 +10505,7 @@ Component that was made reactive: `,
10466
10505
  function guardReactiveProps(props) {
10467
10506
  if (!props)
10468
10507
  return null;
10469
- return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
10508
+ return isProxy(props) || Object.getPrototypeOf(props) === attrsProto ? extend({}, props) : props;
10470
10509
  }
10471
10510
  function cloneVNode(vnode, extraProps, mergeRef = false) {
10472
10511
  const { props, ref, patchFlag, children } = vnode;
@@ -10574,7 +10613,7 @@ function normalizeChildren(vnode, children) {
10574
10613
  } else {
10575
10614
  type = 32;
10576
10615
  const slotFlag = children._;
10577
- if (!slotFlag && !(InternalObjectKey in children)) {
10616
+ if (!slotFlag) {
10578
10617
  children._ctx = currentRenderingInstance;
10579
10618
  } else if (slotFlag === 3 && currentRenderingInstance) {
10580
10619
  if (currentRenderingInstance.slots._ === 1) {
@@ -10795,7 +10834,7 @@ function setupStatefulComponent(instance, isSSR) {
10795
10834
  }
10796
10835
  }
10797
10836
  instance.accessCache = /* @__PURE__ */ Object.create(null);
10798
- instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
10837
+ instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
10799
10838
  {
10800
10839
  exposePropsOnRenderContext(instance);
10801
10840
  }
@@ -10939,26 +10978,21 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
10939
10978
  }
10940
10979
  }
10941
10980
  }
10942
- function getAttrsProxy(instance) {
10943
- return instance.attrsProxy || (instance.attrsProxy = new Proxy(
10944
- instance.attrs,
10945
- {
10946
- get(target, key) {
10947
- markAttrsAccessed();
10948
- track(instance, "get", "$attrs");
10949
- return target[key];
10950
- },
10951
- set() {
10952
- warn$1(`setupContext.attrs is readonly.`);
10953
- return false;
10954
- },
10955
- deleteProperty() {
10956
- warn$1(`setupContext.attrs is readonly.`);
10957
- return false;
10958
- }
10959
- }
10960
- ));
10961
- }
10981
+ const attrsProxyHandlers = {
10982
+ get(target, key) {
10983
+ markAttrsAccessed();
10984
+ track(target, "get", "");
10985
+ return target[key];
10986
+ },
10987
+ set() {
10988
+ warn$1(`setupContext.attrs is readonly.`);
10989
+ return false;
10990
+ },
10991
+ deleteProperty() {
10992
+ warn$1(`setupContext.attrs is readonly.`);
10993
+ return false;
10994
+ }
10995
+ } ;
10962
10996
  function getSlotsProxy(instance) {
10963
10997
  return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
10964
10998
  get(target, key) {
@@ -10992,9 +11026,10 @@ function createSetupContext(instance) {
10992
11026
  instance.exposed = exposed || {};
10993
11027
  };
10994
11028
  {
11029
+ let attrsProxy;
10995
11030
  return Object.freeze({
10996
11031
  get attrs() {
10997
- return getAttrsProxy(instance);
11032
+ return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
10998
11033
  },
10999
11034
  get slots() {
11000
11035
  return getSlotsProxy(instance);
@@ -11339,7 +11374,7 @@ function isMemoSame(cached, memo) {
11339
11374
  return true;
11340
11375
  }
11341
11376
 
11342
- const version = "3.4.21";
11377
+ const version = "3.4.22";
11343
11378
  const warn = warn$1 ;
11344
11379
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11345
11380
  const devtools = devtools$1 ;
@@ -11809,8 +11844,8 @@ function useCssVars(getter) {
11809
11844
  setVarsOnVNode(instance.subTree, vars);
11810
11845
  updateTeleports(vars);
11811
11846
  };
11812
- watchPostEffect(setVars);
11813
11847
  onMounted(() => {
11848
+ watchPostEffect(setVars);
11814
11849
  const ob = new MutationObserver(setVars);
11815
11850
  ob.observe(instance.subTree.el.parentNode, { childList: true });
11816
11851
  onUnmounted(() => ob.disconnect());
@@ -12076,11 +12111,14 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
12076
12111
  const invokers = el[veiKey] || (el[veiKey] = {});
12077
12112
  const existingInvoker = invokers[rawName];
12078
12113
  if (nextValue && existingInvoker) {
12079
- existingInvoker.value = nextValue;
12114
+ existingInvoker.value = sanitizeEventValue(nextValue, rawName) ;
12080
12115
  } else {
12081
12116
  const [name, options] = parseName(rawName);
12082
12117
  if (nextValue) {
12083
- const invoker = invokers[rawName] = createInvoker(nextValue, instance);
12118
+ const invoker = invokers[rawName] = createInvoker(
12119
+ sanitizeEventValue(nextValue, rawName) ,
12120
+ instance
12121
+ );
12084
12122
  addEventListener(el, name, invoker, options);
12085
12123
  } else if (existingInvoker) {
12086
12124
  removeEventListener(el, name, existingInvoker, options);
@@ -12123,6 +12161,16 @@ function createInvoker(initialValue, instance) {
12123
12161
  invoker.attached = getNow();
12124
12162
  return invoker;
12125
12163
  }
12164
+ function sanitizeEventValue(value, propName) {
12165
+ if (isFunction(value) || isArray(value)) {
12166
+ return value;
12167
+ }
12168
+ warn(
12169
+ `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
12170
+ Expected function or array of functions, received type ${typeof value}.`
12171
+ );
12172
+ return NOOP;
12173
+ }
12126
12174
  function patchStopImmediatePropagation(e, value) {
12127
12175
  if (isArray(value)) {
12128
12176
  const originalStop = e.stopImmediatePropagation;
@@ -12130,7 +12178,9 @@ function patchStopImmediatePropagation(e, value) {
12130
12178
  originalStop.call(e);
12131
12179
  e._stopped = true;
12132
12180
  };
12133
- return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
12181
+ return value.map(
12182
+ (fn) => (e2) => !e2._stopped && fn && fn(e2)
12183
+ );
12134
12184
  } else {
12135
12185
  return value;
12136
12186
  }
@@ -12331,7 +12381,7 @@ class VueElement extends BaseClass {
12331
12381
  }
12332
12382
  }
12333
12383
  _setAttr(key) {
12334
- let value = this.getAttribute(key);
12384
+ let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0;
12335
12385
  const camelKey = camelize(key);
12336
12386
  if (this._numberProps && this._numberProps[camelKey]) {
12337
12387
  value = toNumber(value);
@@ -12503,7 +12553,28 @@ const TransitionGroupImpl = {
12503
12553
  )) {
12504
12554
  tag = "span";
12505
12555
  }
12506
- prevChildren = children;
12556
+ prevChildren = [];
12557
+ if (children) {
12558
+ for (let i = 0; i < children.length; i++) {
12559
+ const child = children[i];
12560
+ if (child.el && child.el instanceof Element) {
12561
+ prevChildren.push(child);
12562
+ setTransitionHooks(
12563
+ child,
12564
+ resolveTransitionHooks(
12565
+ child,
12566
+ cssTransitionProps,
12567
+ state,
12568
+ instance
12569
+ )
12570
+ );
12571
+ positionMap.set(
12572
+ child,
12573
+ child.el.getBoundingClientRect()
12574
+ );
12575
+ }
12576
+ }
12577
+ }
12507
12578
  children = slots.default ? getTransitionRawChildren(slots.default()) : [];
12508
12579
  for (let i = 0; i < children.length; i++) {
12509
12580
  const child = children[i];
@@ -12516,16 +12587,6 @@ const TransitionGroupImpl = {
12516
12587
  warn(`<TransitionGroup> children must be keyed.`);
12517
12588
  }
12518
12589
  }
12519
- if (prevChildren) {
12520
- for (let i = 0; i < prevChildren.length; i++) {
12521
- const child = prevChildren[i];
12522
- setTransitionHooks(
12523
- child,
12524
- resolveTransitionHooks(child, cssTransitionProps, state, instance)
12525
- );
12526
- positionMap.set(child, child.el.getBoundingClientRect());
12527
- }
12528
- }
12529
12590
  return createVNode(tag, null, children);
12530
12591
  };
12531
12592
  }
@@ -12627,7 +12688,7 @@ const vModelText = {
12627
12688
  el[assignKey] = getModelAssigner(vnode);
12628
12689
  if (el.composing)
12629
12690
  return;
12630
- const elValue = number || el.type === "number" ? looseToNumber(el.value) : el.value;
12691
+ const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
12631
12692
  const newValue = value == null ? "" : value;
12632
12693
  if (elValue === newValue) {
12633
12694
  return;
@@ -12730,14 +12791,14 @@ const vModelSelect = {
12730
12791
  // set value in mounted & updated because <select> relies on its children
12731
12792
  // <option>s.
12732
12793
  mounted(el, { value, modifiers: { number } }) {
12733
- setSelected(el, value, number);
12794
+ setSelected(el, value);
12734
12795
  },
12735
12796
  beforeUpdate(el, _binding, vnode) {
12736
12797
  el[assignKey] = getModelAssigner(vnode);
12737
12798
  },
12738
12799
  updated(el, { value, modifiers: { number } }) {
12739
12800
  if (!el._assigning) {
12740
- setSelected(el, value, number);
12801
+ setSelected(el, value);
12741
12802
  }
12742
12803
  }
12743
12804
  };
@@ -12757,9 +12818,7 @@ function setSelected(el, value, number) {
12757
12818
  if (isArrayValue) {
12758
12819
  const optionType = typeof optionValue;
12759
12820
  if (optionType === "string" || optionType === "number") {
12760
- option.selected = value.includes(
12761
- number ? looseToNumber(optionValue) : optionValue
12762
- );
12821
+ option.selected = value.some((v) => String(v) === String(optionValue));
12763
12822
  } else {
12764
12823
  option.selected = looseIndexOf(value, optionValue) > -1;
12765
12824
  }
@@ -15080,7 +15139,7 @@ function onCloseTag(el, end, isImplied = false) {
15080
15139
  if (isImplied) {
15081
15140
  setLocEnd(el.loc, backTrack(end, 60));
15082
15141
  } else {
15083
- setLocEnd(el.loc, end + 1);
15142
+ setLocEnd(el.loc, lookAhead(end, 62) + 1);
15084
15143
  }
15085
15144
  if (tokenizer.inSFCRoot) {
15086
15145
  if (el.children.length) {
@@ -15175,6 +15234,12 @@ function onCloseTag(el, end, isImplied = false) {
15175
15234
  }
15176
15235
  }
15177
15236
  }
15237
+ function lookAhead(index, c) {
15238
+ let i = index;
15239
+ while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1)
15240
+ i++;
15241
+ return i;
15242
+ }
15178
15243
  function backTrack(index, c) {
15179
15244
  let i = index;
15180
15245
  while (currentInput.charCodeAt(i) !== c && i >= 0)
@@ -17356,13 +17421,27 @@ const transformElement = (node, context) => {
17356
17421
  function resolveComponentType(node, context, ssr = false) {
17357
17422
  let { tag } = node;
17358
17423
  const isExplicitDynamic = isComponentTag(tag);
17359
- const isProp = findProp(node, "is");
17424
+ const isProp = findProp(
17425
+ node,
17426
+ "is",
17427
+ false,
17428
+ true
17429
+ /* allow empty */
17430
+ );
17360
17431
  if (isProp) {
17361
17432
  if (isExplicitDynamic || isCompatEnabled(
17362
17433
  "COMPILER_IS_ON_ELEMENT",
17363
17434
  context
17364
17435
  )) {
17365
- const exp = isProp.type === 6 ? isProp.value && createSimpleExpression(isProp.value.content, true) : isProp.exp;
17436
+ let exp;
17437
+ if (isProp.type === 6) {
17438
+ exp = isProp.value && createSimpleExpression(isProp.value.content, true);
17439
+ } else {
17440
+ exp = isProp.exp;
17441
+ if (!exp) {
17442
+ exp = createSimpleExpression(`is`, false, isProp.loc);
17443
+ }
17444
+ }
17366
17445
  if (exp) {
17367
17446
  return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
17368
17447
  exp