Skip to content

Commit

Permalink
update vue to v2.6.10
Browse files Browse the repository at this point in the history
  • Loading branch information
liying2008 committed Mar 31, 2019
1 parent 09d24ee commit d0460df
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 29 deletions.
86 changes: 59 additions & 27 deletions js/libs/vue.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.8
* Vue.js v2.6.10
* (c) 2014-2019 Evan You
* Released under the MIT License.
*/
Expand Down Expand Up @@ -1861,10 +1861,11 @@
var res;
try {
res = args ? handler.apply(context, args) : handler.call(context);
if (res && !res._isVue && isPromise(res)) {
if (res && !res._isVue && isPromise(res) && !res._handled) {
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)"); });
// avoid catch triggering multiple times when nested calls
res._handled = true;
}
} catch (e) {
handleError(e, vm, info);
Expand Down Expand Up @@ -2547,7 +2548,8 @@
prevSlots
) {
var res;
var isStable = slots ? !!slots.$stable : true;
var hasNormalSlots = Object.keys(normalSlots).length > 0;
var isStable = slots ? !!slots.$stable : !hasNormalSlots;
var key = slots && slots.$key;
if (!slots) {
res = {};
Expand All @@ -2559,7 +2561,8 @@
prevSlots &&
prevSlots !== emptyObject &&
key === prevSlots.$key &&
Object.keys(normalSlots).length === 0
!hasNormalSlots &&
!prevSlots.$hasNormal
) {
// fast path 2: stable scoped slots w/ no normal slots to proxy,
// only need to normalize once
Expand All @@ -2585,6 +2588,7 @@
}
def(res, '$stable', isStable);
def(res, '$key', key);
def(res, '$hasNormal', hasNormalSlots);
return res
}

Expand All @@ -2594,8 +2598,10 @@
res = res && typeof res === 'object' && !Array.isArray(res)
? [res] // single vnode
: normalizeChildren(res);
return res && res.length === 0
? undefined
return res && (
res.length === 0 ||
(res.length === 1 && res[0].isComment) // #9658
) ? undefined
: res
};
// this is a slot using the new v-slot syntax without scope. although it is
Expand Down Expand Up @@ -2775,12 +2781,13 @@
: data.attrs || (data.attrs = {});
}
var camelizedKey = camelize(key);
if (!(key in hash) && !(camelizedKey in hash)) {
var hyphenatedKey = hyphenate(key);
if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
hash[key] = value[key];

if (isSync) {
var on = data.on || (data.on = {});
on[("update:" + camelizedKey)] = function ($event) {
on[("update:" + key)] = function ($event) {
value[key] = $event;
};
}
Expand Down Expand Up @@ -3615,7 +3622,7 @@
}

var owner = currentRenderingInstance;
if (isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
// already pending
factory.owners.push(owner);
}
Expand All @@ -3624,9 +3631,11 @@
return factory.loadingComp
}

if (!isDef(factory.owners)) {
if (owner && !isDef(factory.owners)) {
var owners = factory.owners = [owner];
var sync = true
var sync = true;
var timerLoading = null;
var timerTimeout = null

;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });

Expand All @@ -3637,6 +3646,14 @@

if (renderCompleted) {
owners.length = 0;
if (timerLoading !== null) {
clearTimeout(timerLoading);
timerLoading = null;
}
if (timerTimeout !== null) {
clearTimeout(timerTimeout);
timerTimeout = null;
}
}
};

Expand Down Expand Up @@ -3683,7 +3700,8 @@
if (res.delay === 0) {
factory.loading = true;
} else {
setTimeout(function () {
timerLoading = setTimeout(function () {
timerLoading = null;
if (isUndef(factory.resolved) && isUndef(factory.error)) {
factory.loading = true;
forceRender(false);
Expand All @@ -3693,7 +3711,8 @@
}

if (isDef(res.timeout)) {
setTimeout(function () {
timerTimeout = setTimeout(function () {
timerTimeout = null;
if (isUndef(factory.resolved)) {
reject(
"timeout (" + (res.timeout) + "ms)"
Expand Down Expand Up @@ -4239,11 +4258,21 @@
// timestamp can either be hi-res (relative to page load) or low-res
// (relative to UNIX epoch), so in order to compare time we have to use the
// same timestamp type when saving the flush timestamp.
if (inBrowser && getNow() > document.createEvent('Event').timeStamp) {
// if the low-res timestamp which is bigger than the event timestamp
// (which is evaluated AFTER) it means the event is using a hi-res timestamp,
// and we need to use the hi-res version for event listeners as well.
getNow = function () { return performance.now(); };
// All IE versions use low-res event timestamps, and have problematic clock
// implementations (#9632)
if (inBrowser && !isIE) {
var performance = window.performance;
if (
performance &&
typeof performance.now === 'function' &&
getNow() > document.createEvent('Event').timeStamp
) {
// if the event timestamp, although evaluated AFTER the Date.now(), is
// smaller than it, it means the event is using a hi-res timestamp,
// and we need to use the hi-res version for event listener timestamps as
// well.
getNow = function () { return performance.now(); };
}
}

/**
Expand Down Expand Up @@ -5408,7 +5437,7 @@
value: FunctionalRenderContext
});

Vue.version = '2.6.8';
Vue.version = '2.6.10';

/* */

Expand Down Expand Up @@ -7500,8 +7529,10 @@
e.target === e.currentTarget ||
// event is fired after handler attachment
e.timeStamp >= attachedTimestamp ||
// #9462 bail for iOS 9 bug: event.timeStamp is 0 after history.pushState
e.timeStamp === 0 ||
// bail for environments that have buggy event.timeStamp implementations
// #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
// #9681 QtWebEngine event.timeStamp is negative value
e.timeStamp <= 0 ||
// #9448 bail if event is fired in another document in a multi-page
// electron/nw.js app, since event.timeStamp will be using a different
// starting reference
Expand Down Expand Up @@ -7568,10 +7599,11 @@
}

for (key in oldProps) {
if (isUndef(props[key])) {
if (!(key in props)) {
elm[key] = '';
}
}

for (key in props) {
cur = props[key];
// ignore children if the node has textContent or innerHTML,
Expand Down Expand Up @@ -8119,8 +8151,8 @@
var context = activeInstance;
var transitionNode = activeInstance.$vnode;
while (transitionNode && transitionNode.parent) {
transitionNode = transitionNode.parent;
context = transitionNode.context;
transitionNode = transitionNode.parent;
}

var isAppear = !context._isMounted || !vnode.isRootInsert;
Expand Down Expand Up @@ -9827,7 +9859,7 @@
text = preserveWhitespace ? ' ' : '';
}
if (text) {
if (whitespaceOption === 'condense') {
if (!inPre && whitespaceOption === 'condense') {
// condense consecutive whitespaces into single space
text = text.replace(whitespaceRE$1, ' ');
}
Expand Down Expand Up @@ -10688,7 +10720,7 @@

/* */

var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*(?:[\w$]+)?\s*\(/;
var fnInvokeRE = /\([^)]*?\);*$/;
var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;

Expand Down
4 changes: 2 additions & 2 deletions js/libs/vue.min.js

Large diffs are not rendered by default.

0 comments on commit d0460df

Please sign in to comment.