1
1
/*!
2
- * Vue.js v2.5.15
2
+ * Vue.js v2.5.16
3
3
* (c) 2014-2018 Evan You
4
4
* Released under the MIT License.
5
5
*/
@@ -1025,10 +1025,9 @@ function defineReactive (
1025
1025
*/
1026
1026
function set ( target , key , val ) {
1027
1027
if ( process . env . NODE_ENV !== 'production' &&
1028
- ! Array . isArray ( target ) &&
1029
- ! isObject ( target )
1028
+ ( isUndef ( target ) || isPrimitive ( target ) )
1030
1029
) {
1031
- warn ( ( "Cannot set reactive property on non-object/array value: " + target ) ) ;
1030
+ warn ( ( "Cannot set reactive property on undefined, null, or primitive value: " + ( ( target ) ) ) ) ;
1032
1031
}
1033
1032
if ( Array . isArray ( target ) && isValidArrayIndex ( key ) ) {
1034
1033
target . length = Math . max ( target . length , key ) ;
@@ -1061,10 +1060,9 @@ function set (target, key, val) {
1061
1060
*/
1062
1061
function del ( target , key ) {
1063
1062
if ( process . env . NODE_ENV !== 'production' &&
1064
- ! Array . isArray ( target ) &&
1065
- ! isObject ( target )
1063
+ ( isUndef ( target ) || isPrimitive ( target ) )
1066
1064
) {
1067
- warn ( ( "Cannot delete reactive property on non-object/array value: " + target ) ) ;
1065
+ warn ( ( "Cannot delete reactive property on undefined, null, or primitive value: " + ( ( target ) ) ) ) ;
1068
1066
}
1069
1067
if ( Array . isArray ( target ) && isValidArrayIndex ( key ) ) {
1070
1068
target . splice ( key , 1 ) ;
@@ -3983,6 +3981,24 @@ function FunctionalRenderContext (
3983
3981
Ctor
3984
3982
) {
3985
3983
var options = Ctor . options ;
3984
+ // ensure the createElement function in functional components
3985
+ // gets a unique context - this is necessary for correct named slot check
3986
+ var contextVm ;
3987
+ if ( hasOwn ( parent , '_uid' ) ) {
3988
+ contextVm = Object . create ( parent ) ;
3989
+ // $flow-disable-line
3990
+ contextVm . _original = parent ;
3991
+ } else {
3992
+ // the context vm passed in is a functional context as well.
3993
+ // in this case we want to make sure we are able to get a hold to the
3994
+ // real context instance.
3995
+ contextVm = parent ;
3996
+ // $flow-disable-line
3997
+ parent = parent . _original ;
3998
+ }
3999
+ var isCompiled = isTrue ( options . _compiled ) ;
4000
+ var needNormalization = ! isCompiled ;
4001
+
3986
4002
this . data = data ;
3987
4003
this . props = props ;
3988
4004
this . children = children ;
@@ -3991,12 +4007,6 @@ function FunctionalRenderContext (
3991
4007
this . injections = resolveInject ( options . inject , parent ) ;
3992
4008
this . slots = function ( ) { return resolveSlots ( children , parent ) ; } ;
3993
4009
3994
- // ensure the createElement function in functional components
3995
- // gets a unique context - this is necessary for correct named slot check
3996
- var contextVm = Object . create ( parent ) ;
3997
- var isCompiled = isTrue ( options . _compiled ) ;
3998
- var needNormalization = ! isCompiled ;
3999
-
4000
4010
// support for compiled functional template
4001
4011
if ( isCompiled ) {
4002
4012
// exposing $options for renderStatic()
@@ -4052,23 +4062,28 @@ function createFunctionalComponent (
4052
4062
var vnode = options . render . call ( null , renderContext . _c , renderContext ) ;
4053
4063
4054
4064
if ( vnode instanceof VNode ) {
4055
- setFunctionalContextForVNode ( vnode , data , contextVm , options ) ;
4056
- return vnode
4065
+ return cloneAndMarkFunctionalResult ( vnode , data , renderContext . parent , options )
4057
4066
} else if ( Array . isArray ( vnode ) ) {
4058
4067
var vnodes = normalizeChildren ( vnode ) || [ ] ;
4068
+ var res = new Array ( vnodes . length ) ;
4059
4069
for ( var i = 0 ; i < vnodes . length ; i ++ ) {
4060
- setFunctionalContextForVNode ( vnodes [ i ] , data , contextVm , options ) ;
4070
+ res [ i ] = cloneAndMarkFunctionalResult ( vnodes [ i ] , data , renderContext . parent , options ) ;
4061
4071
}
4062
- return vnodes
4072
+ return res
4063
4073
}
4064
4074
}
4065
4075
4066
- function setFunctionalContextForVNode ( vnode , data , vm , options ) {
4067
- vnode . fnContext = vm ;
4068
- vnode . fnOptions = options ;
4076
+ function cloneAndMarkFunctionalResult ( vnode , data , contextVm , options ) {
4077
+ // #7817 clone node before setting fnContext, otherwise if the node is reused
4078
+ // (e.g. it was from a cached normal slot) the fnContext causes named slots
4079
+ // that should not be matched to match.
4080
+ var clone = cloneVNode ( vnode ) ;
4081
+ clone . fnContext = contextVm ;
4082
+ clone . fnOptions = options ;
4069
4083
if ( data . slot ) {
4070
- ( vnode . data || ( vnode . data = { } ) ) . slot = data . slot ;
4084
+ ( clone . data || ( clone . data = { } ) ) . slot = data . slot ;
4071
4085
}
4086
+ return clone
4072
4087
}
4073
4088
4074
4089
function mergeProps ( to , from ) {
@@ -4098,7 +4113,7 @@ function mergeProps (to, from) {
4098
4113
4099
4114
/* */
4100
4115
4101
- // hooks to be invoked on component VNodes during patch
4116
+ // inline hooks to be invoked on component VNodes during patch
4102
4117
var componentVNodeHooks = {
4103
4118
init : function init (
4104
4119
vnode ,
@@ -4256,8 +4271,8 @@ function createComponent (
4256
4271
}
4257
4272
}
4258
4273
4259
- // merge component management hooks onto the placeholder node
4260
- mergeHooks ( data ) ;
4274
+ // install component management hooks onto the placeholder node
4275
+ installComponentHooks ( data ) ;
4261
4276
4262
4277
// return a placeholder vnode
4263
4278
var name = Ctor . options . name || tag ;
@@ -4297,22 +4312,11 @@ function createComponentInstanceForVnode (
4297
4312
return new vnode . componentOptions . Ctor ( options )
4298
4313
}
4299
4314
4300
- function mergeHooks ( data ) {
4301
- if ( ! data . hook ) {
4302
- data . hook = { } ;
4303
- }
4315
+ function installComponentHooks ( data ) {
4316
+ var hooks = data . hook || ( data . hook = { } ) ;
4304
4317
for ( var i = 0 ; i < hooksToMerge . length ; i ++ ) {
4305
4318
var key = hooksToMerge [ i ] ;
4306
- var fromParent = data . hook [ key ] ;
4307
- var ours = componentVNodeHooks [ key ] ;
4308
- data . hook [ key ] = fromParent ? mergeHook$1 ( ours , fromParent ) : ours ;
4309
- }
4310
- }
4311
-
4312
- function mergeHook$1 ( one , two ) {
4313
- return function ( a , b , c , d ) {
4314
- one ( a , b , c , d ) ;
4315
- two ( a , b , c , d ) ;
4319
+ hooks [ key ] = componentVNodeHooks [ key ] ;
4316
4320
}
4317
4321
}
4318
4322
@@ -4960,13 +4964,15 @@ var KeepAlive = {
4960
4964
}
4961
4965
} ,
4962
4966
4963
- watch : {
4964
- include : function include ( val ) {
4965
- pruneCache ( this , function ( name ) { return matches ( val , name ) ; } ) ;
4966
- } ,
4967
- exclude : function exclude ( val ) {
4968
- pruneCache ( this , function ( name ) { return ! matches ( val , name ) ; } ) ;
4969
- }
4967
+ mounted : function mounted ( ) {
4968
+ var this$1 = this ;
4969
+
4970
+ this . $watch ( 'include' , function ( val ) {
4971
+ pruneCache ( this$1 , function ( name ) { return matches ( val , name ) ; } ) ;
4972
+ } ) ;
4973
+ this . $watch ( 'exclude' , function ( val ) {
4974
+ pruneCache ( this$1 , function ( name ) { return ! matches ( val , name ) ; } ) ;
4975
+ } ) ;
4970
4976
} ,
4971
4977
4972
4978
render : function render ( ) {
@@ -5084,7 +5090,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
5084
5090
value : FunctionalRenderContext
5085
5091
} ) ;
5086
5092
5087
- Vue . version = '2.5.15 ' ;
5093
+ Vue . version = '2.5.16 ' ;
5088
5094
5089
5095
/* */
5090
5096
@@ -9049,7 +9055,7 @@ function parseHTML (html, options) {
9049
9055
9050
9056
var onRE = / ^ @ | ^ v - o n : / ;
9051
9057
var dirRE = / ^ v - | ^ @ | ^ : / ;
9052
- var forAliasRE = / ( . * ?) \s + (?: i n | o f ) \s + ( . * ) / ;
9058
+ var forAliasRE = / ( [ ^ ] * ?) \s + (?: i n | o f ) \s + ( [ ^ ] * ) / ;
9053
9059
var forIteratorRE = / , ( [ ^ , \} \] ] * ) (?: , ( [ ^ , \} \] ] * ) ) ? $ / ;
9054
9060
var stripParensRE = / ^ \( | \) $ / g;
9055
9061
@@ -9719,7 +9725,7 @@ function preTransformNode (el, options) {
9719
9725
if ( map [ ':type' ] || map [ 'v-bind:type' ] ) {
9720
9726
typeBinding = getBindingAttr ( el , 'type' ) ;
9721
9727
}
9722
- if ( ! typeBinding && map [ 'v-bind' ] ) {
9728
+ if ( ! map . type && ! typeBinding && map [ 'v-bind' ] ) {
9723
9729
typeBinding = "(" + ( map [ 'v-bind' ] ) + ").type" ;
9724
9730
}
9725
9731
@@ -9972,10 +9978,11 @@ var keyNames = {
9972
9978
tab : 'Tab' ,
9973
9979
enter : 'Enter' ,
9974
9980
space : ' ' ,
9975
- up : 'ArrowUp' ,
9976
- left : 'ArrowLeft' ,
9977
- right : 'ArrowRight' ,
9978
- down : 'ArrowDown' ,
9981
+ // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
9982
+ up : [ 'Up' , 'ArrowUp' ] ,
9983
+ left : [ 'Left' , 'ArrowLeft' ] ,
9984
+ right : [ 'Right' , 'ArrowRight' ] ,
9985
+ down : [ 'Down' , 'ArrowDown' ] ,
9979
9986
'delete' : [ 'Backspace' , 'Delete' ]
9980
9987
} ;
9981
9988
0 commit comments