11/*!
2- * Vue.js v2.5.11
2+ * Vue.js v2.5.12
33 * (c) 2014-2017 Evan You
44 * Released under the MIT License.
55 */
@@ -34,6 +34,8 @@ function isPrimitive (value) {
3434 return (
3535 typeof value === 'string' ||
3636 typeof value === 'number' ||
37+ // $flow-disable-line
38+ typeof value === 'symbol' ||
3739 typeof value === 'boolean'
3840 )
3941}
@@ -1353,9 +1355,6 @@ function normalizeProps (options, vm) {
13531355 for ( var key in props ) {
13541356 val = props [ key ] ;
13551357 name = camelize ( key ) ;
1356- if ( process . env . NODE_ENV !== 'production' && isPlainObject ( val ) ) {
1357- validatePropObject ( name , val , vm ) ;
1358- }
13591358 res [ name ] = isPlainObject ( val )
13601359 ? val
13611360 : { type : val } ;
@@ -1370,31 +1369,12 @@ function normalizeProps (options, vm) {
13701369 options . props = res ;
13711370}
13721371
1373- /**
1374- * Validate whether a prop object keys are valid.
1375- */
1376- 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 ) $ / ;
1377-
1378- function validatePropObject (
1379- propName ,
1380- prop ,
1381- vm
1382- ) {
1383- for ( var key in prop ) {
1384- if ( ! propOptionsRE . test ( key ) ) {
1385- warn (
1386- ( "Invalid key \"" + key + "\" in validation rules object for prop \"" + propName + "\"." ) ,
1387- vm
1388- ) ;
1389- }
1390- }
1391- }
1392-
13931372/**
13941373 * Normalize all injections into Object-based format
13951374 */
13961375function normalizeInject ( options , vm ) {
13971376 var inject = options . inject ;
1377+ if ( ! inject ) { return }
13981378 var normalized = options . inject = { } ;
13991379 if ( Array . isArray ( inject ) ) {
14001380 for ( var i = 0 ; i < inject . length ; i ++ ) {
@@ -1407,7 +1387,7 @@ function normalizeInject (options, vm) {
14071387 ? extend ( { from : key } , val )
14081388 : { from : val } ;
14091389 }
1410- } else if ( process . env . NODE_ENV !== 'production' && inject ) {
1390+ } else if ( process . env . NODE_ENV !== 'production' ) {
14111391 warn (
14121392 "Invalid value for option \"inject\": expected an Array or an Object, " +
14131393 "but got " + ( toRawType ( inject ) ) + "." ,
@@ -1549,7 +1529,11 @@ function validateProp (
15491529 observe ( value ) ;
15501530 observerState . shouldConvert = prevShouldConvert ;
15511531 }
1552- if ( process . env . NODE_ENV !== 'production' ) {
1532+ if (
1533+ process . env . NODE_ENV !== 'production' &&
1534+ // skip validation for weex recycle-list child component props
1535+ ! ( false && isObject ( value ) && ( '@binding' in value ) )
1536+ ) {
15531537 assertProp ( prop , key , value , vm , absent ) ;
15541538 }
15551539 return value
@@ -2029,11 +2013,12 @@ function updateListeners (
20292013 remove$$1 ,
20302014 vm
20312015) {
2032- var name , cur , old , event ;
2016+ var name , def , cur , old , event ;
20332017 for ( name in on ) {
2034- cur = on [ name ] ;
2018+ def = cur = on [ name ] ;
20352019 old = oldOn [ name ] ;
20362020 event = normalizeEvent ( name ) ;
2021+ /* istanbul ignore if */
20372022 if ( isUndef ( cur ) ) {
20382023 process . env . NODE_ENV !== 'production' && warn (
20392024 "Invalid handler for event \"" + ( event . name ) + "\": got " + String ( cur ) ,
@@ -2043,7 +2028,7 @@ function updateListeners (
20432028 if ( isUndef ( cur . fns ) ) {
20442029 cur = on [ name ] = createFnInvoker ( cur ) ;
20452030 }
2046- add ( event . name , cur , event . once , event . capture , event . passive ) ;
2031+ add ( event . name , cur , event . once , event . capture , event . passive , event . params ) ;
20472032 } else if ( cur !== old ) {
20482033 old . fns = cur ;
20492034 on [ name ] = old ;
@@ -3290,6 +3275,7 @@ function proxy (target, sourceKey, key) {
32903275
32913276function initState ( vm ) {
32923277 vm . _watchers = [ ] ;
3278+ vm . _inlineComputed = null ;
32933279 var opts = vm . $options ;
32943280 if ( opts . props ) { initProps ( vm , opts . props ) ; }
32953281 if ( opts . methods ) { initMethods ( vm , opts . methods ) ; }
@@ -3926,6 +3912,32 @@ function bindObjectListeners (data, value) {
39263912
39273913/* */
39283914
3915+ /**
3916+ * This runtime helper creates an inline computed property for component
3917+ * props that contain object or array literals. The caching ensures the same
3918+ * object/array is returned unless the value has indeed changed, thus avoiding
3919+ * the child component to always re-render when comparing props values.
3920+ *
3921+ * Installed to the instance as _a, requires special handling in parser that
3922+ * transforms the following
3923+ * <foo :bar="{ a: 1 }"/>
3924+ * to:
3925+ * <foo :bar="_a(0, function(){return { a: 1 }})"
3926+ */
3927+ function createInlineComputed ( id , getter ) {
3928+ var vm = this ;
3929+ var watchers = vm . _inlineComputed || ( vm . _inlineComputed = { } ) ;
3930+ var cached$$1 = watchers [ id ] ;
3931+ if ( cached$$1 ) {
3932+ return cached$$1 . value
3933+ } else {
3934+ watchers [ id ] = new Watcher ( vm , getter , noop , { sync : true } ) ;
3935+ return watchers [ id ] . value
3936+ }
3937+ }
3938+
3939+ /* */
3940+
39293941function installRenderHelpers ( target ) {
39303942 target . _o = markOnce ;
39313943 target . _n = toNumber ;
@@ -3942,6 +3954,7 @@ function installRenderHelpers (target) {
39423954 target . _e = createEmptyVNode ;
39433955 target . _u = resolveScopedSlots ;
39443956 target . _g = bindObjectListeners ;
3957+ target . _a = createInlineComputed ;
39453958}
39463959
39473960/* */
@@ -4041,6 +4054,25 @@ function mergeProps (to, from) {
40414054
40424055/* */
40434056
4057+
4058+
4059+
4060+ // Register the component hook to weex native render engine.
4061+ // The hook will be triggered by native, not javascript.
4062+
4063+
4064+ // Updates the state of the component to weex native render engine.
4065+
4066+ /* */
4067+
4068+ // https://github.com/Hanks10100/weex-native-directive/tree/master/component
4069+
4070+ // listening on native callback
4071+
4072+ /* */
4073+
4074+ /* */
4075+
40444076// hooks to be invoked on component VNodes during patch
40454077var componentVNodeHooks = {
40464078 init : function init (
@@ -4206,6 +4238,11 @@ function createComponent (
42064238 { Ctor : Ctor , propsData : propsData , listeners : listeners , tag : tag , children : children } ,
42074239 asyncFactory
42084240 ) ;
4241+
4242+ // Weex specific: invoke recycle-list optimized @render function for
4243+ // extracting cell-slot template.
4244+ // https://github.com/Hanks10100/weex-native-directive/tree/master/component
4245+ /* istanbul ignore if */
42094246 return vnode
42104247}
42114248
@@ -4316,11 +4353,13 @@ function _createElement (
43164353 if ( process . env . NODE_ENV !== 'production' &&
43174354 isDef ( data ) && isDef ( data . key ) && ! isPrimitive ( data . key )
43184355 ) {
4319- warn (
4320- 'Avoid using non-primitive value as key, ' +
4321- 'use string/number value instead.' ,
4322- context
4323- ) ;
4356+ {
4357+ warn (
4358+ 'Avoid using non-primitive value as key, ' +
4359+ 'use string/number value instead.' ,
4360+ context
4361+ ) ;
4362+ }
43244363 }
43254364 // support single function children as default scoped slot
43264365 if ( Array . isArray ( children ) &&
@@ -4998,7 +5037,7 @@ Object.defineProperty(Vue$3.prototype, '$ssrContext', {
49985037 }
49995038} ) ;
50005039
5001- Vue$3 . version = '2.5.11 ' ;
5040+ Vue$3 . version = '2.5.12 ' ;
50025041
50035042/* */
50045043
@@ -5573,7 +5612,7 @@ function createPatchFunction (backend) {
55735612 createElm ( children [ i ] , insertedVnodeQueue , vnode . elm , null , true ) ;
55745613 }
55755614 } else if ( isPrimitive ( vnode . text ) ) {
5576- nodeOps . appendChild ( vnode . elm , nodeOps . createTextNode ( vnode . text ) ) ;
5615+ nodeOps . appendChild ( vnode . elm , nodeOps . createTextNode ( String ( vnode . text ) ) ) ;
55775616 }
55785617 }
55795618
@@ -6339,6 +6378,9 @@ var klass = {
63396378
63406379
63416380
6381+ // add a raw attr (use this in preTransforms)
6382+
6383+
63426384
63436385
63446386
0 commit comments