11/*!
2- * Vue.js v2.2.1
2+ * Vue.js v2.2.2
33 * (c) 2014-2017 Evan You
44 * Released under the MIT License.
55 */
@@ -214,7 +214,12 @@ function looseEqual (a, b) {
214214 var isObjectA = isObject ( a ) ;
215215 var isObjectB = isObject ( b ) ;
216216 if ( isObjectA && isObjectB ) {
217- return JSON . stringify ( a ) === JSON . stringify ( b )
217+ try {
218+ return JSON . stringify ( a ) === JSON . stringify ( b )
219+ } catch ( e ) {
220+ // possible circular reference
221+ return a === b
222+ }
218223 } else if ( ! isObjectA && ! isObjectB ) {
219224 return String ( a ) === String ( b )
220225 } else {
@@ -533,15 +538,14 @@ var bailRE = /[^\w.$]/;
533538function parsePath ( path ) {
534539 if ( bailRE . test ( path ) ) {
535540 return
536- } else {
537- var segments = path . split ( '.' ) ;
538- return function ( obj ) {
539- for ( var i = 0 ; i < segments . length ; i ++ ) {
540- if ( ! obj ) { return }
541- obj = obj [ segments [ i ] ] ;
542- }
543- return obj
541+ }
542+ var segments = path . split ( '.' ) ;
543+ return function ( obj ) {
544+ for ( var i = 0 ; i < segments . length ; i ++ ) {
545+ if ( ! obj ) { return }
546+ obj = obj [ segments [ i ] ] ;
544547 }
548+ return obj
545549 }
546550}
547551
@@ -629,7 +633,7 @@ Dep.prototype.depend = function depend () {
629633} ;
630634
631635Dep . prototype . notify = function notify ( ) {
632- // stablize the subscriber list first
636+ // stabilize the subscriber list first
633637 var subs = this . subs . slice ( ) ;
634638 for ( var i = 0 , l = subs . length ; i < l ; i ++ ) {
635639 subs [ i ] . update ( ) ;
@@ -872,27 +876,27 @@ function defineReactive$$1 (
872876 * triggers change notification if the property doesn't
873877 * already exist.
874878 */
875- function set ( obj , key , val ) {
876- if ( Array . isArray ( obj ) ) {
877- obj . length = Math . max ( obj . length , key ) ;
878- obj . splice ( key , 1 , val ) ;
879+ function set ( target , key , val ) {
880+ if ( Array . isArray ( target ) ) {
881+ target . length = Math . max ( target . length , key ) ;
882+ target . splice ( key , 1 , val ) ;
879883 return val
880884 }
881- if ( hasOwn ( obj , key ) ) {
882- obj [ key ] = val ;
883- return
885+ if ( hasOwn ( target , key ) ) {
886+ target [ key ] = val ;
887+ return val
884888 }
885- var ob = obj . __ob__ ;
886- if ( obj . _isVue || ( ob && ob . vmCount ) ) {
889+ var ob = target . __ob__ ;
890+ if ( target . _isVue || ( ob && ob . vmCount ) ) {
887891 process . env . NODE_ENV !== 'production' && warn (
888892 'Avoid adding reactive properties to a Vue instance or its root $data ' +
889893 'at runtime - declare it upfront in the data option.'
890894 ) ;
891- return
895+ return val
892896 }
893897 if ( ! ob ) {
894- obj [ key ] = val ;
895- return
898+ target [ key ] = val ;
899+ return val
896900 }
897901 defineReactive$$1 ( ob . value , key , val ) ;
898902 ob . dep . notify ( ) ;
@@ -902,23 +906,23 @@ function set (obj, key, val) {
902906/**
903907 * Delete a property and trigger change if necessary.
904908 */
905- function del ( obj , key ) {
906- if ( Array . isArray ( obj ) ) {
907- obj . splice ( key , 1 ) ;
909+ function del ( target , key ) {
910+ if ( Array . isArray ( target ) ) {
911+ target . splice ( key , 1 ) ;
908912 return
909913 }
910- var ob = obj . __ob__ ;
911- if ( obj . _isVue || ( ob && ob . vmCount ) ) {
914+ var ob = target . __ob__ ;
915+ if ( target . _isVue || ( ob && ob . vmCount ) ) {
912916 process . env . NODE_ENV !== 'production' && warn (
913917 'Avoid deleting properties on a Vue instance or its root $data ' +
914918 '- just set it to null.'
915919 ) ;
916920 return
917921 }
918- if ( ! hasOwn ( obj , key ) ) {
922+ if ( ! hasOwn ( target , key ) ) {
919923 return
920924 }
921- delete obj [ key ] ;
925+ delete target [ key ] ;
922926 if ( ! ob ) {
923927 return
924928 }
@@ -1434,12 +1438,12 @@ function isType (type, fn) {
14341438 return false
14351439}
14361440
1437- function handleError ( err , vm , type ) {
1441+ function handleError ( err , vm , info ) {
14381442 if ( config . errorHandler ) {
1439- config . errorHandler . call ( null , err , vm , type ) ;
1443+ config . errorHandler . call ( null , err , vm , info ) ;
14401444 } else {
14411445 if ( process . env . NODE_ENV !== 'production' ) {
1442- warn ( ( "Error in " + type + ":" ) , vm ) ;
1446+ warn ( ( "Error in " + info + ":" ) , vm ) ;
14431447 }
14441448 /* istanbul ignore else */
14451449 if ( inBrowser && typeof console !== 'undefined' ) {
@@ -1598,8 +1602,9 @@ function cloneVNode (vnode) {
15981602}
15991603
16001604function cloneVNodes ( vnodes ) {
1601- var res = new Array ( vnodes . length ) ;
1602- for ( var i = 0 ; i < vnodes . length ; i ++ ) {
1605+ var len = vnodes . length ;
1606+ var res = new Array ( len ) ;
1607+ for ( var i = 0 ; i < len ; i ++ ) {
16031608 res [ i ] = cloneVNode ( vnodes [ i ] ) ;
16041609 }
16051610 return res
@@ -1727,7 +1732,7 @@ function simpleNormalizeChildren (children) {
17271732 return children
17281733}
17291734
1730- // 2. When the children contains constrcuts that always generated nested Arrays,
1735+ // 2. When the children contains constructs that always generated nested Arrays,
17311736// e.g. <template>, <slot>, v-for, or when the children is provided by user
17321737// with hand-written render functions / JSX. In such cases a full normalization
17331738// is needed to cater to all possible types of children values.
@@ -1845,12 +1850,21 @@ function eventsMixin (Vue) {
18451850 } ;
18461851
18471852 Vue . prototype . $off = function ( event , fn ) {
1853+ var this$1 = this ;
1854+
18481855 var vm = this ;
18491856 // all
18501857 if ( ! arguments . length ) {
18511858 vm . _events = Object . create ( null ) ;
18521859 return vm
18531860 }
1861+ // array of events
1862+ if ( Array . isArray ( event ) ) {
1863+ for ( var i$1 = 0 , l = event . length ; i$1 < l ; i$1 ++ ) {
1864+ this$1 . $off ( event [ i$1 ] , fn ) ;
1865+ }
1866+ return vm
1867+ }
18541868 // specific event
18551869 var cbs = vm . _events [ event ] ;
18561870 if ( ! cbs ) {
@@ -1918,16 +1932,17 @@ function resolveSlots (
19181932 defaultSlot . push ( child ) ;
19191933 }
19201934 }
1921- // ignore single whitespace
1922- if ( defaultSlot . length && ! (
1923- defaultSlot . length === 1 &&
1924- ( defaultSlot [ 0 ] . text === ' ' || defaultSlot [ 0 ] . isComment )
1925- ) ) {
1935+ // ignore whitespace
1936+ if ( ! defaultSlot . every ( isWhitespace ) ) {
19261937 slots . default = defaultSlot ;
19271938 }
19281939 return slots
19291940}
19301941
1942+ function isWhitespace ( node ) {
1943+ return node . isComment || node . text === ' '
1944+ }
1945+
19311946function resolveScopedSlots (
19321947 fns
19331948) {
@@ -2064,10 +2079,11 @@ function mountComponent (
20642079 vm . $options . render = createEmptyVNode ;
20652080 if ( process . env . NODE_ENV !== 'production' ) {
20662081 /* istanbul ignore if */
2067- if ( vm . $options . template && vm . $options . template . charAt ( 0 ) !== '#' ) {
2082+ if ( ( vm . $options . template && vm . $options . template . charAt ( 0 ) !== '#' ) ||
2083+ vm . $options . el || el ) {
20682084 warn (
20692085 'You are using the runtime-only build of Vue where the template ' +
2070- 'option is not available. Either pre-compile the templates into ' +
2086+ 'compiler is not available. Either pre-compile the templates into ' +
20712087 'render functions, or use the compiler-included build.' ,
20722088 vm
20732089 ) ;
@@ -3563,14 +3579,17 @@ function renderMixin (Vue) {
35633579
35643580/* */
35653581
3566- function initInjections ( vm ) {
3582+ function initProvide ( vm ) {
35673583 var provide = vm . $options . provide ;
3568- var inject = vm . $options . inject ;
35693584 if ( provide ) {
35703585 vm . _provided = typeof provide === 'function'
35713586 ? provide . call ( vm )
35723587 : provide ;
35733588 }
3589+ }
3590+
3591+ function initInjections ( vm ) {
3592+ var inject = vm . $options . inject ;
35743593 if ( inject ) {
35753594 // inject is :any because flow is not smart enough to figure out cached
35763595 // isArray here
@@ -3586,7 +3605,7 @@ function initInjections (vm) {
35863605 var provideKey = isArray ? key : inject [ key ] ;
35873606 var source = vm ;
35883607 while ( source ) {
3589- if ( source . _provided && source . _provided [ provideKey ] ) {
3608+ if ( source . _provided && provideKey in source . _provided ) {
35903609 vm [ key ] = source . _provided [ provideKey ] ;
35913610 break
35923611 }
@@ -3637,8 +3656,9 @@ function initMixin (Vue) {
36373656 initEvents ( vm ) ;
36383657 initRender ( vm ) ;
36393658 callHook ( vm , 'beforeCreate' ) ;
3659+ initInjections ( vm ) ; // resolve injections before data/props
36403660 initState ( vm ) ;
3641- initInjections ( vm ) ;
3661+ initProvide ( vm ) ; // resolve provide after data/props
36423662 callHook ( vm , 'created' ) ;
36433663
36443664 /* istanbul ignore if */
@@ -4057,7 +4077,7 @@ Object.defineProperty(Vue$2.prototype, '$isServer', {
40574077 get : isServerRendering
40584078} ) ;
40594079
4060- Vue$2 . version = '2.2.1 ' ;
4080+ Vue$2 . version = '2.2.2 ' ;
40614081
40624082/* */
40634083
@@ -5724,9 +5744,9 @@ var transformRE = /\b(transform|all)(,|$)/;
57245744
57255745function getTransitionInfo ( el , expectedType ) {
57265746 var styles = window . getComputedStyle ( el ) ;
5727- var transitioneDelays = styles [ transitionProp + 'Delay' ] . split ( ', ' ) ;
5747+ var transitionDelays = styles [ transitionProp + 'Delay' ] . split ( ', ' ) ;
57285748 var transitionDurations = styles [ transitionProp + 'Duration' ] . split ( ', ' ) ;
5729- var transitionTimeout = getTimeout ( transitioneDelays , transitionDurations ) ;
5749+ var transitionTimeout = getTimeout ( transitionDelays , transitionDurations ) ;
57305750 var animationDelays = styles [ animationProp + 'Delay' ] . split ( ', ' ) ;
57315751 var animationDurations = styles [ animationProp + 'Duration' ] . split ( ', ' ) ;
57325752 var animationTimeout = getTimeout ( animationDelays , animationDurations ) ;
@@ -5876,7 +5896,7 @@ function enter (vnode, toggleDisplay) {
58765896 }
58775897
58785898 var expectsCSS = css !== false && ! isIE9 ;
5879- var userWantsControl = getHookAgumentsLength ( enterHook ) ;
5899+ var userWantsControl = getHookArgumentsLength ( enterHook ) ;
58805900
58815901 var cb = el . _enterCb = once ( function ( ) {
58825902 if ( expectsCSS ) {
@@ -5968,7 +5988,7 @@ function leave (vnode, rm) {
59685988 var duration = data . duration ;
59695989
59705990 var expectsCSS = css !== false && ! isIE9 ;
5971- var userWantsControl = getHookAgumentsLength ( leave ) ;
5991+ var userWantsControl = getHookArgumentsLength ( leave ) ;
59725992
59735993 var explicitLeaveDuration = toNumber (
59745994 isObject ( duration )
@@ -6065,12 +6085,12 @@ function isValidDuration (val) {
60656085 * - a wrapped component method (check ._length)
60666086 * - a plain function (.length)
60676087 */
6068- function getHookAgumentsLength ( fn ) {
6088+ function getHookArgumentsLength ( fn ) {
60696089 if ( ! fn ) { return false }
60706090 var invokerFns = fn . fns ;
60716091 if ( invokerFns ) {
60726092 // invoker
6073- return getHookAgumentsLength (
6093+ return getHookArgumentsLength (
60746094 Array . isArray ( invokerFns )
60756095 ? invokerFns [ 0 ]
60766096 : invokerFns
@@ -6490,7 +6510,7 @@ var Transition = {
64906510// we force transition-group to update its children into two passes:
64916511// in the first pass, we remove all nodes that need to be removed,
64926512// triggering their leaving transition; in the second pass, we insert/move
6493- // into the final disired state. This way in the second pass removed
6513+ // into the final desired state. This way in the second pass removed
64946514// nodes will remain where they should be.
64956515
64966516var props = extend ( {
0 commit comments