vue 2.7.6 → 2.7.7

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.js v2.7.6
2
+ * Vue.js v2.7.7
3
3
  * (c) 2014-2022 Evan You
4
4
  * Released under the MIT License.
5
5
  */
@@ -1559,7 +1559,7 @@ function doWatch(source, cb, _a) {
1559
1559
  watcher.update = watcher.run;
1560
1560
  }
1561
1561
  else if (flush === 'post') {
1562
- watcher.id = Infinity;
1562
+ watcher.post = true;
1563
1563
  watcher.update = function () { return queueWatcher(watcher); };
1564
1564
  }
1565
1565
  else {
@@ -1711,18 +1711,23 @@ function provide(key, value) {
1711
1711
  }
1712
1712
  }
1713
1713
  else {
1714
- var provides = currentInstance._provided;
1715
- // by default an instance inherits its parent's provides object
1716
- // but when it needs to provide values of its own, it creates its
1717
- // own provides object using parent provides object as prototype.
1718
- // this way in `inject` we can simply look up injections from direct
1719
- // parent and let the prototype chain do the work.
1720
- var parentProvides = currentInstance.$parent && currentInstance.$parent._provided;
1721
- if (parentProvides === provides) {
1722
- provides = currentInstance._provided = Object.create(parentProvides);
1723
- }
1724
1714
  // TS doesn't allow symbol as index type
1725
- provides[key] = value;
1715
+ resolveProvided(currentInstance)[key] = value;
1716
+ }
1717
+ }
1718
+ function resolveProvided(vm) {
1719
+ // by default an instance inherits its parent's provides object
1720
+ // but when it needs to provide values of its own, it creates its
1721
+ // own provides object using parent provides object as prototype.
1722
+ // this way in `inject` we can simply look up injections from direct
1723
+ // parent and let the prototype chain do the work.
1724
+ var existing = vm._provided;
1725
+ var parentProvides = vm.$parent && vm.$parent._provided;
1726
+ if (parentProvides === existing) {
1727
+ return (vm._provided = Object.create(parentProvides));
1728
+ }
1729
+ else {
1730
+ return existing;
1726
1731
  }
1727
1732
  }
1728
1733
  function inject(key, defaultValue, treatDefaultAsFactory) {
@@ -2576,7 +2581,9 @@ function initRender(vm) {
2576
2581
  var parentVnode = (vm.$vnode = options._parentVnode); // the placeholder node in parent tree
2577
2582
  var renderContext = parentVnode && parentVnode.context;
2578
2583
  vm.$slots = resolveSlots(options._renderChildren, renderContext);
2579
- vm.$scopedSlots = emptyObject;
2584
+ vm.$scopedSlots = parentVnode
2585
+ ? normalizeScopedSlots(vm.$parent, parentVnode.data.scopedSlots, vm.$slots)
2586
+ : emptyObject;
2580
2587
  // bind the createElement fn to this instance
2581
2588
  // so that we get proper render context inside it.
2582
2589
  // args order: tag, data, children, normalizationType, alwaysNormalize
@@ -2614,7 +2621,7 @@ function renderMixin(Vue) {
2614
2621
  Vue.prototype._render = function () {
2615
2622
  var vm = this;
2616
2623
  var _a = vm.$options, render = _a.render, _parentVnode = _a._parentVnode;
2617
- if (_parentVnode) {
2624
+ if (_parentVnode && vm._isMounted) {
2618
2625
  vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);
2619
2626
  if (vm._slotsProxy) {
2620
2627
  syncSetupSlots(vm._slotsProxy, vm.$scopedSlots);
@@ -3269,7 +3276,7 @@ var onRenderTriggered = createLifeCycle('renderTriggered');
3269
3276
  /**
3270
3277
  * Note: also update dist/vue.runtime.mjs when adding new exports to this file.
3271
3278
  */
3272
- var version = '2.7.6';
3279
+ var version = '2.7.7';
3273
3280
  /**
3274
3281
  * @internal type is manually declared in <root>/types/v3-define-component.d.ts
3275
3282
  */
@@ -3352,6 +3359,7 @@ var Watcher = /** @class */ (function () {
3352
3359
  this.cb = cb;
3353
3360
  this.id = ++uid$1; // uid for batching
3354
3361
  this.active = true;
3362
+ this.post = false;
3355
3363
  this.dirty = this.lazy; // for lazy watchers
3356
3364
  this.deps = [];
3357
3365
  this.newDeps = [];
@@ -4015,6 +4023,16 @@ if (inBrowser && !isIE) {
4015
4023
  getNow = function () { return performance_1.now(); };
4016
4024
  }
4017
4025
  }
4026
+ var sortCompareFn = function (a, b) {
4027
+ if (a.post) {
4028
+ if (!b.post)
4029
+ return 1;
4030
+ }
4031
+ else if (b.post) {
4032
+ return -1;
4033
+ }
4034
+ return a.id - b.id;
4035
+ };
4018
4036
  /**
4019
4037
  * Flush both queues and run the watchers.
4020
4038
  */
@@ -4030,7 +4048,7 @@ function flushSchedulerQueue() {
4030
4048
  // user watchers are created before the render watcher)
4031
4049
  // 3. If a component is destroyed during a parent component's watcher run,
4032
4050
  // its watchers can be skipped.
4033
- queue.sort(function (a, b) { return a.id - b.id; });
4051
+ queue.sort(sortCompareFn);
4034
4052
  // do not cache length because more watchers might be pushed
4035
4053
  // as we run existing watchers
4036
4054
  for (index = 0; index < queue.length; index++) {
@@ -4138,12 +4156,14 @@ function initProvide(vm) {
4138
4156
  if (!isObject(provided)) {
4139
4157
  return;
4140
4158
  }
4159
+ var source = resolveProvided(vm);
4160
+ // IE9 doesn't support Object.getOwnPropertyDescriptors so we have to
4161
+ // iterate the keys ourselves.
4141
4162
  var keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided);
4142
- setCurrentInstance(vm);
4143
4163
  for (var i = 0; i < keys.length; i++) {
4144
- provide(keys[i], provided[keys[i]]);
4164
+ var key = keys[i];
4165
+ Object.defineProperty(source, key, Object.getOwnPropertyDescriptor(provided, key));
4145
4166
  }
4146
- setCurrentInstance();
4147
4167
  }
4148
4168
  }
4149
4169
  function initInjections(vm) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vue.js v2.7.6
2
+ * Vue.js v2.7.7
3
3
  * (c) 2014-2022 Evan You
4
4
  * Released under the MIT License.
5
5
  */
@@ -1534,7 +1534,7 @@
1534
1534
  watcher.update = watcher.run;
1535
1535
  }
1536
1536
  else if (flush === 'post') {
1537
- watcher.id = Infinity;
1537
+ watcher.post = true;
1538
1538
  watcher.update = function () { return queueWatcher(watcher); };
1539
1539
  }
1540
1540
  else {
@@ -1686,18 +1686,23 @@
1686
1686
  }
1687
1687
  }
1688
1688
  else {
1689
- var provides = currentInstance._provided;
1690
- // by default an instance inherits its parent's provides object
1691
- // but when it needs to provide values of its own, it creates its
1692
- // own provides object using parent provides object as prototype.
1693
- // this way in `inject` we can simply look up injections from direct
1694
- // parent and let the prototype chain do the work.
1695
- var parentProvides = currentInstance.$parent && currentInstance.$parent._provided;
1696
- if (parentProvides === provides) {
1697
- provides = currentInstance._provided = Object.create(parentProvides);
1698
- }
1699
1689
  // TS doesn't allow symbol as index type
1700
- provides[key] = value;
1690
+ resolveProvided(currentInstance)[key] = value;
1691
+ }
1692
+ }
1693
+ function resolveProvided(vm) {
1694
+ // by default an instance inherits its parent's provides object
1695
+ // but when it needs to provide values of its own, it creates its
1696
+ // own provides object using parent provides object as prototype.
1697
+ // this way in `inject` we can simply look up injections from direct
1698
+ // parent and let the prototype chain do the work.
1699
+ var existing = vm._provided;
1700
+ var parentProvides = vm.$parent && vm.$parent._provided;
1701
+ if (parentProvides === existing) {
1702
+ return (vm._provided = Object.create(parentProvides));
1703
+ }
1704
+ else {
1705
+ return existing;
1701
1706
  }
1702
1707
  }
1703
1708
  function inject(key, defaultValue, treatDefaultAsFactory) {
@@ -2549,7 +2554,9 @@
2549
2554
  var parentVnode = (vm.$vnode = options._parentVnode); // the placeholder node in parent tree
2550
2555
  var renderContext = parentVnode && parentVnode.context;
2551
2556
  vm.$slots = resolveSlots(options._renderChildren, renderContext);
2552
- vm.$scopedSlots = emptyObject;
2557
+ vm.$scopedSlots = parentVnode
2558
+ ? normalizeScopedSlots(vm.$parent, parentVnode.data.scopedSlots, vm.$slots)
2559
+ : emptyObject;
2553
2560
  // bind the createElement fn to this instance
2554
2561
  // so that we get proper render context inside it.
2555
2562
  // args order: tag, data, children, normalizationType, alwaysNormalize
@@ -2583,7 +2590,7 @@
2583
2590
  Vue.prototype._render = function () {
2584
2591
  var vm = this;
2585
2592
  var _a = vm.$options, render = _a.render, _parentVnode = _a._parentVnode;
2586
- if (_parentVnode) {
2593
+ if (_parentVnode && vm._isMounted) {
2587
2594
  vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);
2588
2595
  if (vm._slotsProxy) {
2589
2596
  syncSetupSlots(vm._slotsProxy, vm.$scopedSlots);
@@ -3224,7 +3231,7 @@
3224
3231
  /**
3225
3232
  * Note: also update dist/vue.runtime.mjs when adding new exports to this file.
3226
3233
  */
3227
- var version = '2.7.6';
3234
+ var version = '2.7.7';
3228
3235
  /**
3229
3236
  * @internal type is manually declared in <root>/types/v3-define-component.d.ts
3230
3237
  */
@@ -3366,6 +3373,7 @@
3366
3373
  this.cb = cb;
3367
3374
  this.id = ++uid$1; // uid for batching
3368
3375
  this.active = true;
3376
+ this.post = false;
3369
3377
  this.dirty = this.lazy; // for lazy watchers
3370
3378
  this.deps = [];
3371
3379
  this.newDeps = [];
@@ -4028,6 +4036,16 @@
4028
4036
  getNow = function () { return performance_1.now(); };
4029
4037
  }
4030
4038
  }
4039
+ var sortCompareFn = function (a, b) {
4040
+ if (a.post) {
4041
+ if (!b.post)
4042
+ return 1;
4043
+ }
4044
+ else if (b.post) {
4045
+ return -1;
4046
+ }
4047
+ return a.id - b.id;
4048
+ };
4031
4049
  /**
4032
4050
  * Flush both queues and run the watchers.
4033
4051
  */
@@ -4043,7 +4061,7 @@
4043
4061
  // user watchers are created before the render watcher)
4044
4062
  // 3. If a component is destroyed during a parent component's watcher run,
4045
4063
  // its watchers can be skipped.
4046
- queue.sort(function (a, b) { return a.id - b.id; });
4064
+ queue.sort(sortCompareFn);
4047
4065
  // do not cache length because more watchers might be pushed
4048
4066
  // as we run existing watchers
4049
4067
  for (index = 0; index < queue.length; index++) {
@@ -4151,12 +4169,14 @@
4151
4169
  if (!isObject(provided)) {
4152
4170
  return;
4153
4171
  }
4172
+ var source = resolveProvided(vm);
4173
+ // IE9 doesn't support Object.getOwnPropertyDescriptors so we have to
4174
+ // iterate the keys ourselves.
4154
4175
  var keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided);
4155
- setCurrentInstance(vm);
4156
4176
  for (var i = 0; i < keys.length; i++) {
4157
- provide(keys[i], provided[keys[i]]);
4177
+ var key = keys[i];
4178
+ Object.defineProperty(source, key, Object.getOwnPropertyDescriptor(provided, key));
4158
4179
  }
4159
- setCurrentInstance();
4160
4180
  }
4161
4181
  }
4162
4182
  function initInjections(vm) {