1
1
/*
2
- Vue.js v0.10.1
2
+ Vue.js v0.10.2
3
3
(c) 2014 Evan You
4
4
License: MIT
5
5
*/
@@ -1658,7 +1658,7 @@ CompilerProto.getOption = function (type, id, silent) {
1658
1658
? parent . getOption ( type , id , silent )
1659
1659
: globalAssets [ type ] && globalAssets [ type ] [ id ]
1660
1660
)
1661
- if ( ! res && ! silent ) {
1661
+ if ( ! res && ! silent && typeof id === 'string' ) {
1662
1662
utils . warn ( 'Unknown ' + type . slice ( 0 , - 1 ) + ': ' + id )
1663
1663
}
1664
1664
return res
@@ -3831,7 +3831,6 @@ module.exports = {
3831
3831
ctn . insertBefore ( this . ref , el )
3832
3832
ctn . removeChild ( el )
3833
3833
3834
- this . initiated = false
3835
3834
this . collection = null
3836
3835
this . vms = null
3837
3836
@@ -3847,13 +3846,6 @@ module.exports = {
3847
3846
}
3848
3847
}
3849
3848
3850
- // if initiating with an empty collection, we need to
3851
- // force a compile so that we get all the bindings for
3852
- // dependency extraction.
3853
- if ( ! this . initiated && ( ! collection || ! collection . length ) ) {
3854
- this . dryBuild ( )
3855
- }
3856
-
3857
3849
// keep reference of old data and VMs
3858
3850
// so we can reuse them if possible
3859
3851
this . oldVMs = this . vms
@@ -3871,24 +3863,6 @@ module.exports = {
3871
3863
3872
3864
} ,
3873
3865
3874
- /**
3875
- * Run a dry build just to collect bindings
3876
- */
3877
- dryBuild : function ( ) {
3878
- var el = this . el . cloneNode ( true ) ,
3879
- Ctor = this . compiler . resolveComponent ( el )
3880
- new Ctor ( {
3881
- el : el ,
3882
- parent : this . vm ,
3883
- data : { $index : 0 } ,
3884
- compilerOptions : {
3885
- repeat : true ,
3886
- expCache : this . expCache
3887
- }
3888
- } ) . $destroy ( )
3889
- this . initiated = true
3890
- } ,
3891
-
3892
3866
init : function ( collection , isObject ) {
3893
3867
var vm , vms = [ ]
3894
3868
for ( var i = 0 , l = collection . length ; i < l ; i ++ ) {
@@ -3949,7 +3923,9 @@ module.exports = {
3949
3923
// second pass, collect old reused and destroy unused
3950
3924
for ( i = 0 , l = oldVMs . length ; i < l ; i ++ ) {
3951
3925
vm = oldVMs [ i ]
3952
- item = vm . $data
3926
+ item = this . arg
3927
+ ? vm . $data [ this . arg ]
3928
+ : vm . $data
3953
3929
if ( item . $reused ) {
3954
3930
vm . $reused = true
3955
3931
delete item . $reused
@@ -3964,7 +3940,9 @@ module.exports = {
3964
3940
vms [ vm . $index ] = vm
3965
3941
} else {
3966
3942
// this one can be destroyed.
3967
- delete item . __emitter__ [ this . identifier ]
3943
+ if ( item . __emitter__ ) {
3944
+ delete item . __emitter__ [ this . identifier ]
3945
+ }
3968
3946
vm . $destroy ( )
3969
3947
}
3970
3948
}
@@ -4035,8 +4013,10 @@ module.exports = {
4035
4013
}
4036
4014
} )
4037
4015
4038
- // attach an ienumerable identifier
4039
- data . __emitter__ [ this . identifier ] = true
4016
+ if ( isObject ) {
4017
+ // attach an ienumerable identifier to the raw data
4018
+ ( raw || data ) . __emitter__ [ this . identifier ] = true
4019
+ }
4040
4020
4041
4021
if ( wrap ) {
4042
4022
var self = this ,
0 commit comments