@vue/runtime-dom 3.2.21 → 3.2.25

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.
@@ -37,7 +37,7 @@ var VueRuntimeDOM = (function (exports) {
37
37
  const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);
38
38
  /**
39
39
  * Boolean attributes should be included if the value is truthy or ''.
40
- * e.g. <select multiple> compiles to { multiple: '' }
40
+ * e.g. `<select multiple>` compiles to `{ multiple: '' }`
41
41
  */
42
42
  function includeBooleanAttr(value) {
43
43
  return !!value || value === '';
@@ -269,7 +269,7 @@ var VueRuntimeDOM = (function (exports) {
269
269
  '' + parseInt(key, 10) === key;
270
270
  const isReservedProp = /*#__PURE__*/ makeMap(
271
271
  // the leading comma is intentional so empty string "" is also included
272
- ',key,ref,' +
272
+ ',key,ref,ref_for,ref_key,' +
273
273
  'onVnodeBeforeMount,onVnodeMounted,' +
274
274
  'onVnodeBeforeUpdate,onVnodeUpdated,' +
275
275
  'onVnodeBeforeUnmount,onVnodeUnmounted');
@@ -458,7 +458,7 @@ var VueRuntimeDOM = (function (exports) {
458
458
  let effectTrackDepth = 0;
459
459
  let trackOpBit = 1;
460
460
  /**
461
- * The bitwise track markers support at most 30 levels op recursion.
461
+ * The bitwise track markers support at most 30 levels of recursion.
462
462
  * This value is chosen to enable modern JS engines to use a SMI on all platforms.
463
463
  * When recursion depth is greater, fall back to using a full cleanup.
464
464
  */
@@ -779,7 +779,7 @@ var VueRuntimeDOM = (function (exports) {
779
779
  function createSetter(shallow = false) {
780
780
  return function set(target, key, value, receiver) {
781
781
  let oldValue = target[key];
782
- if (!shallow) {
782
+ if (!shallow && !isReadonly(value)) {
783
783
  value = toRaw(value);
784
784
  oldValue = toRaw(oldValue);
785
785
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
@@ -1364,21 +1364,25 @@ var VueRuntimeDOM = (function (exports) {
1364
1364
  return ret;
1365
1365
  }
1366
1366
  class ObjectRefImpl {
1367
- constructor(_object, _key) {
1367
+ constructor(_object, _key, _defaultValue) {
1368
1368
  this._object = _object;
1369
1369
  this._key = _key;
1370
+ this._defaultValue = _defaultValue;
1370
1371
  this.__v_isRef = true;
1371
1372
  }
1372
1373
  get value() {
1373
- return this._object[this._key];
1374
+ const val = this._object[this._key];
1375
+ return val === undefined ? this._defaultValue : val;
1374
1376
  }
1375
1377
  set value(newVal) {
1376
1378
  this._object[this._key] = newVal;
1377
1379
  }
1378
1380
  }
1379
- function toRef(object, key) {
1381
+ function toRef(object, key, defaultValue) {
1380
1382
  const val = object[key];
1381
- return isRef(val) ? val : new ObjectRefImpl(object, key);
1383
+ return isRef(val)
1384
+ ? val
1385
+ : new ObjectRefImpl(object, key, defaultValue);
1382
1386
  }
1383
1387
 
1384
1388
  class ComputedRefImpl {
@@ -1584,6 +1588,7 @@ var VueRuntimeDOM = (function (exports) {
1584
1588
  }
1585
1589
  }
1586
1590
  function setDevtoolsHook(hook, target) {
1591
+ var _a, _b;
1587
1592
  exports.devtools = hook;
1588
1593
  if (exports.devtools) {
1589
1594
  exports.devtools.enabled = true;
@@ -1596,7 +1601,10 @@ var VueRuntimeDOM = (function (exports) {
1596
1601
  // (#4815)
1597
1602
  // eslint-disable-next-line no-restricted-globals
1598
1603
  typeof window !== 'undefined' &&
1599
- !navigator.userAgent.includes('jsdom')) {
1604
+ // some envs mock window but not fully
1605
+ window.HTMLElement &&
1606
+ // also exclude jsdom
1607
+ !((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes('jsdom'))) {
1600
1608
  const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
1601
1609
  target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []);
1602
1610
  replay.push((newHook) => {
@@ -2690,7 +2698,8 @@ var VueRuntimeDOM = (function (exports) {
2690
2698
  const rawProps = toRaw(props);
2691
2699
  const { mode } = rawProps;
2692
2700
  // check mode
2693
- if (mode && !['in-out', 'out-in', 'default'].includes(mode)) {
2701
+ if (mode &&
2702
+ mode !== 'in-out' && mode !== 'out-in' && mode !== 'default') {
2694
2703
  warn$1(`invalid <transition> mode: ${mode}`);
2695
2704
  }
2696
2705
  // at this point children has a guaranteed length of 1.
@@ -3330,7 +3339,7 @@ var VueRuntimeDOM = (function (exports) {
3330
3339
  }
3331
3340
  current = current.parent;
3332
3341
  }
3333
- hook();
3342
+ return hook();
3334
3343
  });
3335
3344
  injectHook(type, wrappedHook, target);
3336
3345
  // In addition to registering it on the target instance, we walk up the parent
@@ -3992,7 +4001,7 @@ var VueRuntimeDOM = (function (exports) {
3992
4001
  }
3993
4002
  }
3994
4003
  else if (!isEmitListener(instance.emitsOptions, key)) {
3995
- if (value !== attrs[key]) {
4004
+ if (!(key in attrs) || value !== attrs[key]) {
3996
4005
  attrs[key] = value;
3997
4006
  hasAttrsChanged = true;
3998
4007
  }
@@ -4632,6 +4641,102 @@ var VueRuntimeDOM = (function (exports) {
4632
4641
  };
4633
4642
  }
4634
4643
 
4644
+ /**
4645
+ * Function for handling a template ref
4646
+ */
4647
+ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4648
+ if (isArray(rawRef)) {
4649
+ rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));
4650
+ return;
4651
+ }
4652
+ if (isAsyncWrapper(vnode) && !isUnmount) {
4653
+ // when mounting async components, nothing needs to be done,
4654
+ // because the template ref is forwarded to inner component
4655
+ return;
4656
+ }
4657
+ const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
4658
+ ? getExposeProxy(vnode.component) || vnode.component.proxy
4659
+ : vnode.el;
4660
+ const value = isUnmount ? null : refValue;
4661
+ const { i: owner, r: ref } = rawRef;
4662
+ if (!owner) {
4663
+ warn$1(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
4664
+ `A vnode with ref must be created inside the render function.`);
4665
+ return;
4666
+ }
4667
+ const oldRef = oldRawRef && oldRawRef.r;
4668
+ const refs = owner.refs === EMPTY_OBJ ? (owner.refs = {}) : owner.refs;
4669
+ const setupState = owner.setupState;
4670
+ // dynamic ref changed. unset old ref
4671
+ if (oldRef != null && oldRef !== ref) {
4672
+ if (isString(oldRef)) {
4673
+ refs[oldRef] = null;
4674
+ if (hasOwn(setupState, oldRef)) {
4675
+ setupState[oldRef] = null;
4676
+ }
4677
+ }
4678
+ else if (isRef(oldRef)) {
4679
+ oldRef.value = null;
4680
+ }
4681
+ }
4682
+ if (isFunction(ref)) {
4683
+ callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
4684
+ }
4685
+ else {
4686
+ const _isString = isString(ref);
4687
+ const _isRef = isRef(ref);
4688
+ if (_isString || _isRef) {
4689
+ const doSet = () => {
4690
+ if (rawRef.f) {
4691
+ const existing = _isString ? refs[ref] : ref.value;
4692
+ if (isUnmount) {
4693
+ isArray(existing) && remove(existing, refValue);
4694
+ }
4695
+ else {
4696
+ if (!isArray(existing)) {
4697
+ if (_isString) {
4698
+ refs[ref] = [refValue];
4699
+ }
4700
+ else {
4701
+ ref.value = [refValue];
4702
+ if (rawRef.k)
4703
+ refs[rawRef.k] = ref.value;
4704
+ }
4705
+ }
4706
+ else if (!existing.includes(refValue)) {
4707
+ existing.push(refValue);
4708
+ }
4709
+ }
4710
+ }
4711
+ else if (_isString) {
4712
+ refs[ref] = value;
4713
+ if (hasOwn(setupState, ref)) {
4714
+ setupState[ref] = value;
4715
+ }
4716
+ }
4717
+ else if (isRef(ref)) {
4718
+ ref.value = value;
4719
+ if (rawRef.k)
4720
+ refs[rawRef.k] = value;
4721
+ }
4722
+ else {
4723
+ warn$1('Invalid template ref type:', ref, `(${typeof ref})`);
4724
+ }
4725
+ };
4726
+ if (value) {
4727
+ doSet.id = -1;
4728
+ queuePostRenderEffect(doSet, parentSuspense);
4729
+ }
4730
+ else {
4731
+ doSet();
4732
+ }
4733
+ }
4734
+ else {
4735
+ warn$1('Invalid template ref type:', ref, `(${typeof ref})`);
4736
+ }
4737
+ }
4738
+ }
4739
+
4635
4740
  let hasMismatch = false;
4636
4741
  const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== 'foreignObject';
4637
4742
  const isComment = (node) => node.nodeType === 8 /* COMMENT */;
@@ -5264,12 +5369,15 @@ var VueRuntimeDOM = (function (exports) {
5264
5369
  const oldProps = n1.props || EMPTY_OBJ;
5265
5370
  const newProps = n2.props || EMPTY_OBJ;
5266
5371
  let vnodeHook;
5372
+ // disable recurse in beforeUpdate hooks
5373
+ parentComponent && toggleRecurse(parentComponent, false);
5267
5374
  if ((vnodeHook = newProps.onVnodeBeforeUpdate)) {
5268
5375
  invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
5269
5376
  }
5270
5377
  if (dirs) {
5271
5378
  invokeDirectiveHook(n2, n1, parentComponent, 'beforeUpdate');
5272
5379
  }
5380
+ parentComponent && toggleRecurse(parentComponent, true);
5273
5381
  if (isHmrUpdating) {
5274
5382
  // HMR updated, force full diff
5275
5383
  patchFlag = 0;
@@ -5549,7 +5657,7 @@ var VueRuntimeDOM = (function (exports) {
5549
5657
  const { el, props } = initialVNode;
5550
5658
  const { bm, m, parent } = instance;
5551
5659
  const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
5552
- effect.allowRecurse = false;
5660
+ toggleRecurse(instance, false);
5553
5661
  // beforeMount hook
5554
5662
  if (bm) {
5555
5663
  invokeArrayFns(bm);
@@ -5559,7 +5667,7 @@ var VueRuntimeDOM = (function (exports) {
5559
5667
  (vnodeHook = props && props.onVnodeBeforeMount)) {
5560
5668
  invokeVNodeHook(vnodeHook, parent, initialVNode);
5561
5669
  }
5562
- effect.allowRecurse = true;
5670
+ toggleRecurse(instance, true);
5563
5671
  if (el && hydrateNode) {
5564
5672
  // vnode has adopted host node - perform hydration instead of mount.
5565
5673
  const hydrateSubTree = () => {
@@ -5641,7 +5749,7 @@ var VueRuntimeDOM = (function (exports) {
5641
5749
  pushWarningContext(next || instance.vnode);
5642
5750
  }
5643
5751
  // Disallow component effect recursion during pre-lifecycle hooks.
5644
- effect.allowRecurse = false;
5752
+ toggleRecurse(instance, false);
5645
5753
  if (next) {
5646
5754
  next.el = vnode.el;
5647
5755
  updateComponentPreRender(instance, next, optimized);
@@ -5657,7 +5765,7 @@ var VueRuntimeDOM = (function (exports) {
5657
5765
  if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {
5658
5766
  invokeVNodeHook(vnodeHook, parent, next, vnode);
5659
5767
  }
5660
- effect.allowRecurse = true;
5768
+ toggleRecurse(instance, true);
5661
5769
  // render
5662
5770
  {
5663
5771
  startMeasure(instance, `render`);
@@ -5703,13 +5811,13 @@ var VueRuntimeDOM = (function (exports) {
5703
5811
  }
5704
5812
  };
5705
5813
  // create reactive effect for rendering
5706
- const effect = new ReactiveEffect(componentUpdateFn, () => queueJob(instance.update), instance.scope // track it in component's effect scope
5707
- );
5814
+ const effect = (instance.effect = new ReactiveEffect(componentUpdateFn, () => queueJob(instance.update), instance.scope // track it in component's effect scope
5815
+ ));
5708
5816
  const update = (instance.update = effect.run.bind(effect));
5709
5817
  update.id = instance.uid;
5710
5818
  // allowRecurse
5711
5819
  // #1801, #2043 component render effects should allow recursive updates
5712
- effect.allowRecurse = update.allowRecurse = true;
5820
+ toggleRecurse(instance, true);
5713
5821
  {
5714
5822
  effect.onTrack = instance.rtc
5715
5823
  ? e => invokeArrayFns(instance.rtc, e)
@@ -6233,85 +6341,8 @@ var VueRuntimeDOM = (function (exports) {
6233
6341
  createApp: createAppAPI(render, hydrate)
6234
6342
  };
6235
6343
  }
6236
- function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
6237
- if (isArray(rawRef)) {
6238
- rawRef.forEach((r, i) => setRef(r, oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));
6239
- return;
6240
- }
6241
- if (isAsyncWrapper(vnode) && !isUnmount) {
6242
- // when mounting async components, nothing needs to be done,
6243
- // because the template ref is forwarded to inner component
6244
- return;
6245
- }
6246
- const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
6247
- ? getExposeProxy(vnode.component) || vnode.component.proxy
6248
- : vnode.el;
6249
- const value = isUnmount ? null : refValue;
6250
- const { i: owner, r: ref } = rawRef;
6251
- if (!owner) {
6252
- warn$1(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
6253
- `A vnode with ref must be created inside the render function.`);
6254
- return;
6255
- }
6256
- const oldRef = oldRawRef && oldRawRef.r;
6257
- const refs = owner.refs === EMPTY_OBJ ? (owner.refs = {}) : owner.refs;
6258
- const setupState = owner.setupState;
6259
- // dynamic ref changed. unset old ref
6260
- if (oldRef != null && oldRef !== ref) {
6261
- if (isString(oldRef)) {
6262
- refs[oldRef] = null;
6263
- if (hasOwn(setupState, oldRef)) {
6264
- setupState[oldRef] = null;
6265
- }
6266
- }
6267
- else if (isRef(oldRef)) {
6268
- oldRef.value = null;
6269
- }
6270
- }
6271
- if (isString(ref)) {
6272
- const doSet = () => {
6273
- {
6274
- refs[ref] = value;
6275
- }
6276
- if (hasOwn(setupState, ref)) {
6277
- setupState[ref] = value;
6278
- }
6279
- };
6280
- // #1789: for non-null values, set them after render
6281
- // null values means this is unmount and it should not overwrite another
6282
- // ref with the same key
6283
- if (value) {
6284
- doSet.id = -1;
6285
- queuePostRenderEffect(doSet, parentSuspense);
6286
- }
6287
- else {
6288
- doSet();
6289
- }
6290
- }
6291
- else if (isRef(ref)) {
6292
- const doSet = () => {
6293
- ref.value = value;
6294
- };
6295
- if (value) {
6296
- doSet.id = -1;
6297
- queuePostRenderEffect(doSet, parentSuspense);
6298
- }
6299
- else {
6300
- doSet();
6301
- }
6302
- }
6303
- else if (isFunction(ref)) {
6304
- callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
6305
- }
6306
- else {
6307
- warn$1('Invalid template ref type:', value, `(${typeof value})`);
6308
- }
6309
- }
6310
- function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
6311
- callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
6312
- vnode,
6313
- prevVNode
6314
- ]);
6344
+ function toggleRecurse({ effect, update }, allowed) {
6345
+ effect.allowRecurse = update.allowRecurse = allowed;
6315
6346
  }
6316
6347
  /**
6317
6348
  * #1156
@@ -6321,8 +6352,8 @@ var VueRuntimeDOM = (function (exports) {
6321
6352
  *
6322
6353
  * #2080
6323
6354
  * Inside keyed `template` fragment static children, if a fragment is moved,
6324
- * the children will always moved so that need inherit el form previous nodes
6325
- * to ensure correct moved position.
6355
+ * the children will always be moved. Therefore, in order to ensure correct move
6356
+ * position, el should be inherited from previous nodes.
6326
6357
  */
6327
6358
  function traverseStaticChildren(n1, n2, shallow = false) {
6328
6359
  const ch1 = n1.children;
@@ -6770,10 +6801,10 @@ var VueRuntimeDOM = (function (exports) {
6770
6801
  };
6771
6802
  const InternalObjectKey = `__vInternal`;
6772
6803
  const normalizeKey = ({ key }) => key != null ? key : null;
6773
- const normalizeRef = ({ ref }) => {
6804
+ const normalizeRef = ({ ref, ref_key, ref_for }) => {
6774
6805
  return (ref != null
6775
6806
  ? isString(ref) || isRef(ref) || isFunction(ref)
6776
- ? { i: currentRenderingInstance, r: ref }
6807
+ ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for }
6777
6808
  : ref
6778
6809
  : null);
6779
6810
  };
@@ -7102,7 +7133,8 @@ var VueRuntimeDOM = (function (exports) {
7102
7133
  else if (isOn(key)) {
7103
7134
  const existing = ret[key];
7104
7135
  const incoming = toMerge[key];
7105
- if (existing !== incoming) {
7136
+ if (existing !== incoming &&
7137
+ !(isArray(existing) && existing.includes(incoming))) {
7106
7138
  ret[key] = existing
7107
7139
  ? [].concat(existing, incoming)
7108
7140
  : incoming;
@@ -7114,6 +7146,12 @@ var VueRuntimeDOM = (function (exports) {
7114
7146
  }
7115
7147
  }
7116
7148
  return ret;
7149
+ }
7150
+ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
7151
+ callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
7152
+ vnode,
7153
+ prevVNode
7154
+ ]);
7117
7155
  }
7118
7156
 
7119
7157
  /**
@@ -7305,23 +7343,23 @@ var VueRuntimeDOM = (function (exports) {
7305
7343
  const n = accessCache[key];
7306
7344
  if (n !== undefined) {
7307
7345
  switch (n) {
7308
- case 0 /* SETUP */:
7346
+ case 1 /* SETUP */:
7309
7347
  return setupState[key];
7310
- case 1 /* DATA */:
7348
+ case 2 /* DATA */:
7311
7349
  return data[key];
7312
- case 3 /* CONTEXT */:
7350
+ case 4 /* CONTEXT */:
7313
7351
  return ctx[key];
7314
- case 2 /* PROPS */:
7352
+ case 3 /* PROPS */:
7315
7353
  return props[key];
7316
7354
  // default: just fallthrough
7317
7355
  }
7318
7356
  }
7319
7357
  else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
7320
- accessCache[key] = 0 /* SETUP */;
7358
+ accessCache[key] = 1 /* SETUP */;
7321
7359
  return setupState[key];
7322
7360
  }
7323
7361
  else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
7324
- accessCache[key] = 1 /* DATA */;
7362
+ accessCache[key] = 2 /* DATA */;
7325
7363
  return data[key];
7326
7364
  }
7327
7365
  else if (
@@ -7329,15 +7367,15 @@ var VueRuntimeDOM = (function (exports) {
7329
7367
  // props
7330
7368
  (normalizedProps = instance.propsOptions[0]) &&
7331
7369
  hasOwn(normalizedProps, key)) {
7332
- accessCache[key] = 2 /* PROPS */;
7370
+ accessCache[key] = 3 /* PROPS */;
7333
7371
  return props[key];
7334
7372
  }
7335
7373
  else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
7336
- accessCache[key] = 3 /* CONTEXT */;
7374
+ accessCache[key] = 4 /* CONTEXT */;
7337
7375
  return ctx[key];
7338
7376
  }
7339
7377
  else if (shouldCacheAccess) {
7340
- accessCache[key] = 4 /* OTHER */;
7378
+ accessCache[key] = 0 /* OTHER */;
7341
7379
  }
7342
7380
  }
7343
7381
  const publicGetter = publicPropertiesMap[key];
@@ -7358,7 +7396,7 @@ var VueRuntimeDOM = (function (exports) {
7358
7396
  }
7359
7397
  else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
7360
7398
  // user may set custom properties to `this` that start with `$`
7361
- accessCache[key] = 3 /* CONTEXT */;
7399
+ accessCache[key] = 4 /* CONTEXT */;
7362
7400
  return ctx[key];
7363
7401
  }
7364
7402
  else if (
@@ -7419,7 +7457,7 @@ var VueRuntimeDOM = (function (exports) {
7419
7457
  },
7420
7458
  has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
7421
7459
  let normalizedProps;
7422
- return (accessCache[key] !== undefined ||
7460
+ return (!!accessCache[key] ||
7423
7461
  (data !== EMPTY_OBJ && hasOwn(data, key)) ||
7424
7462
  (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
7425
7463
  ((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
@@ -7525,6 +7563,7 @@ var VueRuntimeDOM = (function (exports) {
7525
7563
  root: null,
7526
7564
  next: null,
7527
7565
  subTree: null,
7566
+ effect: null,
7528
7567
  update: null,
7529
7568
  scope: new EffectScope(true /* detached */),
7530
7569
  render: null,
@@ -8961,7 +9000,7 @@ var VueRuntimeDOM = (function (exports) {
8961
9000
  }
8962
9001
 
8963
9002
  // Core API ------------------------------------------------------------------
8964
- const version = "3.2.21";
9003
+ const version = "3.2.25";
8965
9004
  /**
8966
9005
  * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
8967
9006
  * @internal
@@ -9194,12 +9233,19 @@ var VueRuntimeDOM = (function (exports) {
9194
9233
  el[key] = value == null ? '' : value;
9195
9234
  return;
9196
9235
  }
9197
- if (key === 'value' && el.tagName !== 'PROGRESS') {
9236
+ if (key === 'value' &&
9237
+ el.tagName !== 'PROGRESS' &&
9238
+ // custom elements may use _value internally
9239
+ !el.tagName.includes('-')) {
9198
9240
  // store value as _value as well since
9199
9241
  // non-string values will be stringified.
9200
9242
  el._value = value;
9201
9243
  const newValue = value == null ? '' : value;
9202
- if (el.value !== newValue) {
9244
+ if (el.value !== newValue ||
9245
+ // #4956: always set for OPTION elements because its value falls back to
9246
+ // textContent if no value attribute is present. And setting .value for
9247
+ // OPTION has no side effect
9248
+ el.tagName === 'OPTION') {
9203
9249
  el.value = newValue;
9204
9250
  }
9205
9251
  if (value == null) {
@@ -9585,7 +9631,7 @@ var VueRuntimeDOM = (function (exports) {
9585
9631
  // HMR
9586
9632
  {
9587
9633
  instance.ceReload = newStyles => {
9588
- // alawys reset styles
9634
+ // always reset styles
9589
9635
  if (this._styles) {
9590
9636
  this._styles.forEach(s => this.shadowRoot.removeChild(s));
9591
9637
  this._styles.length = 0;