File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
test/unit/specs/directives/internal Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -673,4 +673,31 @@ describe('prop', function () {
673
673
} )
674
674
expect ( vm . $el . textContent ) . toBe ( '1' )
675
675
} )
676
+
677
+ it ( 'non reactive values passed down as prop should not be converted' , function ( done ) {
678
+ var a = Object . freeze ( {
679
+ msg : 'hello'
680
+ } )
681
+ var parent = new Vue ( {
682
+ el : el ,
683
+ template : '<comp :a="a"></comp>' ,
684
+ data : {
685
+ a : a
686
+ } ,
687
+ components : {
688
+ comp : {
689
+ props : [ 'a' ]
690
+ }
691
+ }
692
+ } )
693
+ var child = parent . $children [ 0 ]
694
+ expect ( child . a . msg ) . toBe ( 'hello' )
695
+ expect ( child . a . __ob__ ) . toBeUndefined ( ) // should not be converted
696
+ parent . a = Object . freeze ( { msg : 'yo' } )
697
+ Vue . nextTick ( function ( ) {
698
+ expect ( child . a . msg ) . toBe ( 'yo' )
699
+ expect ( child . a . __ob__ ) . toBeUndefined ( )
700
+ done ( )
701
+ } )
702
+ } )
676
703
} )
You can’t perform that action at this time.
0 commit comments