vue 2.7.0-alpha.2 → 2.7.0-alpha.5

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.0-alpha.2
2
+ * Vue.js v2.7.0-alpha.5
3
3
  * (c) 2014-2022 Evan You
4
4
  * Released under the MIT License.
5
5
  */
@@ -1943,6 +1943,9 @@ function initProvide(vm) {
1943
1943
  var provided = isFunction(provideOption)
1944
1944
  ? provideOption.call(vm)
1945
1945
  : provideOption;
1946
+ if (!isObject(provided)) {
1947
+ return;
1948
+ }
1946
1949
  var keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided);
1947
1950
  setCurrentInstance(vm);
1948
1951
  for (var i = 0; i < keys.length; i++) {
@@ -2258,34 +2261,33 @@ function isAsyncPlaceholder(node) {
2258
2261
  return node.isComment && node.asyncFactory;
2259
2262
  }
2260
2263
 
2261
- function normalizeScopedSlots(ownerVm, slots, normalSlots) {
2264
+ function normalizeScopedSlots(ownerVm, scopedSlots, normalSlots, prevScopedSlots) {
2262
2265
  var res;
2263
- var prevSlots = ownerVm.$scopedSlots;
2264
2266
  var hasNormalSlots = Object.keys(normalSlots).length > 0;
2265
- var isStable = slots ? !!slots.$stable : !hasNormalSlots;
2266
- var key = slots && slots.$key;
2267
- if (!slots) {
2267
+ var isStable = scopedSlots ? !!scopedSlots.$stable : !hasNormalSlots;
2268
+ var key = scopedSlots && scopedSlots.$key;
2269
+ if (!scopedSlots) {
2268
2270
  res = {};
2269
2271
  }
2270
- else if (slots._normalized) {
2272
+ else if (scopedSlots._normalized) {
2271
2273
  // fast path 1: child component re-render only, parent did not change
2272
- return slots._normalized;
2274
+ return scopedSlots._normalized;
2273
2275
  }
2274
2276
  else if (isStable &&
2275
- prevSlots &&
2276
- prevSlots !== emptyObject &&
2277
- key === prevSlots.$key &&
2277
+ prevScopedSlots &&
2278
+ prevScopedSlots !== emptyObject &&
2279
+ key === prevScopedSlots.$key &&
2278
2280
  !hasNormalSlots &&
2279
- !prevSlots.$hasNormal) {
2281
+ !prevScopedSlots.$hasNormal) {
2280
2282
  // fast path 2: stable scoped slots w/ no normal slots to proxy,
2281
2283
  // only need to normalize once
2282
- return prevSlots;
2284
+ return prevScopedSlots;
2283
2285
  }
2284
2286
  else {
2285
2287
  res = {};
2286
- for (var key_1 in slots) {
2287
- if (slots[key_1] && key_1[0] !== '$') {
2288
- res[key_1] = normalizeScopedSlot(ownerVm, normalSlots, key_1, slots[key_1]);
2288
+ for (var key_1 in scopedSlots) {
2289
+ if (scopedSlots[key_1] && key_1[0] !== '$') {
2290
+ res[key_1] = normalizeScopedSlot(ownerVm, normalSlots, key_1, scopedSlots[key_1]);
2289
2291
  }
2290
2292
  }
2291
2293
  }
@@ -2297,8 +2299,8 @@ function normalizeScopedSlots(ownerVm, slots, normalSlots) {
2297
2299
  }
2298
2300
  // avoriaz seems to mock a non-extensible $scopedSlots object
2299
2301
  // and when that is passed down this would cause an error
2300
- if (slots && Object.isExtensible(slots)) {
2301
- slots._normalized = res;
2302
+ if (scopedSlots && Object.isExtensible(scopedSlots)) {
2303
+ scopedSlots._normalized = res;
2302
2304
  }
2303
2305
  def(res, '$stable', isStable);
2304
2306
  def(res, '$key', key);
@@ -3084,7 +3086,7 @@ function renderMixin(Vue) {
3084
3086
  var vm = this;
3085
3087
  var _a = vm.$options, render = _a.render, _parentVnode = _a._parentVnode;
3086
3088
  if (_parentVnode) {
3087
- vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots);
3089
+ vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);
3088
3090
  if (vm._slotsProxy) {
3089
3091
  syncSetupSlots(vm._slotsProxy, vm.$scopedSlots);
3090
3092
  }
@@ -4552,8 +4554,16 @@ var onServerPrefetch = createLifeCycle('serverPrefetch');
4552
4554
  var onRenderTracked = createLifeCycle('renderTracked');
4553
4555
  var onRenderTriggered = createLifeCycle('renderTriggered');
4554
4556
 
4557
+ /**
4558
+ * @internal type is manually declared in <root>/types/v3-define-component.d.ts
4559
+ */
4560
+ function defineComponent(options) {
4561
+ return options;
4562
+ }
4563
+
4555
4564
  var vca = /*#__PURE__*/Object.freeze({
4556
4565
  __proto__: null,
4566
+ defineComponent: defineComponent,
4557
4567
  ref: ref$1,
4558
4568
  shallowRef: shallowRef,
4559
4569
  isRef: isRef,
@@ -5787,7 +5797,7 @@ Object.defineProperty(Vue.prototype, '$ssrContext', {
5787
5797
  Object.defineProperty(Vue, 'FunctionalRenderContext', {
5788
5798
  value: FunctionalRenderContext
5789
5799
  });
5790
- Vue.version = '2.7.0-alpha.2';
5800
+ Vue.version = '2.7.0-alpha.5';
5791
5801
 
5792
5802
  // these are reserved for web because they are directly compiled away
5793
5803
  // during template compilation