Skip to content

Commit

Permalink
build: build 2.5.16
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 13, 2018
1 parent 62a922e commit 9089170
Show file tree
Hide file tree
Showing 17 changed files with 1,230 additions and 859 deletions.
111 changes: 59 additions & 52 deletions dist/vue.common.js
@@ -1,5 +1,5 @@
/*!
* Vue.js v2.5.15
* Vue.js v2.5.16
* (c) 2014-2018 Evan You
* Released under the MIT License.
*/
Expand Down Expand Up @@ -1025,10 +1025,9 @@ function defineReactive (
*/
function set (target, key, val) {
if (process.env.NODE_ENV !== 'production' &&
!Array.isArray(target) &&
!isObject(target)
(isUndef(target) || isPrimitive(target))
) {
warn(("Cannot set reactive property on non-object/array value: " + target));
warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
}
if (Array.isArray(target) && isValidArrayIndex(key)) {
target.length = Math.max(target.length, key);
Expand Down Expand Up @@ -1061,10 +1060,9 @@ function set (target, key, val) {
*/
function del (target, key) {
if (process.env.NODE_ENV !== 'production' &&
!Array.isArray(target) &&
!isObject(target)
(isUndef(target) || isPrimitive(target))
) {
warn(("Cannot delete reactive property on non-object/array value: " + target));
warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
}
if (Array.isArray(target) && isValidArrayIndex(key)) {
target.splice(key, 1);
Expand Down Expand Up @@ -3983,6 +3981,24 @@ function FunctionalRenderContext (
Ctor
) {
var options = Ctor.options;
// ensure the createElement function in functional components
// gets a unique context - this is necessary for correct named slot check
var contextVm;
if (hasOwn(parent, '_uid')) {
contextVm = Object.create(parent);
// $flow-disable-line
contextVm._original = parent;
} else {
// the context vm passed in is a functional context as well.
// in this case we want to make sure we are able to get a hold to the
// real context instance.
contextVm = parent;
// $flow-disable-line
parent = parent._original;
}
var isCompiled = isTrue(options._compiled);
var needNormalization = !isCompiled;

this.data = data;
this.props = props;
this.children = children;
Expand All @@ -3991,12 +4007,6 @@ function FunctionalRenderContext (
this.injections = resolveInject(options.inject, parent);
this.slots = function () { return resolveSlots(children, parent); };

// ensure the createElement function in functional components
// gets a unique context - this is necessary for correct named slot check
var contextVm = Object.create(parent);
var isCompiled = isTrue(options._compiled);
var needNormalization = !isCompiled;

// support for compiled functional template
if (isCompiled) {
// exposing $options for renderStatic()
Expand Down Expand Up @@ -4052,23 +4062,28 @@ function createFunctionalComponent (
var vnode = options.render.call(null, renderContext._c, renderContext);

if (vnode instanceof VNode) {
setFunctionalContextForVNode(vnode, data, contextVm, options);
return vnode
return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options)
} else if (Array.isArray(vnode)) {
var vnodes = normalizeChildren(vnode) || [];
var res = new Array(vnodes.length);
for (var i = 0; i < vnodes.length; i++) {
setFunctionalContextForVNode(vnodes[i], data, contextVm, options);
res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options);
}
return vnodes
return res
}
}

function setFunctionalContextForVNode (vnode, data, vm, options) {
vnode.fnContext = vm;
vnode.fnOptions = options;
function cloneAndMarkFunctionalResult (vnode, data, contextVm, options) {
// #7817 clone node before setting fnContext, otherwise if the node is reused
// (e.g. it was from a cached normal slot) the fnContext causes named slots
// that should not be matched to match.
var clone = cloneVNode(vnode);
clone.fnContext = contextVm;
clone.fnOptions = options;
if (data.slot) {
(vnode.data || (vnode.data = {})).slot = data.slot;
(clone.data || (clone.data = {})).slot = data.slot;
}
return clone
}

function mergeProps (to, from) {
Expand Down Expand Up @@ -4098,7 +4113,7 @@ function mergeProps (to, from) {

/* */

// hooks to be invoked on component VNodes during patch
// inline hooks to be invoked on component VNodes during patch
var componentVNodeHooks = {
init: function init (
vnode,
Expand Down Expand Up @@ -4256,8 +4271,8 @@ function createComponent (
}
}

// merge component management hooks onto the placeholder node
mergeHooks(data);
// install component management hooks onto the placeholder node
installComponentHooks(data);

// return a placeholder vnode
var name = Ctor.options.name || tag;
Expand Down Expand Up @@ -4297,22 +4312,11 @@ function createComponentInstanceForVnode (
return new vnode.componentOptions.Ctor(options)
}

function mergeHooks (data) {
if (!data.hook) {
data.hook = {};
}
function installComponentHooks (data) {
var hooks = data.hook || (data.hook = {});
for (var i = 0; i < hooksToMerge.length; i++) {
var key = hooksToMerge[i];
var fromParent = data.hook[key];
var ours = componentVNodeHooks[key];
data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;
}
}

function mergeHook$1 (one, two) {
return function (a, b, c, d) {
one(a, b, c, d);
two(a, b, c, d);
hooks[key] = componentVNodeHooks[key];
}
}

Expand Down Expand Up @@ -4960,13 +4964,15 @@ var KeepAlive = {
}
},

watch: {
include: function include (val) {
pruneCache(this, function (name) { return matches(val, name); });
},
exclude: function exclude (val) {
pruneCache(this, function (name) { return !matches(val, name); });
}
mounted: function mounted () {
var this$1 = this;

this.$watch('include', function (val) {
pruneCache(this$1, function (name) { return matches(val, name); });
});
this.$watch('exclude', function (val) {
pruneCache(this$1, function (name) { return !matches(val, name); });
});
},

render: function render () {
Expand Down Expand Up @@ -5084,7 +5090,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext
});

Vue.version = '2.5.15';
Vue.version = '2.5.16';

/* */

Expand Down Expand Up @@ -9049,7 +9055,7 @@ function parseHTML (html, options) {

var onRE = /^@|^v-on:/;
var dirRE = /^v-|^@|^:/;
var forAliasRE = /(.*?)\s+(?:in|of)\s+(.*)/;
var forAliasRE = /([^]*?)\s+(?:in|of)\s+([^]*)/;
var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
var stripParensRE = /^\(|\)$/g;

Expand Down Expand Up @@ -9719,7 +9725,7 @@ function preTransformNode (el, options) {
if (map[':type'] || map['v-bind:type']) {
typeBinding = getBindingAttr(el, 'type');
}
if (!typeBinding && map['v-bind']) {
if (!map.type && !typeBinding && map['v-bind']) {
typeBinding = "(" + (map['v-bind']) + ").type";
}

Expand Down Expand Up @@ -9972,10 +9978,11 @@ var keyNames = {
tab: 'Tab',
enter: 'Enter',
space: ' ',
up: 'ArrowUp',
left: 'ArrowLeft',
right: 'ArrowRight',
down: 'ArrowDown',
// #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
up: ['Up', 'ArrowUp'],
left: ['Left', 'ArrowLeft'],
right: ['Right', 'ArrowRight'],
down: ['Down', 'ArrowDown'],
'delete': ['Backspace', 'Delete']
};

Expand Down

0 comments on commit 9089170

Please sign in to comment.