1
1
/*!
2
- * Vue.js v2.5.11
2
+ * Vue.js v2.5.12
3
3
* (c) 2014-2017 Evan You
4
4
* Released under the MIT License.
5
5
*/
@@ -34,6 +34,8 @@ function isPrimitive (value) {
34
34
return (
35
35
typeof value === 'string' ||
36
36
typeof value === 'number' ||
37
+ // $flow-disable-line
38
+ typeof value === 'symbol' ||
37
39
typeof value === 'boolean'
38
40
)
39
41
}
@@ -1353,9 +1355,6 @@ function normalizeProps (options, vm) {
1353
1355
for ( var key in props ) {
1354
1356
val = props [ key ] ;
1355
1357
name = camelize ( key ) ;
1356
- if ( process . env . NODE_ENV !== 'production' && isPlainObject ( val ) ) {
1357
- validatePropObject ( name , val , vm ) ;
1358
- }
1359
1358
res [ name ] = isPlainObject ( val )
1360
1359
? val
1361
1360
: { type : val } ;
@@ -1370,31 +1369,12 @@ function normalizeProps (options, vm) {
1370
1369
options . props = res ;
1371
1370
}
1372
1371
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
-
1393
1372
/**
1394
1373
* Normalize all injections into Object-based format
1395
1374
*/
1396
1375
function normalizeInject ( options , vm ) {
1397
1376
var inject = options . inject ;
1377
+ if ( ! inject ) { return }
1398
1378
var normalized = options . inject = { } ;
1399
1379
if ( Array . isArray ( inject ) ) {
1400
1380
for ( var i = 0 ; i < inject . length ; i ++ ) {
@@ -1407,7 +1387,7 @@ function normalizeInject (options, vm) {
1407
1387
? extend ( { from : key } , val )
1408
1388
: { from : val } ;
1409
1389
}
1410
- } else if ( process . env . NODE_ENV !== 'production' && inject ) {
1390
+ } else if ( process . env . NODE_ENV !== 'production' ) {
1411
1391
warn (
1412
1392
"Invalid value for option \"inject\": expected an Array or an Object, " +
1413
1393
"but got " + ( toRawType ( inject ) ) + "." ,
@@ -1549,7 +1529,11 @@ function validateProp (
1549
1529
observe ( value ) ;
1550
1530
observerState . shouldConvert = prevShouldConvert ;
1551
1531
}
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
+ ) {
1553
1537
assertProp ( prop , key , value , vm , absent ) ;
1554
1538
}
1555
1539
return value
@@ -2029,11 +2013,12 @@ function updateListeners (
2029
2013
remove$$1 ,
2030
2014
vm
2031
2015
) {
2032
- var name , cur , old , event ;
2016
+ var name , def , cur , old , event ;
2033
2017
for ( name in on ) {
2034
- cur = on [ name ] ;
2018
+ def = cur = on [ name ] ;
2035
2019
old = oldOn [ name ] ;
2036
2020
event = normalizeEvent ( name ) ;
2021
+ /* istanbul ignore if */
2037
2022
if ( isUndef ( cur ) ) {
2038
2023
process . env . NODE_ENV !== 'production' && warn (
2039
2024
"Invalid handler for event \"" + ( event . name ) + "\": got " + String ( cur ) ,
@@ -2043,7 +2028,7 @@ function updateListeners (
2043
2028
if ( isUndef ( cur . fns ) ) {
2044
2029
cur = on [ name ] = createFnInvoker ( cur ) ;
2045
2030
}
2046
- add ( event . name , cur , event . once , event . capture , event . passive ) ;
2031
+ add ( event . name , cur , event . once , event . capture , event . passive , event . params ) ;
2047
2032
} else if ( cur !== old ) {
2048
2033
old . fns = cur ;
2049
2034
on [ name ] = old ;
@@ -3290,6 +3275,7 @@ function proxy (target, sourceKey, key) {
3290
3275
3291
3276
function initState ( vm ) {
3292
3277
vm . _watchers = [ ] ;
3278
+ vm . _inlineComputed = null ;
3293
3279
var opts = vm . $options ;
3294
3280
if ( opts . props ) { initProps ( vm , opts . props ) ; }
3295
3281
if ( opts . methods ) { initMethods ( vm , opts . methods ) ; }
@@ -3926,6 +3912,32 @@ function bindObjectListeners (data, value) {
3926
3912
3927
3913
/* */
3928
3914
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
+
3929
3941
function installRenderHelpers ( target ) {
3930
3942
target . _o = markOnce ;
3931
3943
target . _n = toNumber ;
@@ -3942,6 +3954,7 @@ function installRenderHelpers (target) {
3942
3954
target . _e = createEmptyVNode ;
3943
3955
target . _u = resolveScopedSlots ;
3944
3956
target . _g = bindObjectListeners ;
3957
+ target . _a = createInlineComputed ;
3945
3958
}
3946
3959
3947
3960
/* */
@@ -4041,6 +4054,25 @@ function mergeProps (to, from) {
4041
4054
4042
4055
/* */
4043
4056
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
+
4044
4076
// hooks to be invoked on component VNodes during patch
4045
4077
var componentVNodeHooks = {
4046
4078
init : function init (
@@ -4206,6 +4238,11 @@ function createComponent (
4206
4238
{ Ctor : Ctor , propsData : propsData , listeners : listeners , tag : tag , children : children } ,
4207
4239
asyncFactory
4208
4240
) ;
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 */
4209
4246
return vnode
4210
4247
}
4211
4248
@@ -4316,11 +4353,13 @@ function _createElement (
4316
4353
if ( process . env . NODE_ENV !== 'production' &&
4317
4354
isDef ( data ) && isDef ( data . key ) && ! isPrimitive ( data . key )
4318
4355
) {
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
+ }
4324
4363
}
4325
4364
// support single function children as default scoped slot
4326
4365
if ( Array . isArray ( children ) &&
@@ -4998,7 +5037,7 @@ Object.defineProperty(Vue$3.prototype, '$ssrContext', {
4998
5037
}
4999
5038
} ) ;
5000
5039
5001
- Vue$3 . version = '2.5.11 ' ;
5040
+ Vue$3 . version = '2.5.12 ' ;
5002
5041
5003
5042
/* */
5004
5043
@@ -5573,7 +5612,7 @@ function createPatchFunction (backend) {
5573
5612
createElm ( children [ i ] , insertedVnodeQueue , vnode . elm , null , true ) ;
5574
5613
}
5575
5614
} else if ( isPrimitive ( vnode . text ) ) {
5576
- nodeOps . appendChild ( vnode . elm , nodeOps . createTextNode ( vnode . text ) ) ;
5615
+ nodeOps . appendChild ( vnode . elm , nodeOps . createTextNode ( String ( vnode . text ) ) ) ;
5577
5616
}
5578
5617
}
5579
5618
@@ -6339,6 +6378,9 @@ var klass = {
6339
6378
6340
6379
6341
6380
6381
+ // add a raw attr (use this in preTransforms)
6382
+
6383
+
6342
6384
6343
6385
6344
6386
0 commit comments