1
1
/*!
2
- * Vue.js v2.5.10
2
+ * Vue.js v2.5.11
3
3
* (c) 2014-2017 Evan You
4
4
* Released under the MIT License.
5
5
*/
@@ -342,6 +342,7 @@ var config = ({
342
342
/**
343
343
* Option merge strategies (used in core/util/options)
344
344
*/
345
+ // $flow-disable-line
345
346
optionMergeStrategies : Object . create ( null ) ,
346
347
347
348
/**
@@ -382,6 +383,7 @@ var config = ({
382
383
/**
383
384
* Custom user key aliases for v-on
384
385
*/
386
+ // $flow-disable-line
385
387
keyCodes : Object . create ( null ) ,
386
388
387
389
/**
@@ -816,8 +818,7 @@ var arrayMethods = Object.create(arrayProto);[
816
818
'splice' ,
817
819
'sort' ,
818
820
'reverse'
819
- ]
820
- . forEach ( function ( method ) {
821
+ ] . forEach ( function ( method ) {
821
822
// cache original method
822
823
var original = arrayProto [ method ] ;
823
824
def ( arrayMethods , method , function mutator ( ) {
@@ -1324,8 +1325,7 @@ function validateComponentName (name) {
1324
1325
'and must start with a letter.'
1325
1326
) ;
1326
1327
}
1327
- var lower = name . toLowerCase ( ) ;
1328
- if ( isBuiltInTag ( lower ) || config . isReservedTag ( lower ) ) {
1328
+ if ( isBuiltInTag ( name ) || config . isReservedTag ( name ) ) {
1329
1329
warn (
1330
1330
'Do not use built-in or reserved HTML elements as component ' +
1331
1331
'id: ' + name
@@ -1357,6 +1357,9 @@ function normalizeProps (options, vm) {
1357
1357
for ( var key in props ) {
1358
1358
val = props [ key ] ;
1359
1359
name = camelize ( key ) ;
1360
+ if ( process . env . NODE_ENV !== 'production' && isPlainObject ( val ) ) {
1361
+ validatePropObject ( name , val , vm ) ;
1362
+ }
1360
1363
res [ name ] = isPlainObject ( val )
1361
1364
? val
1362
1365
: { type : val } ;
@@ -1371,6 +1374,26 @@ function normalizeProps (options, vm) {
1371
1374
options . props = res ;
1372
1375
}
1373
1376
1377
+ /**
1378
+ * Validate whether a prop object keys are valid.
1379
+ */
1380
+ var propOptionsRE = / ^ ( t y p e | d e f a u l t | r e q u i r e d | v a l i d a t o r ) $ / ;
1381
+
1382
+ function validatePropObject (
1383
+ propName ,
1384
+ prop ,
1385
+ vm
1386
+ ) {
1387
+ for ( var key in prop ) {
1388
+ if ( ! propOptionsRE . test ( key ) ) {
1389
+ warn (
1390
+ ( "Invalid key \"" + key + "\" in validation rules object for prop \"" + propName + "\"." ) ,
1391
+ vm
1392
+ ) ;
1393
+ }
1394
+ }
1395
+ }
1396
+
1374
1397
/**
1375
1398
* Normalize all injections into Object-based format
1376
1399
*/
@@ -2518,6 +2541,8 @@ function eventsMixin (Vue) {
2518
2541
2519
2542
/* */
2520
2543
2544
+
2545
+
2521
2546
/**
2522
2547
* Runtime helper for resolving raw children VNodes into a slot object.
2523
2548
*/
@@ -2541,10 +2566,10 @@ function resolveSlots (
2541
2566
if ( ( child . context === context || child . fnContext === context ) &&
2542
2567
data && data . slot != null
2543
2568
) {
2544
- var name = child . data . slot ;
2569
+ var name = data . slot ;
2545
2570
var slot = ( slots [ name ] || ( slots [ name ] = [ ] ) ) ;
2546
2571
if ( child . tag === 'template' ) {
2547
- slot . push . apply ( slot , child . children ) ;
2572
+ slot . push . apply ( slot , child . children || [ ] ) ;
2548
2573
} else {
2549
2574
slot . push ( child ) ;
2550
2575
}
@@ -3385,6 +3410,7 @@ function getData (data, vm) {
3385
3410
var computedWatcherOptions = { lazy : true } ;
3386
3411
3387
3412
function initComputed ( vm , computed ) {
3413
+ // $flow-disable-line
3388
3414
var watchers = vm . _computedWatchers = Object . create ( null ) ;
3389
3415
// computed properties are just getters during SSR
3390
3416
var isSSR = isServerRendering ( ) ;
@@ -3615,11 +3641,11 @@ function resolveInject (inject, vm) {
3615
3641
// inject is :any because flow is not smart enough to figure out cached
3616
3642
var result = Object . create ( null ) ;
3617
3643
var keys = hasSymbol
3618
- ? Reflect . ownKeys ( inject ) . filter ( function ( key ) {
3619
- /* istanbul ignore next */
3620
- return Object . getOwnPropertyDescriptor ( inject , key ) . enumerable
3621
- } )
3622
- : Object . keys ( inject ) ;
3644
+ ? Reflect . ownKeys ( inject ) . filter ( function ( key ) {
3645
+ /* istanbul ignore next */
3646
+ return Object . getOwnPropertyDescriptor ( inject , key ) . enumerable
3647
+ } )
3648
+ : Object . keys ( inject ) ;
3623
3649
3624
3650
for ( var i = 0 ; i < keys . length ; i ++ ) {
3625
3651
var key = keys [ i ] ;
@@ -4976,7 +5002,7 @@ Object.defineProperty(Vue$3.prototype, '$ssrContext', {
4976
5002
}
4977
5003
} ) ;
4978
5004
4979
- Vue$3 . version = '2.5.10 ' ;
5005
+ Vue$3 . version = '2.5.11 ' ;
4980
5006
4981
5007
/* */
4982
5008
@@ -5028,12 +5054,12 @@ function genClassForVnode (vnode) {
5028
5054
var childNode = vnode ;
5029
5055
while ( isDef ( childNode . componentInstance ) ) {
5030
5056
childNode = childNode . componentInstance . _vnode ;
5031
- if ( childNode . data ) {
5057
+ if ( childNode && childNode . data ) {
5032
5058
data = mergeClassData ( childNode . data , data ) ;
5033
5059
}
5034
5060
}
5035
5061
while ( isDef ( parentNode = parentNode . parent ) ) {
5036
- if ( parentNode . data ) {
5062
+ if ( parentNode && parentNode . data ) {
5037
5063
data = mergeClassData ( data , parentNode . data ) ;
5038
5064
}
5039
5065
}
@@ -6134,17 +6160,20 @@ function normalizeDirectives$1 (
6134
6160
) {
6135
6161
var res = Object . create ( null ) ;
6136
6162
if ( ! dirs ) {
6163
+ // $flow-disable-line
6137
6164
return res
6138
6165
}
6139
6166
var i , dir ;
6140
6167
for ( i = 0 ; i < dirs . length ; i ++ ) {
6141
6168
dir = dirs [ i ] ;
6142
6169
if ( ! dir . modifiers ) {
6170
+ // $flow-disable-line
6143
6171
dir . modifiers = emptyModifiers ;
6144
6172
}
6145
6173
res [ getRawDirName ( dir ) ] = dir ;
6146
6174
dir . def = resolveAsset ( vm . $options , 'directives' , dir . name , true ) ;
6147
6175
}
6176
+ // $flow-disable-line
6148
6177
return res
6149
6178
}
6150
6179
@@ -6770,11 +6799,11 @@ function genCheckboxModel (
6770
6799
var falseValueBinding = getBindingAttr ( el , 'false-value' ) || 'false' ;
6771
6800
addProp ( el , 'checked' ,
6772
6801
"Array.isArray(" + value + ")" +
6773
- "?_i(" + value + "," + valueBinding + ")>-1" + (
6774
- trueValueBinding === 'true'
6775
- ? ( ":(" + value + ")" )
6776
- : ( ":_q(" + value + "," + trueValueBinding + ")" )
6777
- )
6802
+ "?_i(" + value + "," + valueBinding + ")>-1" + (
6803
+ trueValueBinding === 'true'
6804
+ ? ( ":(" + value + ")" )
6805
+ : ( ":_q(" + value + "," + trueValueBinding + ")" )
6806
+ )
6778
6807
) ;
6779
6808
addHandler ( el , 'change' ,
6780
6809
"var $$a=" + value + "," +
@@ -6791,9 +6820,9 @@ function genCheckboxModel (
6791
6820
}
6792
6821
6793
6822
function genRadioModel (
6794
- el ,
6795
- value ,
6796
- modifiers
6823
+ el ,
6824
+ value ,
6825
+ modifiers
6797
6826
) {
6798
6827
var number = modifiers && modifiers . number ;
6799
6828
var valueBinding = getBindingAttr ( el , 'value' ) || 'null' ;
@@ -6803,9 +6832,9 @@ function genRadioModel (
6803
6832
}
6804
6833
6805
6834
function genSelect (
6806
- el ,
6807
- value ,
6808
- modifiers
6835
+ el ,
6836
+ value ,
6837
+ modifiers
6809
6838
) {
6810
6839
var number = modifiers && modifiers . number ;
6811
6840
var selectedVal = "Array.prototype.filter" +
@@ -7094,7 +7123,10 @@ function getStyle (vnode, checkChild) {
7094
7123
var childNode = vnode ;
7095
7124
while ( childNode . componentInstance ) {
7096
7125
childNode = childNode . componentInstance . _vnode ;
7097
- if ( childNode . data && ( styleData = normalizeStyleData ( childNode . data ) ) ) {
7126
+ if (
7127
+ childNode && childNode . data &&
7128
+ ( styleData = normalizeStyleData ( childNode . data ) )
7129
+ ) {
7098
7130
extend ( res , styleData ) ;
7099
7131
}
7100
7132
}
@@ -8250,7 +8282,7 @@ var TransitionGroup = {
8250
8282
this . _vnode ,
8251
8283
this . kept ,
8252
8284
false , // hydrating
8253
- true // removeOnly (!important, avoids unnecessary moves)
8285
+ true // removeOnly (!important avoids unnecessary moves)
8254
8286
) ;
8255
8287
this . _vnode = this . kept ;
8256
8288
} ,
@@ -10574,7 +10606,7 @@ function createCompilerCreator (baseCompile) {
10574
10606
// merge custom directives
10575
10607
if ( options . directives ) {
10576
10608
finalOptions . directives = extend (
10577
- Object . create ( baseOptions . directives ) ,
10609
+ Object . create ( baseOptions . directives || null ) ,
10578
10610
options . directives
10579
10611
) ;
10580
10612
}
0 commit comments