1
1
/*!
2
- * Vue.js v2.6.10
2
+ * Vue.js v2.6.11
3
3
* (c) 2014-2019 Evan You
4
4
* Released under the MIT License.
5
5
*/
@@ -1996,7 +1996,7 @@ if (typeof Promise !== 'undefined' && isNative(Promise)) {
1996
1996
isUsingMicroTask = true ;
1997
1997
} else if ( typeof setImmediate !== 'undefined' && isNative ( setImmediate ) ) {
1998
1998
// Fallback to setImmediate.
1999
- // Techinically it leverages the (macro) task queue,
1999
+ // Technically it leverages the (macro) task queue,
2000
2000
// but it is still a better choice than setTimeout.
2001
2001
timerFunc = ( ) => {
2002
2002
setImmediate ( flushCallbacks ) ;
@@ -2085,7 +2085,7 @@ let initProxy;
2085
2085
warn (
2086
2086
`Property "${ key } " must be accessed with "$data.${ key } " because ` +
2087
2087
'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
2088
- 'prevent conflicts with Vue internals' +
2088
+ 'prevent conflicts with Vue internals. ' +
2089
2089
'See: https://vuejs.org/v2/api/#data' ,
2090
2090
target
2091
2091
) ;
@@ -2940,7 +2940,7 @@ function bindDynamicKeys (baseObj, values) {
2940
2940
if ( typeof key === 'string' && key ) {
2941
2941
baseObj [ values [ i ] ] = values [ i + 1 ] ;
2942
2942
} else if ( key !== '' && key !== null ) {
2943
- // null is a speical value for explicitly removing a binding
2943
+ // null is a special value for explicitly removing a binding
2944
2944
warn (
2945
2945
`Invalid value for dynamic directive argument (expected string or null): ${ key } ` ,
2946
2946
this
@@ -3432,6 +3432,12 @@ function _createElement (
3432
3432
ns = ( context . $vnode && context . $vnode . ns ) || config . getTagNamespace ( tag ) ;
3433
3433
if ( config . isReservedTag ( tag ) ) {
3434
3434
// platform built-in elements
3435
+ if ( isDef ( data ) && isDef ( data . nativeOn ) ) {
3436
+ warn (
3437
+ `The .native modifier for v-on is only valid on components but it was used on <${ tag } >.` ,
3438
+ context
3439
+ ) ;
3440
+ }
3435
3441
vnode = new VNode (
3436
3442
config . parsePlatformTagName ( tag ) , data , children ,
3437
3443
undefined , undefined , context
@@ -3555,7 +3561,7 @@ function renderMixin (Vue) {
3555
3561
// render self
3556
3562
let vnode ;
3557
3563
try {
3558
- // There's no need to maintain a stack becaues all render fns are called
3564
+ // There's no need to maintain a stack because all render fns are called
3559
3565
// separately from one another. Nested component's render fns are called
3560
3566
// when parent component is patched.
3561
3567
currentRenderingInstance = vm ;
@@ -5464,7 +5470,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
5464
5470
value : FunctionalRenderContext
5465
5471
} ) ;
5466
5472
5467
- Vue . version = '2.6.10 ' ;
5473
+ Vue . version = '2.6.11 ' ;
5468
5474
5469
5475
/* */
5470
5476
@@ -6136,7 +6142,7 @@ function createPatchFunction (backend) {
6136
6142
}
6137
6143
}
6138
6144
6139
- function removeVnodes ( parentElm , vnodes , startIdx , endIdx ) {
6145
+ function removeVnodes ( vnodes , startIdx , endIdx ) {
6140
6146
for ( ; startIdx <= endIdx ; ++ startIdx ) {
6141
6147
const ch = vnodes [ startIdx ] ;
6142
6148
if ( isDef ( ch ) ) {
@@ -6247,7 +6253,7 @@ function createPatchFunction (backend) {
6247
6253
refElm = isUndef ( newCh [ newEndIdx + 1 ] ) ? null : newCh [ newEndIdx + 1 ] . elm ;
6248
6254
addVnodes ( parentElm , refElm , newCh , newStartIdx , newEndIdx , insertedVnodeQueue ) ;
6249
6255
} else if ( newStartIdx > newEndIdx ) {
6250
- removeVnodes ( parentElm , oldCh , oldStartIdx , oldEndIdx ) ;
6256
+ removeVnodes ( oldCh , oldStartIdx , oldEndIdx ) ;
6251
6257
}
6252
6258
}
6253
6259
@@ -6339,7 +6345,7 @@ function createPatchFunction (backend) {
6339
6345
if ( isDef ( oldVnode . text ) ) nodeOps . setTextContent ( elm , '' ) ;
6340
6346
addVnodes ( elm , null , ch , 0 , ch . length - 1 , insertedVnodeQueue ) ;
6341
6347
} else if ( isDef ( oldCh ) ) {
6342
- removeVnodes ( elm , oldCh , 0 , oldCh . length - 1 ) ;
6348
+ removeVnodes ( oldCh , 0 , oldCh . length - 1 ) ;
6343
6349
} else if ( isDef ( oldVnode . text ) ) {
6344
6350
nodeOps . setTextContent ( elm , '' ) ;
6345
6351
}
@@ -6566,7 +6572,7 @@ function createPatchFunction (backend) {
6566
6572
6567
6573
// destroy old node
6568
6574
if ( isDef ( parentElm ) ) {
6569
- removeVnodes ( parentElm , [ oldVnode ] , 0 , 0 ) ;
6575
+ removeVnodes ( [ oldVnode ] , 0 , 0 ) ;
6570
6576
} else if ( isDef ( oldVnode . tag ) ) {
6571
6577
invokeDestroyHook ( oldVnode ) ;
6572
6578
}
@@ -9261,7 +9267,7 @@ const startTagOpen = new RegExp(`^<${qnameCapture}`);
9261
9267
const startTagClose = / ^ \s * ( \/ ? ) > / ;
9262
9268
const endTag = new RegExp ( `^<\\/${ qnameCapture } [^>]*>` ) ;
9263
9269
const doctype = / ^ < ! D O C T Y P E [ ^ > ] + > / i;
9264
- // #7298: escape - to avoid being pased as HTML comment when inlined in page
9270
+ // #7298: escape - to avoid being passed as HTML comment when inlined in page
9265
9271
const comment = / ^ < ! \- - / ;
9266
9272
const conditionalComment = / ^ < ! \[ / ;
9267
9273
@@ -9546,7 +9552,7 @@ function parseHTML (html, options) {
9546
9552
/* */
9547
9553
9548
9554
const onRE = / ^ @ | ^ v - o n : / ;
9549
- const dirRE = / ^ v - | ^ @ | ^ : / ;
9555
+ const dirRE = / ^ v - | ^ @ | ^ : | ^ # / ;
9550
9556
const forAliasRE = / ( [ \s \S ] * ?) \s + (?: i n | o f ) \s + ( [ \s \S ] * ) / ;
9551
9557
const forIteratorRE = / , ( [ ^ , \} \] ] * ) (?: , ( [ ^ , \} \] ] * ) ) ? $ / ;
9552
9558
const stripParensRE = / ^ \( | \) $ / g;
@@ -10170,7 +10176,7 @@ function processSlotContent (el) {
10170
10176
if ( el . parent && ! maybeComponent ( el . parent ) ) {
10171
10177
warn$2 (
10172
10178
`<template v-slot> can only appear at the root level inside ` +
10173
- `the receiving the component` ,
10179
+ `the receiving component` ,
10174
10180
el
10175
10181
) ;
10176
10182
}
@@ -10729,7 +10735,7 @@ function isDirectChildOfTemplateFor (node) {
10729
10735
10730
10736
/* */
10731
10737
10732
- const fnExpRE = / ^ ( [ \w $ _ ] + | \( [ ^ ) ] * ?\) ) \s * = > | ^ f u n c t i o n \s * (?: [ \w $ ] + ) ? \s * \( / ;
10738
+ const fnExpRE = / ^ ( [ \w $ _ ] + | \( [ ^ ) ] * ?\) ) \s * = > | ^ f u n c t i o n (?: \s + [ \w $ ] + ) ? \s * \( / ;
10733
10739
const fnInvokeRE = / \( [ ^ ) ] * ?\) ; * $ / ;
10734
10740
const simplePathRE = / ^ [ A - Z a - z _ $ ] [ \w $ ] * (?: \. [ A - Z a - z _ $ ] [ \w $ ] * | \[ ' [ ^ ' ] * ?' ] | \[ " [ ^ " ] * ?" ] | \[ \d + ] | \[ [ A - Z a - z _ $ ] [ \w $ ] * ] ) * $ / ;
10735
10741
@@ -11554,6 +11560,8 @@ function checkNode (node, warn) {
11554
11560
const range = node . rawAttrsMap [ name ] ;
11555
11561
if ( name === 'v-for' ) {
11556
11562
checkFor ( node , `v-for="${ value } "` , warn , range ) ;
11563
+ } else if ( name === 'v-slot' || name [ 0 ] === '#' ) {
11564
+ checkFunctionParameterExpression ( value , `${ name } ="${ value } "` , warn , range ) ;
11557
11565
} else if ( onRE . test ( name ) ) {
11558
11566
checkEvent ( value , `${ name } ="${ value } "` , warn , range ) ;
11559
11567
} else {
@@ -11573,9 +11581,9 @@ function checkNode (node, warn) {
11573
11581
}
11574
11582
11575
11583
function checkEvent ( exp , text , warn , range ) {
11576
- const stipped = exp . replace ( stripStringRE , '' ) ;
11577
- const keywordMatch = stipped . match ( unaryOperatorsRE ) ;
11578
- if ( keywordMatch && stipped . charAt ( keywordMatch . index - 1 ) !== '$' ) {
11584
+ const stripped = exp . replace ( stripStringRE , '' ) ;
11585
+ const keywordMatch = stripped . match ( unaryOperatorsRE ) ;
11586
+ if ( keywordMatch && stripped . charAt ( keywordMatch . index - 1 ) !== '$' ) {
11579
11587
warn (
11580
11588
`avoid using JavaScript unary operator as property name: ` +
11581
11589
`"${ keywordMatch [ 0 ] } " in expression ${ text . trim ( ) } ` ,
@@ -11630,6 +11638,19 @@ function checkExpression (exp, text, warn, range) {
11630
11638
}
11631
11639
}
11632
11640
11641
+ function checkFunctionParameterExpression ( exp , text , warn , range ) {
11642
+ try {
11643
+ new Function ( exp , '' ) ;
11644
+ } catch ( e ) {
11645
+ warn (
11646
+ `invalid function parameter expression: ${ e . message } in\n\n` +
11647
+ ` ${ exp } \n\n` +
11648
+ ` Raw expression: ${ text . trim ( ) } \n` ,
11649
+ range
11650
+ ) ;
11651
+ }
11652
+ }
11653
+
11633
11654
/* */
11634
11655
11635
11656
const range = 2 ;
0 commit comments