@vue/compat 3.5.13 → 3.5.15

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,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.13
2
+ * @vue/compat v3.5.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -366,6 +366,10 @@ class EffectScope {
366
366
  * @internal
367
367
  */
368
368
  this._active = true;
369
+ /**
370
+ * @internal track `on` calls, allow `on` call multiple times
371
+ */
372
+ this._on = 0;
369
373
  /**
370
374
  * @internal
371
375
  */
@@ -434,14 +438,20 @@ class EffectScope {
434
438
  * @internal
435
439
  */
436
440
  on() {
437
- activeEffectScope = this;
441
+ if (++this._on === 1) {
442
+ this.prevScope = activeEffectScope;
443
+ activeEffectScope = this;
444
+ }
438
445
  }
439
446
  /**
440
447
  * This should only be called on non-detached scopes
441
448
  * @internal
442
449
  */
443
450
  off() {
444
- activeEffectScope = this.parent;
451
+ if (this._on > 0 && --this._on === 0) {
452
+ activeEffectScope = this.prevScope;
453
+ this.prevScope = void 0;
454
+ }
445
455
  }
446
456
  stop(fromParent) {
447
457
  if (this._active) {
@@ -519,7 +529,7 @@ class ReactiveEffect {
519
529
  }
520
530
  resume() {
521
531
  if (this.flags & 64) {
522
- this.flags &= ~64;
532
+ this.flags &= -65;
523
533
  if (pausedQueueEffects.has(this)) {
524
534
  pausedQueueEffects.delete(this);
525
535
  this.trigger();
@@ -554,7 +564,7 @@ class ReactiveEffect {
554
564
  cleanupDeps(this);
555
565
  activeSub = prevEffect;
556
566
  shouldTrack = prevShouldTrack;
557
- this.flags &= ~2;
567
+ this.flags &= -3;
558
568
  }
559
569
  }
560
570
  stop() {
@@ -565,7 +575,7 @@ class ReactiveEffect {
565
575
  this.deps = this.depsTail = void 0;
566
576
  cleanupEffect(this);
567
577
  this.onStop && this.onStop();
568
- this.flags &= ~1;
578
+ this.flags &= -2;
569
579
  }
570
580
  }
571
581
  trigger() {
@@ -615,7 +625,7 @@ function endBatch() {
615
625
  while (e) {
616
626
  const next = e.next;
617
627
  e.next = void 0;
618
- e.flags &= ~8;
628
+ e.flags &= -9;
619
629
  e = next;
620
630
  }
621
631
  }
@@ -626,7 +636,7 @@ function endBatch() {
626
636
  while (e) {
627
637
  const next = e.next;
628
638
  e.next = void 0;
629
- e.flags &= ~8;
639
+ e.flags &= -9;
630
640
  if (e.flags & 1) {
631
641
  try {
632
642
  ;
@@ -682,17 +692,16 @@ function refreshComputed(computed) {
682
692
  if (computed.flags & 4 && !(computed.flags & 16)) {
683
693
  return;
684
694
  }
685
- computed.flags &= ~16;
695
+ computed.flags &= -17;
686
696
  if (computed.globalVersion === globalVersion) {
687
697
  return;
688
698
  }
689
699
  computed.globalVersion = globalVersion;
690
- const dep = computed.dep;
691
- computed.flags |= 2;
692
- if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) {
693
- computed.flags &= ~2;
700
+ if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) {
694
701
  return;
695
702
  }
703
+ computed.flags |= 2;
704
+ const dep = computed.dep;
696
705
  const prevSub = activeSub;
697
706
  const prevShouldTrack = shouldTrack;
698
707
  activeSub = computed;
@@ -701,6 +710,7 @@ function refreshComputed(computed) {
701
710
  prepareDeps(computed);
702
711
  const value = computed.fn(computed._value);
703
712
  if (dep.version === 0 || hasChanged(value, computed._value)) {
713
+ computed.flags |= 128;
704
714
  computed._value = value;
705
715
  dep.version++;
706
716
  }
@@ -711,7 +721,7 @@ function refreshComputed(computed) {
711
721
  activeSub = prevSub;
712
722
  shouldTrack = prevShouldTrack;
713
723
  cleanupDeps(computed);
714
- computed.flags &= ~2;
724
+ computed.flags &= -3;
715
725
  }
716
726
  }
717
727
  function removeSub(link, soft = false) {
@@ -727,7 +737,7 @@ function removeSub(link, soft = false) {
727
737
  if (dep.subs === link) {
728
738
  dep.subs = prevSub;
729
739
  if (!prevSub && dep.computed) {
730
- dep.computed.flags &= ~4;
740
+ dep.computed.flags &= -5;
731
741
  for (let l = dep.computed.deps; l; l = l.nextDep) {
732
742
  removeSub(l, true);
733
743
  }
@@ -1578,14 +1588,14 @@ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandl
1578
1588
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1579
1589
  return target;
1580
1590
  }
1581
- const existingProxy = proxyMap.get(target);
1582
- if (existingProxy) {
1583
- return existingProxy;
1584
- }
1585
1591
  const targetType = getTargetType(target);
1586
1592
  if (targetType === 0 /* INVALID */) {
1587
1593
  return target;
1588
1594
  }
1595
+ const existingProxy = proxyMap.get(target);
1596
+ if (existingProxy) {
1597
+ return existingProxy;
1598
+ }
1589
1599
  const proxy = new Proxy(
1590
1600
  target,
1591
1601
  targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
@@ -1966,11 +1976,11 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
1966
1976
  oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
1967
1977
  boundCleanup
1968
1978
  ];
1979
+ oldValue = newValue;
1969
1980
  call ? call(cb, 3, args) : (
1970
1981
  // @ts-expect-error
1971
1982
  cb(...args)
1972
1983
  );
1973
- oldValue = newValue;
1974
1984
  } finally {
1975
1985
  activeWatcher = currentWatcher;
1976
1986
  }
@@ -2248,11 +2258,11 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2248
2258
  queue.splice(i, 1);
2249
2259
  i--;
2250
2260
  if (cb.flags & 4) {
2251
- cb.flags &= ~1;
2261
+ cb.flags &= -2;
2252
2262
  }
2253
2263
  cb();
2254
2264
  if (!(cb.flags & 4)) {
2255
- cb.flags &= ~1;
2265
+ cb.flags &= -2;
2256
2266
  }
2257
2267
  }
2258
2268
  }
@@ -2271,10 +2281,10 @@ function flushPostFlushCbs(seen) {
2271
2281
  for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
2272
2282
  const cb = activePostFlushCbs[postFlushIndex];
2273
2283
  if (cb.flags & 4) {
2274
- cb.flags &= ~1;
2284
+ cb.flags &= -2;
2275
2285
  }
2276
2286
  if (!(cb.flags & 8)) cb();
2277
- cb.flags &= ~1;
2287
+ cb.flags &= -2;
2278
2288
  }
2279
2289
  activePostFlushCbs = null;
2280
2290
  postFlushIndex = 0;
@@ -2304,7 +2314,7 @@ function flushJobs(seen) {
2304
2314
  for (; flushIndex < queue.length; flushIndex++) {
2305
2315
  const job = queue[flushIndex];
2306
2316
  if (job) {
2307
- job.flags &= ~1;
2317
+ job.flags &= -2;
2308
2318
  }
2309
2319
  }
2310
2320
  flushIndex = -1;
@@ -2742,15 +2752,16 @@ const TeleportImpl = {
2742
2752
  updateCssVars(n2, true);
2743
2753
  }
2744
2754
  if (isTeleportDeferred(n2.props)) {
2755
+ n2.el.__isMounted = false;
2745
2756
  queuePostRenderEffect(() => {
2746
2757
  mountToTarget();
2747
- n2.el.__isMounted = true;
2758
+ delete n2.el.__isMounted;
2748
2759
  }, parentSuspense);
2749
2760
  } else {
2750
2761
  mountToTarget();
2751
2762
  }
2752
2763
  } else {
2753
- if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
2764
+ if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
2754
2765
  queuePostRenderEffect(() => {
2755
2766
  TeleportImpl.process(
2756
2767
  n1,
@@ -2764,7 +2775,6 @@ const TeleportImpl = {
2764
2775
  optimized,
2765
2776
  internals
2766
2777
  );
2767
- delete n1.el.__isMounted;
2768
2778
  }, parentSuspense);
2769
2779
  return;
2770
2780
  }
@@ -3294,6 +3304,9 @@ function getInnerChild$1(vnode) {
3294
3304
  }
3295
3305
  return vnode;
3296
3306
  }
3307
+ if (vnode.component) {
3308
+ return vnode.component.subTree;
3309
+ }
3297
3310
  const { shapeFlag, children } = vnode;
3298
3311
  if (children) {
3299
3312
  if (shapeFlag & 16) {
@@ -3683,6 +3696,8 @@ function createHydrationFunctions(rendererInternals) {
3683
3696
  ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
3684
3697
  const content = el.content.firstChild;
3685
3698
  if (needCallTransitionHooks) {
3699
+ const cls = content.getAttribute("class");
3700
+ if (cls) content.$cls = cls;
3686
3701
  transition.beforeEnter(content);
3687
3702
  }
3688
3703
  replaceNode(content, el, parentComponent);
@@ -4073,13 +4088,17 @@ function defineAsyncComponent(source) {
4073
4088
  __asyncLoader: load,
4074
4089
  __asyncHydrate(el, instance, hydrate) {
4075
4090
  const doHydrate = hydrateStrategy ? () => {
4091
+ const performHydrate = () => {
4092
+ hydrate();
4093
+ };
4076
4094
  const teardown = hydrateStrategy(
4077
- hydrate,
4095
+ performHydrate,
4078
4096
  (cb) => forEachElement(el, cb)
4079
4097
  );
4080
4098
  if (teardown) {
4081
4099
  (instance.bum || (instance.bum = [])).push(teardown);
4082
4100
  }
4101
+ (instance.u || (instance.u = [])).push(() => true);
4083
4102
  } : hydrate;
4084
4103
  if (resolvedComp) {
4085
4104
  doHydrate();
@@ -4324,7 +4343,7 @@ const KeepAliveImpl = {
4324
4343
  );
4325
4344
  const { include, exclude, max } = props;
4326
4345
  if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
4327
- vnode.shapeFlag &= ~256;
4346
+ vnode.shapeFlag &= -257;
4328
4347
  current = vnode;
4329
4348
  return rawVNode;
4330
4349
  }
@@ -4415,8 +4434,8 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
4415
4434
  }, target);
4416
4435
  }
4417
4436
  function resetShapeFlag(vnode) {
4418
- vnode.shapeFlag &= ~256;
4419
- vnode.shapeFlag &= ~512;
4437
+ vnode.shapeFlag &= -257;
4438
+ vnode.shapeFlag &= -513;
4420
4439
  }
4421
4440
  function getInnerChild(vnode) {
4422
4441
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
@@ -4804,14 +4823,16 @@ function renderList(source, renderItem, cache, index) {
4804
4823
  if (sourceIsArray || isString(source)) {
4805
4824
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
4806
4825
  let needsWrap = false;
4826
+ let isReadonlySource = false;
4807
4827
  if (sourceIsReactiveArray) {
4808
4828
  needsWrap = !isShallow(source);
4829
+ isReadonlySource = isReadonly(source);
4809
4830
  source = shallowReadArray(source);
4810
4831
  }
4811
4832
  ret = new Array(source.length);
4812
4833
  for (let i = 0, l = source.length; i < l; i++) {
4813
4834
  ret[i] = renderItem(
4814
- needsWrap ? toReactive(source[i]) : source[i],
4835
+ needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i],
4815
4836
  i,
4816
4837
  void 0,
4817
4838
  cached && cached[i]
@@ -5801,7 +5822,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5801
5822
  return vm;
5802
5823
  }
5803
5824
  }
5804
- Vue.version = `2.6.14-compat:${"3.5.13"}`;
5825
+ Vue.version = `2.6.14-compat:${"3.5.15"}`;
5805
5826
  Vue.config = singletonApp.config;
5806
5827
  Vue.use = (plugin, ...options) => {
5807
5828
  if (plugin && isFunction(plugin.install)) {
@@ -6281,7 +6302,7 @@ function provide(key, value) {
6281
6302
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
6282
6303
  const instance = currentInstance || currentRenderingInstance;
6283
6304
  if (instance || currentApp) {
6284
- const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
6305
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
6285
6306
  if (provides && key in provides) {
6286
6307
  return provides[key];
6287
6308
  } else if (arguments.length > 1) {
@@ -6672,7 +6693,7 @@ const normalizeVNodeSlots = (instance, children) => {
6672
6693
  };
6673
6694
  const assignSlots = (slots, children, optimized) => {
6674
6695
  for (const key in children) {
6675
- if (optimized || key !== "_") {
6696
+ if (optimized || !isInternalKey(key)) {
6676
6697
  slots[key] = children[key];
6677
6698
  }
6678
6699
  }
@@ -7113,7 +7134,7 @@ function baseCreateRenderer(options, createHydrationFns) {
7113
7134
  (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
7114
7135
  // which also requires the correct parent container
7115
7136
  !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
7116
- oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
7137
+ oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
7117
7138
  // In other cases, the parent container is not actually used so we
7118
7139
  // just pass the block element here to avoid a DOM parentNode call.
7119
7140
  fallbackContainer
@@ -7783,7 +7804,13 @@ function baseCreateRenderer(options, createHydrationFns) {
7783
7804
  queuePostRenderEffect(() => transition.enter(el), parentSuspense);
7784
7805
  } else {
7785
7806
  const { leave, delayLeave, afterLeave } = transition;
7786
- const remove2 = () => hostInsert(el, container, anchor);
7807
+ const remove2 = () => {
7808
+ if (vnode.ctx.isUnmounted) {
7809
+ hostRemove(el);
7810
+ } else {
7811
+ hostInsert(el, container, anchor);
7812
+ }
7813
+ };
7787
7814
  const performLeave = () => {
7788
7815
  leave(el, () => {
7789
7816
  remove2();
@@ -7816,7 +7843,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7816
7843
  optimized = false;
7817
7844
  }
7818
7845
  if (ref != null) {
7846
+ pauseTracking();
7819
7847
  setRef(ref, null, parentSuspense, vnode, true);
7848
+ resetTracking();
7820
7849
  }
7821
7850
  if (cacheIndex != null) {
7822
7851
  parentComponent.renderCache[cacheIndex] = void 0;
@@ -7917,12 +7946,27 @@ function baseCreateRenderer(options, createHydrationFns) {
7917
7946
  hostRemove(end);
7918
7947
  };
7919
7948
  const unmountComponent = (instance, parentSuspense, doRemove) => {
7920
- const { bum, scope, job, subTree, um, m, a } = instance;
7949
+ const {
7950
+ bum,
7951
+ scope,
7952
+ job,
7953
+ subTree,
7954
+ um,
7955
+ m,
7956
+ a,
7957
+ parent,
7958
+ slots: { __: slotCacheKeys }
7959
+ } = instance;
7921
7960
  invalidateMount(m);
7922
7961
  invalidateMount(a);
7923
7962
  if (bum) {
7924
7963
  invokeArrayFns(bum);
7925
7964
  }
7965
+ if (parent && isArray(slotCacheKeys)) {
7966
+ slotCacheKeys.forEach((v) => {
7967
+ parent.renderCache[v] = void 0;
7968
+ });
7969
+ }
7926
7970
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) {
7927
7971
  instance.emit("hook:beforeDestroy");
7928
7972
  }
@@ -8024,8 +8068,8 @@ function toggleRecurse({ effect, job }, allowed) {
8024
8068
  effect.flags |= 32;
8025
8069
  job.flags |= 4;
8026
8070
  } else {
8027
- effect.flags &= ~32;
8028
- job.flags &= ~4;
8071
+ effect.flags &= -33;
8072
+ job.flags &= -5;
8029
8073
  }
8030
8074
  }
8031
8075
  function needTransition(parentSuspense, transition) {
@@ -8049,6 +8093,9 @@ function traverseStaticChildren(n1, n2, shallow = false) {
8049
8093
  if (c2.type === Text) {
8050
8094
  c2.el = c1.el;
8051
8095
  }
8096
+ if (c2.type === Comment && !c2.el) {
8097
+ c2.el = c1.el;
8098
+ }
8052
8099
  }
8053
8100
  }
8054
8101
  }
@@ -9712,7 +9759,7 @@ function setupComponent(instance, isSSR = false, optimized = false) {
9712
9759
  const { props, children } = instance.vnode;
9713
9760
  const isStateful = isStatefulComponent(instance);
9714
9761
  initProps(instance, props, isStateful, isSSR);
9715
- initSlots(instance, children, optimized);
9762
+ initSlots(instance, children, optimized || isSSR);
9716
9763
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
9717
9764
  isSSR && setInSSRSetupState(false);
9718
9765
  return setupResult;
@@ -9930,7 +9977,7 @@ function isMemoSame(cached, memo) {
9930
9977
  return true;
9931
9978
  }
9932
9979
 
9933
- const version = "3.5.13";
9980
+ const version = "3.5.15";
9934
9981
  const warn$1 = NOOP;
9935
9982
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9936
9983
  const devtools = void 0;
@@ -10548,7 +10595,7 @@ function compatCoerceAttr(el, key, value, instance = null) {
10548
10595
  el.setAttribute(key, v2CoercedValue);
10549
10596
  return true;
10550
10597
  }
10551
- } else if (value === false && !isSpecialBooleanAttr(key) && compatUtils.isCompatEnabled("ATTR_FALSE_VALUE", instance)) {
10598
+ } else if (value === false && !(el.tagName === "INPUT" && key === "value") && !isSpecialBooleanAttr(key) && compatUtils.isCompatEnabled("ATTR_FALSE_VALUE", instance)) {
10552
10599
  compatUtils.warnDeprecation(
10553
10600
  "ATTR_FALSE_VALUE",
10554
10601
  instance,
@@ -10733,7 +10780,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
10733
10780
  }
10734
10781
  return false;
10735
10782
  }
10736
- if (key === "spellcheck" || key === "draggable" || key === "translate") {
10783
+ if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
10737
10784
  return false;
10738
10785
  }
10739
10786
  if (key === "form") {
@@ -10811,13 +10858,10 @@ class VueElement extends BaseClass {
10811
10858
  this._root = this;
10812
10859
  }
10813
10860
  }
10814
- if (!this._def.__asyncLoader) {
10815
- this._resolveProps(this._def);
10816
- }
10817
10861
  }
10818
10862
  connectedCallback() {
10819
10863
  if (!this.isConnected) return;
10820
- if (!this.shadowRoot) {
10864
+ if (!this.shadowRoot && !this._resolved) {
10821
10865
  this._parseSlots();
10822
10866
  }
10823
10867
  this._connected = true;
@@ -10830,8 +10874,7 @@ class VueElement extends BaseClass {
10830
10874
  }
10831
10875
  if (!this._instance) {
10832
10876
  if (this._resolved) {
10833
- this._setParent();
10834
- this._update();
10877
+ this._mount(this._def);
10835
10878
  } else {
10836
10879
  if (parent && parent._pendingResolve) {
10837
10880
  this._pendingResolve = parent._pendingResolve.then(() => {
@@ -10847,7 +10890,15 @@ class VueElement extends BaseClass {
10847
10890
  _setParent(parent = this._parent) {
10848
10891
  if (parent) {
10849
10892
  this._instance.parent = parent._instance;
10850
- this._instance.provides = parent._instance.provides;
10893
+ this._inheritParentContext(parent);
10894
+ }
10895
+ }
10896
+ _inheritParentContext(parent = this._parent) {
10897
+ if (parent && this._app) {
10898
+ Object.setPrototypeOf(
10899
+ this._app._context.provides,
10900
+ parent._instance.provides
10901
+ );
10851
10902
  }
10852
10903
  }
10853
10904
  disconnectedCallback() {
@@ -10897,9 +10948,7 @@ class VueElement extends BaseClass {
10897
10948
  }
10898
10949
  }
10899
10950
  this._numberProps = numberProps;
10900
- if (isAsync) {
10901
- this._resolveProps(def);
10902
- }
10951
+ this._resolveProps(def);
10903
10952
  if (this.shadowRoot) {
10904
10953
  this._applyStyles(styles);
10905
10954
  }
@@ -10916,6 +10965,7 @@ class VueElement extends BaseClass {
10916
10965
  }
10917
10966
  _mount(def) {
10918
10967
  this._app = this._createApp(def);
10968
+ this._inheritParentContext();
10919
10969
  if (def.configureApp) {
10920
10970
  def.configureApp(this._app);
10921
10971
  }
@@ -10998,7 +11048,9 @@ class VueElement extends BaseClass {
10998
11048
  }
10999
11049
  }
11000
11050
  _update() {
11001
- render(this._createVNode(), this._root);
11051
+ const vnode = this._createVNode();
11052
+ if (this._app) vnode.appContext = this._app._context;
11053
+ render(vnode, this._root);
11002
11054
  }
11003
11055
  _createVNode() {
11004
11056
  const baseProps = {};
@@ -11163,6 +11215,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11163
11215
  instance.vnode.el,
11164
11216
  moveClass
11165
11217
  )) {
11218
+ prevChildren = [];
11166
11219
  return;
11167
11220
  }
11168
11221
  prevChildren.forEach(callPendingCbs);
@@ -11186,6 +11239,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11186
11239
  };
11187
11240
  el.addEventListener("transitionend", cb);
11188
11241
  });
11242
+ prevChildren = [];
11189
11243
  });
11190
11244
  return () => {
11191
11245
  const rawProps = toRaw(props);
@@ -13365,7 +13419,7 @@ function isReferenced(node, parent, grandparent) {
13365
13419
  if (parent.key === node) {
13366
13420
  return !!parent.computed;
13367
13421
  }
13368
- return !grandparent;
13422
+ return true;
13369
13423
  // no: class { NODE = value; }
13370
13424
  // yes: class { [NODE] = value; }
13371
13425
  // yes: class { key = NODE; }
@@ -13984,7 +14038,7 @@ const tokenizer = new Tokenizer(stack, {
13984
14038
  "COMPILER_V_BIND_SYNC",
13985
14039
  currentOptions,
13986
14040
  currentProp.loc,
13987
- currentProp.rawName
14041
+ currentProp.arg.loc.source
13988
14042
  )) {
13989
14043
  currentProp.name = "model";
13990
14044
  currentProp.modifiers.splice(syncIndex, 1);
@@ -14539,6 +14593,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14539
14593
  }
14540
14594
  }
14541
14595
  let cachedAsArray = false;
14596
+ const slotCacheKeys = [];
14542
14597
  if (toCache.length === children.length && node.type === 1) {
14543
14598
  if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
14544
14599
  node.codegenNode.children = getCacheExpression(
@@ -14548,6 +14603,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14548
14603
  } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
14549
14604
  const slot = getSlotNode(node.codegenNode, "default");
14550
14605
  if (slot) {
14606
+ slotCacheKeys.push(context.cached.length);
14551
14607
  slot.returns = getCacheExpression(
14552
14608
  createArrayExpression(slot.returns)
14553
14609
  );
@@ -14557,6 +14613,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14557
14613
  const slotName = findDir(node, "slot", true);
14558
14614
  const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
14559
14615
  if (slot) {
14616
+ slotCacheKeys.push(context.cached.length);
14560
14617
  slot.returns = getCacheExpression(
14561
14618
  createArrayExpression(slot.returns)
14562
14619
  );
@@ -14566,9 +14623,18 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14566
14623
  }
14567
14624
  if (!cachedAsArray) {
14568
14625
  for (const child of toCache) {
14626
+ slotCacheKeys.push(context.cached.length);
14569
14627
  child.codegenNode = context.cache(child.codegenNode);
14570
14628
  }
14571
14629
  }
14630
+ if (slotCacheKeys.length && node.type === 1 && node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
14631
+ node.codegenNode.children.properties.push(
14632
+ createObjectProperty(
14633
+ `__`,
14634
+ createSimpleExpression(JSON.stringify(slotCacheKeys), false)
14635
+ )
14636
+ );
14637
+ }
14572
14638
  function getCacheExpression(value) {
14573
14639
  const exp = context.cache(value);
14574
14640
  if (inFor && context.hmr) {
@@ -15110,7 +15176,9 @@ function createCodegenContext(ast, {
15110
15176
  name = content;
15111
15177
  }
15112
15178
  }
15113
- addMapping(node.loc.start, name);
15179
+ if (node.loc.source) {
15180
+ addMapping(node.loc.start, name);
15181
+ }
15114
15182
  }
15115
15183
  if (newlineIndex === -3 /* Unknown */) {
15116
15184
  advancePositionWithMutation(context, code);
@@ -15126,7 +15194,7 @@ function createCodegenContext(ast, {
15126
15194
  context.column = code.length - newlineIndex;
15127
15195
  }
15128
15196
  }
15129
- if (node && node.loc !== locStub) {
15197
+ if (node && node.loc !== locStub && node.loc.source) {
15130
15198
  addMapping(node.loc.end);
15131
15199
  }
15132
15200
  }
@@ -17201,9 +17269,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
17201
17269
  hasDynamicKeys = true;
17202
17270
  if (exp) {
17203
17271
  if (isVBind) {
17204
- pushRefVForMarker();
17205
- pushMergeArg();
17206
17272
  {
17273
+ pushMergeArg();
17207
17274
  if (isCompatEnabled(
17208
17275
  "COMPILER_V_BIND_OBJECT_ORDER",
17209
17276
  context
@@ -17212,6 +17279,8 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
17212
17279
  continue;
17213
17280
  }
17214
17281
  }
17282
+ pushRefVForMarker();
17283
+ pushMergeArg();
17215
17284
  mergeArgs.push(exp);
17216
17285
  } else {
17217
17286
  pushMergeArg({