vue 3.5.7 → 3.5.9

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 v3.5.7
2
+ * vue v3.5.9
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -572,11 +572,14 @@ function endBatch() {
572
572
  let error;
573
573
  while (batchedSub) {
574
574
  let e = batchedSub;
575
- batchedSub = void 0;
575
+ let next;
576
576
  while (e) {
577
- const next = e.next;
578
- e.next = void 0;
579
577
  e.flags &= ~8;
578
+ e = e.next;
579
+ }
580
+ e = batchedSub;
581
+ batchedSub = void 0;
582
+ while (e) {
580
583
  if (e.flags & 1) {
581
584
  try {
582
585
  ;
@@ -585,6 +588,8 @@ function endBatch() {
585
588
  if (!error) error = err;
586
589
  }
587
590
  }
591
+ next = e.next;
592
+ e.next = void 0;
588
593
  e = next;
589
594
  }
590
595
  }
@@ -664,7 +669,7 @@ function refreshComputed(computed) {
664
669
  computed.flags &= ~2;
665
670
  }
666
671
  }
667
- function removeSub(link, fromComputed = false) {
672
+ function removeSub(link, soft = false) {
668
673
  const { dep, prevSub, nextSub } = link;
669
674
  if (prevSub) {
670
675
  prevSub.nextSub = nextSub;
@@ -680,17 +685,15 @@ function removeSub(link, fromComputed = false) {
680
685
  if (dep.subsHead === link) {
681
686
  dep.subsHead = nextSub;
682
687
  }
683
- if (!dep.subs) {
684
- if (dep.computed) {
685
- dep.computed.flags &= ~4;
686
- for (let l = dep.computed.deps; l; l = l.nextDep) {
687
- removeSub(l, true);
688
- }
689
- } else if (dep.map && !fromComputed) {
690
- dep.map.delete(dep.key);
691
- if (!dep.map.size) targetMap.delete(dep.target);
688
+ if (!dep.subs && dep.computed) {
689
+ dep.computed.flags &= ~4;
690
+ for (let l = dep.computed.deps; l; l = l.nextDep) {
691
+ removeSub(l, true);
692
692
  }
693
693
  }
694
+ if (!soft && !--dep.sc && dep.map) {
695
+ dep.map.delete(dep.key);
696
+ }
694
697
  }
695
698
  function removeDep(link) {
696
699
  const { prevDep, nextDep } = link;
@@ -775,6 +778,10 @@ class Dep {
775
778
  this.target = void 0;
776
779
  this.map = void 0;
777
780
  this.key = void 0;
781
+ /**
782
+ * Subscriber counter
783
+ */
784
+ this.sc = 0;
778
785
  {
779
786
  this.subsHead = void 0;
780
787
  }
@@ -793,9 +800,7 @@ class Dep {
793
800
  activeSub.depsTail.nextDep = link;
794
801
  activeSub.depsTail = link;
795
802
  }
796
- if (activeSub.flags & 4) {
797
- addSub(link);
798
- }
803
+ addSub(link);
799
804
  } else if (link.version === -1) {
800
805
  link.version = this.version;
801
806
  if (link.nextDep) {
@@ -859,22 +864,25 @@ class Dep {
859
864
  }
860
865
  }
861
866
  function addSub(link) {
862
- const computed = link.dep.computed;
863
- if (computed && !link.dep.subs) {
864
- computed.flags |= 4 | 16;
865
- for (let l = computed.deps; l; l = l.nextDep) {
866
- addSub(l);
867
+ link.dep.sc++;
868
+ if (link.sub.flags & 4) {
869
+ const computed = link.dep.computed;
870
+ if (computed && !link.dep.subs) {
871
+ computed.flags |= 4 | 16;
872
+ for (let l = computed.deps; l; l = l.nextDep) {
873
+ addSub(l);
874
+ }
867
875
  }
876
+ const currentTail = link.dep.subs;
877
+ if (currentTail !== link) {
878
+ link.prevSub = currentTail;
879
+ if (currentTail) currentTail.nextSub = link;
880
+ }
881
+ if (link.dep.subsHead === void 0) {
882
+ link.dep.subsHead = link;
883
+ }
884
+ link.dep.subs = link;
868
885
  }
869
- const currentTail = link.dep.subs;
870
- if (currentTail !== link) {
871
- link.prevSub = currentTail;
872
- if (currentTail) currentTail.nextSub = link;
873
- }
874
- if (link.dep.subsHead === void 0) {
875
- link.dep.subsHead = link;
876
- }
877
- link.dep.subs = link;
878
886
  }
879
887
  const targetMap = /* @__PURE__ */ new WeakMap();
880
888
  const ITERATE_KEY = Symbol(
@@ -978,8 +986,8 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
978
986
  endBatch();
979
987
  }
980
988
  function getDepFromReactive(object, key) {
981
- var _a;
982
- return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
989
+ const depMap = targetMap.get(object);
990
+ return depMap && depMap.get(key);
983
991
  }
984
992
 
985
993
  function reactiveReadArray(array) {
@@ -3631,6 +3639,7 @@ function useId() {
3631
3639
  `useId() is called when there is no active component instance to be associated with.`
3632
3640
  );
3633
3641
  }
3642
+ return "";
3634
3643
  }
3635
3644
  function markAsyncBoundary(instance) {
3636
3645
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
@@ -9691,7 +9700,7 @@ function normalizeVNode(child) {
9691
9700
  // #3666, avoid reference pollution when reusing vnode
9692
9701
  child.slice()
9693
9702
  );
9694
- } else if (typeof child === "object") {
9703
+ } else if (isVNode(child)) {
9695
9704
  return cloneIfMounted(child);
9696
9705
  } else {
9697
9706
  return createVNode(Text, null, String(child));
@@ -10436,7 +10445,7 @@ function isMemoSame(cached, memo) {
10436
10445
  return true;
10437
10446
  }
10438
10447
 
10439
- const version = "3.5.7";
10448
+ const version = "3.5.9";
10440
10449
  const warn = warn$1 ;
10441
10450
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10442
10451
  const devtools = devtools$1 ;
@@ -11946,7 +11955,7 @@ const vModelCheckbox = {
11946
11955
  setChecked(el, binding, vnode);
11947
11956
  }
11948
11957
  };
11949
- function setChecked(el, { value, oldValue }, vnode) {
11958
+ function setChecked(el, { value }, vnode) {
11950
11959
  el._modelValue = value;
11951
11960
  let checked;
11952
11961
  if (isArray(value)) {
@@ -11996,19 +12005,19 @@ const vModelSelect = {
11996
12005
  },
11997
12006
  // set value in mounted & updated because <select> relies on its children
11998
12007
  // <option>s.
11999
- mounted(el, { value, modifiers: { number } }) {
12008
+ mounted(el, { value }) {
12000
12009
  setSelected(el, value);
12001
12010
  },
12002
12011
  beforeUpdate(el, _binding, vnode) {
12003
12012
  el[assignKey] = getModelAssigner(vnode);
12004
12013
  },
12005
- updated(el, { value, modifiers: { number } }) {
12014
+ updated(el, { value }) {
12006
12015
  if (!el._assigning) {
12007
12016
  setSelected(el, value);
12008
12017
  }
12009
12018
  }
12010
12019
  };
12011
- function setSelected(el, value, number) {
12020
+ function setSelected(el, value) {
12012
12021
  const isMultiple = el.multiple;
12013
12022
  const isArrayValue = isArray(value);
12014
12023
  if (isMultiple && !isArrayValue && !isSet(value)) {