@@ -152,12 +152,9 @@ var capitalize = cached(function (str) {
152152/**
153153 * Hyphenate a camelCase string.
154154 */
155- var hyphenateRE = / ( [ ^ - ] ) ( [ A - Z ] ) / g;
155+ var hyphenateRE = / \B ( [ A - Z ] ) / g;
156156var hyphenate = cached ( function ( str ) {
157- return str
158- . replace ( hyphenateRE , '$1-$2' )
159- . replace ( hyphenateRE , '$1-$2' )
160- . toLowerCase ( )
157+ return str . replace ( hyphenateRE , '-$1' ) . toLowerCase ( )
161158} ) ;
162159
163160/**
@@ -284,8 +281,6 @@ function escape (s) {
284281 return s . replace ( / [ < > " & ] / g, escapeChar )
285282}
286283
287- var cachedEscape = cached ( escape ) ;
288-
289284function escapeChar ( a ) {
290285 return ESC [ a ] || a
291286}
@@ -297,7 +292,7 @@ function escapeChar (a) {
297292var isReservedAttr = makeMap ( 'style,class' ) ;
298293
299294// attributes that should be using props for binding
300- var acceptValue = makeMap ( 'input,textarea,option,select' ) ;
295+ var acceptValue = makeMap ( 'input,textarea,option,select,progress ' ) ;
301296var mustUseProp = function ( tag , type , attr ) {
302297 return (
303298 ( attr === 'value' && acceptValue ( tag ) ) && type !== 'button' ||
@@ -367,7 +362,7 @@ function renderAttr (key, value) {
367362 } else if ( isEnumeratedAttr ( key ) ) {
368363 return ( " " + key + "=\"" + ( isFalsyAttrValue ( value ) || value === 'false' ? 'false' : 'true' ) + "\"" )
369364 } else if ( ! isFalsyAttrValue ( value ) ) {
370- return ( " " + key + "=\"" + ( typeof value === 'string' ? cachedEscape ( value ) : value ) + "\"" )
365+ return ( " " + key + "=\"" + ( escape ( String ( value ) ) ) + "\"" )
371366 }
372367 return ''
373368}
@@ -758,7 +753,7 @@ var isAndroid = UA && UA.indexOf('android') > 0;
758753var isIOS = UA && / i p h o n e | i p a d | i p o d | i o s / . test ( UA ) ;
759754var isChrome = UA && / c h r o m e \/ \d + / . test ( UA ) && ! isEdge ;
760755
761- // Firefix has a "watch" function on Object.prototype...
756+ // Firefox has a "watch" function on Object.prototype...
762757var nativeWatch = ( { } ) . watch ;
763758
764759var supportsPassive = false ;
@@ -840,13 +835,13 @@ var nextTick = (function () {
840835 // "force" the microtask queue to be flushed by adding an empty timer.
841836 if ( isIOS ) { setTimeout ( noop ) ; }
842837 } ;
843- } else if ( typeof MutationObserver !== 'undefined' && (
838+ } else if ( ! isIE && typeof MutationObserver !== 'undefined' && (
844839 isNative ( MutationObserver ) ||
845840 // PhantomJS and iOS 7.x
846841 MutationObserver . toString ( ) === '[object MutationObserverConstructor]'
847842 ) ) {
848843 // use MutationObserver where native Promise is not available,
849- // e.g. PhantomJS IE11 , iOS7, Android 4.4
844+ // e.g. PhantomJS, iOS7, Android 4.4
850845 var counter = 1 ;
851846 var observer = new MutationObserver ( nextTickHandler ) ;
852847 var textNode = document . createTextNode ( String ( counter ) ) ;
@@ -1146,9 +1141,9 @@ function defineReactive$$1 (
11461141 dep . depend ( ) ;
11471142 if ( childOb ) {
11481143 childOb . dep . depend ( ) ;
1149- }
1150- if ( Array . isArray ( value ) ) {
1151- dependArray ( value ) ;
1144+ if ( Array . isArray ( value ) ) {
1145+ dependArray ( value ) ;
1146+ }
11521147 }
11531148 }
11541149 return value
@@ -1304,7 +1299,7 @@ function mergeDataOrFn (
13041299 : childVal ;
13051300 var defaultData = typeof parentVal === 'function'
13061301 ? parentVal . call ( vm )
1307- : undefined ;
1302+ : parentVal ;
13081303 if ( instanceData ) {
13091304 return mergeData ( instanceData , defaultData )
13101305 } else {
@@ -1707,7 +1702,12 @@ function assertType (value, type) {
17071702 var valid ;
17081703 var expectedType = getType ( type ) ;
17091704 if ( simpleCheckRE . test ( expectedType ) ) {
1710- valid = typeof value === expectedType . toLowerCase ( ) ;
1705+ var t = typeof value ;
1706+ valid = t === expectedType . toLowerCase ( ) ;
1707+ // for primitive wrapper objects
1708+ if ( ! valid && t === 'object' ) {
1709+ valid = value instanceof type ;
1710+ }
17111711 } else if ( expectedType === 'Object' ) {
17121712 valid = isPlainObject ( value ) ;
17131713 } else if ( expectedType === 'Array' ) {
@@ -1871,6 +1871,10 @@ function getTagNamespace (tag) {
18711871 }
18721872}
18731873
1874+
1875+
1876+ var isTextInputType = makeMap ( 'text,number,password,search,email,tel,url' ) ;
1877+
18741878/* */
18751879
18761880/**
@@ -1882,7 +1886,7 @@ function getTagNamespace (tag) {
18821886function renderClass ( node ) {
18831887 var classList = genClassForVnode ( node ) ;
18841888 if ( classList !== '' ) {
1885- return ( " class=\"" + ( cachedEscape ( classList ) ) + "\"" )
1889+ return ( " class=\"" + ( escape ( classList ) ) + "\"" )
18861890 }
18871891}
18881892
@@ -1974,7 +1978,7 @@ function genStyle (style) {
19741978function renderStyle ( vnode ) {
19751979 var styleText = genStyle ( getStyle ( vnode , false ) ) ;
19761980 if ( styleText !== '' ) {
1977- return ( " style=" + ( JSON . stringify ( cachedEscape ( styleText ) ) ) )
1981+ return ( " style=" + ( JSON . stringify ( escape ( styleText ) ) ) )
19781982 }
19791983}
19801984
@@ -2718,7 +2722,7 @@ function genCheckboxModel (
27182722 'if(Array.isArray($$a)){' +
27192723 "var $$v=" + ( number ? '_n(' + valueBinding + ')' : valueBinding ) + "," +
27202724 '$$i=_i($$a,$$v);' +
2721- "if($$el.checked){$$i<0&&(" + value + "=$$a.concat($$v))}" +
2725+ "if($$el.checked){$$i<0&&(" + value + "=$$a.concat([ $$v] ))}" +
27222726 "else{$$i>-1&&(" + value + "=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}" +
27232727 "}else{" + ( genAssignmentCode ( value , '$$c' ) ) + "}" ,
27242728 null , true
@@ -3195,29 +3199,14 @@ var he = createCommonjsModule(function (module, exports) {
31953199 */
31963200
31973201// Regular Expressions for parsing tags and attributes
3198- var singleAttrIdentifier = / ( [ ^ \s " ' < > / = ] + ) / ;
3199- var singleAttrAssign = / (?: = ) / ;
3200- var singleAttrValues = [
3201- // attr value double quotes
3202- / " ( [ ^ " ] * ) " + / . source ,
3203- // attr value, single quotes
3204- / ' ( [ ^ ' ] * ) ' + / . source ,
3205- // attr value, no quotes
3206- / ( [ ^ \s " ' = < > ` ] + ) / . source
3207- ] ;
3208- var attribute = new RegExp (
3209- '^\\s*' + singleAttrIdentifier . source +
3210- '(?:\\s*(' + singleAttrAssign . source + ')' +
3211- '\\s*(?:' + singleAttrValues . join ( '|' ) + '))?'
3212- ) ;
3213-
3202+ var attribute = / ^ \s * ( [ ^ \s " ' < > \/ = ] + ) (?: \s * ( = ) \s * (?: " ( [ ^ " ] * ) " + | ' ( [ ^ ' ] * ) ' + | ( [ ^ \s " ' = < > ` ] + ) ) ) ? / ;
32143203// could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName
32153204// but for Vue templates we can enforce a simple charset
32163205var ncname = '[a-zA-Z_][\\w\\-\\.]*' ;
3217- var qnameCapture = ' ((?:' + ncname + ' \\:)?' + ncname + ')' ;
3218- var startTagOpen = new RegExp ( '^<' + qnameCapture ) ;
3206+ var qnameCapture = " ((?:" + ncname + " \\:)?" + ncname + ")" ;
3207+ var startTagOpen = new RegExp ( ( "^<" + qnameCapture ) ) ;
32193208var startTagClose = / ^ \s * ( \/ ? ) > / ;
3220- var endTag = new RegExp ( ' ^<\\/' + qnameCapture + ' [^>]*>' ) ;
3209+ var endTag = new RegExp ( ( " ^<\\/" + qnameCapture + " [^>]*>" ) ) ;
32213210var doctype = / ^ < ! D O C T Y P E [ ^ > ] + > / i;
32223211var comment = / ^ < ! - - / ;
32233212var conditionalComment = / ^ < ! \[ / ;
@@ -3917,6 +3906,8 @@ function processSlot (el) {
39173906 var slotTarget = getBindingAttr ( el , 'slot' ) ;
39183907 if ( slotTarget ) {
39193908 el . slotTarget = slotTarget === '""' ? '"default"' : slotTarget ;
3909+ // preserve slot as an attribute for native shadow DOM compat
3910+ addAttr ( el , 'slot' , slotTarget ) ;
39203911 }
39213912 if ( el . tag === 'template' ) {
39223913 el . slotScope = getAndRemoveAttr ( el , 'scope' ) ;
@@ -4326,7 +4317,7 @@ function genOnce (el, state) {
43264317 ) ;
43274318 return genElement ( el , state )
43284319 }
4329- return ( "_o(" + ( genElement ( el , state ) ) + "," + ( state . onceId ++ ) + ( key ? ( "," + key ) : "" ) + ")" )
4320+ return ( "_o(" + ( genElement ( el , state ) ) + "," + ( state . onceId ++ ) + "," + key + ")" )
43304321 } else {
43314322 return genStatic ( el , state )
43324323 }
@@ -5075,10 +5066,10 @@ function elementToOpenTagSegments (el, state) {
50755066function childrenToSegments ( el , state ) {
50765067 var binding ;
50775068 if ( ( binding = el . attrsMap [ 'v-html' ] ) ) {
5078- return [ { type : EXPRESSION , value : binding } ]
5069+ return [ { type : EXPRESSION , value : ( "_s(" + binding + ")" ) } ]
50795070 }
50805071 if ( ( binding = el . attrsMap [ 'v-text' ] ) ) {
5081- return [ { type : INTERPOLATION , value : binding } ]
5072+ return [ { type : INTERPOLATION , value : ( "_s(" + binding + ")" ) } ]
50825073 }
50835074 return el . children
50845075 ? nodesToSegments ( el . children , state )
@@ -5097,7 +5088,7 @@ function nodesToSegments (
50975088 } else if ( c . type === 2 ) {
50985089 segments . push ( { type : INTERPOLATION , value : c . expression } ) ;
50995090 } else if ( c . type === 3 ) {
5100- segments . push ( { type : RAW , value : c . text } ) ;
5091+ segments . push ( { type : RAW , value : escape ( c . text ) } ) ;
51015092 }
51025093 }
51035094 return segments
@@ -5571,7 +5562,7 @@ function renderSSRClass (
55715562 dynamic
55725563) {
55735564 var res = renderClass$1 ( staticClass , dynamic ) ;
5574- return res === '' ? res : ( " class=\"" + ( cachedEscape ( res ) ) + "\"" )
5565+ return res === '' ? res : ( " class=\"" + ( escape ( res ) ) + "\"" )
55755566}
55765567
55775568function renderSSRStyle (
@@ -5584,7 +5575,7 @@ function renderSSRStyle (
55845575 if ( dynamic ) { extend ( style , normalizeStyleBinding ( dynamic ) ) ; }
55855576 if ( extra ) { extend ( style , extra ) ; }
55865577 var res = genStyle ( style ) ;
5587- return res === '' ? res : ( " style=" + ( JSON . stringify ( cachedEscape ( res ) ) ) )
5578+ return res === '' ? res : ( " style=" + ( JSON . stringify ( escape ( res ) ) ) )
55885579}
55895580
55905581/* not type checking this file because flow doesn't play well with Proxy */
@@ -5693,8 +5684,10 @@ var normalizeEvent = cached(function (name) {
56935684 name = once$$1 ? name . slice ( 1 ) : name ;
56945685 var capture = name . charAt ( 0 ) === '!' ;
56955686 name = capture ? name . slice ( 1 ) : name ;
5687+ var plain = ! ( passive || once$$1 || capture ) ;
56965688 return {
56975689 name : name ,
5690+ plain : plain ,
56985691 once : once$$1 ,
56995692 capture : capture ,
57005693 passive : passive
@@ -5720,6 +5713,11 @@ function createFnInvoker (fns) {
57205713 return invoker
57215714}
57225715
5716+ // #6552
5717+ function prioritizePlainEvents ( a , b ) {
5718+ return a . plain ? - 1 : b . plain ? 1 : 0
5719+ }
5720+
57235721function updateListeners (
57245722 on ,
57255723 oldOn ,
@@ -5728,10 +5726,13 @@ function updateListeners (
57285726 vm
57295727) {
57305728 var name , cur , old , event ;
5729+ var toAdd = [ ] ;
5730+ var hasModifier = false ;
57315731 for ( name in on ) {
57325732 cur = on [ name ] ;
57335733 old = oldOn [ name ] ;
57345734 event = normalizeEvent ( name ) ;
5735+ if ( ! event . plain ) { hasModifier = true ; }
57355736 if ( isUndef ( cur ) ) {
57365737 "development" !== 'production' && warn (
57375738 "Invalid handler for event \"" + ( event . name ) + "\": got " + String ( cur ) ,
@@ -5741,12 +5742,20 @@ function updateListeners (
57415742 if ( isUndef ( cur . fns ) ) {
57425743 cur = on [ name ] = createFnInvoker ( cur ) ;
57435744 }
5744- add ( event . name , cur , event . once , event . capture , event . passive ) ;
5745+ event . handler = cur ;
5746+ toAdd . push ( event ) ;
57455747 } else if ( cur !== old ) {
57465748 old . fns = cur ;
57475749 on [ name ] = old ;
57485750 }
57495751 }
5752+ if ( toAdd . length ) {
5753+ if ( hasModifier ) { toAdd . sort ( prioritizePlainEvents ) ; }
5754+ for ( var i = 0 ; i < toAdd . length ; i ++ ) {
5755+ var event$1 = toAdd [ i ] ;
5756+ add ( event$1 . name , event$1 . handler , event$1 . once , event$1 . capture , event$1 . passive ) ;
5757+ }
5758+ }
57505759 for ( name in oldOn ) {
57515760 if ( isUndef ( on [ name ] ) ) {
57525761 event = normalizeEvent ( name ) ;
@@ -5955,6 +5964,8 @@ function resolveAsyncComponent (
59555964
59565965/* */
59575966
5967+ /* */
5968+
59585969
59595970
59605971var target ;
@@ -5996,10 +6007,15 @@ function resolveSlots (
59966007 var defaultSlot = [ ] ;
59976008 for ( var i = 0 , l = children . length ; i < l ; i ++ ) {
59986009 var child = children [ i ] ;
6010+ var data = child . data ;
6011+ // remove slot attribute if the node is resolved as a Vue slot node
6012+ if ( data && data . attrs && data . attrs . slot ) {
6013+ delete data . attrs . slot ;
6014+ }
59996015 // named slots should only be respected if the vnode was rendered in the
60006016 // same context.
60016017 if ( ( child . context === context || child . functionalContext === context ) &&
6002- child . data && child . data . slot != null
6018+ data && data . slot != null
60036019 ) {
60046020 var name = child . data . slot ;
60056021 var slot = ( slots [ name ] || ( slots [ name ] = [ ] ) ) ;
@@ -6062,11 +6078,11 @@ function updateChildComponent (
60626078 }
60636079 vm . $options . _renderChildren = renderChildren ;
60646080
6065- // update $attrs and $listensers hash
6081+ // update $attrs and $listeners hash
60666082 // these are also reactive so they may trigger child update if the child
60676083 // used them during render
6068- vm . $attrs = parentVnode . data && parentVnode . data . attrs ;
6069- vm . $listeners = listeners ;
6084+ vm . $attrs = ( parentVnode . data && parentVnode . data . attrs ) || emptyObject ;
6085+ vm . $listeners = listeners || emptyObject ;
60706086
60716087 // update props
60726088 if ( propsData && vm . $options . props ) {
@@ -6642,7 +6658,7 @@ function _createElement (
66426658 var vnode , ns ;
66436659 if ( typeof tag === 'string' ) {
66446660 var Ctor ;
6645- ns = config . getTagNamespace ( tag ) ;
6661+ ns = ( context . $vnode && context . $vnode . ns ) || config . getTagNamespace ( tag ) ;
66466662 if ( config . isReservedTag ( tag ) ) {
66476663 // platform built-in elements
66486664 vnode = new VNode (
@@ -6746,7 +6762,10 @@ function resolveInject (inject, vm) {
67466762 // inject is :any because flow is not smart enough to figure out cached
67476763 var result = Object . create ( null ) ;
67486764 var keys = hasSymbol
6749- ? Reflect . ownKeys ( inject )
6765+ ? Reflect . ownKeys ( inject ) . filter ( function ( key ) {
6766+ /* istanbul ignore next */
6767+ return Object . getOwnPropertyDescriptor ( inject , key ) . enumerable
6768+ } )
67506769 : Object . keys ( inject ) ;
67516770
67526771 for ( var i = 0 ; i < keys . length ; i ++ ) {
@@ -6842,7 +6861,7 @@ function createFunctionalComponent (
68426861 var propOptions = Ctor . options . props ;
68436862 if ( isDef ( propOptions ) ) {
68446863 for ( var key in propOptions ) {
6845- props [ key ] = validateProp ( key , propOptions , propsData || { } ) ;
6864+ props [ key ] = validateProp ( key , propOptions , propsData || emptyObject ) ;
68466865 }
68476866 } else {
68486867 if ( isDef ( data . attrs ) ) { mergeProps ( props , data . attrs ) ; }
@@ -6857,7 +6876,7 @@ function createFunctionalComponent (
68576876 props : props ,
68586877 children : children ,
68596878 parent : context ,
6860- listeners : data . on || { } ,
6879+ listeners : data . on || emptyObject ,
68616880 injections : resolveInject ( Ctor . options . inject , context ) ,
68626881 slots : function ( ) { return resolveSlots ( children , context ) ; }
68636882 } ) ;
0 commit comments