11/*!
2- * Vue.js v2.5.15
2+ * Vue.js v2.5.16
33 * (c) 2014-2018 Evan You
44 * Released under the MIT License.
55 */
@@ -1025,10 +1025,9 @@ function defineReactive (
10251025 */
10261026function set ( target , key , val ) {
10271027 if ( process . env . NODE_ENV !== 'production' &&
1028- ! Array . isArray ( target ) &&
1029- ! isObject ( target )
1028+ ( isUndef ( target ) || isPrimitive ( target ) )
10301029 ) {
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 ) ) ) ) ;
10321031 }
10331032 if ( Array . isArray ( target ) && isValidArrayIndex ( key ) ) {
10341033 target . length = Math . max ( target . length , key ) ;
@@ -1061,10 +1060,9 @@ function set (target, key, val) {
10611060 */
10621061function del ( target , key ) {
10631062 if ( process . env . NODE_ENV !== 'production' &&
1064- ! Array . isArray ( target ) &&
1065- ! isObject ( target )
1063+ ( isUndef ( target ) || isPrimitive ( target ) )
10661064 ) {
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 ) ) ) ) ;
10681066 }
10691067 if ( Array . isArray ( target ) && isValidArrayIndex ( key ) ) {
10701068 target . splice ( key , 1 ) ;
@@ -3983,6 +3981,24 @@ function FunctionalRenderContext (
39833981 Ctor
39843982) {
39853983 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+
39864002 this . data = data ;
39874003 this . props = props ;
39884004 this . children = children ;
@@ -3991,12 +4007,6 @@ function FunctionalRenderContext (
39914007 this . injections = resolveInject ( options . inject , parent ) ;
39924008 this . slots = function ( ) { return resolveSlots ( children , parent ) ; } ;
39934009
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-
40004010 // support for compiled functional template
40014011 if ( isCompiled ) {
40024012 // exposing $options for renderStatic()
@@ -4052,23 +4062,28 @@ function createFunctionalComponent (
40524062 var vnode = options . render . call ( null , renderContext . _c , renderContext ) ;
40534063
40544064 if ( vnode instanceof VNode ) {
4055- setFunctionalContextForVNode ( vnode , data , contextVm , options ) ;
4056- return vnode
4065+ return cloneAndMarkFunctionalResult ( vnode , data , renderContext . parent , options )
40574066 } else if ( Array . isArray ( vnode ) ) {
40584067 var vnodes = normalizeChildren ( vnode ) || [ ] ;
4068+ var res = new Array ( vnodes . length ) ;
40594069 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 ) ;
40614071 }
4062- return vnodes
4072+ return res
40634073 }
40644074}
40654075
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 ;
40694083 if ( data . slot ) {
4070- ( vnode . data || ( vnode . data = { } ) ) . slot = data . slot ;
4084+ ( clone . data || ( clone . data = { } ) ) . slot = data . slot ;
40714085 }
4086+ return clone
40724087}
40734088
40744089function mergeProps ( to , from ) {
@@ -4098,7 +4113,7 @@ function mergeProps (to, from) {
40984113
40994114/* */
41004115
4101- // hooks to be invoked on component VNodes during patch
4116+ // inline hooks to be invoked on component VNodes during patch
41024117var componentVNodeHooks = {
41034118 init : function init (
41044119 vnode ,
@@ -4256,8 +4271,8 @@ function createComponent (
42564271 }
42574272 }
42584273
4259- // merge component management hooks onto the placeholder node
4260- mergeHooks ( data ) ;
4274+ // install component management hooks onto the placeholder node
4275+ installComponentHooks ( data ) ;
42614276
42624277 // return a placeholder vnode
42634278 var name = Ctor . options . name || tag ;
@@ -4297,22 +4312,11 @@ function createComponentInstanceForVnode (
42974312 return new vnode . componentOptions . Ctor ( options )
42984313}
42994314
4300- function mergeHooks ( data ) {
4301- if ( ! data . hook ) {
4302- data . hook = { } ;
4303- }
4315+ function installComponentHooks ( data ) {
4316+ var hooks = data . hook || ( data . hook = { } ) ;
43044317 for ( var i = 0 ; i < hooksToMerge . length ; i ++ ) {
43054318 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 ] ;
43164320 }
43174321}
43184322
@@ -4960,13 +4964,15 @@ var KeepAlive = {
49604964 }
49614965 } ,
49624966
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+ } ) ;
49704976 } ,
49714977
49724978 render : function render ( ) {
@@ -5084,7 +5090,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
50845090 value : FunctionalRenderContext
50855091} ) ;
50865092
5087- Vue . version = '2.5.15 ' ;
5093+ Vue . version = '2.5.16 ' ;
50885094
50895095/* */
50905096
@@ -9049,7 +9055,7 @@ function parseHTML (html, options) {
90499055
90509056var onRE = / ^ @ | ^ v - o n : / ;
90519057var dirRE = / ^ v - | ^ @ | ^ : / ;
9052- var forAliasRE = / ( . * ?) \s + (?: i n | o f ) \s + ( . * ) / ;
9058+ var forAliasRE = / ( [ ^ ] * ?) \s + (?: i n | o f ) \s + ( [ ^ ] * ) / ;
90539059var forIteratorRE = / , ( [ ^ , \} \] ] * ) (?: , ( [ ^ , \} \] ] * ) ) ? $ / ;
90549060var stripParensRE = / ^ \( | \) $ / g;
90559061
@@ -9719,7 +9725,7 @@ function preTransformNode (el, options) {
97199725 if ( map [ ':type' ] || map [ 'v-bind:type' ] ) {
97209726 typeBinding = getBindingAttr ( el , 'type' ) ;
97219727 }
9722- if ( ! typeBinding && map [ 'v-bind' ] ) {
9728+ if ( ! map . type && ! typeBinding && map [ 'v-bind' ] ) {
97239729 typeBinding = "(" + ( map [ 'v-bind' ] ) + ").type" ;
97249730 }
97259731
@@ -9972,10 +9978,11 @@ var keyNames = {
99729978 tab : 'Tab' ,
99739979 enter : 'Enter' ,
99749980 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' ] ,
99799986 'delete' : [ 'Backspace' , 'Delete' ]
99809987} ;
99819988
0 commit comments