Skip to content

Commit

Permalink
build: build 2.6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Feb 21, 2019
1 parent 7a8de91 commit 875d6ac
Show file tree
Hide file tree
Showing 19 changed files with 850 additions and 413 deletions.
150 changes: 101 additions & 49 deletions dist/vue.common.dev.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.6
* Vue.js v2.6.7
* (c) 2014-2019 Evan You
* Released under the MIT License.
*/
Expand Down Expand Up @@ -1821,23 +1821,30 @@ function isBoolean () {
/* */

function handleError (err, vm, info) {
if (vm) {
var cur = vm;
while ((cur = cur.$parent)) {
var hooks = cur.$options.errorCaptured;
if (hooks) {
for (var i = 0; i < hooks.length; i++) {
try {
var capture = hooks[i].call(cur, err, vm, info) === false;
if (capture) { return }
} catch (e) {
globalHandleError(e, cur, 'errorCaptured hook');
// Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
// See: https://github.com/vuejs/vuex/issues/1505
pushTarget();
try {
if (vm) {
var cur = vm;
while ((cur = cur.$parent)) {
var hooks = cur.$options.errorCaptured;
if (hooks) {
for (var i = 0; i < hooks.length; i++) {
try {
var capture = hooks[i].call(cur, err, vm, info) === false;
if (capture) { return }
} catch (e) {
globalHandleError(e, cur, 'errorCaptured hook');
}
}
}
}
}
globalHandleError(err, vm, info);
} finally {
popTarget();
}
globalHandleError(err, vm, info);
}

function invokeWithErrorHandling (
Expand All @@ -1851,7 +1858,9 @@ function invokeWithErrorHandling (
try {
res = args ? handler.apply(context, args) : handler.call(context);
if (res && !res._isVue && isPromise(res)) {
res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
// issue #9511
// reassign to res to avoid catch triggering multiple times when nested calls
res = res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
}
} catch (e) {
handleError(e, vm, info);
Expand Down Expand Up @@ -2534,40 +2543,44 @@ function normalizeScopedSlots (
prevSlots
) {
var res;
var isStable = slots ? !!slots.$stable : true;
var key = slots && slots.$key;
if (!slots) {
res = {};
} else if (slots._normalized) {
// fast path 1: child component re-render only, parent did not change
return slots._normalized
} else if (
slots.$stable &&
isStable &&
prevSlots &&
prevSlots !== emptyObject &&
key === prevSlots.$key &&
Object.keys(normalSlots).length === 0
) {
// fast path 2: stable scoped slots w/ no normal slots to proxy,
// only need to normalize once
return prevSlots
} else {
res = {};
for (var key in slots) {
if (slots[key] && key[0] !== '$') {
res[key] = normalizeScopedSlot(normalSlots, key, slots[key]);
for (var key$1 in slots) {
if (slots[key$1] && key$1[0] !== '$') {
res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
}
}
}
// expose normal slots on scopedSlots
for (var key$1 in normalSlots) {
if (!(key$1 in res)) {
res[key$1] = proxyNormalSlot(normalSlots, key$1);
for (var key$2 in normalSlots) {
if (!(key$2 in res)) {
res[key$2] = proxyNormalSlot(normalSlots, key$2);
}
}
// avoriaz seems to mock a non-extensible $scopedSlots object
// and when that is passed down this would cause an error
if (slots && Object.isExtensible(slots)) {
(slots)._normalized = res;
}
def(res, '$stable', slots ? !!slots.$stable : true);
def(res, '$stable', isStable);
def(res, '$key', key);
return res
}

Expand Down Expand Up @@ -2862,14 +2875,16 @@ function bindObjectListeners (data, value) {

function resolveScopedSlots (
fns, // see flow/vnode
res,
// the following are added in 2.6
hasDynamicKeys,
res
contentHashKey
) {
res = res || { $stable: !hasDynamicKeys };
for (var i = 0; i < fns.length; i++) {
var slot = fns[i];
if (Array.isArray(slot)) {
resolveScopedSlots(slot, hasDynamicKeys, res);
resolveScopedSlots(slot, res, hasDynamicKeys);
} else if (slot) {
// marker for reverse proxying v-slot without scope on this.$slots
if (slot.proxy) {
Expand All @@ -2878,6 +2893,9 @@ function resolveScopedSlots (
res[slot.key] = slot.fn;
}
}
if (contentHashKey) {
(res).$key = contentHashKey;
}
return res
}

Expand Down Expand Up @@ -4055,9 +4073,12 @@ function updateChildComponent (
// check if there are dynamic scopedSlots (hand-written or compiled but with
// dynamic slot names). Static scoped slots compiled from template has the
// "$stable" marker.
var newScopedSlots = parentVnode.data.scopedSlots;
var oldScopedSlots = vm.$scopedSlots;
var hasDynamicScopedSlot = !!(
(parentVnode.data.scopedSlots && !parentVnode.data.scopedSlots.$stable) ||
(vm.$scopedSlots !== emptyObject && !vm.$scopedSlots.$stable)
(newScopedSlots && !newScopedSlots.$stable) ||
(oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
(newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
);

// Any static slot children from the parent may have changed during parent's
Expand Down Expand Up @@ -5379,7 +5400,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext
});

Vue.version = '2.6.6';
Vue.version = '2.6.7';

/* */

Expand Down Expand Up @@ -7558,15 +7579,7 @@ function updateDOMProps (oldVnode, vnode) {
}
}

// skip the update if old and new VDOM state is the same.
// the only exception is `value` where the DOM value may be temporarily
// out of sync with VDOM state due to focus, composition and modifiers.
// This also covers #4521 by skipping the unnecesarry `checked` update.
if (key !== 'value' && cur === oldProps[key]) {
continue
}

if (key === 'value') {
if (key === 'value' && elm.tagName !== 'PROGRESS') {
// store value as _value as well since
// non-string values will be stringified
elm._value = cur;
Expand All @@ -7586,8 +7599,18 @@ function updateDOMProps (oldVnode, vnode) {
while (svg.firstChild) {
elm.appendChild(svg.firstChild);
}
} else {
elm[key] = cur;
} else if (
// skip the update if old and new VDOM state is the same.
// `value` is handled separately because the DOM value may be temporarily
// out of sync with VDOM state due to focus, composition and modifiers.
// This #4521 by skipping the unnecesarry `checked` update.
cur !== oldProps[key]
) {
// some property updates can throw
// e.g. `value` on <progress> w/ non-finite value
try {
elm[key] = cur;
} catch (e) {}
}
}
}
Expand Down Expand Up @@ -11167,22 +11190,49 @@ function genScopedSlots (
containsSlotChild(slot) // is passing down slot from parent which may be dynamic
)
});
// OR when it is inside another scoped slot (the reactivity is disconnected)
// #9438

// #9534: if a component with scoped slots is inside a conditional branch,
// it's possible for the same component to be reused but with different
// compiled slot content. To avoid that, we generate a unique key based on
// the generated code of all the slot contents.
var needsKey = !!el.if;

// OR when it is inside another scoped slot or v-for (the reactivity may be
// disconnected due to the intermediate scope variable)
// #9438, #9506
// TODO: this can be further optimized by properly analyzing in-scope bindings
// and skip force updating ones that do not actually use scope variables.
if (!needsForceUpdate) {
var parent = el.parent;
while (parent) {
if (parent.slotScope && parent.slotScope !== emptySlotScopeToken) {
if (
(parent.slotScope && parent.slotScope !== emptySlotScopeToken) ||
parent.for
) {
needsForceUpdate = true;
break
}
if (parent.if) {
needsKey = true;
}
parent = parent.parent;
}
}

return ("scopedSlots:_u([" + (Object.keys(slots).map(function (key) {
return genScopedSlot(slots[key], state)
}).join(',')) + "]" + (needsForceUpdate ? ",true" : "") + ")")
var generatedSlots = Object.keys(slots)
.map(function (key) { return genScopedSlot(slots[key], state); })
.join(',');

return ("scopedSlots:_u([" + generatedSlots + "]" + (needsForceUpdate ? ",null,true" : "") + (!needsForceUpdate && needsKey ? (",null,false," + (hash(generatedSlots))) : "") + ")")
}

function hash(str) {
var hash = 5381;
var i = str.length;
while(i) {
hash = (hash * 33) ^ str.charCodeAt(--i);
}
return hash >>> 0
}

function containsSlotChild (el) {
Expand Down Expand Up @@ -11517,11 +11567,13 @@ function generateCodeFrame (

function repeat$1 (str, n) {
var result = '';
while (true) { // eslint-disable-line
if (n & 1) { result += str; }
n >>>= 1;
if (n <= 0) { break }
str += str;
if (n > 0) {
while (true) { // eslint-disable-line
if (n & 1) { result += str; }
n >>>= 1;
if (n <= 0) { break }
str += str;
}
}
return result
}
Expand Down
4 changes: 2 additions & 2 deletions dist/vue.common.prod.js

Large diffs are not rendered by default.

Loading

0 comments on commit 875d6ac

Please sign in to comment.